Repository: bitcoinjs/bitcoinjs-lib
Pull request #732 (2016-12-15 10:51:48)

bscript.compile - minimal -1 stack element

dcousens: ACK
dcousens: Also,  next time please just either make a PR to merge this into the *other* PR... or add to it directly.

For me to edit this, I'd have submit a PR to your branch in your repository, rather than to a branch... in this repository.
afk11: Woops, yeah meant to target that one. if you're happy to merge both I'll leave this open, but can resubmit
dcousens: @afk11 this one is rebased on the other, so its fine :+1: 

Patch:
diff --git a/src/script.js b/src/script.js
index d8785f07..62c5d3ae 100644
--- a/src/script.js
+++ b/src/script.js
@@ -39,7 +39,7 @@ function compile (chunks) {
     // data chunk
     if (Buffer.isBuffer(chunk)) {
       // adhere to BIP62.3, minimal push policy
-      if (chunk.length === 1 && chunk[0] >= 1 && chunk[0] <= 16) {
+      if (chunk.length === 1 && (chunk[0] === 0x81 || chunk[0] >= 1 && chunk[0] <= 16)) {
         return accum + 1
       }
 
@@ -64,6 +64,12 @@ function compile (chunks) {
         return
       }
 
+      if (chunk.length === 1 && chunk[0] === 0x81) {
+        buffer.writeUInt8(OPS.OP_1NEGATE, offset)
+        offset += 1
+        return
+      }
+
       offset += bufferutils.writePushDataInt(buffer, chunk.length, offset)
 
       chunk.copy(buffer, offset)
@@ -145,8 +151,8 @@ function fromASM (asm) {
   }))
 }
 
-function decompilePushOnly (script) {
-  var chunks = decompile(script)
+function toStack (chunks) {
+  chunks = decompile(chunks)
   typeforce(isPushOnly, chunks)
 
   return chunks.map(function (op) {
@@ -157,11 +163,6 @@ function decompilePushOnly (script) {
   })
 }
 
-function compilePushOnly (chunks) {
-  typeforce(isPushOnly, chunks)
-  return compile(chunks)
-}
-
 function isCanonicalPubKey (buffer) {
   if (!Buffer.isBuffer(buffer)) return false
   if (buffer.length < 33) return false
@@ -196,12 +197,13 @@ module.exports = {
   decompile: decompile,
   fromASM: fromASM,
   toASM: toASM,
-  compilePushOnly: compilePushOnly,
-  decompilePushOnly: decompilePushOnly,
+  toStack: toStack,
+
   number: require('./script_number'),
 
   isCanonicalPubKey: isCanonicalPubKey,
   isCanonicalSignature: isCanonicalSignature,
+  isPushOnly: isPushOnly,
   isDefinedHashType: isDefinedHashType
 }
 
diff --git a/src/templates/scripthash/input.js b/src/templates/scripthash/input.js
index 1513dcde..adf1cecf 100644
--- a/src/templates/scripthash/input.js
+++ b/src/templates/scripthash/input.js
@@ -16,6 +16,9 @@ function check (script, allowIncomplete) {
   // is redeemScript a valid script?
   if (redeemScriptChunks.length === 0) return false
 
+  // is redeemScriptSig push only?
+  if (!bscript.isPushOnly(scriptSigChunks)) return false
+
   var inputType = bscript.classifyInput(scriptSigChunks, allowIncomplete)
   var outputType = bscript.classifyOutput(redeemScriptChunks)
   return inputType === outputType
@@ -23,7 +26,7 @@ function check (script, allowIncomplete) {
 check.toJSON = function () { return 'scriptHash input' }
 
 function encode (redeemScriptSig, redeemScript) {
-  var scriptSigChunks = bscript.decompilePushOnly(redeemScriptSig)
+  var scriptSigChunks = bscript.decompile(redeemScriptSig)
   var serializedScriptPubKey = bscript.compile(redeemScript)
 
   return bscript.compile([].concat(
@@ -37,7 +40,7 @@ function decode (buffer) {
   typeforce(check, chunks)
 
   return {
-    redeemScriptSig: bscript.compilePushOnly(chunks.slice(0, -1)),
+    redeemScriptSig: bscript.compile(chunks.slice(0, -1)),
     redeemScript: chunks[chunks.length - 1]
   }
 }


Test patch:
diff --git a/test/fixtures/script.json b/test/fixtures/script.json
index feff69a6..c6a0eea8 100644
--- a/test/fixtures/script.json
+++ b/test/fixtures/script.json
@@ -1,445 +1,194 @@
 {
   "valid": [
     {
-      "type": "pubkey",
-      "pubKey": "02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1",
-      "signature": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
-      "scriptPubKey": "02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1 OP_CHECKSIG",
-      "scriptSig": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
-      "scriptSigHex": "47304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
-      "scriptPubKeyHex": "2102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1ac"
+      "asm": "OP_1NEGATE",
+      "script": "4f",
+      "stack": [
+        "81"
+      ]
     },
     {
-      "type": "pubkeyhash",
-      "pubKey": "02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1",
-      "signature": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
-      "scriptPubKey": "OP_DUP OP_HASH160 aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5 OP_EQUALVERIFY OP_CHECKSIG",
-      "scriptSig": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1",
-      "scriptSigHex": "47304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca28012102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1",
-      "scriptPubKeyHex": "76a914aa4d7985c57e011a8b3dd8e0e5a73aaef41629c588ac"
+      "asm": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
+      "script": "47304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
+      "stack": [
+        "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801"
+      ]
     },
     {
-      "type": "multisig",
-      "pubKeys": [
-        "02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1",
-        "0395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a"
-      ],
-      "signatures": [
+      "asm": "02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1 OP_CHECKSIG",
+      "script": "2102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1ac"
+    },
+    {
+      "asm": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1",
+      "script": "47304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca28012102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1",
+      "stack": [
+        "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
+        "02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1"
+      ]
+    },
+    {
+      "asm": "OP_DUP OP_HASH160 aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5 OP_EQUALVERIFY OP_CHECKSIG",
+      "script": "76a914aa4d7985c57e011a8b3dd8e0e5a73aaef41629c588ac"
+    },
+    {
+      "asm": "OP_0 304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501",
+      "script": "0047304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801483045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501",
+      "stack": [
+        "",
         "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
         "3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501"
-      ],
-      "scriptPubKey": "OP_2 02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1 0395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a OP_2 OP_CHECKMULTISIG",
-      "scriptSig": "OP_0 304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501",
-      "scriptSigHex": "0047304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801483045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501",
-      "scriptPubKeyHex": "522102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1210395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a52ae"
+      ]
     },
     {
-      "type": "multisig",
-      "pubKeys": [
-        "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
-        "02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340",
-        "024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a34"
-      ],
-      "signatures": [
+      "asm": "OP_2 02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1 0395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a OP_2 OP_CHECKMULTISIG",
+      "script": "522102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1210395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a52ae"
+    },
+    {
+      "asm": "OP_0 3045022100fe324541215798b2df68cbd44039615e23c506d4ec1a05572064392a98196b82022068c849fa6699206da2fc6d7848efc1d3804a5816d6293615fe34c1a7f34e1c2f01 3044022001ab168e80b863fdec694350b587339bb72a37108ac3c989849251444d13ebba02201811272023e3c1038478eb972a82d3ad431bfc2408e88e4da990f1a7ecbb263901 3045022100aaeb7204c17eee2f2c4ff1c9f8b39b79e75e7fbf33e92cc67ac51be8f15b75f90220659eee314a4943a6384d2b154fa5821ef7a084814d7ee2c6f9f7f0ffb53be34b01",
+      "script": "00483045022100fe324541215798b2df68cbd44039615e23c506d4ec1a05572064392a98196b82022068c849fa6699206da2fc6d7848efc1d3804a5816d6293615fe34c1a7f34e1c2f01473044022001ab168e80b863fdec694350b587339bb72a37108ac3c989849251444d13ebba02201811272023e3c1038478eb972a82d3ad431bfc2408e88e4da990f1a7ecbb263901483045022100aaeb7204c17eee2f2c4ff1c9f8b39b79e75e7fbf33e92cc67ac51be8f15b75f90220659eee314a4943a6384d2b154fa5821ef7a084814d7ee2c6f9f7f0ffb53be34b01",
+      "stack": [
+        "",
         "3045022100fe324541215798b2df68cbd44039615e23c506d4ec1a05572064392a98196b82022068c849fa6699206da2fc6d7848efc1d3804a5816d6293615fe34c1a7f34e1c2f01",
         "3044022001ab168e80b863fdec694350b587339bb72a37108ac3c989849251444d13ebba02201811272023e3c1038478eb972a82d3ad431bfc2408e88e4da990f1a7ecbb263901",
         "3045022100aaeb7204c17eee2f2c4ff1c9f8b39b79e75e7fbf33e92cc67ac51be8f15b75f90220659eee314a4943a6384d2b154fa5821ef7a084814d7ee2c6f9f7f0ffb53be34b01"
-      ],
-      "scriptPubKey": "OP_3 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a34 OP_3 OP_CHECKMULTISIG",
-      "scriptSig": "OP_0 3045022100fe324541215798b2df68cbd44039615e23c506d4ec1a05572064392a98196b82022068c849fa6699206da2fc6d7848efc1d3804a5816d6293615fe34c1a7f34e1c2f01 3044022001ab168e80b863fdec694350b587339bb72a37108ac3c989849251444d13ebba02201811272023e3c1038478eb972a82d3ad431bfc2408e88e4da990f1a7ecbb263901 3045022100aaeb7204c17eee2f2c4ff1c9f8b39b79e75e7fbf33e92cc67ac51be8f15b75f90220659eee314a4943a6384d2b154fa5821ef7a084814d7ee2c6f9f7f0ffb53be34b01",
-      "scriptSigHex": "00483045022100fe324541215798b2df68cbd44039615e23c506d4ec1a05572064392a98196b82022068c849fa6699206da2fc6d7848efc1d3804a5816d6293615fe34c1a7f34e1c2f01473044022001ab168e80b863fdec694350b587339bb72a37108ac3c989849251444d13ebba02201811272023e3c1038478eb972a82d3ad431bfc2408e88e4da990f1a7ecbb263901483045022100aaeb7204c17eee2f2c4ff1c9f8b39b79e75e7fbf33e92cc67ac51be8f15b75f90220659eee314a4943a6384d2b154fa5821ef7a084814d7ee2c6f9f7f0ffb53be34b01",
-      "scriptPubKeyHex": "53210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f817982102b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f84834021024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a3453ae"
+      ]
+    },
+    {
+      "asm": "OP_3 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a34 OP_3 OP_CHECKMULTISIG",
+      "script": "53210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f817982102b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f84834021024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a3453ae"
+    },
+    {
+      "asm": "OP_0 304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501 522102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1210395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a52ae",
+      "script": "0047304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801483045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d14050147522102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1210395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a52ae",
+      "stack": [
+        "",
+        "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
+        "3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501",
+        "522102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1210395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a52ae"
+      ]
     },
     {
-      "type": "scripthash",
-      "redeemScript": "OP_2 02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1 0395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a OP_2 OP_CHECKMULTISIG",
-      "redeemScriptSig": "OP_0 304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501",
-      "scriptSig": "OP_0 304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501 522102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1210395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a52ae",
-      "scriptPubKey": "OP_HASH160 722ff0bc2c3f47b35c20df646c395594da24e90e OP_EQUAL",
-      "scriptSigHex": "0047304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801483045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d14050147522102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1210395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a52ae",
-      "scriptPubKeyHex": "a914722ff0bc2c3f47b35c20df646c395594da24e90e87"
+      "asm": "OP_HASH160 722ff0bc2c3f47b35c20df646c395594da24e90e OP_EQUAL",
+      "script": "a914722ff0bc2c3f47b35c20df646c395594da24e90e87"
     },
     {
-      "type": "witnesspubkeyhash",
-      "pubKey": "02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1",
-      "scriptPubKey": "OP_0 aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5",
-      "scriptPubKeyHex": "0014aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5"
+      "asm": "OP_0 aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5",
+      "script": "0014aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5",
+      "stack": [
+        "",
+        "aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5"
+      ]
     },
     {
-      "type": "witnessscripthash",
-      "witnessScriptPubKey": "OP_2 02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1 0395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a OP_2 OP_CHECKMULTISIG",
-      "witnessScriptSig": "OP_0 304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501",
-      "scriptPubKey": "OP_0 32447752937d355ca2defddcd1f6b4fc53d182f8901cebbcff42f5e381bf0b80",
-      "scriptPubKeyHex": "002032447752937d355ca2defddcd1f6b4fc53d182f8901cebbcff42f5e381bf0b80",
-      "witness": "OP_0 304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501 522102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1210395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a52ae"
+      "asm": "OP_0 32447752937d355ca2defddcd1f6b4fc53d182f8901cebbcff42f5e381bf0b80",
+      "script": "002032447752937d355ca2defddcd1f6b4fc53d182f8901cebbcff42f5e381bf0b80",
+      "stack": [
+        "",
+        "32447752937d355ca2defddcd1f6b4fc53d182f8901cebbcff42f5e381bf0b80"
+      ]
     },
     {
-      "type": "nulldata",
-      "data": "06deadbeef03f895a2ad89fb6d696497af486cb7c644a27aa568c7a18dd06113401115185474",
-      "scriptPubKey": "OP_RETURN 06deadbeef03f895a2ad89fb6d696497af486cb7c644a27aa568c7a18dd06113401115185474",
-      "scriptPubKeyHex": "6a2606deadbeef03f895a2ad89fb6d696497af486cb7c644a27aa568c7a18dd06113401115185474"
+      "asm": "OP_RETURN 06deadbeef03f895a2ad89fb6d696497af486cb7c644a27aa568c7a18dd06113401115185474",
+      "script": "6a2606deadbeef03f895a2ad89fb6d696497af486cb7c644a27aa568c7a18dd06113401115185474"
     },
     {
-      "type": "nulldata",
-      "data": "deadffffffffffffffffffffffffffffffffbeef",
-      "scriptPubKey": "OP_RETURN deadffffffffffffffffffffffffffffffffbeef",
-      "scriptPubKeyHex": "6a14deadffffffffffffffffffffffffffffffffbeef"
+      "asm": "OP_RETURN deadffffffffffffffffffffffffffffffffbeef",
+      "script": "6a14deadffffffffffffffffffffffffffffffffbeef"
     },
     {
-      "type": "nonstandard",
-      "typeIncomplete": "multisig",
-      "pubKeys": [
-        "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
-        "02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340",
-        "024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a34"
-      ],
-      "signatures": [
-        null,
+      "asm": "OP_0 OP_0 3044022001ab168e80b863fdec694350b587339bb72a37108ac3c989849251444d13ebba02201811272023e3c1038478eb972a82d3ad431bfc2408e88e4da990f1a7ecbb263901 3045022100aaeb7204c17eee2f2c4ff1c9f8b39b79e75e7fbf33e92cc67ac51be8f15b75f90220659eee314a4943a6384d2b154fa5821ef7a084814d7ee2c6f9f7f0ffb53be34b01",
+      "script": "0000473044022001ab168e80b863fdec694350b587339bb72a37108ac3c989849251444d13ebba02201811272023e3c1038478eb972a82d3ad431bfc2408e88e4da990f1a7ecbb263901483045022100aaeb7204c17eee2f2c4ff1c9f8b39b79e75e7fbf33e92cc67ac51be8f15b75f90220659eee314a4943a6384d2b154fa5821ef7a084814d7ee2c6f9f7f0ffb53be34b01",
+      "stack": [
+        "",
+        "",
         "3044022001ab168e80b863fdec694350b587339bb72a37108ac3c989849251444d13ebba02201811272023e3c1038478eb972a82d3ad431bfc2408e88e4da990f1a7ecbb263901",
         "3045022100aaeb7204c17eee2f2c4ff1c9f8b39b79e75e7fbf33e92cc67ac51be8f15b75f90220659eee314a4943a6384d2b154fa5821ef7a084814d7ee2c6f9f7f0ffb53be34b01"
-      ],
-      "scriptSig": "OP_0 OP_0 3044022001ab168e80b863fdec694350b587339bb72a37108ac3c989849251444d13ebba02201811272023e3c1038478eb972a82d3ad431bfc2408e88e4da990f1a7ecbb263901 3045022100aaeb7204c17eee2f2c4ff1c9f8b39b79e75e7fbf33e92cc67ac51be8f15b75f90220659eee314a4943a6384d2b154fa5821ef7a084814d7ee2c6f9f7f0ffb53be34b01",
-      "scriptSigHex": "0000473044022001ab168e80b863fdec694350b587339bb72a37108ac3c989849251444d13ebba02201811272023e3c1038478eb972a82d3ad431bfc2408e88e4da990f1a7ecbb263901483045022100aaeb7204c17eee2f2c4ff1c9f8b39b79e75e7fbf33e92cc67ac51be8f15b75f90220659eee314a4943a6384d2b154fa5821ef7a084814d7ee2c6f9f7f0ffb53be34b01"
+      ]
     },
     {
-      "type": "nonstandard",
-      "typeIncomplete": "multisig",
-      "pubKeys": [
-        "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
-        "02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340",
-        "024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a34"
-      ],
-      "signatures": [
-        null,
-        null,
-        null
-      ],
-      "scriptSig": "OP_0 OP_0 OP_0 OP_0",
-      "scriptSigHex": "00000000"
+      "asm": "OP_0 OP_0 OP_0 OP_0",
+      "script": "00000000",
+      "stack": [
+        "",
+        "",
+        "",
+        ""
+      ]
     },
     {
-      "type": "nonstandard",
-      "typeIncomplete": "scripthash",
-      "pubKeys": [
-        "0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",
-        "04c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee51ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52a"
-      ],
-      "signatures": [
-        null,
-        "30450221009c92c1ae1767ac04e424da7f6db045d979b08cde86b1ddba48621d59a109d818022004f5bb21ad72255177270abaeb2d7940ac18f1e5ca1f53db4f3fd1045647a8a801"
-      ],
-      "redeemScript": "OP_2 0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 04c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee51ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52a OP_2 OP_CHECKMULTISIG",
-      "redeemScriptSig": "OP_0 OP_0 30450221009c92c1ae1767ac04e424da7f6db045d979b08cde86b1ddba48621d59a109d818022004f5bb21ad72255177270abaeb2d7940ac18f1e5ca1f53db4f3fd1045647a8a801",
-      "scriptSig": "OP_0 OP_0 30450221009c92c1ae1767ac04e424da7f6db045d979b08cde86b1ddba48621d59a109d818022004f5bb21ad72255177270abaeb2d7940ac18f1e5ca1f53db4f3fd1045647a8a801 52410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b84104c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee51ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52a52ae",
-      "scriptSigHex": "00004830450221009c92c1ae1767ac04e424da7f6db045d979b08cde86b1ddba48621d59a109d818022004f5bb21ad72255177270abaeb2d7940ac18f1e5ca1f53db4f3fd1045647a8a8014c8752410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b84104c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee51ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52a52ae"
+      "asm": "OP_0 OP_0 30450221009c92c1ae1767ac04e424da7f6db045d979b08cde86b1ddba48621d59a109d818022004f5bb21ad72255177270abaeb2d7940ac18f1e5ca1f53db4f3fd1045647a8a801 52410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b84104c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee51ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52a52ae",
+      "script": "00004830450221009c92c1ae1767ac04e424da7f6db045d979b08cde86b1ddba48621d59a109d818022004f5bb21ad72255177270abaeb2d7940ac18f1e5ca1f53db4f3fd1045647a8a8014c8752410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b84104c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee51ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52a52ae",
+      "stack": [
+        "",
+        "",
+        "30450221009c92c1ae1767ac04e424da7f6db045d979b08cde86b1ddba48621d59a109d818022004f5bb21ad72255177270abaeb2d7940ac18f1e5ca1f53db4f3fd1045647a8a801",
+        "52410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b84104c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee51ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52a52ae"
+      ]
     },
     {
-      "type": "nonstandard",
-      "scriptPubKey": "OP_HASH256 6fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000 OP_EQUAL",
-      "scriptPubKeyHex": "aa206fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d619000000000087"
+      "asm": "OP_HASH256 6fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000 OP_EQUAL",
+      "script": "aa206fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d619000000000087"
     },
     {
-      "type": "nonstandard",
-      "scriptPubKey": "OP_0 OP_0 OP_0 OP_CHECKMULTISIG",
-      "scriptPubKeyHex": "000000ae"
+      "asm": "OP_0 OP_0 OP_0 OP_CHECKMULTISIG",
+      "script": "000000ae"
     },
     {
-      "type": "nonstandard",
-      "scriptPubKey": "OP_0",
-      "scriptPubKeyHex": "00"
+      "asm": "OP_0",
+      "script": "00",
+      "stack": [
+        ""
+      ]
     },
     {
-      "type": "scripthash",
-      "redeemScript": "OP_0",
-      "redeemScriptSig": "OP_0",
-      "scriptSig": "OP_0 00",
-      "scriptSigHex": "000100"
+      "asm": "OP_0 00",
+      "script": "000100",
+      "stack": [
+        "",
+        "00"
+      ]
     },
     {
-      "type": "nonstandard",
-      "scriptSig": "OP_6",
-      "scriptSigHex": "56",
+      "asm": "OP_6",
+      "script": "56",
+      "stack": [
+        "06"
+      ],
       "nonstandard": {
         "scriptSig": "06",
         "scriptSigHex": "0106"
       }
     },
     {
-      "type": "nonstandard",
-      "scriptSig": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-      "scriptSigHex": "4cff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+      "asm": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+      "script": "4cff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+      "stack": [
+        "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+      ]
     }
   ],
   "invalid": {
     "decompile": [
       {
         "description": "Not enough data: OP_1",
-        "hex": "01"
+        "script": "01"
       },
       {
         "description": "Not enough data: OP_2",
-        "hex": "0201"
+        "script": "0201"
       },
       {
         "description": "Not enough data: OP_PUSHDATA1 0x02",
-        "hex": "4c0201"
+        "script": "4c0201"
       },
       {
         "description": "Not enough data: OP_PUSHDATA2 0xffff",
-        "hex": "4dffff01"
+        "script": "4dffff01"
       },
       {
         "description": "Not enough data: OP_PUSHDATA4 0xffffffff",
-        "hex": "4effffffff01"
+        "script": "4effffffff01"
       }
-    ],
-    "pubKey": {
-      "inputs": [
-        {
-          "description": "non-canonical signature (too short)",
-          "scriptSig": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf7593"
-        },
-        {
-          "description": "non-canonical signature (too long)",
-          "scriptSig": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca28ffffffff01"
-        },
-        {
-          "description": "non-canonical signature (invalid hashType)",
-          "scriptSig": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca28ff"
-        }
-      ],
-      "outputs": [
-        {
-          "description": "non-canonical pubkey (too short)",
-          "scriptPubKey": "02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce OP_CHECKSIG"
-        },
-        {
-          "description": "non-canonical pubkey (too long)",
-          "scriptPubKey": "02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1ffffff OP_CHECKSIG"
-        },
-        {
-          "description": "last operator is wrong for pubkey-output",
-          "scriptPubKeyHex": "21027a71801ab59336de37785c50005b6abd8ea859eecce1edbe8e81afa74ee5c752ae"
-        },
-        {
-          "description": "missing OP_CHECKSIG",
-          "scriptPubKeyHex": "21027a71801ab59336de37785c50005b6abd8ea859eecce1edbe8e81afa74ee5c752"
-        },
-        {
-          "description": "non-canonical pubkey (bad prefix)",
-          "scriptPubKey": "427a71801ab59336de37785c50005b6abd8ea859eecce1edbe8e81afa74ee5c752 OP_CHECKSIG"
-        },
-        {
-          "description": "has extra opcode at the end isPubKeyOutput",
-          "scriptPubKey": "027a71801ab59336de37785c50005b6abd8ea859eecce1edbe8e81afa74ee5c752 OP_CHECKSIG OP_0"
-        }
-      ]
-    },
-    "pubKeyHash": {
-      "inputs": [
-        {
-          "description": "pubKeyHash input : extraneous data",
-          "scriptSig": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1 ffffffff"
-        }
-      ],
-      "outputs": [
-        {
-          "description": "non-minimal encoded isPubKeyHashOutput (non BIP62 compliant)",
-          "scriptPubKeyHex": "76a94c14aa4d7985c57e011a8b3dd8e0e5a73aaef41629c588ac"
-        },
-        {
-          "description": "bad OP_DUP isPubKeyHashOutput",
-          "scriptPubKeyHex": "aca914aa4d7985c57e011a8b3dd8e0e5a73aaef41629c588ac"
-        },
-        {
-          "description": "bad OP_HASH160 isPubKeyHashOutput",
-          "scriptPubKeyHex": "76ac14aa4d7985c57e011a8b3dd8e0e5a73aaef41629c588ac"
-        },
-        {
-          "description": "bad OP_EQUALVERIFY isPubKeyHashOutput",
-          "scriptPubKeyHex": "76a914aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5acac"
-        },
-        {
-          "description": "bad OP_CHECKSIG isPubKeyHashOutput",
-          "scriptPubKeyHex": "76a914aa4d7985c57e011a8b3dd8e0e5a73aaef41629c58888"
-        },
-        {
-          "description": "bad length isPubKeyHashOutput",
-          "scriptPubKeyHex": "76a920aa4d7985c57e011a8b3dd8e0e5a73aaef41629c588ac"
-        },
-        {
-          "description": "has something at the end isPubKeyHashOutput",
-          "scriptPubKeyHex": "76a920aa4d7985c57e011a8b3dd8e0e5a73aaef41629c588ac00"
-        },
-        {
-          "exception": "Expected Buffer\\(Length: 20\\), got Buffer\\(Length: 2\\)",
-          "hash": "ffff"
-        }
-      ]
-    },
-    "scriptHash": {
-      "inputs": [
-        {
-          "description": "redeemScript not data",
-          "scriptSig": "OP_0 304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501 OP_RESERVED"
-        },
-        {
-          "description": "redeemScript is a signature, therefore not a valid script",
-          "scriptSig": "OP_0 3045022100e12b17b3a4c80c401a1687487bd2bafee9e5f1f8f1ffc6180ce186672ad7b43a02205e316d1e5e71822f5ef301b694e578fa9c94af4f5f098c952c833f4691307f4e01"
-        }
-      ],
-      "outputs": [
-        {
-          "description": "non-minimal encoded isScriptHashOutput (non BIP62 compliant)",
-          "scriptPubKeyHex": "a94c14c286a1af0947f58d1ad787385b1c2c4a976f9e7187"
-        },
-        {
-          "description": "wrong OP_HASH160 opcode",
-          "scriptPubKeyHex": "ac4c14c286a1af0947f58d1ad787385b1c2c4a976f9e7187"
-        },
-        {
-          "description": "wrong length marker",
-          "scriptPubKeyHex": "a916c286a1af0947f58d1ad787385b1c2c4a976f9e7187"
-        },
-        {
-          "description": "wrong OP_EQUAL opcode",
-          "scriptPubKeyHex": "a914c286a1af0947f58d1ad787385b1c2c4a976f9e7188"
-        },
-        {
-          "exception": "Expected Buffer\\(Length: 20\\), got Buffer\\(Length: 3\\)",
-          "hash": "ffffff"
-        }
-      ]
-    },
-    "multisig": {
-      "inputs": [
-        {
-          "description": "Not enough signatures provided",
-          "type": "multisig",
-          "scriptPubKey": "OP_2 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 OP_2 OP_CHECKMULTISIG",
-          "signatures": []
-        },
-        {
-          "exception": "Not enough signatures provided",
-          "scriptPubKey": "OP_2 02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1 0395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a OP_2 OP_CHECKMULTISIG",
-          "signatures": [
-            "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801"
-          ]
-        },
-        {
-          "exception": "Too many signatures provided",
-          "scriptPubKey": "OP_2 02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1 0395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a OP_2 OP_CHECKMULTISIG",
-          "signatures": [
-            "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
-            "3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501",
-            "3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501"
-          ]
-        }
-      ],
-      "outputs": [
-        {
-          "description": "OP_CHECKMULTISIG not found",
-          "scriptPubKey": "OP_0 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 OP_2 OP_HASH160"
-        },
-        {
-          "description": "less than 4 chunks",
-          "scriptPubKey": "OP_0 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 OP_HASH160"
-        },
-        {
-          "description": "m === 0",
-          "scriptPubKey": "OP_0 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 OP_2 OP_CHECKMULTISIG"
-        },
-        {
-          "description": "m < OP_1",
-          "scriptPubKey": "OP_1NEGATE 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 OP_2 OP_CHECKMULTISIG"
-        },
-        {
-          "description": "m > OP_16",
-          "scriptPubKey": "OP_NOP 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 OP_2 OP_CHECKMULTISIG"
-        },
-        {
-          "description": "n === 0",
-          "scriptPubKey": "OP_1 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 OP_0 OP_CHECKMULTISIG"
-        },
-        {
-          "description": "n < OP_1",
-          "scriptPubKey": "OP_1 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 OP_1NEGATE OP_CHECKMULTISIG"
-        },
-        {
-          "description": "n > OP_16",
-          "scriptPubKey": "OP_1 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 OP_NOP OP_CHECKMULTISIG"
-        },
-        {
-          "description": "n < m",
-          "scriptPubKey": "OP_2 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 OP_1 OP_CHECKMULTISIG"
-        },
-        {
-          "description": "n < len(pubKeys)",
-          "scriptPubKey": "OP_2 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a34 OP_2 OP_CHECKMULTISIG"
-        },
-        {
-          "description": "n > len(pubKeys)",
-          "scriptPubKey": "OP_1 024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a34 OP_2 OP_CHECKMULTISIG"
-        },
-        {
-          "description": "m is data",
-          "scriptPubKey": "ffff 024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a34 OP_1 OP_CHECKMULTISIG"
-        },
-        {
-          "description": "n is data",
-          "scriptPubKey": "OP_1 024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a34 ffff OP_CHECKMULTISIG"
-        },
-        {
-          "description": "non-canonical pubKey (bad length)",
-          "scriptPubKey": "OP_1 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ffff OP_1 OP_CHECKMULTISIG"
-        },
-        {
-          "exception": "Not enough pubKeys provided",
-          "m": 4,
-          "pubKeys": [
-            "02ea1297665dd733d444f31ec2581020004892cdaaf3dd6c0107c615afb839785f",
-            "02fab2dea1458990793f56f42e4a47dbf35a12a351f26fa5d7e0cc7447eaafa21f",
-            "036c6802ce7e8113723dd92cdb852e492ebb157a871ca532c3cb9ed08248ff0e19"
-          ],
-          "signatures": [
-            "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801"
-          ]
-        }
-      ]
-    },
-    "witnessPubKeyHash": {
-      "inputs": [],
-      "outputs": [
-        {
-          "description": "wrong version",
-          "scriptPubKeyHex": "51149090909090909090909090909090909090909090"
-        },
-        {
-          "description": "wrong length marker",
-          "scriptPubKeyHex": "00209090909090909090909090909090909090909090"
-        },
-        {
-          "exception": "Expected Buffer\\(Length: 20\\), got Buffer\\(Length: 3\\)",
-          "hash": "ffffff"
-        }
-      ]
-    },
-    "witnessScriptHash": {
-      "inputs": [],
-      "outputs": [
-        {
-          "description": "wrong version",
-          "scriptPubKeyHex": "51209090909090909090909090909090909090909090909090909090909090909090"
-        },
-        {
-          "description": "wrong length marker",
-          "scriptPubKeyHex": "00219090909090909090909090909090909090909090909090909090909090909090"
-        },
-        {
-          "exception": "Expected Buffer\\(Length: 32\\), got Buffer\\(Length: 3\\)",
-          "hash": "ffffff"
-        }
-      ]
-    }
+    ]
   }
 }
diff --git a/test/fixtures/templates.json b/test/fixtures/templates.json
new file mode 100644
index 00000000..17568211
--- /dev/null
+++ b/test/fixtures/templates.json
@@ -0,0 +1,499 @@
+{
+  "valid": [
+    {
+      "type": "pubkey",
+      "pubKey": "02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1",
+      "signature": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
+      "output": "02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1 OP_CHECKSIG",
+      "input": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
+      "inputHex": "47304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
+      "outputHex": "2102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1ac",
+      "inputStack": [
+        "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801"
+      ]
+    },
+    {
+      "type": "pubkeyhash",
+      "pubKey": "02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1",
+      "signature": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
+      "output": "OP_DUP OP_HASH160 aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5 OP_EQUALVERIFY OP_CHECKSIG",
+      "input": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1",
+      "inputHex": "47304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca28012102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1",
+      "outputHex": "76a914aa4d7985c57e011a8b3dd8e0e5a73aaef41629c588ac",
+      "pushOnly": false,
+      "pushOnlySig": true,
+      "inputStack": [
+        "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
+        "02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1"
+      ]
+    },
+    {
+      "type": "multisig",
+      "pubKeys": [
+        "02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1",
+        "0395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a"
+      ],
+      "signatures": [
+        "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
+        "3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501"
+      ],
+      "output": "OP_2 02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1 0395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a OP_2 OP_CHECKMULTISIG",
+      "input": "OP_0 304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501",
+      "inputHex": "0047304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801483045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501",
+      "outputHex": "522102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1210395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a52ae",
+      "pushOnly": false,
+      "pushOnlySig": true,
+      "inputStack": [
+        "",
+        "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
+        "3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501"
+      ]
+    },
+    {
+      "type": "multisig",
+      "pubKeys": [
+        "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
+        "02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340",
+        "024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a34"
+      ],
+      "signatures": [
+        "3045022100fe324541215798b2df68cbd44039615e23c506d4ec1a05572064392a98196b82022068c849fa6699206da2fc6d7848efc1d3804a5816d6293615fe34c1a7f34e1c2f01",
+        "3044022001ab168e80b863fdec694350b587339bb72a37108ac3c989849251444d13ebba02201811272023e3c1038478eb972a82d3ad431bfc2408e88e4da990f1a7ecbb263901",
+        "3045022100aaeb7204c17eee2f2c4ff1c9f8b39b79e75e7fbf33e92cc67ac51be8f15b75f90220659eee314a4943a6384d2b154fa5821ef7a084814d7ee2c6f9f7f0ffb53be34b01"
+      ],
+      "output": "OP_3 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a34 OP_3 OP_CHECKMULTISIG",
+      "input": "OP_0 3045022100fe324541215798b2df68cbd44039615e23c506d4ec1a05572064392a98196b82022068c849fa6699206da2fc6d7848efc1d3804a5816d6293615fe34c1a7f34e1c2f01 3044022001ab168e80b863fdec694350b587339bb72a37108ac3c989849251444d13ebba02201811272023e3c1038478eb972a82d3ad431bfc2408e88e4da990f1a7ecbb263901 3045022100aaeb7204c17eee2f2c4ff1c9f8b39b79e75e7fbf33e92cc67ac51be8f15b75f90220659eee314a4943a6384d2b154fa5821ef7a084814d7ee2c6f9f7f0ffb53be34b01",
+      "inputHex": "00483045022100fe324541215798b2df68cbd44039615e23c506d4ec1a05572064392a98196b82022068c849fa6699206da2fc6d7848efc1d3804a5816d6293615fe34c1a7f34e1c2f01473044022001ab168e80b863fdec694350b587339bb72a37108ac3c989849251444d13ebba02201811272023e3c1038478eb972a82d3ad431bfc2408e88e4da990f1a7ecbb263901483045022100aaeb7204c17eee2f2c4ff1c9f8b39b79e75e7fbf33e92cc67ac51be8f15b75f90220659eee314a4943a6384d2b154fa5821ef7a084814d7ee2c6f9f7f0ffb53be34b01",
+      "outputHex": "53210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f817982102b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f84834021024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a3453ae",
+      "pushOnly": false,
+      "pushOnlySig": true,
+      "inputStack": [
+        "",
+        "3045022100fe324541215798b2df68cbd44039615e23c506d4ec1a05572064392a98196b82022068c849fa6699206da2fc6d7848efc1d3804a5816d6293615fe34c1a7f34e1c2f01",
+        "3044022001ab168e80b863fdec694350b587339bb72a37108ac3c989849251444d13ebba02201811272023e3c1038478eb972a82d3ad431bfc2408e88e4da990f1a7ecbb263901",
+        "3045022100aaeb7204c17eee2f2c4ff1c9f8b39b79e75e7fbf33e92cc67ac51be8f15b75f90220659eee314a4943a6384d2b154fa5821ef7a084814d7ee2c6f9f7f0ffb53be34b01"
+      ]
+    },
+    {
+      "type": "scripthash",
+      "redeemScript": "OP_2 02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1 0395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a OP_2 OP_CHECKMULTISIG",
+      "redeemScriptSig": "OP_0 304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501",
+      "input": "OP_0 304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501 522102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1210395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a52ae",
+      "output": "OP_HASH160 722ff0bc2c3f47b35c20df646c395594da24e90e OP_EQUAL",
+      "inputHex": "0047304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801483045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d14050147522102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1210395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a52ae",
+      "outputHex": "a914722ff0bc2c3f47b35c20df646c395594da24e90e87",
+      "pushOnly": false,
+      "pushOnlySig": true,
+      "inputStack": [
+        "",
+        "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
+        "3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501",
+        "522102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1210395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a52ae"
+      ]
+    },
+    {
+      "type": "witnesspubkeyhash",
+      "pubKey": "02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1",
+      "output": "OP_0 aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5",
+      "outputHex": "0014aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5",
+      "pushOnly": true
+    },
+    {
+      "type": "witnessscripthash",
+      "witnessScriptPubKey": "OP_2 02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1 0395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a OP_2 OP_CHECKMULTISIG",
+      "witnessScriptSig": "OP_0 304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501",
+      "output": "OP_0 32447752937d355ca2defddcd1f6b4fc53d182f8901cebbcff42f5e381bf0b80",
+      "outputHex": "002032447752937d355ca2defddcd1f6b4fc53d182f8901cebbcff42f5e381bf0b80",
+      "witness": "OP_0 304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501 522102359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1210395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a52ae",
+      "pushOnly": true
+    },
+    {
+      "type": "nulldata",
+      "data": "06deadbeef03f895a2ad89fb6d696497af486cb7c644a27aa568c7a18dd06113401115185474",
+      "output": "OP_RETURN 06deadbeef03f895a2ad89fb6d696497af486cb7c644a27aa568c7a18dd06113401115185474",
+      "outputHex": "6a2606deadbeef03f895a2ad89fb6d696497af486cb7c644a27aa568c7a18dd06113401115185474",
+      "pushOnly": false
+    },
+    {
+      "type": "nulldata",
+      "data": "deadffffffffffffffffffffffffffffffffbeef",
+      "output": "OP_RETURN deadffffffffffffffffffffffffffffffffbeef",
+      "outputHex": "6a14deadffffffffffffffffffffffffffffffffbeef",
+      "pushOnly": false
+    },
+    {
+      "type": "nonstandard",
+      "typeIncomplete": "multisig",
+      "pubKeys": [
+        "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
+        "02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340",
+        "024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a34"
+      ],
+      "signatures": [
+        null,
+        "3044022001ab168e80b863fdec694350b587339bb72a37108ac3c989849251444d13ebba02201811272023e3c1038478eb972a82d3ad431bfc2408e88e4da990f1a7ecbb263901",
+        "3045022100aaeb7204c17eee2f2c4ff1c9f8b39b79e75e7fbf33e92cc67ac51be8f15b75f90220659eee314a4943a6384d2b154fa5821ef7a084814d7ee2c6f9f7f0ffb53be34b01"
+      ],
+      "input": "OP_0 OP_0 3044022001ab168e80b863fdec694350b587339bb72a37108ac3c989849251444d13ebba02201811272023e3c1038478eb972a82d3ad431bfc2408e88e4da990f1a7ecbb263901 3045022100aaeb7204c17eee2f2c4ff1c9f8b39b79e75e7fbf33e92cc67ac51be8f15b75f90220659eee314a4943a6384d2b154fa5821ef7a084814d7ee2c6f9f7f0ffb53be34b01",
+      "inputHex": "0000473044022001ab168e80b863fdec694350b587339bb72a37108ac3c989849251444d13ebba02201811272023e3c1038478eb972a82d3ad431bfc2408e88e4da990f1a7ecbb263901483045022100aaeb7204c17eee2f2c4ff1c9f8b39b79e75e7fbf33e92cc67ac51be8f15b75f90220659eee314a4943a6384d2b154fa5821ef7a084814d7ee2c6f9f7f0ffb53be34b01",
+      "pushOnlySig": true,
+      "inputStack": [
+        "",
+        "",
+        "3044022001ab168e80b863fdec694350b587339bb72a37108ac3c989849251444d13ebba02201811272023e3c1038478eb972a82d3ad431bfc2408e88e4da990f1a7ecbb263901",
+        "3045022100aaeb7204c17eee2f2c4ff1c9f8b39b79e75e7fbf33e92cc67ac51be8f15b75f90220659eee314a4943a6384d2b154fa5821ef7a084814d7ee2c6f9f7f0ffb53be34b01"
+      ]
+    },
+    {
+      "type": "nonstandard",
+      "typeIncomplete": "multisig",
+      "pubKeys": [
+        "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
+        "02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340",
+        "024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a34"
+      ],
+      "signatures": [
+        null,
+        null,
+        null
+      ],
+      "input": "OP_0 OP_0 OP_0 OP_0",
+      "inputHex": "00000000",
+      "pushOnlySig": true,
+      "inputStack": [
+        "",
+        "",
+        "",
+        ""
+      ]
+    },
+    {
+      "type": "nonstandard",
+      "typeIncomplete": "scripthash",
+      "pubKeys": [
+        "0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",
+        "04c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee51ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52a"
+      ],
+      "signatures": [
+        null,
+        "30450221009c92c1ae1767ac04e424da7f6db045d979b08cde86b1ddba48621d59a109d818022004f5bb21ad72255177270abaeb2d7940ac18f1e5ca1f53db4f3fd1045647a8a801"
+      ],
+      "redeemScript": "OP_2 0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 04c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee51ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52a OP_2 OP_CHECKMULTISIG",
+      "redeemScriptSig": "OP_0 OP_0 30450221009c92c1ae1767ac04e424da7f6db045d979b08cde86b1ddba48621d59a109d818022004f5bb21ad72255177270abaeb2d7940ac18f1e5ca1f53db4f3fd1045647a8a801",
+      "input": "OP_0 OP_0 30450221009c92c1ae1767ac04e424da7f6db045d979b08cde86b1ddba48621d59a109d818022004f5bb21ad72255177270abaeb2d7940ac18f1e5ca1f53db4f3fd1045647a8a801 52410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b84104c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee51ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52a52ae",
+      "inputHex": "00004830450221009c92c1ae1767ac04e424da7f6db045d979b08cde86b1ddba48621d59a109d818022004f5bb21ad72255177270abaeb2d7940ac18f1e5ca1f53db4f3fd1045647a8a8014c8752410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b84104c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee51ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52a52ae",
+      "pushOnlySig": true,
+      "inputStack": [
+        "",
+        "",
+        "30450221009c92c1ae1767ac04e424da7f6db045d979b08cde86b1ddba48621d59a109d818022004f5bb21ad72255177270abaeb2d7940ac18f1e5ca1f53db4f3fd1045647a8a801",
+        "52410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b84104c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee51ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52a52ae"
+      ]
+    },
+    {
+      "type": "nonstandard",
+      "output": "OP_HASH256 6fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000 OP_EQUAL",
+      "outputHex": "aa206fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d619000000000087",
+      "pushOnly": false
+    },
+    {
+      "type": "nonstandard",
+      "output": "OP_0 OP_0 OP_0 OP_CHECKMULTISIG",
+      "outputHex": "000000ae",
+      "pushOnly": false
+    },
+    {
+      "type": "nonstandard",
+      "output": "OP_0",
+      "outputHex": "00",
+      "pushOnly": true
+    },
+    {
+      "type": "scripthash",
+      "redeemScript": "OP_0",
+      "redeemScriptSig": "OP_0",
+      "input": "OP_0 00",
+      "inputHex": "000100",
+      "pushOnly": true,
+      "pushOnlySig": true,
+      "inputStack": [
+        "",
+        "00"
+      ]
+    },
+    {
+      "type": "nonstandard",
+      "input": "OP_6",
+      "inputHex": "56",
+      "nonstandard": {
+        "input": "06",
+        "inputHex": "0106"
+      },
+      "pushOnly": true,
+      "pushOnlySig": true,
+      "inputStack": [
+        "06"
+      ]
+    },
+    {
+      "type": "nonstandard",
+      "input": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+      "inputHex": "4cff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+      "pushOnly": true,
+      "pushOnlySig": true,
+      "inputStack": [
+        "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+      ]
+    }
+  ],
+  "invalid": {
+    "pubKey": {
+      "inputs": [
+        {
+          "description": "non-canonical signature (too short)",
+          "input": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf7593"
+        },
+        {
+          "description": "non-canonical signature (too long)",
+          "input": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca28ffffffff01"
+        },
+        {
+          "description": "non-canonical signature (invalid hashType)",
+          "input": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca28ff"
+        }
+      ],
+      "outputs": [
+        {
+          "description": "non-canonical pubkey (too short)",
+          "output": "02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce OP_CHECKSIG"
+        },
+        {
+          "description": "non-canonical pubkey (too long)",
+          "output": "02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1ffffff OP_CHECKSIG"
+        },
+        {
+          "description": "last operator is wrong for pubkey-output",
+          "outputHex": "21027a71801ab59336de37785c50005b6abd8ea859eecce1edbe8e81afa74ee5c752ae"
+        },
+        {
+          "description": "missing OP_CHECKSIG",
+          "outputHex": "21027a71801ab59336de37785c50005b6abd8ea859eecce1edbe8e81afa74ee5c752"
+        },
+        {
+          "description": "non-canonical pubkey (bad prefix)",
+          "output": "427a71801ab59336de37785c50005b6abd8ea859eecce1edbe8e81afa74ee5c752 OP_CHECKSIG"
+        },
+        {
+          "description": "has extra opcode at the end isPubKeyOutput",
+          "output": "027a71801ab59336de37785c50005b6abd8ea859eecce1edbe8e81afa74ee5c752 OP_CHECKSIG OP_0"
+        }
+      ]
+    },
+    "pubKeyHash": {
+      "inputs": [
+        {
+          "description": "pubKeyHash input : extraneous data",
+          "input": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1 ffffffff"
+        }
+      ],
+      "outputs": [
+        {
+          "description": "non-minimal encoded isPubKeyHashOutput (non BIP62 compliant)",
+          "outputHex": "76a94c14aa4d7985c57e011a8b3dd8e0e5a73aaef41629c588ac"
+        },
+        {
+          "description": "bad OP_DUP isPubKeyHashOutput",
+          "outputHex": "aca914aa4d7985c57e011a8b3dd8e0e5a73aaef41629c588ac"
+        },
+        {
+          "description": "bad OP_HASH160 isPubKeyHashOutput",
+          "outputHex": "76ac14aa4d7985c57e011a8b3dd8e0e5a73aaef41629c588ac"
+        },
+        {
+          "description": "bad OP_EQUALVERIFY isPubKeyHashOutput",
+          "outputHex": "76a914aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5acac"
+        },
+        {
+          "description": "bad OP_CHECKSIG isPubKeyHashOutput",
+          "outputHex": "76a914aa4d7985c57e011a8b3dd8e0e5a73aaef41629c58888"
+        },
+        {
+          "description": "bad length isPubKeyHashOutput",
+          "outputHex": "76a920aa4d7985c57e011a8b3dd8e0e5a73aaef41629c588ac"
+        },
+        {
+          "description": "has something at the end isPubKeyHashOutput",
+          "outputHex": "76a920aa4d7985c57e011a8b3dd8e0e5a73aaef41629c588ac00"
+        },
+        {
+          "exception": "Expected Buffer\\(Length: 20\\), got Buffer\\(Length: 2\\)",
+          "hash": "ffff"
+        }
+      ]
+    },
+    "scriptHash": {
+      "inputs": [
+        {
+          "description": "redeemScript not data",
+          "input": "OP_0 304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501 OP_RESERVED"
+        },
+        {
+          "description": "redeemScript is a signature, therefore not a valid script",
+          "input": "OP_0 3045022100e12b17b3a4c80c401a1687487bd2bafee9e5f1f8f1ffc6180ce186672ad7b43a02205e316d1e5e71822f5ef301b694e578fa9c94af4f5f098c952c833f4691307f4e01"
+        }
+      ],
+      "outputs": [
+        {
+          "description": "non-minimal encoded isScriptHashOutput (non BIP62 compliant)",
+          "outputHex": "a94c14c286a1af0947f58d1ad787385b1c2c4a976f9e7187"
+        },
+        {
+          "description": "wrong OP_HASH160 opcode",
+          "outputHex": "ac4c14c286a1af0947f58d1ad787385b1c2c4a976f9e7187"
+        },
+        {
+          "description": "wrong length marker",
+          "outputHex": "a916c286a1af0947f58d1ad787385b1c2c4a976f9e7187"
+        },
+        {
+          "description": "wrong OP_EQUAL opcode",
+          "outputHex": "a914c286a1af0947f58d1ad787385b1c2c4a976f9e7188"
+        },
+        {
+          "exception": "Expected Buffer\\(Length: 20\\), got Buffer\\(Length: 3\\)",
+          "hash": "ffffff"
+        }
+      ]
+    },
+    "multisig": {
+      "inputs": [
+        {
+          "description": "Not enough signatures provided",
+          "type": "multisig",
+          "output": "OP_2 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 OP_2 OP_CHECKMULTISIG",
+          "signatures": []
+        },
+        {
+          "exception": "Not enough signatures provided",
+          "output": "OP_2 02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1 0395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a OP_2 OP_CHECKMULTISIG",
+          "signatures": [
+            "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801"
+          ]
+        },
+        {
+          "exception": "Too many signatures provided",
+          "output": "OP_2 02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1 0395a9d84d47d524548f79f435758c01faec5da2b7e551d3b8c995b7e06326ae4a OP_2 OP_CHECKMULTISIG",
+          "signatures": [
+            "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801",
+            "3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501",
+            "3045022100ef253c1faa39e65115872519e5f0a33bbecf430c0f35cf562beabbad4da24d8d02201742be8ee49812a73adea3007c9641ce6725c32cd44ddb8e3a3af460015d140501"
+          ]
+        }
+      ],
+      "outputs": [
+        {
+          "description": "OP_CHECKMULTISIG not found",
+          "output": "OP_0 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 OP_2 OP_HASH160"
+        },
+        {
+          "description": "less than 4 chunks",
+          "output": "OP_0 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 OP_HASH160"
+        },
+        {
+          "description": "m === 0",
+          "output": "OP_0 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 OP_2 OP_CHECKMULTISIG"
+        },
+        {
+          "description": "m < OP_1",
+          "output": "OP_1NEGATE 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 OP_2 OP_CHECKMULTISIG"
+        },
+        {
+          "description": "m > OP_16",
+          "output": "OP_NOP 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 OP_2 OP_CHECKMULTISIG"
+        },
+        {
+          "description": "n === 0",
+          "output": "OP_1 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 OP_0 OP_CHECKMULTISIG"
+        },
+        {
+          "description": "n < OP_1",
+          "output": "OP_1 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 OP_1NEGATE OP_CHECKMULTISIG"
+        },
+        {
+          "description": "n > OP_16",
+          "output": "OP_1 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 OP_NOP OP_CHECKMULTISIG"
+        },
+        {
+          "description": "n < m",
+          "output": "OP_2 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 OP_1 OP_CHECKMULTISIG"
+        },
+        {
+          "description": "n < len(pubKeys)",
+          "output": "OP_2 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 02b80011a883a0fd621ad46dfc405df1e74bf075cbaf700fd4aebef6e96f848340 024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a34 OP_2 OP_CHECKMULTISIG"
+        },
+        {
+          "description": "n > len(pubKeys)",
+          "output": "OP_1 024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a34 OP_2 OP_CHECKMULTISIG"
+        },
+        {
+          "description": "m is data",
+          "output": "ffff 024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a34 OP_1 OP_CHECKMULTISIG"
+        },
+        {
+          "description": "n is data",
+          "output": "OP_1 024289801366bcee6172b771cf5a7f13aaecd237a0b9a1ff9d769cabc2e6b70a34 ffff OP_CHECKMULTISIG"
+        },
+        {
+          "description": "non-canonical pubKey (bad length)",
+          "output": "OP_1 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ffff OP_1 OP_CHECKMULTISIG"
+        },
+        {
+          "exception": "Not enough pubKeys provided",
+          "m": 4,
+          "pubKeys": [
+            "02ea1297665dd733d444f31ec2581020004892cdaaf3dd6c0107c615afb839785f",
+            "02fab2dea1458990793f56f42e4a47dbf35a12a351f26fa5d7e0cc7447eaafa21f",
+            "036c6802ce7e8113723dd92cdb852e492ebb157a871ca532c3cb9ed08248ff0e19"
+          ],
+          "signatures": [
+            "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801"
+          ]
+        }
+      ]
+    },
+    "witnessPubKeyHash": {
+      "inputs": [],
+      "outputs": [
+        {
+          "description": "wrong version",
+          "outputHex": "51149090909090909090909090909090909090909090"
+        },
+        {
+          "description": "wrong length marker",
+          "outputHex": "00209090909090909090909090909090909090909090"
+        },
+        {
+          "exception": "Expected Buffer\\(Length: 20\\), got Buffer\\(Length: 3\\)",
+          "hash": "ffffff"
+        }
+      ]
+    },
+    "witnessScriptHash": {
+      "inputs": [],
+      "outputs": [
+        {
+          "description": "wrong version",
+          "outputHex": "51209090909090909090909090909090909090909090909090909090909090909090"
+        },
+        {
+          "description": "wrong length marker",
+          "outputHex": "00219090909090909090909090909090909090909090909090909090909090909090"
+        },
+        {
+          "exception": "Expected Buffer\\(Length: 32\\), got Buffer\\(Length: 3\\)",
+          "hash": "ffffff"
+        }
+      ]
+    }
+  }
+}
diff --git a/test/fixtures/transaction.json b/test/fixtures/transaction.json
index 5879482b..04b22e6d 100644
--- a/test/fixtures/transaction.json
+++ b/test/fixtures/transaction.json
@@ -164,8 +164,7 @@
           {
             "hash": "0000000000000000000000000000000000000000000000000000000000000000",
             "index": 4294967295,
-            "data": "032832051c4d696e656420627920416e74506f6f6c20626a343a45ef0454c5de8d5e5300004e2c0000",
-            "sequence": 4294967295
+            "data": "032832051c4d696e656420627920416e74506f6f6c20626a343a45ef0454c5de8d5e5300004e2c0000"
           }
         ],
         "outs": [
@@ -242,22 +241,14 @@
           {
             "hash": "93aef40ae141694895e99e18e49d0181b086dd7c011c0241175c6eaf32009997",
             "index": 0,
-            "sigHash": "8d590cd3c3622f1cc22b17967abfeac8aa72e5b64f80d9ca7a61c59f07a47a8f",
             "script": "3045022100e57eba5380dcc8a7bdb5370b423dadd43070e1ca268f94bc97b2ded55ca45e9502206a43151c8af03a00f0ac86526d07981e303fc0daea8c6ed435abe8961533046d01",
-            "scriptHex": "483045022100e57eba5380dcc8a7bdb5370b423dadd43070e1ca268f94bc97b2ded55ca45e9502206a43151c8af03a00f0ac86526d07981e303fc0daea8c6ed435abe8961533046d01",
-            "sequence": 4294967295,
-            "witness": [],
-            "value": 80000,
-            "scriptPubKey": "21038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2bac",
-            "redeemScript": "",
-            "witnessScript": ""
+            "value": 80000
           }
         ],
         "outs": [
           {
             "value": 60000,
-            "script": "OP_DUP OP_HASH160 851a33a5ef0d4279bd5854949174e2c65b1d4500 OP_EQUALVERIFY OP_CHECKSIG",
-            "scriptHex": "76a914851a33a5ef0d4279bd5854949174e2c65b1d450088ac"
+            "script": "OP_DUP OP_HASH160 851a33a5ef0d4279bd5854949174e2c65b1d4500 OP_EQUALVERIFY OP_CHECKSIG"
           }
         ],
         "locktime": 0
@@ -276,15 +267,8 @@
           {
             "hash": "a30e865fa60f6c25a8b218bb5a6b9acc7cf3f1db2f2e3a7114b51af5d6ae811f",
             "index": 0,
-            "sigHash": "e5a339f87c44b443de94b28c1c2a5fe5acedd9ffd2d25ca194cd1d89284b08ed",
             "script": "3044022026d2b56b6cb0269bf4e80dd655b9e917019e2ccef57f4b858d03bb45a2da59d9022010519a7f327f03e7c9613e0694f929544af29d3682e7ec8f19147e7a86651ecd01 21038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2bac",
-            "scriptHex": "473044022026d2b56b6cb0269bf4e80dd655b9e917019e2ccef57f4b858d03bb45a2da59d9022010519a7f327f03e7c9613e0694f929544af29d3682e7ec8f19147e7a86651ecd012321038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2bac",
-            "sequence": 4294967295,
-            "witness": [],
-            "value": 80000,
-            "scriptPubKey": "a914c99d9ebb5a4828e4e1b606dd6a51a2babebbdc0987",
-            "redeemScript": "21038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2bac",
-            "witnessScript": ""
+            "value": 80000
           }
         ],
         "outs": [
@@ -310,7 +294,6 @@
           {
             "hash": "4533a3bc1e039bd787656068e135aaee10aee95a64776bfc047ee6a7c1ebdd2f",
             "index": 0,
-            "sequence": 4294967295,
             "witness": [
               "3044022039725bb7291a14dd182dafdeaf3ea0d5c05c34f4617ccbaa46522ca913995c4e02203b170d072ed2e489e7424ad96d8fa888deb530be2d4c5d9aaddf111a7efdb2d301",
               "21038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2bac"
@@ -340,25 +323,17 @@
           {
             "hash": "e0779d448aaa203a96b3de14d0482e26dd75a4278ae5bb6d7cc18e6874f38660",
             "index": 0,
-            "sigHash": "b3caa13417b83a07e4684c5f1b5f4563936cd66791ca106b1770aeeaae682794",
             "script": "00200f9ea7bae7166c980169059e39443ed13324495b0d6678ce716262e879591210",
-            "scriptHex": "2200200f9ea7bae7166c980169059e39443ed13324495b0d6678ce716262e879591210",
-            "sequence": 4294967295,
             "witness": [
               "30440220014207a5f0601ed7b3c3f9d82309b32e8f76dd6776a55cb5f8684b9ff029e0850220693afd7b69471b51d9354cc1a956b68b8d48e32f6b0ad7a19bb5dd3e4499179a01",
               "21038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2bac"
-            ],
-            "value": 80000,
-            "scriptPubKey": "a9146d185c7042d01ea8276dc6be6603101dc441d8a487",
-            "redeemScript": "00200f9ea7bae7166c980169059e39443ed13324495b0d6678ce716262e879591210",
-            "witnessScript": "21038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2bac"
+            ]
           }
         ],
         "outs": [
           {
             "value": 60000,
-            "script": "OP_DUP OP_HASH160 851a33a5ef0d4279bd5854949174e2c65b1d4500 OP_EQUALVERIFY OP_CHECKSIG",
-            "scriptHex": "76a914851a33a5ef0d4279bd5854949174e2c65b1d450088ac"
+            "script": "OP_DUP OP_HASH160 851a33a5ef0d4279bd5854949174e2c65b1d4500 OP_EQUALVERIFY OP_CHECKSIG"
           }
         ],
         "locktime": 0
@@ -377,22 +352,13 @@
           {
             "hash": "76d7b05b96e69d9760bacf14e496ea01085eff32be8f4e08b299eb92057826e5",
             "index": 0,
-            "sigHash": "b01334b1f522b3d824960b2ce215031b392b084eca649a6bd1efdf4caa841e7b",
-            "script": "30450221009bd6ff2561437155913c289923175d3f114cca1c0e2bc5989315d5261502c2c902201b71ad90dce076a5eb872330ed729e7c2c4bc2d0513efff099dbefb3b62eab4f01 038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b",
-            "scriptHex": "4830450221009bd6ff2561437155913c289923175d3f114cca1c0e2bc5989315d5261502c2c902201b71ad90dce076a5eb872330ed729e7c2c4bc2d0513efff099dbefb3b62eab4f0121038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b",
-            "sequence": 4294967295,
-            "witness": [],
-            "value": 80000,
-            "scriptPubKey": "76a914851a33a5ef0d4279bd5854949174e2c65b1d450088ac",
-            "redeemScript": "",
-            "witnessScript": ""
+            "script": "30450221009bd6ff2561437155913c289923175d3f114cca1c0e2bc5989315d5261502c2c902201b71ad90dce076a5eb872330ed729e7c2c4bc2d0513efff099dbefb3b62eab4f01 038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b"
           }
         ],
         "outs": [
           {
             "value": 60000,
-            "script": "OP_DUP OP_HASH160 851a33a5ef0d4279bd5854949174e2c65b1d4500 OP_EQUALVERIFY OP_CHECKSIG",
-            "scriptHex": "76a914851a33a5ef0d4279bd5854949174e2c65b1d450088ac"
+            "script": "OP_DUP OP_HASH160 851a33a5ef0d4279bd5854949174e2c65b1d4500 OP_EQUALVERIFY OP_CHECKSIG"
           }
         ],
         "locktime": 0
@@ -411,22 +377,13 @@
           {
             "hash": "4b9ffc17c3cce03ee66980bf32d36aaa13462980c3af9d9d29ec6b97ab1c9165",
             "index": 0,
-            "sigHash": "40c2576db2ad631c5799d344dcb5efd05eef3c52aacb51585af327f8efb3bcde",
-            "script": "3044022003d738d855d0c54a419ac62ebe1a1c0bf2dc6993c9585adb9a8666736658107002204d57ff62ee7efae6df73430bba62494faeba8c125a4abcf2488757a4f8877dd501 038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b 76a914851a33a5ef0d4279bd5854949174e2c65b1d450088ac",
-            "scriptHex": "473044022003d738d855d0c54a419ac62ebe1a1c0bf2dc6993c9585adb9a8666736658107002204d57ff62ee7efae6df73430bba62494faeba8c125a4abcf2488757a4f8877dd50121038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b1976a914851a33a5ef0d4279bd5854949174e2c65b1d450088ac",
-            "sequence": 4294967295,
-            "witness": [],
-            "value": 80000,
-            "scriptPubKey": "a9142162ff7c23d47a0c331f95c67d7c3e22abb12a0287",
-            "redeemScript": "76a914851a33a5ef0d4279bd5854949174e2c65b1d450088ac",
-            "witnessScript": ""
+            "script": "3044022003d738d855d0c54a419ac62ebe1a1c0bf2dc6993c9585adb9a8666736658107002204d57ff62ee7efae6df73430bba62494faeba8c125a4abcf2488757a4f8877dd501 038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b 76a914851a33a5ef0d4279bd5854949174e2c65b1d450088ac"
           }
         ],
         "outs": [
           {
             "value": 60000,
-            "script": "OP_DUP OP_HASH160 851a33a5ef0d4279bd5854949174e2c65b1d4500 OP_EQUALVERIFY OP_CHECKSIG",
-            "scriptHex": "76a914851a33a5ef0d4279bd5854949174e2c65b1d450088ac"
+            "script": "OP_DUP OP_HASH160 851a33a5ef0d4279bd5854949174e2c65b1d4500 OP_EQUALVERIFY OP_CHECKSIG"
           }
         ],
         "locktime": 0
@@ -445,19 +402,12 @@
           {
             "hash": "23539877e39a273819006de1c433e09f9e9af201fc178dd0f2cf2eaa5ad53b48",
             "index": 0,
-            "sigHash": "b0197f4cd027b33ebb2ef54e02a7008dc29ec807ec2de58843fffbdf07ceb2c3",
             "script": "",
-            "scriptHex": "",
-            "sequence": 4294967295,
             "witness": [
               "3045022100f02a82b0a94a5d5dc4d2127ac34be62cb066713d71d56bdf5ef7810ab57a157302205f24abdde1dab554a02edcf378e98828024e57272e5e474a5b04accdca080a0301",
               "038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b",
               "76a914851a33a5ef0d4279bd5854949174e2c65b1d450088ac"
-            ],
-            "value": 80000,
-            "scriptPubKey": "0020578db4b54a6961060b71385c17d3280379a557224c52b11b19a3a1c1eef606a0",
-            "redeemScript": "",
-            "witnessScript": "76a914851a33a5ef0d4279bd5854949174e2c65b1d450088ac"
+            ]
           }
         ],
         "outs": [
@@ -483,26 +433,18 @@
           {
             "hash": "363dfbfe2566db77e3b1195bedf1d0daeb9ce526cd7611ba81759b2654ce415c",
             "index": 0,
-            "sigHash": "9580096496f72ae9fed63e6701b2a9df3c8d212d8accd4b1966d3239c33a859f",
             "script": "0020578db4b54a6961060b71385c17d3280379a557224c52b11b19a3a1c1eef606a0",
-            "scriptHex": "220020578db4b54a6961060b71385c17d3280379a557224c52b11b19a3a1c1eef606a0",
-            "sequence": 4294967295,
             "witness": [
               "3045022100c8bd5ebb26ba6719158650c3e7c5e80be4c886ba025c44cc41f5149b3114705a02203ac6e1f38f6c081d506f28f1b5e38ebec9e0f0fa911d0e3f68d48d8b0e77b34b01",
               "038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b",
               "76a914851a33a5ef0d4279bd5854949174e2c65b1d450088ac"
-            ],
-            "value": 80000,
-            "scriptPubKey": "a91444a641c4e06eb6118c99e5ed29954b705b50fb6a87",
-            "redeemScript": "0020578db4b54a6961060b71385c17d3280379a557224c52b11b19a3a1c1eef606a0",
-            "witnessScript": "76a914851a33a5ef0d4279bd5854949174e2c65b1d450088ac"
+            ]
           }
         ],
         "outs": [
           {
             "value": 60000,
-            "script": "OP_DUP OP_HASH160 851a33a5ef0d4279bd5854949174e2c65b1d4500 OP_EQUALVERIFY OP_CHECKSIG",
-            "scriptHex": "76a914851a33a5ef0d4279bd5854949174e2c65b1d450088ac"
+            "script": "OP_DUP OP_HASH160 851a33a5ef0d4279bd5854949174e2c65b1d4500 OP_EQUALVERIFY OP_CHECKSIG"
           }
         ],
         "locktime": 0
@@ -521,22 +463,13 @@
           {
             "hash": "79310ec46e734b3490ee839c5ae4a09d28561ee9fff2d051f733d201f958d6d2",
             "index": 0,
-            "sigHash": "1c68226955e39aed91eb7f35fa106240951208138b584caeb05b44f367078b09",
-            "script": "OP_0 3045022100d269531f120f377ed2f94f42bef893ff2fe6544ac97fb477fa291bc6cfb7647e02200983f6a5bbd4ce6cf97f571995634805a7324cc5d8353ed954fa62477b0fcd0901",
-            "scriptHex": "00483045022100d269531f120f377ed2f94f42bef893ff2fe6544ac97fb477fa291bc6cfb7647e02200983f6a5bbd4ce6cf97f571995634805a7324cc5d8353ed954fa62477b0fcd0901",
-            "sequence": 4294967295,
-            "witness": [],
-            "value": 80000,
-            "scriptPubKey": "5121038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b51ae",
-            "redeemScript": "",
-            "witnessScript": ""
+            "script": "OP_0 3045022100d269531f120f377ed2f94f42bef893ff2fe6544ac97fb477fa291bc6cfb7647e02200983f6a5bbd4ce6cf97f571995634805a7324cc5d8353ed954fa62477b0fcd0901"
           }
         ],
         "outs": [
           {
             "value": 60000,
-            "script": "OP_DUP OP_HASH160 851a33a5ef0d4279bd5854949174e2c65b1d4500 OP_EQUALVERIFY OP_CHECKSIG",
-            "scriptHex": "76a914851a33a5ef0d4279bd5854949174e2c65b1d450088ac"
+            "script": "OP_DUP OP_HASH160 851a33a5ef0d4279bd5854949174e2c65b1d4500 OP_EQUALVERIFY OP_CHECKSIG"
           }
         ],
         "locktime": 0
@@ -555,15 +488,7 @@
           {
             "hash": "52882c661c49dd2f53bd9ced7e9f44b184888ad2fe7d86737f0efaa7aecdced1",
             "index": 0,
-            "sigHash": "a1b982ea4d57c3255268a801885ea8ee8b785d52bf7dd024997a5111c9295f5a",
-            "script": "OP_0 3044022025f2e161f0a97888df948f4dcc7c04fe502510b8d8260ca9920f38d55e4d17720220271b6843224b3a34542a4df31781d048da56ee46b8c5fb99043e30abd527b2d801 5121038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b51ae",
-            "scriptHex": "00473044022025f2e161f0a97888df948f4dcc7c04fe502510b8d8260ca9920f38d55e4d17720220271b6843224b3a34542a4df31781d048da56ee46b8c5fb99043e30abd527b2d801255121038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b51ae",
-            "sequence": 4294967295,
-            "witness": [],
-            "value": 80000,
-            "scriptPubKey": "a91438c064c6387d1071eeb5c3d90350054aea0b3fc187",
-            "redeemScript": "5121038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b51ae",
-            "witnessScript": ""
+            "script": "OP_0 3044022025f2e161f0a97888df948f4dcc7c04fe502510b8d8260ca9920f38d55e4d17720220271b6843224b3a34542a4df31781d048da56ee46b8c5fb99043e30abd527b2d801 5121038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b51ae"
           }
         ],
         "outs": [
@@ -589,26 +514,18 @@
           {
             "hash": "c1eced6216de0889d4629ff64a8af8e8ec6d0b414de0c57b46c02cc303d321fe",
             "index": 0,
-            "sigHash": "c57f8489d77552631b10fc703de3d2a72e473590b8b8283f4a1134855c6e4368",
             "script": "",
-            "scriptHex": "",
-            "sequence": 4294967295,
             "witness": [
               "",
               "3045022100d4c0cbdb45915b8a3162362fa5f74556de919aeda5337fc44a7fb000e833460d022017742c37d7a061e2ae3a086c7c585c9c85e5d31af468d3e00045c0f35b8f8eb601",
               "5121038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b51ae"
-            ],
-            "value": 80000,
-            "scriptPubKey": "00201b8c0c2878c5634c3ce738cdc568c592e99783dbd28ff4c6cb5b7b4675d9ee99",
-            "redeemScript": "",
-            "witnessScript": "5121038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b51ae"
+            ]
           }
         ],
         "outs": [
           {
             "value": 60000,
-            "script": "OP_DUP OP_HASH160 851a33a5ef0d4279bd5854949174e2c65b1d4500 OP_EQUALVERIFY OP_CHECKSIG",
-            "scriptHex": "76a914851a33a5ef0d4279bd5854949174e2c65b1d450088ac"
+            "script": "OP_DUP OP_HASH160 851a33a5ef0d4279bd5854949174e2c65b1d4500 OP_EQUALVERIFY OP_CHECKSIG"
           }
         ],
         "locktime": 0
@@ -627,19 +544,12 @@
           {
             "hash": "3a5a2ab0223d3b504b52af76d650329750666fbf1be13d4cb08d0d9fc550a47d",
             "index": 0,
-            "sigHash": "90ced36a2a53e986837407ec5b34fca11c68b477fa51806715186595372c0b37",
             "script": "00201b8c0c2878c5634c3ce738cdc568c592e99783dbd28ff4c6cb5b7b4675d9ee99",
-            "scriptHex": "2200201b8c0c2878c5634c3ce738cdc568c592e99783dbd28ff4c6cb5b7b4675d9ee99",
-            "sequence": 4294967295,
             "witness": [
               "",
               "3045022100c97a5e205ce0023d3d44f846abf1f0e21b6f2646bd2496bbe92e4333fe4401be02201247e047d669f713582713e35d2eba430abc3d75a924bb500362bf47d6234ed501",
               "5121038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b51ae"
-            ],
-            "value": 80000,
-            "scriptPubKey": "a914cc6ea17c33de7996471e40892acdd6e5f61b9b6f87",
-            "redeemScript": "00201b8c0c2878c5634c3ce738cdc568c592e99783dbd28ff4c6cb5b7b4675d9ee99",
-            "witnessScript": "5121038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b51ae"
+            ]
           }
         ],
         "outs": [
@@ -665,25 +575,17 @@
           {
             "hash": "33defbe3e28860007ff3e21222774c220cb35d554fa3e3796d25bf8ee983e108",
             "index": 0,
-            "sigHash": "8ef2f4892fdbb44a7859ac059cdacf20903566a1472fae38ba37443c44b66202",
             "script": "",
-            "scriptHex": "",
-            "sequence": 4294967295,
             "witness": [
               "304502210097c3006f0b390982eb47f762b2853773c6cedf83668a22d710f4c13c4fd6b15502205e26ef16a81fc818a37f3a34fc6d0700e61100ea6c6773907c9c046042c4403401",
               "038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b"
-            ],
-            "value": 80000,
-            "scriptPubKey": "0014851a33a5ef0d4279bd5854949174e2c65b1d4500",
-            "redeemScript": "",
-            "witnessScript": ""
+            ]
           }
         ],
         "outs": [
           {
             "value": 60000,
-            "script": "OP_DUP OP_HASH160 851a33a5ef0d4279bd5854949174e2c65b1d4500 OP_EQUALVERIFY OP_CHECKSIG",
-            "scriptHex": "76a914851a33a5ef0d4279bd5854949174e2c65b1d450088ac"
+            "script": "OP_DUP OP_HASH160 851a33a5ef0d4279bd5854949174e2c65b1d4500 OP_EQUALVERIFY OP_CHECKSIG"
           }
         ],
         "locktime": 0
@@ -702,25 +604,17 @@
           {
             "hash": "5df9a0b9ade2d835881704e0f53b51a4b19ecfc794ea1f3555783dd7f68659ce",
             "index": 0,
-            "sigHash": "b9d9a395dbd84365e93016a3ba1ffe2c373b85e245598597b2f8cd6eb0706252",
             "script": "0014851a33a5ef0d4279bd5854949174e2c65b1d4500",
-            "scriptHex": "160014851a33a5ef0d4279bd5854949174e2c65b1d4500",
-            "sequence": 4294967295,
             "witness": [
               "3045022100cb3929c128fec5108071b662e5af58e39ac8708882753a421455ca80462956f6022030c0f4738dd1a13fc7a34393002d25c6e8a6399f29c7db4b98f53a9475d94ca201",
               "038de63cf582d058a399a176825c045672d5ff8ea25b64d28d4375dcdb14c02b2b"
-            ],
-            "value": 80000,
-            "scriptPubKey": "a9140d061ae2c8ad224a81142a2e02181f5173b576b387",
-            "redeemScript": "0014851a33a5ef0d4279bd5854949174e2c65b1d4500",
-            "witnessScript": ""
+            ]
           }
         ],
         "outs": [
           {
             "value": 60000,
-            "script": "OP_DUP OP_HASH160 851a33a5ef0d4279bd5854949174e2c65b1d4500 OP_EQUALVERIFY OP_CHECKSIG",
-            "scriptHex": "76a914851a33a5ef0d4279bd5854949174e2c65b1d450088ac"
+            "script": "OP_DUP OP_HASH160 851a33a5ef0d4279bd5854949174e2c65b1d4500 OP_EQUALVERIFY OP_CHECKSIG"
           }
         ],
         "locktime": 0
@@ -778,7 +672,7 @@
       "value": 600000000
     },
     {
-      "description": "P2SH(P2WPKH) with SIGHASH_ALL",
+      "description": "P2WPKH with SIGHASH_ALL",
       "txHex": "0100000001db6b1b20aa0fd7b23880be2ecbd4a98130974cf4748fb66092ac4d3ceb1a54770100000000feffffff02b8b4eb0b000000001976a914a457b684d7f0d539a46a45bbc043f35b59d0d96388ac0008af2f000000001976a914fd270b1ee6abcaea97fea7ad0402e8bd8ad6d77c88ac92040000",
       "inIndex": 0,
       "script": "OP_DUP OP_HASH160 79091972186c449eb1ded22b78e40d009bdf0089 OP_EQUALVERIFY OP_CHECKSIG",
@@ -787,7 +681,7 @@
       "value": 1000000000
     },
     {
-      "description": "P2SH(P2WSH) with SIGHASH_ALL",
+      "description": "P2WSH with SIGHASH_ALL",
       "txHex": "010000000136641869ca081e70f394c6948e8af409e18b619df2ed74aa106c1ca29787b96e0100000000ffffffff0200e9a435000000001976a914389ffce9cd9ae88dcc0631e88a821ffdbe9bfe2688acc0832f05000000001976a9147480a33f950689af511e6e84c138dbbd3c3ee41588ac00000000",
       "inIndex": 0,
       "script": "OP_6 0307b8ae49ac90a048e9b53357a2354b3334e9c8bee813ecb98e99a7e07e8c3ba3 03b28f0c28bfab54554ae8c658ac5c3e0ce6e79ad336331f78c428dd43eea8449b 034b8113d703413d57761b8b9781957b8c0ac1dfe69f492580ca4195f50376ba4a 033400f6afecb833092a9a21cfdf1ed1376e58c5d1f47de74683123987e967a8f4 03a6d48b1131e94ba04d9737d61acdaa1322008af9602b3b14862c07a1789aac16 02d8b661b0b3302ee2f162b09e07a55ad5dfbe673a9f01d9f0c19617681024306b OP_6 OP_CHECKMULTISIG",
@@ -796,7 +690,7 @@
       "value": 987654321
     },
     {
-      "description": "P2SH(P2WSH) with SIGHASH_NONE",
+      "description": "P2WSH with SIGHASH_NONE",
       "txHex": "010000000136641869ca081e70f394c6948e8af409e18b619df2ed74aa106c1ca29787b96e0100000000ffffffff0200e9a435000000001976a914389ffce9cd9ae88dcc0631e88a821ffdbe9bfe2688acc0832f05000000001976a9147480a33f950689af511e6e84c138dbbd3c3ee41588ac00000000",
       "inIndex": 0,
       "script": "OP_6 0307b8ae49ac90a048e9b53357a2354b3334e9c8bee813ecb98e99a7e07e8c3ba3 03b28f0c28bfab54554ae8c658ac5c3e0ce6e79ad336331f78c428dd43eea8449b 034b8113d703413d57761b8b9781957b8c0ac1dfe69f492580ca4195f50376ba4a 033400f6afecb833092a9a21cfdf1ed1376e58c5d1f47de74683123987e967a8f4 03a6d48b1131e94ba04d9737d61acdaa1322008af9602b3b14862c07a1789aac16 02d8b661b0b3302ee2f162b09e07a55ad5dfbe673a9f01d9f0c19617681024306b OP_6 OP_CHECKMULTISIG",
@@ -805,7 +699,7 @@
       "value": 987654321
     },
     {
-      "description": "P2SH(P2WSH) with SIGHASH_SINGLE",
+      "description": "P2WSH with SIGHASH_SINGLE",
       "txHex": "010000000136641869ca081e70f394c6948e8af409e18b619df2ed74aa106c1ca29787b96e0100000000ffffffff0200e9a435000000001976a914389ffce9cd9ae88dcc0631e88a821ffdbe9bfe2688acc0832f05000000001976a9147480a33f950689af511e6e84c138dbbd3c3ee41588ac00000000",
       "inIndex": 0,
       "script": "OP_6 0307b8ae49ac90a048e9b53357a2354b3334e9c8bee813ecb98e99a7e07e8c3ba3 03b28f0c28bfab54554ae8c658ac5c3e0ce6e79ad336331f78c428dd43eea8449b 034b8113d703413d57761b8b9781957b8c0ac1dfe69f492580ca4195f50376ba4a 033400f6afecb833092a9a21cfdf1ed1376e58c5d1f47de74683123987e967a8f4 03a6d48b1131e94ba04d9737d61acdaa1322008af9602b3b14862c07a1789aac16 02d8b661b0b3302ee2f162b09e07a55ad5dfbe673a9f01d9f0c19617681024306b OP_6 OP_CHECKMULTISIG",
@@ -814,7 +708,7 @@
       "value": 987654321
     },
     {
-      "description": "P2SH(P2WSH) with SIGHASH_ALL | SIGHASH_ANYONECANPAY",
+      "description": "P2WSH with SIGHASH_ALL | SIGHASH_ANYONECANPAY",
       "txHex": "010000000136641869ca081e70f394c6948e8af409e18b619df2ed74aa106c1ca29787b96e0100000000ffffffff0200e9a435000000001976a914389ffce9cd9ae88dcc0631e88a821ffdbe9bfe2688acc0832f05000000001976a9147480a33f950689af511e6e84c138dbbd3c3ee41588ac00000000",
       "inIndex": 0,
       "script": "OP_6 0307b8ae49ac90a048e9b53357a2354b3334e9c8bee813ecb98e99a7e07e8c3ba3 03b28f0c28bfab54554ae8c658ac5c3e0ce6e79ad336331f78c428dd43eea8449b 034b8113d703413d57761b8b9781957b8c0ac1dfe69f492580ca4195f50376ba4a 033400f6afecb833092a9a21cfdf1ed1376e58c5d1f47de74683123987e967a8f4 03a6d48b1131e94ba04d9737d61acdaa1322008af9602b3b14862c07a1789aac16 02d8b661b0b3302ee2f162b09e07a55ad5dfbe673a9f01d9f0c19617681024306b OP_6 OP_CHECKMULTISIG",
@@ -823,7 +717,7 @@
       "value": 987654321
     },
     {
-      "description": "P2SH(P2WSH) with SIGHASH_NONE | SIGHASH_ANYONECANPAY",
+      "description": "P2WSH with SIGHASH_NONE | SIGHASH_ANYONECANPAY",
       "txHex": "010000000136641869ca081e70f394c6948e8af409e18b619df2ed74aa106c1ca29787b96e0100000000ffffffff0200e9a435000000001976a914389ffce9cd9ae88dcc0631e88a821ffdbe9bfe2688acc0832f05000000001976a9147480a33f950689af511e6e84c138dbbd3c3ee41588ac00000000",
       "inIndex": 0,
       "script": "OP_6 0307b8ae49ac90a048e9b53357a2354b3334e9c8bee813ecb98e99a7e07e8c3ba3 03b28f0c28bfab54554ae8c658ac5c3e0ce6e79ad336331f78c428dd43eea8449b 034b8113d703413d57761b8b9781957b8c0ac1dfe69f492580ca4195f50376ba4a 033400f6afecb833092a9a21cfdf1ed1376e58c5d1f47de74683123987e967a8f4 03a6d48b1131e94ba04d9737d61acdaa1322008af9602b3b14862c07a1789aac16 02d8b661b0b3302ee2f162b09e07a55ad5dfbe673a9f01d9f0c19617681024306b OP_6 OP_CHECKMULTISIG",
@@ -832,7 +726,7 @@
       "value": 987654321
     },
     {
-      "description": "P2SH(P2WSH) with SIGHASH_SINGLE | SIGHASH_ANYONECANPAY",
+      "description": "P2WSH with SIGHASH_SINGLE | SIGHASH_ANYONECANPAY",
       "txHex": "010000000136641869ca081e70f394c6948e8af409e18b619df2ed74aa106c1ca29787b96e0100000000ffffffff0200e9a435000000001976a914389ffce9cd9ae88dcc0631e88a821ffdbe9bfe2688acc0832f05000000001976a9147480a33f950689af511e6e84c138dbbd3c3ee41588ac00000000",
       "inIndex": 0,
       "script": "OP_6 0307b8ae49ac90a048e9b53357a2354b3334e9c8bee813ecb98e99a7e07e8c3ba3 03b28f0c28bfab54554ae8c658ac5c3e0ce6e79ad336331f78c428dd43eea8449b 034b8113d703413d57761b8b9781957b8c0ac1dfe69f492580ca4195f50376ba4a 033400f6afecb833092a9a21cfdf1ed1376e58c5d1f47de74683123987e967a8f4 03a6d48b1131e94ba04d9737d61acdaa1322008af9602b3b14862c07a1789aac16 02d8b661b0b3302ee2f162b09e07a55ad5dfbe673a9f01d9f0c19617681024306b OP_6 OP_CHECKMULTISIG",
diff --git a/test/script.js b/test/script.js
index db11c18c..e164cb7d 100644
--- a/test/script.js
+++ b/test/script.js
@@ -22,96 +22,81 @@ describe('script', function () {
 
   describe('fromASM/toASM', function () {
     fixtures.valid.forEach(function (f) {
-      if (f.scriptSig) {
-        it('encodes/decodes ' + f.scriptSig, function () {
-          var scriptSig = bscript.fromASM(f.scriptSig)
+      it('encodes/decodes ' + f.asm, function () {
+        var scriptSig = bscript.fromASM(f.asm)
 
-          assert.strictEqual(bscript.toASM(scriptSig), f.scriptSig)
-        })
-      }
+        assert.strictEqual(bscript.toASM(scriptSig), f.asm)
+      })
+    })
+  })
 
-      if (f.scriptPubKey) {
-        it('encodes/decodes ' + f.scriptPubKey, function () {
-          var scriptPubKey = bscript.fromASM(f.scriptPubKey)
+  describe('isPushOnly', function () {
+    fixtures.valid.forEach(function (f) {
+      it('returns ' + !!f.stack + ' for ' + f.asm, function () {
+        var script = bscript.fromASM(f.asm)
+        var chunks = bscript.decompile(script)
 
-          assert.strictEqual(bscript.toASM(scriptPubKey), f.scriptPubKey)
-        })
-      }
+        assert.strictEqual(bscript.isPushOnly(chunks), !!f.stack)
+      })
     })
   })
 
-  describe('decompilePushOnly/compilePushOnly', function () {
+  describe('toStack', function () {
     fixtures.valid.forEach(function (f) {
-      if (f.scriptSig) {
-        it('encodes/decodes scriptSigs as script stack: ' + f.scriptSig, function () {
-          var script = bscript.fromASM(f.scriptSig)
-          var sigStack = bscript.decompilePushOnly(script)
-          var rebuildScript = bscript.compilePushOnly(sigStack)
-          assert.strictEqual(bscript.toASM(rebuildScript), f.scriptSig)
-        })
-      }
+      it('returns ' + !!f.stack + ' for ' + f.asm, function () {
+        var script = bscript.fromASM(f.asm)
+
+        if (f.stack && f.asm) {
+          try {
+            var stack = bscript.toStack(script)
+            assert.deepEqual(stack.map(function (x) { return x.toString('hex') }), f.stack)
+            assert.equal(bscript.toASM(bscript.compile(stack)), f.asm, 'should rebuild same script from stack')
+          } catch (e) {
+            assert.strictEqual(f.stack, undefined)
+          }
+        }
+      })
     })
   })
 
   describe('compile (via fromASM)', function () {
     fixtures.valid.forEach(function (f) {
-      if (f.scriptSig) {
-        it('(' + f.type + ') compiles ' + f.scriptSig, function () {
-          var scriptSig = bscript.fromASM(f.scriptSig)
-
-          assert.strictEqual(scriptSig.toString('hex'), f.scriptSigHex)
+      it('(' + f.type + ') compiles ' + f.asm, function () {
+        var scriptSig = bscript.fromASM(f.asm)
 
-          if (f.nonstandard) {
-            var scriptSigNS = bscript.fromASM(f.nonstandard.scriptSig)
-
-            assert.strictEqual(scriptSigNS.toString('hex'), f.scriptSigHex)
-          }
-        })
-      }
+        assert.strictEqual(scriptSig.toString('hex'), f.script)
 
-      if (f.scriptPubKey) {
-        it('(' + f.type + ') compiles ' + f.scriptPubKey, function () {
-          var scriptPubKey = bscript.fromASM(f.scriptPubKey)
+        if (f.nonstandard) {
+          var scriptSigNS = bscript.fromASM(f.nonstandard.scriptSig)
 
-          assert.strictEqual(scriptPubKey.toString('hex'), f.scriptPubKeyHex)
-        })
-      }
+          assert.strictEqual(scriptSigNS.toString('hex'), f.script)
+        }
+      })
     })
   })
 
   describe('decompile', function () {
     fixtures.valid.forEach(function (f) {
-      if (f.scriptSigHex) {
-        it('decompiles ' + f.scriptSig, function () {
-          var chunks = bscript.decompile(new Buffer(f.scriptSigHex, 'hex'))
+      it('decompiles ' + f.asm, function () {
+        var chunks = bscript.decompile(new Buffer(f.script, 'hex'))
 
-          assert.strictEqual(bscript.compile(chunks).toString('hex'), f.scriptSigHex)
-          assert.strictEqual(bscript.toASM(chunks), f.scriptSig)
+        assert.strictEqual(bscript.compile(chunks).toString('hex'), f.script)
+        assert.strictEqual(bscript.toASM(chunks), f.asm)
 
-          if (f.nonstandard) {
-            var chunksNS = bscript.decompile(new Buffer(f.nonstandard.scriptSigHex, 'hex'))
+        if (f.nonstandard) {
+          var chunksNS = bscript.decompile(new Buffer(f.nonstandard.scriptSigHex, 'hex'))
 
-            assert.strictEqual(bscript.compile(chunksNS).toString('hex'), f.scriptSigHex)
+          assert.strictEqual(bscript.compile(chunksNS).toString('hex'), f.script)
 
-            // toASM converts verbatim, only `compile` transforms the script to a minimalpush compliant script
-            assert.strictEqual(bscript.toASM(chunksNS), f.nonstandard.scriptSig)
-          }
-        })
-      }
-
-      if (f.scriptPubKeyHex) {
-        it('decompiles ' + f.scriptPubKey, function () {
-          var chunks = bscript.decompile(new Buffer(f.scriptPubKeyHex, 'hex'))
-
-          assert.strictEqual(bscript.compile(chunks).toString('hex'), f.scriptPubKeyHex)
-          assert.strictEqual(bscript.toASM(chunks), f.scriptPubKey)
-        })
-      }
+          // toASM converts verbatim, only `compile` transforms the script to a minimalpush compliant script
+          assert.strictEqual(bscript.toASM(chunksNS), f.nonstandard.scriptSig)
+        }
+      })
     })
 
     fixtures.invalid.decompile.forEach(function (f) {
-      it('decompiles ' + f.hex + ' to [] because of "' + f.description + '"', function () {
-        var chunks = bscript.decompile(new Buffer(f.hex, 'hex'))
+      it('decompiles ' + f.script + ' to [] because of "' + f.description + '"', function () {
+        var chunks = bscript.decompile(new Buffer(f.script, 'hex'))
 
         assert.strictEqual(chunks.length, 0)
       })
@@ -120,21 +105,11 @@ describe('script', function () {
 
   describe('SCRIPT_VERIFY_MINIMALDATA policy', function () {
     fixtures.valid.forEach(function (f) {
-      if (f.scriptSigHex) {
-        it('compliant for ' + f.type + ' scriptSig ' + f.scriptSig, function () {
-          var script = new Buffer(f.scriptSigHex, 'hex')
-
-          assert(minimalData(script))
-        })
-      }
+      it('compliant for ' + f.type + ' scriptSig ' + f.asm, function () {
+        var script = new Buffer(f.script, 'hex')
 
-      if (f.scriptPubKeyHex) {
-        it('compliant for ' + f.type + ' scriptPubKey ' + f.scriptPubKey, function () {
-          var script = new Buffer(f.scriptPubKeyHex, 'hex')
-
-          assert(minimalData(script))
-        })
-      }
+        assert(minimalData(script))
+      })
     })
 
     function testEncodingForSize (i) {
diff --git a/test/templates.js b/test/templates.js
index ad325583..613d4d74 100644
--- a/test/templates.js
+++ b/test/templates.js
@@ -5,28 +5,28 @@ var bcrypto = require('../src/crypto')
 var bscript = require('../src/script')
 var ops = require('../src/opcodes')
 
-var fixtures = require('./fixtures/script.json')
+var fixtures = require('./fixtures/templates.json')
 
 describe('script-templates', function () {
   describe('classifyInput', function () {
     fixtures.valid.forEach(function (f) {
-      if (!f.scriptSig) return
+      if (!f.input) return
 
-      it('classifies ' + f.scriptSig + ' as ' + f.type, function () {
-        var scriptSig = bscript.fromASM(f.scriptSig)
-        var type = bscript.classifyInput(scriptSig)
+      it('classifies ' + f.input + ' as ' + f.type, function () {
+        var input = bscript.fromASM(f.input)
+        var type = bscript.classifyInput(input)
 
         assert.strictEqual(type, f.type)
       })
     })
 
     fixtures.valid.forEach(function (f) {
-      if (!f.scriptSig) return
+      if (!f.input) return
       if (!f.typeIncomplete) return
 
-      it('classifies incomplete ' + f.scriptSig + ' as ' + f.typeIncomplete, function () {
-        var scriptSig = bscript.fromASM(f.scriptSig)
-        var type = bscript.classifyInput(scriptSig, true)
+      it('classifies incomplete ' + f.input + ' as ' + f.typeIncomplete, function () {
+        var input = bscript.fromASM(f.input)
+        var type = bscript.classifyInput(input, true)
 
         assert.strictEqual(type, f.typeIncomplete)
       })
@@ -35,11 +35,11 @@ describe('script-templates', function () {
 
   describe('classifyOutput', function () {
     fixtures.valid.forEach(function (f) {
-      if (!f.scriptPubKey) return
+      if (!f.output) return
 
-      it('classifies ' + f.scriptPubKey + ' as ' + f.type, function () {
-        var scriptPubKey = bscript.fromASM(f.scriptPubKey)
-        var type = bscript.classifyOutput(scriptPubKey)
+      it('classifies ' + f.output + ' as ' + f.type, function () {
+        var output = bscript.fromASM(f.output)
+        var type = bscript.classifyOutput(output)
 
         assert.strictEqual(type, f.type)
       })
@@ -62,18 +62,18 @@ describe('script-templates', function () {
       fixtures.valid.forEach(function (f) {
         var expected = name.toLowerCase() === f.type
 
-        if (inputType && f.scriptSig) {
-          var scriptSig = bscript.fromASM(f.scriptSig)
+        if (inputType && f.input) {
+          var input = bscript.fromASM(f.input)
 
-          it('returns ' + expected + ' for ' + f.scriptSig, function () {
-            assert.strictEqual(inputType.check(scriptSig), expected)
+          it('returns ' + expected + ' for ' + f.input, function () {
+            assert.strictEqual(inputType.check(input), expected)
           })
 
           if (f.typeIncomplete) {
             var expectedIncomplete = name.toLowerCase() === f.typeIncomplete
 
-            it('returns ' + expected + ' for ' + f.scriptSig, function () {
-              assert.strictEqual(inputType.check(scriptSig, true), expectedIncomplete)
+            it('returns ' + expected + ' for ' + f.input, function () {
+              assert.strictEqual(inputType.check(input, true), expectedIncomplete)
             })
           }
         }
@@ -82,18 +82,18 @@ describe('script-templates', function () {
       if (!(fixtures.invalid[name])) return
 
       fixtures.invalid[name].inputs.forEach(function (f) {
-        if (!f.scriptSig && !f.scriptSigHex) return
+        if (!f.input && !f.inputHex) return
 
-        it('returns false for ' + f.description + ' (' + (f.scriptSig || f.scriptSigHex) + ')', function () {
-          var scriptSig
+        it('returns false for ' + f.description + ' (' + (f.input || f.inputHex) + ')', function () {
+          var input
 
-          if (f.scriptSig) {
-            scriptSig = bscript.fromASM(f.scriptSig)
+          if (f.input) {
+            input = bscript.fromASM(f.input)
           } else {
-            scriptSig = new Buffer(f.scriptSigHex, 'hex')
+            input = new Buffer(f.inputHex, 'hex')
           }
 
-          assert.strictEqual(inputType.check(scriptSig), false)
+          assert.strictEqual(inputType.check(input), false)
         })
       })
     })
@@ -102,11 +102,11 @@ describe('script-templates', function () {
       fixtures.valid.forEach(function (f) {
         var expected = name.toLowerCase() === f.type
 
-        if (outputType && f.scriptPubKey) {
-          it('returns ' + expected + ' for ' + f.scriptPubKey, function () {
-            var scriptPubKey = bscript.fromASM(f.scriptPubKey)
+        if (outputType && f.output) {
+          it('returns ' + expected + ' for ' + f.output, function () {
+            var output = bscript.fromASM(f.output)
 
-            assert.strictEqual(outputType.check(scriptPubKey), expected)
+            assert.strictEqual(outputType.check(output), expected)
           })
         }
       })
@@ -114,18 +114,18 @@ describe('script-templates', function () {
       if (!(fixtures.invalid[name])) return
 
       fixtures.invalid[name].outputs.forEach(function (f) {
-        if (!f.scriptPubKey && !f.scriptPubKeyHex) return
+        if (!f.output && !f.outputHex) return
 
-        it('returns false for ' + f.description + ' (' + (f.scriptPubKey || f.scriptPubKeyHex) + ')', function () {
-          var scriptPubKey
+        it('returns false for ' + f.description + ' (' + (f.output || f.outputHex) + ')', function () {
+          var output
 
-          if (f.scriptPubKey) {
-            scriptPubKey = bscript.fromASM(f.scriptPubKey)
+          if (f.output) {
+            output = bscript.fromASM(f.output)
           } else {
-            scriptPubKey = new Buffer(f.scriptPubKeyHex, 'hex')
+            output = new Buffer(f.outputHex, 'hex')
           }
 
-          assert.strictEqual(outputType.check(scriptPubKey), false)
+          assert.strictEqual(outputType.check(output), false)
         })
       })
     })
@@ -136,14 +136,14 @@ describe('script-templates', function () {
       if (f.type !== 'pubkey') return
 
       var signature = new Buffer(f.signature, 'hex')
-      var scriptSig = bscript.pubKey.input.encode(signature)
+      var input = bscript.pubKey.input.encode(signature)
 
-      it('encodes to ' + f.scriptSig, function () {
-        assert.strictEqual(bscript.toASM(scriptSig), f.scriptSig)
+      it('encodes to ' + f.input, function () {
+        assert.strictEqual(bscript.toASM(input), f.input)
       })
 
       it('decodes to ' + f.signature, function () {
-        assert.deepEqual(bscript.pubKey.input.decode(scriptSig), signature)
+        assert.deepEqual(bscript.pubKey.input.decode(input), signature)
       })
     })
   })
@@ -153,14 +153,14 @@ describe('script-templates', function () {
       if (f.type !== 'pubkey') return
 
       var pubKey = new Buffer(f.pubKey, 'hex')
-      var scriptPubKey = bscript.pubKey.output.encode(pubKey)
+      var output = bscript.pubKey.output.encode(pubKey)
 
-      it('encodes to ' + f.scriptPubKey, function () {
-        assert.strictEqual(bscript.toASM(scriptPubKey), f.scriptPubKey)
+      it('encodes to ' + f.output, function () {
+        assert.strictEqual(bscript.toASM(output), f.output)
       })
 
       it('decodes to ' + f.pubKey, function () {
-        assert.deepEqual(bscript.pubKey.output.decode(scriptPubKey), pubKey)
+        assert.deepEqual(bscript.pubKey.output.decode(output), pubKey)
       })
     })
   })
@@ -171,14 +171,14 @@ describe('script-templates', function () {
 
       var pubKey = new Buffer(f.pubKey, 'hex')
       var signature = new Buffer(f.signature, 'hex')
-      var scriptSig = bscript.pubKeyHash.input.encode(signature, pubKey)
+      var input = bscript.pubKeyHash.input.encode(signature, pubKey)
 
-      it('encodes to ' + f.scriptSig, function () {
-        assert.strictEqual(bscript.toASM(scriptSig), f.scriptSig)
+      it('encodes to ' + f.input, function () {
+        assert.strictEqual(bscript.toASM(input), f.input)
       })
 
       it('decodes to original arguments', function () {
-        assert.deepEqual(bscript.pubKeyHash.input.decode(scriptSig), {
+        assert.deepEqual(bscript.pubKeyHash.input.decode(input), {
           signature: signature,
           pubKey: pubKey
         })
@@ -192,14 +192,14 @@ describe('script-templates', function () {
 
       var pubKey = new Buffer(f.pubKey, 'hex')
       var pubKeyHash = bcrypto.hash160(pubKey)
-      var scriptPubKey = bscript.pubKeyHash.output.encode(pubKeyHash)
+      var output = bscript.pubKeyHash.output.encode(pubKeyHash)
 
-      it('encodes to ' + f.scriptPubKey, function () {
-        assert.strictEqual(bscript.toASM(scriptPubKey), f.scriptPubKey)
+      it('encodes to ' + f.output, function () {
+        assert.strictEqual(bscript.toASM(output), f.output)
       })
 
       it('decodes to ' + pubKeyHash.toString('hex'), function () {
-        assert.deepEqual(bscript.pubKeyHash.output.decode(scriptPubKey), pubKeyHash)
+        assert.deepEqual(bscript.pubKeyHash.output.decode(output), pubKeyHash)
       })
     })
 
@@ -224,20 +224,20 @@ describe('script-templates', function () {
         return signature ? new Buffer(signature, 'hex') : ops.OP_0
       })
 
-      var scriptSig = bscript.multisig.input.encode(signatures)
+      var input = bscript.multisig.input.encode(signatures)
 
-      it('encodes to ' + f.scriptSig, function () {
-        assert.strictEqual(bscript.toASM(scriptSig), f.scriptSig)
+      it('encodes to ' + f.input, function () {
+        assert.strictEqual(bscript.toASM(input), f.input)
       })
 
       it('decodes to ' + signatures.map(function (x) { return x === ops.OP_0 ? 'OP_0' : x.toString('hex') }), function () {
-        assert.deepEqual(bscript.multisig.input.decode(scriptSig, allowIncomplete), signatures)
+        assert.deepEqual(bscript.multisig.input.decode(input, allowIncomplete), signatures)
       })
     })
 
     fixtures.invalid.multisig.inputs.forEach(function (f) {
-      if (!f.scriptPubKey) return
-      var scriptPubKey = bscript.fromASM(f.scriptPubKey)
+      if (!f.output) return
+      var output = bscript.fromASM(f.output)
 
       it('throws on ' + f.exception, function () {
         var signatures = f.signatures.map(function (signature) {
@@ -245,7 +245,7 @@ describe('script-templates', function () {
         })
 
         assert.throws(function () {
-          bscript.multisig.input.encode(signatures, scriptPubKey)
+          bscript.multisig.input.encode(signatures, output)
         }, new RegExp(f.exception))
       })
     })
@@ -258,14 +258,14 @@ describe('script-templates', function () {
       var pubKeys = f.pubKeys.map(function (p) { return new Buffer(p, 'hex') })
       var m = pubKeys.length
 
-      var scriptPubKey = bscript.multisig.output.encode(m, pubKeys)
+      var output = bscript.multisig.output.encode(m, pubKeys)
 
-      it('encodes ' + f.scriptPubKey, function () {
-        assert.strictEqual(bscript.toASM(scriptPubKey), f.scriptPubKey)
+      it('encodes ' + f.output, function () {
+        assert.strictEqual(bscript.toASM(output), f.output)
       })
 
       it('decodes to original arguments', function () {
-        assert.deepEqual(bscript.multisig.output.decode(scriptPubKey), {
+        assert.deepEqual(bscript.multisig.output.decode(output), {
           m: m,
           pubKeys: pubKeys
         })
@@ -292,18 +292,18 @@ describe('script-templates', function () {
 
       var redeemScript = bscript.fromASM(f.redeemScript)
       var redeemScriptSig = bscript.fromASM(f.redeemScriptSig)
-      var scriptSig = bscript.scriptHash.input.encode(redeemScriptSig, redeemScript)
+      var input = bscript.scriptHash.input.encode(redeemScriptSig, redeemScript)
 
-      it('encodes to ' + f.scriptPubKey, function () {
-        if (f.scriptSig) {
-          assert.strictEqual(bscript.toASM(scriptSig), f.scriptSig)
+      it('encodes to ' + f.output, function () {
+        if (f.input) {
+          assert.strictEqual(bscript.toASM(input), f.input)
         } else {
-          assert.strictEqual(scriptSig.toString('hex'), f.scriptSigHex)
+          assert.strictEqual(input.toString('hex'), f.inputHex)
         }
       })
 
       it('decodes to original arguments', function () {
-        assert.deepEqual(bscript.scriptHash.input.decode(scriptSig), {
+        assert.deepEqual(bscript.scriptHash.input.decode(input), {
           redeemScriptSig: redeemScriptSig,
           redeemScript: redeemScript
         })
@@ -314,18 +314,18 @@ describe('script-templates', function () {
   describe('scriptHash.output', function () {
     fixtures.valid.forEach(function (f) {
       if (f.type !== 'scripthash') return
-      if (!f.scriptPubKey) return
+      if (!f.output) return
 
       var redeemScript = bscript.fromASM(f.redeemScript)
       var scriptHash = bcrypto.hash160(redeemScript)
-      var scriptPubKey = bscript.scriptHash.output.encode(scriptHash)
+      var output = bscript.scriptHash.output.encode(scriptHash)
 
-      it('encodes to ' + f.scriptPubKey, function () {
-        assert.strictEqual(bscript.toASM(scriptPubKey), f.scriptPubKey)
+      it('encodes to ' + f.output, function () {
+        assert.strictEqual(bscript.toASM(output), f.output)
       })
 
       it('decodes to ' + scriptHash.toString('hex'), function () {
-        assert.deepEqual(bscript.scriptHash.output.decode(scriptPubKey), scriptHash)
+        assert.deepEqual(bscript.scriptHash.output.decode(output), scriptHash)
       })
     })
 
@@ -344,18 +344,18 @@ describe('script-templates', function () {
   describe('witnessPubKeyHash.output', function () {
     fixtures.valid.forEach(function (f) {
       if (f.type !== 'witnesspubkeyhash') return
-      if (!f.scriptPubKey) return
+      if (!f.output) return
 
       var pubKey = new Buffer(f.pubKey, 'hex')
       var pubKeyHash = bcrypto.hash160(pubKey)
-      var scriptPubKey = bscript.witnessPubKeyHash.output.encode(pubKeyHash)
+      var output = bscript.witnessPubKeyHash.output.encode(pubKeyHash)
 
-      it('encodes to ' + f.scriptPubKey, function () {
-        assert.strictEqual(bscript.toASM(scriptPubKey), f.scriptPubKey)
+      it('encodes to ' + f.output, function () {
+        assert.strictEqual(bscript.toASM(output), f.output)
       })
 
       it('decodes to ' + pubKeyHash.toString('hex'), function () {
-        assert.deepEqual(bscript.witnessPubKeyHash.output.decode(scriptPubKey), pubKeyHash)
+        assert.deepEqual(bscript.witnessPubKeyHash.output.decode(output), pubKeyHash)
       })
     })
 
@@ -374,18 +374,18 @@ describe('script-templates', function () {
   describe('witnessScriptHash.output', function () {
     fixtures.valid.forEach(function (f) {
       if (f.type !== 'witnessscripthash') return
-      if (!f.scriptPubKey) return
+      if (!f.output) return
 
       var witnessScriptPubKey = bscript.fromASM(f.witnessScriptPubKey)
       var scriptHash = bcrypto.hash256(witnessScriptPubKey)
-      var scriptPubKey = bscript.witnessScriptHash.output.encode(scriptHash)
+      var output = bscript.witnessScriptHash.output.encode(scriptHash)
 
-      it('encodes to ' + f.scriptPubKey, function () {
-        assert.strictEqual(bscript.toASM(scriptPubKey), f.scriptPubKey)
+      it('encodes to ' + f.output, function () {
+        assert.strictEqual(bscript.toASM(output), f.output)
       })
 
       it('decodes to ' + scriptHash.toString('hex'), function () {
-        assert.deepEqual(bscript.witnessScriptHash.output.decode(scriptPubKey), scriptHash)
+        assert.deepEqual(bscript.witnessScriptHash.output.decode(output), scriptHash)
       })
     })
 
@@ -406,14 +406,14 @@ describe('script-templates', function () {
       if (f.type !== 'nulldata') return
 
       var data = new Buffer(f.data, 'hex')
-      var scriptPubKey = bscript.nullData.output.encode(data)
+      var output = bscript.nullData.output.encode(data)
 
-      it('encodes to ' + f.scriptPubKey, function () {
-        assert.strictEqual(bscript.toASM(scriptPubKey), f.scriptPubKey)
+      it('encodes to ' + f.output, function () {
+        assert.strictEqual(bscript.toASM(output), f.output)
       })
 
       it('decodes to ' + f.data, function () {
-        assert.deepEqual(bscript.nullData.output.decode(scriptPubKey), data)
+        assert.deepEqual(bscript.nullData.output.decode(output), data)
       })
     })
   })