@opcat-labs/opcat 3.4.0 → 4.0.0-beta-27c8e56c-20260301

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,6 +10,7 @@ var $ = require('../util/preconditions.cjs')
10
10
  var _ = require('../util/_.cjs')
11
11
 
12
12
  var SIGHASH_SINGLE_BUG = Buffer.from('0000000000000000000000000000000000000000000000000000000000000001', 'hex')
13
+ var EMPTY_HASH = Buffer.alloc(32, 0)
13
14
 
14
15
  /**
15
16
  * Represents a Sighash utility for cryptographic signature operations.
@@ -36,9 +37,19 @@ Sighash.sighashPreimage = function (transaction, sighashType, inputNumber) {
36
37
  _.each(transaction.inputs, function (input) {
37
38
  $.checkState(input.output instanceof Output, 'input.output must be an instance of Output')
38
39
  })
39
- $.checkArgument(sighashType === Signature.SIGHASH_ALL, 'only SIGHASH_ALL is supported')
40
+
41
+ // Validate sighash type
42
+ var baseType = sighashType & 0x1f
43
+ $.checkArgument(
44
+ baseType >= Signature.SIGHASH_ALL && baseType <= Signature.SIGHASH_SINGLE,
45
+ 'invalid sighash type'
46
+ )
40
47
  $.checkArgument(inputNumber < transaction.inputs.length, 'inputNumber must be less than the number of inputs')
41
48
 
49
+ var hasAnyoneCanPay = (sighashType & Signature.SIGHASH_ANYONECANPAY) !== 0
50
+ var isNone = baseType === Signature.SIGHASH_NONE
51
+ var isSingle = baseType === Signature.SIGHASH_SINGLE
52
+
42
53
  var nVersion
43
54
  var prevouts = []
44
55
  var spentScriptHash
@@ -60,14 +71,16 @@ Sighash.sighashPreimage = function (transaction, sighashType, inputNumber) {
60
71
  return separatedScript
61
72
  }
62
73
 
63
- // all inputs
64
- _.each(transaction.inputs, function (input) {
65
- prevouts.push(input.toPrevout())
66
- spentAmounts.push(new BufferWriter().writeUInt64LEBN(input.output.satoshisBN).toBuffer())
67
- spentScriptHashes.push(Hash.sha256(getSeparatedScript(input.output.script).toBuffer()))
68
- spentDataHashes.push(Hash.sha256(input.output.data))
69
- sequences.push(new BufferWriter().writeUInt32LE(input.sequenceNumber).toBuffer())
70
- })
74
+ // all inputs - only process if not ANYONECANPAY
75
+ if (!hasAnyoneCanPay) {
76
+ _.each(transaction.inputs, function (input) {
77
+ prevouts.push(input.toPrevout())
78
+ spentAmounts.push(new BufferWriter().writeUInt64LEBN(input.output.satoshisBN).toBuffer())
79
+ spentScriptHashes.push(Hash.sha256(getSeparatedScript(input.output.script).toBuffer()))
80
+ spentDataHashes.push(Hash.sha256(input.output.data))
81
+ sequences.push(new BufferWriter().writeUInt32LE(input.sequenceNumber).toBuffer())
82
+ })
83
+ }
71
84
 
72
85
  // current input
73
86
  spentScriptHash = Hash.sha256(getSeparatedScript(transaction.inputs[inputNumber].output.script).toBuffer())
@@ -77,10 +90,17 @@ Sighash.sighashPreimage = function (transaction, sighashType, inputNumber) {
77
90
  inputIndex = new BufferWriter().writeUInt32LE(inputNumber).toBuffer()
78
91
  sighashTypeBuf = new BufferWriter().writeUInt32LE(sighashType).toBuffer()
79
92
 
80
- // all outputs
81
- _.each(transaction.outputs, function (output) {
82
- outputs.push(output.toBufferWriter(true).toBuffer())
83
- })
93
+ // outputs - depends on sighash type
94
+ if (!isNone && !isSingle) {
95
+ // ALL: hash all outputs
96
+ _.each(transaction.outputs, function (output) {
97
+ outputs.push(output.toBufferWriter(true).toBuffer())
98
+ })
99
+ } else if (isSingle && inputNumber < transaction.outputs.length) {
100
+ // SINGLE: only hash the output at the same index
101
+ outputs.push(transaction.outputs[inputNumber].toBufferWriter(true).toBuffer())
102
+ }
103
+ // NONE: outputs array stays empty
84
104
 
85
105
  // tx.version
86
106
  nVersion = new BufferWriter().writeUInt32LE(transaction.version).toBuffer()
@@ -90,19 +110,67 @@ Sighash.sighashPreimage = function (transaction, sighashType, inputNumber) {
90
110
  let bw = new BufferWriter()
91
111
 
92
112
  bw.write(nVersion)
93
- bw.write(Hash.sha256sha256(Buffer.concat([...prevouts])))
113
+
114
+ // hashPrevouts - empty if ANYONECANPAY
115
+ if (hasAnyoneCanPay) {
116
+ bw.write(EMPTY_HASH)
117
+ } else {
118
+ bw.write(Hash.sha256sha256(Buffer.concat([...prevouts])))
119
+ }
120
+
121
+ // inputIndex (ANYONECANPAY: 0, otherwise: actual inputIndex)
122
+ // Note: When ANYONECANPAY is set, inputIndex is forced to 0 per Layer protocol spec,
123
+ // but the outpoint below still contains the actual input's prevout. This is intentional:
124
+ // - inputIndex=0 allows the signature to be valid regardless of input position in the tx
125
+ // - outpoint identifies which specific UTXO is being spent (required for validation)
126
+ // This follows BIP-341/342 Taproot sighash semantics adapted for Layer.
127
+ var nInForPreimage = hasAnyoneCanPay ? 0 : inputNumber
128
+ bw.write(new BufferWriter().writeUInt32LE(nInForPreimage).toBuffer())
129
+
130
+ // outpoint (current input's prevout: txHash + outputIndex)
131
+ // Always uses actual input's prevout, even with ANYONECANPAY (see note above)
132
+ bw.write(transaction.inputs[inputNumber].toPrevout())
133
+
94
134
  bw.write(spentScriptHash)
95
135
  bw.write(spentDataHash)
96
136
  bw.write(spentAmount)
97
137
  bw.write(sequence)
98
138
 
99
- bw.write(Hash.sha256sha256(Buffer.concat([...spentAmounts])))
100
- bw.write(Hash.sha256sha256(Buffer.concat([...spentScriptHashes])))
101
- bw.write(Hash.sha256sha256(Buffer.concat([...spentDataHashes])))
102
- bw.write(Hash.sha256sha256(Buffer.concat([...sequences])))
103
- bw.write(Hash.sha256sha256(Buffer.concat([...outputs])))
139
+ // hashSpentAmounts, hashSpentScriptHashes, hashSpentDataHashes - empty if ANYONECANPAY
140
+ if (hasAnyoneCanPay) {
141
+ bw.write(EMPTY_HASH)
142
+ bw.write(EMPTY_HASH)
143
+ bw.write(EMPTY_HASH)
144
+ } else {
145
+ bw.write(Hash.sha256sha256(Buffer.concat([...spentAmounts])))
146
+ bw.write(Hash.sha256sha256(Buffer.concat([...spentScriptHashes])))
147
+ bw.write(Hash.sha256sha256(Buffer.concat([...spentDataHashes])))
148
+ }
149
+
150
+ // hashSequences - empty if ANYONECANPAY or SINGLE or NONE
151
+ if (hasAnyoneCanPay || isSingle || isNone) {
152
+ bw.write(EMPTY_HASH)
153
+ } else {
154
+ bw.write(Hash.sha256sha256(Buffer.concat([...sequences])))
155
+ }
156
+
157
+ // hashOutputs - depends on sighash type
158
+ if (isNone) {
159
+ // NONE: empty hash
160
+ bw.write(EMPTY_HASH)
161
+ } else if (isSingle) {
162
+ // SINGLE: hash only the output at same index, or empty if no corresponding output
163
+ if (inputNumber < transaction.outputs.length) {
164
+ bw.write(Hash.sha256sha256(Buffer.concat([...outputs])))
165
+ } else {
166
+ bw.write(EMPTY_HASH)
167
+ }
168
+ } else {
169
+ // ALL: hash all outputs
170
+ bw.write(Hash.sha256sha256(Buffer.concat([...outputs])))
171
+ }
104
172
 
105
- bw.write(inputIndex)
173
+ // inputIndex moved after hashPrevouts
106
174
  bw.write(nLockTime)
107
175
  bw.write(sighashTypeBuf)
108
176
 
@@ -10,6 +10,7 @@ import $ from '../util/preconditions.js';
10
10
  import _ from '../util/_.js';
11
11
 
12
12
  var SIGHASH_SINGLE_BUG = Buffer.from('0000000000000000000000000000000000000000000000000000000000000001', 'hex')
13
+ var EMPTY_HASH = Buffer.alloc(32, 0)
13
14
 
14
15
  /**
15
16
  * Represents a Sighash utility for cryptographic signature operations.
@@ -36,9 +37,19 @@ Sighash.sighashPreimage = function (transaction, sighashType, inputNumber) {
36
37
  _.each(transaction.inputs, function (input) {
37
38
  $.checkState(input.output instanceof Output, 'input.output must be an instance of Output')
38
39
  })
39
- $.checkArgument(sighashType === Signature.SIGHASH_ALL, 'only SIGHASH_ALL is supported')
40
+
41
+ // Validate sighash type
42
+ var baseType = sighashType & 0x1f
43
+ $.checkArgument(
44
+ baseType >= Signature.SIGHASH_ALL && baseType <= Signature.SIGHASH_SINGLE,
45
+ 'invalid sighash type'
46
+ )
40
47
  $.checkArgument(inputNumber < transaction.inputs.length, 'inputNumber must be less than the number of inputs')
41
48
 
49
+ var hasAnyoneCanPay = (sighashType & Signature.SIGHASH_ANYONECANPAY) !== 0
50
+ var isNone = baseType === Signature.SIGHASH_NONE
51
+ var isSingle = baseType === Signature.SIGHASH_SINGLE
52
+
42
53
  var nVersion
43
54
  var prevouts = []
44
55
  var spentScriptHash
@@ -60,14 +71,16 @@ Sighash.sighashPreimage = function (transaction, sighashType, inputNumber) {
60
71
  return separatedScript
61
72
  }
62
73
 
63
- // all inputs
64
- _.each(transaction.inputs, function (input) {
65
- prevouts.push(input.toPrevout())
66
- spentAmounts.push(new BufferWriter().writeUInt64LEBN(input.output.satoshisBN).toBuffer())
67
- spentScriptHashes.push(Hash.sha256(getSeparatedScript(input.output.script).toBuffer()))
68
- spentDataHashes.push(Hash.sha256(input.output.data))
69
- sequences.push(new BufferWriter().writeUInt32LE(input.sequenceNumber).toBuffer())
70
- })
74
+ // all inputs - only process if not ANYONECANPAY
75
+ if (!hasAnyoneCanPay) {
76
+ _.each(transaction.inputs, function (input) {
77
+ prevouts.push(input.toPrevout())
78
+ spentAmounts.push(new BufferWriter().writeUInt64LEBN(input.output.satoshisBN).toBuffer())
79
+ spentScriptHashes.push(Hash.sha256(getSeparatedScript(input.output.script).toBuffer()))
80
+ spentDataHashes.push(Hash.sha256(input.output.data))
81
+ sequences.push(new BufferWriter().writeUInt32LE(input.sequenceNumber).toBuffer())
82
+ })
83
+ }
71
84
 
72
85
  // current input
73
86
  spentScriptHash = Hash.sha256(getSeparatedScript(transaction.inputs[inputNumber].output.script).toBuffer())
@@ -77,10 +90,17 @@ Sighash.sighashPreimage = function (transaction, sighashType, inputNumber) {
77
90
  inputIndex = new BufferWriter().writeUInt32LE(inputNumber).toBuffer()
78
91
  sighashTypeBuf = new BufferWriter().writeUInt32LE(sighashType).toBuffer()
79
92
 
80
- // all outputs
81
- _.each(transaction.outputs, function (output) {
82
- outputs.push(output.toBufferWriter(true).toBuffer())
83
- })
93
+ // outputs - depends on sighash type
94
+ if (!isNone && !isSingle) {
95
+ // ALL: hash all outputs
96
+ _.each(transaction.outputs, function (output) {
97
+ outputs.push(output.toBufferWriter(true).toBuffer())
98
+ })
99
+ } else if (isSingle && inputNumber < transaction.outputs.length) {
100
+ // SINGLE: only hash the output at the same index
101
+ outputs.push(transaction.outputs[inputNumber].toBufferWriter(true).toBuffer())
102
+ }
103
+ // NONE: outputs array stays empty
84
104
 
85
105
  // tx.version
86
106
  nVersion = new BufferWriter().writeUInt32LE(transaction.version).toBuffer()
@@ -90,19 +110,67 @@ Sighash.sighashPreimage = function (transaction, sighashType, inputNumber) {
90
110
  let bw = new BufferWriter()
91
111
 
92
112
  bw.write(nVersion)
93
- bw.write(Hash.sha256sha256(Buffer.concat([...prevouts])))
113
+
114
+ // hashPrevouts - empty if ANYONECANPAY
115
+ if (hasAnyoneCanPay) {
116
+ bw.write(EMPTY_HASH)
117
+ } else {
118
+ bw.write(Hash.sha256sha256(Buffer.concat([...prevouts])))
119
+ }
120
+
121
+ // inputIndex (ANYONECANPAY: 0, otherwise: actual inputIndex)
122
+ // Note: When ANYONECANPAY is set, inputIndex is forced to 0 per Layer protocol spec,
123
+ // but the outpoint below still contains the actual input's prevout. This is intentional:
124
+ // - inputIndex=0 allows the signature to be valid regardless of input position in the tx
125
+ // - outpoint identifies which specific UTXO is being spent (required for validation)
126
+ // This follows BIP-341/342 Taproot sighash semantics adapted for Layer.
127
+ var nInForPreimage = hasAnyoneCanPay ? 0 : inputNumber
128
+ bw.write(new BufferWriter().writeUInt32LE(nInForPreimage).toBuffer())
129
+
130
+ // outpoint (current input's prevout: txHash + outputIndex)
131
+ // Always uses actual input's prevout, even with ANYONECANPAY (see note above)
132
+ bw.write(transaction.inputs[inputNumber].toPrevout())
133
+
94
134
  bw.write(spentScriptHash)
95
135
  bw.write(spentDataHash)
96
136
  bw.write(spentAmount)
97
137
  bw.write(sequence)
98
138
 
99
- bw.write(Hash.sha256sha256(Buffer.concat([...spentAmounts])))
100
- bw.write(Hash.sha256sha256(Buffer.concat([...spentScriptHashes])))
101
- bw.write(Hash.sha256sha256(Buffer.concat([...spentDataHashes])))
102
- bw.write(Hash.sha256sha256(Buffer.concat([...sequences])))
103
- bw.write(Hash.sha256sha256(Buffer.concat([...outputs])))
139
+ // hashSpentAmounts, hashSpentScriptHashes, hashSpentDataHashes - empty if ANYONECANPAY
140
+ if (hasAnyoneCanPay) {
141
+ bw.write(EMPTY_HASH)
142
+ bw.write(EMPTY_HASH)
143
+ bw.write(EMPTY_HASH)
144
+ } else {
145
+ bw.write(Hash.sha256sha256(Buffer.concat([...spentAmounts])))
146
+ bw.write(Hash.sha256sha256(Buffer.concat([...spentScriptHashes])))
147
+ bw.write(Hash.sha256sha256(Buffer.concat([...spentDataHashes])))
148
+ }
149
+
150
+ // hashSequences - empty if ANYONECANPAY or SINGLE or NONE
151
+ if (hasAnyoneCanPay || isSingle || isNone) {
152
+ bw.write(EMPTY_HASH)
153
+ } else {
154
+ bw.write(Hash.sha256sha256(Buffer.concat([...sequences])))
155
+ }
156
+
157
+ // hashOutputs - depends on sighash type
158
+ if (isNone) {
159
+ // NONE: empty hash
160
+ bw.write(EMPTY_HASH)
161
+ } else if (isSingle) {
162
+ // SINGLE: hash only the output at same index, or empty if no corresponding output
163
+ if (inputNumber < transaction.outputs.length) {
164
+ bw.write(Hash.sha256sha256(Buffer.concat([...outputs])))
165
+ } else {
166
+ bw.write(EMPTY_HASH)
167
+ }
168
+ } else {
169
+ // ALL: hash all outputs
170
+ bw.write(Hash.sha256sha256(Buffer.concat([...outputs])))
171
+ }
104
172
 
105
- bw.write(inputIndex)
173
+ // inputIndex moved after hashPrevouts
106
174
  bw.write(nLockTime)
107
175
  bw.write(sighashTypeBuf)
108
176
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opcat-labs/opcat",
3
- "version": "3.4.0",
3
+ "version": "4.0.0-beta-27c8e56c-20260301",
4
4
  "description": "opcat base SDK",
5
5
  "main": "./cjs/index.cjs",
6
6
  "module": "./esm/index.js",
@@ -3154,22 +3154,22 @@
3154
3154
 
3155
3155
  ["Automatically generated test cases"],
3156
3156
  [
3157
- "0x48 0x3045022100de9e97ac5a8063b0e6953a6f67b2d34a78e3ffa4108019cfc5eff5bddb87cd4e022027c1dc1512cc67c3bc7e096341fbb3bf5d172c829c610af892287212e58de9ef01",
3158
- "0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 CHECKSIG",
3157
+ "0x48 0x3045022100f7bc0702a0355b1b42f40b17e81b96c2a49cb75c6ad46b647c323627cc1957fe02203bcfa6f1ee08fe9e4e1bd8dc6b5819f8ff5a732427f1c3b3d2a87cf29099e2db01",
3158
+ "0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e CHECKSIG",
3159
3159
  "",
3160
3160
  "OK",
3161
3161
  "P2PK"
3162
3162
  ],
3163
3163
  [
3164
3164
  "0x47 0x304402200a5c6163f07b8c3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001",
3165
- "0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 CHECKSIG",
3165
+ "0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e CHECKSIG",
3166
3166
  "",
3167
3167
  "EVAL_FALSE",
3168
3168
  "P2PK, bad sig"
3169
3169
  ],
3170
3170
  [
3171
- "0x47 0x304402206c5b0e6002a3bc4ac99ec730ae3d32846e5a3f1b17c431be2204c54a80ee83bc02201315e7b91bdcd03e736c6db915dba00dacbfba967433adc1320c5d87efe4788f01 0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0",
3172
- "DUP HASH160 0x14 0x05097bec4d3746623fe8957971ab611a551da677 EQUALVERIFY CHECKSIG",
3171
+ "0x47 0x30440220556f0453851921d93b33cfb4e8d143b63734ee916aeac6113cd92d06ba27a31402201b0581b672e27d8ad1ecb6504d0a4743cf340ae301033fc19def5f7602f0db0d01 0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e",
3172
+ "DUP HASH160 0x14 0x88d9931ea73d60eaf7e5671efc0552b912911f2a EQUALVERIFY CHECKSIG",
3173
3173
  "",
3174
3174
  "OK",
3175
3175
  "P2PKH"
@@ -3212,15 +3212,15 @@
3212
3212
  "P2SH(P2PK), bad redeemscript"
3213
3213
  ],
3214
3214
  [
3215
- "0x47 0x30440220781ba4f59a7b207a10db87628bc2168df4d59b844b397d2dbc9a5835fb2f2b7602206ed8fbcc1072fe2dfc5bb25909269e5dc42ffcae7ec2bc81d59692210ff30c2b01 0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 0x19 0x76a91491b24bf9f5288532960ac687abb035127b1d28a588ac",
3215
+ "0x47 0x30440220781ba4f59a7b207a10db87628bc2168df4d59b844b397d2dbc9a5835fb2f2b7602206ed8fbcc1072fe2dfc5bb25909269e5dc42ffcae7ec2bc81d59692210ff30c2b01 0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e 0x19 0x76a91491b24bf9f5288532960ac687abb035127b1d28a588ac",
3216
3216
  "HASH160 0x14 0x7f67f0521934a57d3039f77f9f32cf313f3ac74b EQUAL",
3217
3217
  "P2SH",
3218
3218
  "OK",
3219
3219
  "P2SH(P2PKH)"
3220
3220
  ],
3221
3221
  [
3222
- "0x48 0x3045022100daaf676935a561f11e3e72339fba614b9c6e12d8edfcadfefc987835bbf3216a022028c3b79bc1f62644d6418c772b13feab5d8e7bf132c64f32a98d8cfda2bff39701 0x48 0x3045022100b21be39db6fbc991ea326c20c4e22b9695b9c0a48e2af616632c21ec11b68d5b022010c36cd31a5baf494bf306d1416f0cd167ec3d867e36e7b2433535b9296c44c101 0x47 0x30440220401d18d6acb5c4c2f508c4594aa17d88a38c23f2c7297a83865dc6f45159a83c02205f02468b347d0e2e579d306e4116852e37bd42313a60ef02aaf0ab4b4fbf26d301",
3223
- "3 0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 0x21 0x025a51bb1eaa5bd1faa032c2e7ef2b1bcb510be37744a7fe3618c45d8a263838a3 0x21 0x024a193d18bc1b8b342a27c867e5665778ece7bfcd04b96565f1753dbb6f38ede7 3 CHECKMULTISIG",
3222
+ "0x48 0x3045022100aa93772cc0a557054d5d3ef8ccc1c7f82a3ee85f62d12e037a98b5dc3d93545902203d2627afe5dacb2190e14904ea7db442498294c62dcffabf34bab2a93352ad2d01 0x47 0x304402204b74d026754202708aa4aafa771fb2ba0019cacb752c8aa2c8eb164290b4aa48022037ec075d9f79fcf86abecfc805da04f42f808a9f480113c7d042b14de1a0f70d01 0x47 0x3044022004b960c548db1c9e21b10491c2b2e8b62104021c3a427c28a18d35dbb2758c4302204f665c266a318e4bb427ea8dba81bd65fbb4ef031bcaab2c9ce68f4b827122c201",
3223
+ "3 0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e 0x21 0x032d0d280192d66ec4f125ae661b32a2cd7c8d85c3fe3aa8988ee0941fae5f586c 0x21 0x02a370403748d9355ecbfee664876cc0269bf2c7ae23c4e58c79967f8073ed0f1e 3 CHECKMULTISIG",
3224
3224
  "",
3225
3225
  "OK",
3226
3226
  "3-of-3"
@@ -3240,8 +3240,8 @@
3240
3240
  "P2SH(2-of-3)"
3241
3241
  ],
3242
3242
  [
3243
- "0x48 0x3045022100de9e97ac5a8063b0e6953a6f67b2d34a78e3ffa4108019cfc5eff5bddb87cd4e022027c1dc1512cc67c3bc7e096341fbb3bf5d172c829c610af892287212e58de9ef01",
3244
- "0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 CHECKSIG",
3243
+ "0x48 0x3045022100f7bc0702a0355b1b42f40b17e81b96c2a49cb75c6ad46b647c323627cc1957fe02203bcfa6f1ee08fe9e4e1bd8dc6b5819f8ff5a732427f1c3b3d2a87cf29099e2db01",
3244
+ "0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e CHECKSIG",
3245
3245
  "",
3246
3246
  "OK",
3247
3247
  "P2PK with too much R padding but no DERSIG"
@@ -3254,8 +3254,8 @@
3254
3254
  "P2PK with too much R padding"
3255
3255
  ],
3256
3256
  [
3257
- "0x48 0x3045022100de9e97ac5a8063b0e6953a6f67b2d34a78e3ffa4108019cfc5eff5bddb87cd4e022027c1dc1512cc67c3bc7e096341fbb3bf5d172c829c610af892287212e58de9ef01",
3258
- "0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 CHECKSIG",
3257
+ "0x48 0x3045022100f7bc0702a0355b1b42f40b17e81b96c2a49cb75c6ad46b647c323627cc1957fe02203bcfa6f1ee08fe9e4e1bd8dc6b5819f8ff5a732427f1c3b3d2a87cf29099e2db01",
3258
+ "0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e CHECKSIG",
3259
3259
  "",
3260
3260
  "OK",
3261
3261
  "P2PK with too much S padding but no DERSIG"
@@ -3268,8 +3268,8 @@
3268
3268
  "P2PK with too much S padding"
3269
3269
  ],
3270
3270
  [
3271
- "0x48 0x3045022100de9e97ac5a8063b0e6953a6f67b2d34a78e3ffa4108019cfc5eff5bddb87cd4e022027c1dc1512cc67c3bc7e096341fbb3bf5d172c829c610af892287212e58de9ef01",
3272
- "0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 CHECKSIG",
3271
+ "0x48 0x3045022100f7bc0702a0355b1b42f40b17e81b96c2a49cb75c6ad46b647c323627cc1957fe02203bcfa6f1ee08fe9e4e1bd8dc6b5819f8ff5a732427f1c3b3d2a87cf29099e2db01",
3272
+ "0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e CHECKSIG",
3273
3273
  "",
3274
3274
  "OK",
3275
3275
  "P2PK with too little R padding but no DERSIG"
@@ -3296,8 +3296,8 @@
3296
3296
  "P2PK NOT with bad sig with too much R padding"
3297
3297
  ],
3298
3298
  [
3299
- "0x48 0x3045022100dc8a65c665fa5f2e543d2293c87ef1ff9300dbd7e1c82499e383c6747a16483202203b5c8855c64cd2ec626f72c796a7cc8d8feef2ca80b638ea7b63eb3e49f9a4b701",
3300
- "0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 CHECKSIG NOT",
3299
+ "0x48 0x3045022100e47f3613a3a5262c32525e39020b1140b09fc5da5236ef751418c8292ddf6fc0022067ce2baec774fbbc86fc90504bb096bedbe511ba2db053fef1ffad7ed3cbd03f01",
3300
+ "0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e CHECKSIG NOT",
3301
3301
  "",
3302
3302
  "EVAL_FALSE",
3303
3303
  "P2PK NOT with too much R padding but no DERSIG"
@@ -3310,8 +3310,8 @@
3310
3310
  "P2PK NOT with too much R padding"
3311
3311
  ],
3312
3312
  [
3313
- "0x48 0x3045022100de9e97ac5a8063b0e6953a6f67b2d34a78e3ffa4108019cfc5eff5bddb87cd4e022027c1dc1512cc67c3bc7e096341fbb3bf5d172c829c610af892287212e58de9ef01",
3314
- "0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 CHECKSIG",
3313
+ "0x48 0x3045022100f7bc0702a0355b1b42f40b17e81b96c2a49cb75c6ad46b647c323627cc1957fe02203bcfa6f1ee08fe9e4e1bd8dc6b5819f8ff5a732427f1c3b3d2a87cf29099e2db01",
3314
+ "0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e CHECKSIG",
3315
3315
  "",
3316
3316
  "OK",
3317
3317
  "BIP66 example 1, without DERSIG"
@@ -3324,8 +3324,8 @@
3324
3324
  "BIP66 example 1, with DERSIG"
3325
3325
  ],
3326
3326
  [
3327
- "0x48 0x3045022100dc8a65c665fa5f2e543d2293c87ef1ff9300dbd7e1c82499e383c6747a16483202203b5c8855c64cd2ec626f72c796a7cc8d8feef2ca80b638ea7b63eb3e49f9a4b701",
3328
- "0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 CHECKSIG NOT",
3327
+ "0x48 0x3045022100e47f3613a3a5262c32525e39020b1140b09fc5da5236ef751418c8292ddf6fc0022067ce2baec774fbbc86fc90504bb096bedbe511ba2db053fef1ffad7ed3cbd03f01",
3328
+ "0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e CHECKSIG NOT",
3329
3329
  "",
3330
3330
  "EVAL_FALSE",
3331
3331
  "BIP66 example 2, without DERSIG"
@@ -3415,29 +3415,29 @@
3415
3415
  "BIP66 example 6, with DERSIG"
3416
3416
  ],
3417
3417
  [
3418
- "0x47 0x304402205f4add191797ee07d049711063922ece052f96106976e7ce81c51e7a793034b402203564d8031bbc09a02ffb3c73352fba08fad88e3738f973c1df23c8262c7e829001 0x48 0x3045022100d484e06b876ed806e8a2b0ccd13ce4e1d4a1811e9276315b5dbb7d41c02e855c02203b0f3e388b12b2ffbc452a4cc02a770dca8a0437506960bc55a1e4f32c1caf4601",
3419
- "2 0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 0x21 0x025a51bb1eaa5bd1faa032c2e7ef2b1bcb510be37744a7fe3618c45d8a263838a3 2 CHECKMULTISIG",
3418
+ "0x47 0x3044022014ef0cc3db1c7d4b6262a1cd6bd2ff721df1ec1b4e8905959d353e43634b6a9402207afdacba859a59229b3d870dde9d29c55e4f18dbcbd538ff9480a2b06701c03e01 0x48 0x3045022100bfd3160d962cd372adf00e56344f81b0c9aa067cd93f297d339ead89e96294f902201fa95365dfb0e0d4ca068c91d056817822b6d409ec4bb48ca99b8a3fbd60427d01",
3419
+ "2 0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e 0x21 0x032d0d280192d66ec4f125ae661b32a2cd7c8d85c3fe3aa8988ee0941fae5f586c 2 CHECKMULTISIG",
3420
3420
  "",
3421
3421
  "OK",
3422
3422
  "BIP66 example 7, without DERSIG"
3423
3423
  ],
3424
3424
  [
3425
3425
  "0x47 0x3044022009255526f4b9113295b08c5b0256b1639564e027a2e245538d6a85456f5dd04302207fbbdadc34bbc50ae79e5db49c83639de38b610d5a92affde18cf05368e0706c01 0x47 0x3044022027c2714269ca5aeecc4d70edc88ba5ee0e3da4986e9216028f489ab4f1b8efce022022bd545b4951215267e4c5ceabd4c5350331b2e4a0b6494c56f361fa5a57a1a201",
3426
- "2 0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 0x21 0x025a51bb1eaa5bd1faa032c2e7ef2b1bcb510be37744a7fe3618c45d8a263838a3 2 CHECKMULTISIG",
3426
+ "2 0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e 0x21 0x032d0d280192d66ec4f125ae661b32a2cd7c8d85c3fe3aa8988ee0941fae5f586c 2 CHECKMULTISIG",
3427
3427
  "DERSIG",
3428
3428
  "SIG_DER",
3429
3429
  "BIP66 example 7, with DERSIG"
3430
3430
  ],
3431
3431
  [
3432
3432
  "0x47 0x304402207c131e85d1ec87e032dec9df8d9b4a9c946182758a308559992e37854e0fa0e2022006280b72736f7701bb66bb89104e5576f8f79e69a3b020a98df08e683d96100d01 0x47 0x30450221009cf089f7a713450a59956895ad4d27819cce18ff4dfc045d045890b5be737a9a02203cca5e1a85b0539a8c9b88d2ad778e6baceff59c2a20a6319a89915b66a7054501",
3433
- "2 0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 0x21 0x025a51bb1eaa5bd1faa032c2e7ef2b1bcb510be37744a7fe3618c45d8a263838a3 2 CHECKMULTISIG NOT",
3433
+ "2 0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e 0x21 0x032d0d280192d66ec4f125ae661b32a2cd7c8d85c3fe3aa8988ee0941fae5f586c 2 CHECKMULTISIG NOT",
3434
3434
  "",
3435
3435
  "EVAL_FALSE",
3436
3436
  "BIP66 example 8, without DERSIG"
3437
3437
  ],
3438
3438
  [
3439
3439
  "0x47 0x30440220071a283571a21d3c29d00d006386b2e4926b4b63f1a473e4bdab1e66029e1882022009e0cd26650ee6b23c1f22d5a2742f7ffd88c330b4af98b3a0746c01185e76b501 0x48 0x304402204ab01774c5341c27aa60a4504d787646be407fcaf232f92378ce10752d7424b4022007cd04c6df5f345184d3e231be6e892aa266661418abea92ec2682c22e55a9ed01",
3440
- "2 0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 0x21 0x025a51bb1eaa5bd1faa032c2e7ef2b1bcb510be37744a7fe3618c45d8a263838a3 2 CHECKMULTISIG NOT",
3440
+ "2 0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e 0x21 0x032d0d280192d66ec4f125ae661b32a2cd7c8d85c3fe3aa8988ee0941fae5f586c 2 CHECKMULTISIG NOT",
3441
3441
  "DERSIG",
3442
3442
  "SIG_DER",
3443
3443
  "BIP66 example 8, with DERSIG"
@@ -3499,8 +3499,8 @@
3499
3499
  "BIP66 example 12, with DERSIG"
3500
3500
  ],
3501
3501
  [
3502
- "0x48 0x3045022100de9e97ac5a8063b0e6953a6f67b2d34a78e3ffa4108019cfc5eff5bddb87cd4e022027c1dc1512cc67c3bc7e096341fbb3bf5d172c829c610af892287212e58de9ef01",
3503
- "0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 CHECKSIG",
3502
+ "0x48 0x3045022100f7bc0702a0355b1b42f40b17e81b96c2a49cb75c6ad46b647c323627cc1957fe02203bcfa6f1ee08fe9e4e1bd8dc6b5819f8ff5a732427f1c3b3d2a87cf29099e2db01",
3503
+ "0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e CHECKSIG",
3504
3504
  "",
3505
3505
  "OK",
3506
3506
  "P2PK with multi-byte hashtype, without DERSIG"
@@ -3513,8 +3513,8 @@
3513
3513
  "P2PK with multi-byte hashtype, with DERSIG"
3514
3514
  ],
3515
3515
  [
3516
- "0x48 0x3045022100de9e97ac5a8063b0e6953a6f67b2d34a78e3ffa4108019cfc5eff5bddb87cd4e022027c1dc1512cc67c3bc7e096341fbb3bf5d172c829c610af892287212e58de9ef01",
3517
- "0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 CHECKSIG",
3516
+ "0x48 0x3045022100f7bc0702a0355b1b42f40b17e81b96c2a49cb75c6ad46b647c323627cc1957fe02203bcfa6f1ee08fe9e4e1bd8dc6b5819f8ff5a732427f1c3b3d2a87cf29099e2db01",
3517
+ "0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e CHECKSIG",
3518
3518
  "",
3519
3519
  "OK",
3520
3520
  "P2PK with high S but no LOW_S"
@@ -3527,8 +3527,8 @@
3527
3527
  "P2PK with high S"
3528
3528
  ],
3529
3529
  [
3530
- "0x48 0x3045022100ecf335a87483cd71c4b0fee8c2ca844dca6e1a5dcf7285019fac28cbdb6200db0220169f5880a61c274ff18113c1770cdeca7c35b5c3d14e265ef10e9e837ac7bab701",
3531
- "0x41 0x048e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0a3018a1c78c613b1b9490b9250abaf0e53d84558e1512ef18069651574b7e337 CHECKSIG",
3530
+ "0x48 0x3045022100ff2f86538c05b38dcce797f336fa42f08fe2c634dad6a39f701006cc628323ec0220382155b5c9b2739f0383283522215646c421f8d4c773ed7d0f5fbaada72875d501",
3531
+ "0x41 0x0423078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e1985126a01ad82ad1f5ec2edbe9cd86dec5858424b5dbbb8193db6f2c552b36e CHECKSIG",
3532
3532
  "",
3533
3533
  "OK",
3534
3534
  "P2PK with hybrid pubkey but no STRICTENC"
@@ -3541,8 +3541,8 @@
3541
3541
  "P2PK with hybrid pubkey"
3542
3542
  ],
3543
3543
  [
3544
- "0x48 0x30450221008772e6a056eb95bcc2eb245d3091af9003a5c3c4592870c125171d8b7b7d2dde02207fca76f8bbd32ca84413efcb0b3cd89c63480144c3a6deb1b26d2aa6cc079ce901",
3545
- "0x41 0x048e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0a3018a1c78c613b1b9490b9250abaf0e53d84558e1512ef18069651574b7e337 CHECKSIG NOT",
3544
+ "0x48 0x3045022100dddf53b6d40b14445b2235d078ca8a29fe7149e9f81d3d0d62b8ec6506b6b52502202fc7746671e251be32ebdc49a75f69e01bdb8461f31d448588ff8f7d73db3a4d01",
3545
+ "0x41 0x0423078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e1985126a01ad82ad1f5ec2edbe9cd86dec5858424b5dbbb8193db6f2c552b36e CHECKSIG NOT",
3546
3546
  "",
3547
3547
  "EVAL_FALSE",
3548
3548
  "P2PK NOT with hybrid pubkey but no STRICTENC"
@@ -3569,15 +3569,15 @@
3569
3569
  "P2PK NOT with invalid hybrid pubkey"
3570
3570
  ],
3571
3571
  [
3572
- "0x48 0x3045022100a75c364b14472293244ea13de836a33248041ff74c4d7d78995acd96548fb10602201a52c395a30a5e565f8a7aebb798773dc8e8b3e4dd3c1217cf825a2f7ed3c90b01",
3573
- "1 0x41 0x048e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0a3018a1c78c613b1b9490b9250abaf0e53d84558e1512ef18069651574b7e337 0x21 0x025a51bb1eaa5bd1faa032c2e7ef2b1bcb510be37744a7fe3618c45d8a263838a3 2 CHECKMULTISIG",
3572
+ "0x48 0x3045022100da6b64fc3969070fe3b17a5a353fa5779a890d13ab18931218bf6ba088c43d3802204a968d16360f7d168f3966530e1eec254441082b3c481f7c8ace09dcaf8d7fe401",
3573
+ "1 0x41 0x0423078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e1985126a01ad82ad1f5ec2edbe9cd86dec5858424b5dbbb8193db6f2c552b36e 0x21 0x032d0d280192d66ec4f125ae661b32a2cd7c8d85c3fe3aa8988ee0941fae5f586c 2 CHECKMULTISIG",
3574
3574
  "",
3575
3575
  "OK",
3576
3576
  "1-of-2 with the second 1 hybrid pubkey and no STRICTENC"
3577
3577
  ],
3578
3578
  [
3579
- "0x47 0x304402202cce1aa7f311dd3ade2d3634dc05f408094c94ec8550b47a8d9b67e39d788c47022019f5dbab836fe87c41998e7289811c767f423189e00722c7a26e3a6121e6734501",
3580
- "1 0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 0x21 0x025a51bb1eaa5bd1faa032c2e7ef2b1bcb510be37744a7fe3618c45d8a263838a3 2 CHECKMULTISIG",
3579
+ "0x48 0x3045022100d16c92bb12d27f91c59807c0f47512a95ecb2e34cf988db5bbef80b8ecc25da902204d1a5dd60958ee6fd43bfc09a8b2b55d89666bc4324b3bbd43e9ed5f22048a4701",
3580
+ "1 0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e 0x21 0x032d0d280192d66ec4f125ae661b32a2cd7c8d85c3fe3aa8988ee0941fae5f586c 2 CHECKMULTISIG",
3581
3581
  "STRICTENC",
3582
3582
  "OK",
3583
3583
  "1-of-2 with the second 1 hybrid pubkey"
@@ -3590,8 +3590,8 @@
3590
3590
  "1-of-2 with the first 1 hybrid pubkey"
3591
3591
  ],
3592
3592
  [
3593
- "0x48 0x3045022100de9e97ac5a8063b0e6953a6f67b2d34a78e3ffa4108019cfc5eff5bddb87cd4e022027c1dc1512cc67c3bc7e096341fbb3bf5d172c829c610af892287212e58de9ef01",
3594
- "0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 CHECKSIG",
3593
+ "0x48 0x3045022100f7bc0702a0355b1b42f40b17e81b96c2a49cb75c6ad46b647c323627cc1957fe02203bcfa6f1ee08fe9e4e1bd8dc6b5819f8ff5a732427f1c3b3d2a87cf29099e2db01",
3594
+ "0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e CHECKSIG",
3595
3595
  "",
3596
3596
  "OK",
3597
3597
  "P2PK with undefined hashtype but no STRICTENC"
@@ -3618,8 +3618,8 @@
3618
3618
  "P2PK NOT with invalid sig and undefined hashtype"
3619
3619
  ],
3620
3620
  [
3621
- "0x48 0x3045022100b20eca64f362e47c46992f205fd124de1766bcc64f80f9eac20cd785ef24465902201bab5291aef4c5d61d050ee0591b3d4e100ff7dc1b5f9579730a5173b7d3e96e01 0x47 0x304402205d3fb1321932c22e12b38dc639cd0addbd617ce2eebc4f5d6de02e3e46d339df02203b9f419fa82f9aa355b6344bac2d9d1bc308184427631e32b37a0d1816d2203501 0x48 0x3045022100d09690af08c28ecc300425763696463c66da3b80551d3b9443eebe0d7ac8c27002200c21d4549c530efb3d91a39d3eab5df32ee60777471d7cbf74da2e8e2efc7e8c01",
3622
- "3 0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 0x21 0x024a193d18bc1b8b342a27c867e5665778ece7bfcd04b96565f1753dbb6f38ede7 0x21 0x025a51bb1eaa5bd1faa032c2e7ef2b1bcb510be37744a7fe3618c45d8a263838a3 3 CHECKMULTISIG",
3621
+ "0x48 0x3045022100a862b426b3186924d2dd571e1839b7ab939bbbcc95625b484dff4b6fe068d5e10220505168fa58c9c7dcc77c7dad5e0c0f7dce91c1d3897705fbb6552fc22f9a7a1b01 0x47 0x304402206cbc42a44a85cc3e5adf91312cbb389c17c7736d119597eafce44d19014827a7022049c99dfa7fe7ba8e30a8e4745c8cf5afb8d8fa2a79db11a9cb55369bc55b62ba01 0x47 0x304402207ad2f74e6c564f0c9de66a73079fb41ad8e84f96c28da2e5a37ddbde124ce84a02202e5d09853ab6a836be69b364d92f892df43defaab92df41f8f8d8e4c7f97560001",
3622
+ "3 0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e 0x21 0x02a370403748d9355ecbfee664876cc0269bf2c7ae23c4e58c79967f8073ed0f1e 0x21 0x032d0d280192d66ec4f125ae661b32a2cd7c8d85c3fe3aa8988ee0941fae5f586c 3 CHECKMULTISIG",
3623
3623
  "",
3624
3624
  "OK",
3625
3625
  "3-of-3 with nonzero dummy but no NULLDUMMY"
@@ -3632,8 +3632,8 @@
3632
3632
  "3-of-3 NOT with invalid sig and nonzero dummy but no NULLDUMMY"
3633
3633
  ],
3634
3634
  [
3635
- "0x47 0x304402201818e9a575f6a388e4cf057dbdfc14817b183edad760b87935867d265134cd000220279f7da4427822824e6a236315b7aba13b022087a0e29bf5f0390fa6e3a0242901 DUP",
3636
- "2 0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 2 CHECKMULTISIG",
3635
+ "0x47 0x304402206ff5ec4fae6dbdca5e5e12ae5327bcfdf188155a08ee1df6fc1f0e077e61a3ce02203ebb24378e2769f7badbf6070c9686b93875844fbf35fc2aeb195a7981837df901 DUP",
3636
+ "2 0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e 0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e 2 CHECKMULTISIG",
3637
3637
  "",
3638
3638
  "OK",
3639
3639
  "2-of-2 with two identical keys and sigs pushed using OP_DUP but no SIGPUSHONLY"
@@ -3653,8 +3653,8 @@
3653
3653
  "P2SH(P2PK) with non-push scriptSig but no P2SH or SIGPUSHONLY"
3654
3654
  ],
3655
3655
  [
3656
- "0x48 0x3045022100de9e97ac5a8063b0e6953a6f67b2d34a78e3ffa4108019cfc5eff5bddb87cd4e022027c1dc1512cc67c3bc7e096341fbb3bf5d172c829c610af892287212e58de9ef01 NOP8",
3657
- "0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 CHECKSIG",
3656
+ "0x48 0x3045022100f7bc0702a0355b1b42f40b17e81b96c2a49cb75c6ad46b647c323627cc1957fe02203bcfa6f1ee08fe9e4e1bd8dc6b5819f8ff5a732427f1c3b3d2a87cf29099e2db01 NOP8",
3657
+ "0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e CHECKSIG",
3658
3658
  "",
3659
3659
  "OK",
3660
3660
  "P2PK with non-push scriptSig but with P2SH validation"
@@ -3674,16 +3674,16 @@
3674
3674
  "P2SH(P2PK) with non-push scriptSig but not P2SH"
3675
3675
  ],
3676
3676
  [
3677
- "0x47 0x304402201818e9a575f6a388e4cf057dbdfc14817b183edad760b87935867d265134cd000220279f7da4427822824e6a236315b7aba13b022087a0e29bf5f0390fa6e3a0242901 0x47 0x304402201818e9a575f6a388e4cf057dbdfc14817b183edad760b87935867d265134cd000220279f7da4427822824e6a236315b7aba13b022087a0e29bf5f0390fa6e3a0242901",
3678
- "2 0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 2 CHECKMULTISIG",
3677
+ "0x47 0x304402206ff5ec4fae6dbdca5e5e12ae5327bcfdf188155a08ee1df6fc1f0e077e61a3ce02203ebb24378e2769f7badbf6070c9686b93875844fbf35fc2aeb195a7981837df901 0x47 0x304402206ff5ec4fae6dbdca5e5e12ae5327bcfdf188155a08ee1df6fc1f0e077e61a3ce02203ebb24378e2769f7badbf6070c9686b93875844fbf35fc2aeb195a7981837df901",
3678
+ "2 0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e 0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e 2 CHECKMULTISIG",
3679
3679
  "SIGPUSHONLY",
3680
3680
  "OK",
3681
3681
  "2-of-2 with two identical keys and sigs pushed"
3682
3682
  ],
3683
3683
  [
3684
3684
  [123450.0],
3685
- "0x47 0x3044022053f7e3c98778311f9196adc5a747261ef0506b29d048cfb99be22fd4ede4c886022072612a032a67ac4ab6d34a2a6e17fb4064a657e24f4728f53c28c0c9e22a05ae01",
3686
- "0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 CHECKSIG",
3685
+ "0x48 0x3045022100d228c7089f790ddf8af50f37b30a0981d6e7530910e7b564c68330fc95fa9f5b02207780a1c7994ca670b2912a412d1f87427c7ae01d8def9dedf90281eb3f92a05801",
3686
+ "0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e CHECKSIG",
3687
3687
  "",
3688
3688
  "OK",
3689
3689
  "P2PK FORKID THIS"
@@ -3691,7 +3691,7 @@
3691
3691
  [
3692
3692
  [123450.0],
3693
3693
  "0x47 0x3044022053cebf0befa1f435d1631d7b0de2c870203b4cedcce98bd2ce6b72e08978e1a302203b63345ec2de3682eec5f008a3b1c925b2f71be53f0469a49fb7f1df0c49409b41",
3694
- "0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 CHECKSIG",
3694
+ "0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e CHECKSIG",
3695
3695
  "",
3696
3696
  "EVAL_FALSE",
3697
3697
  "P2PK INVALID AMOUNT"
@@ -3699,7 +3699,7 @@
3699
3699
  [
3700
3700
  [123450.0],
3701
3701
  "0x47 0x30440220368d68340dfbebf99d5ec87d77fba899763e466c0a7ab2fa0221fb868ab0f3ef0220266c1a52a8e5b7b597613b80cf53814d3925dfb6715dce712c8e7a25e63a044041",
3702
- "0x21 0x038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0 CHECKSIG",
3702
+ "0x21 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e CHECKSIG",
3703
3703
  "STRICTENC",
3704
3704
  "ILLEGAL_FORKID",
3705
3705
  "P2PK INVALID FORKID"
@@ -17,12 +17,12 @@
17
17
  [
18
18
  "323bb4b41cf56ede01e7a1666262b51ef0635d8c96e029ddcd742ca2c4794687",
19
19
  1,
20
- "DUP HASH160 0x14 0x05097bec4d3746623fe8957971ab611a551da677 EQUALVERIFY CHECKSIG",
20
+ "DUP HASH160 0x14 0x88d9931ea73d60eaf7e5671efc0552b912911f2a EQUALVERIFY CHECKSIG",
21
21
  505299040397,
22
22
  ""
23
23
  ]
24
24
  ],
25
- "0100000001874679c4a22c74cddd29e0968c5d63f01eb5626266a1e701de6ef51cb4b43b32010000006a47304402201d10950760ad1676ef68266866a3906c5d7686174e1417f035e0cdb72e65929c0220506e3180ecf0003635f4e036d533be4af02c5a23f6dd0ccefc8407fd8311ea720121038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0ffffffff01bd702ba6750000001976a91405097bec4d3746623fe8957971ab611a551da67788ac0000000000",
25
+ "0100000001874679c4a22c74cddd29e0968c5d63f01eb5626266a1e701de6ef51cb4b43b32010000006a47304402200ba77b913c98419c962dac3a6a6f5629ca3700449a401d314c6dbc70f2c219ec0220452c8b0e86fbdce552c2ccf5a6569cde5ddba486e4b85fd603c1e9a0468c731b01210223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5effffffff01bd702ba6750000001976a91488d9931ea73d60eaf7e5671efc0552b912911f2a88ac0000000000",
26
26
  ""
27
27
  ],
28
28
  ["A p2pkh with data"],
@@ -31,12 +31,12 @@
31
31
  [
32
32
  "e3253397c371fb22b00be500ae4211d7a985bfde482d41f5bea5fd707f86aea6",
33
33
  0,
34
- "DUP HASH160 0x14 0x05097bec4d3746623fe8957971ab611a551da677 EQUALVERIFY CHECKSIG",
34
+ "DUP HASH160 0x14 0x88d9931ea73d60eaf7e5671efc0552b912911f2a EQUALVERIFY CHECKSIG",
35
35
  505299036397,
36
36
  "68656c6c6f206f70636174"
37
37
  ]
38
38
  ],
39
- "0100000001a6ae867f70fda5bef5412d48debf85a9d71142ae00e50bb022fb71c3973325e3000000006b48304502210095fbb6afe55c41c587cc31af5e20b16569cb3fa00352c89742e21ab3e0cb1291022050e7c3473cb7a2a4714f1d4bf8019c502b93b75226120f632e04224ddf5da61b0121038e7493d0256b3294edab57f6104c4da9ab0770c7c1d1f07b49a0919b50a42fe0ffffffff011d612ba6750000001976a91405097bec4d3746623fe8957971ab611a551da67788ac0000000000",
39
+ "0100000001a6ae867f70fda5bef5412d48debf85a9d71142ae00e50bb022fb71c3973325e3000000006a4730440220351cc37940362669f7be998cf01f0d0336e0def99830baa879335b62767c230d0220119d10cda578641871e59bd565757ebea23e48de9d0485a2e851b11f897aef3701210223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5effffffff011d612ba6750000001976a91488d9931ea73d60eaf7e5671efc0552b912911f2a88ac0000000000",
40
40
  ""
41
41
  ],
42
42
 
@@ -7,6 +7,6 @@
7
7
  "",
8
8
  0,
9
9
  1,
10
- "9545188cd926de5bb3e7575e4feaa763eb8bba11b3a17077ba8ab1aa7d602101"
10
+ "b04172dd3c496c8cd1d49ced455ad20ca44ff25bc53b4524c125eb1bdca96899"
11
11
  ]
12
12
  ]
@@ -15,7 +15,7 @@
15
15
  "sign",
16
16
  ["cSBnVM4xvxarwGQuAfQFwqDg9k5tErHUHzgWsEfD4zdwUasvqRVY", 1],
17
17
  "serialize",
18
- "01000000015884e5db9de218238671572340b207ee85b628074e7e467096c267266baf77a4000000006b483045022100b7cf60ba75a9a5d5c76b8364c52ffaeaee25ec95b5438c7381005d8c596804780220436ae93998364d7141ba39ad2d828eda2838ee0994083a2f837d40da518bf0cb01210223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5effffffff0150690f00000000001976a9147821c0a3768aa9d1a37e16cf76002aef5373f1a888ac0000000000"
18
+ "01000000015884e5db9de218238671572340b207ee85b628074e7e467096c267266baf77a4000000006a47304402203870bd5551a118eb85126e39952e82be050934a9c13462cbfd1b023820691ba30220578d5f42daea846e4cca7f83860d79c49a1920d58f38a03c906466fda2bd076501210223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5effffffff0150690f00000000001976a9147821c0a3768aa9d1a37e16cf76002aef5373f1a888ac0000000000"
19
19
  ],
20
20
  [
21
21
  "from",
@@ -35,7 +35,7 @@
35
35
  "sign",
36
36
  ["cSQUuwwJBAg6tYQhzqqLWW115D1s5KFZDyhCF2ffrnukZxMK6rNZ", 1],
37
37
  "serialize",
38
- "0100000001863957ca797bf847eae50f6999e4c3616dc64b1e6661b16d9da2b57d184724e4010000006a473044022056d1e647ec6aa8ee4036d3cbe89f7050af8497031781cd2e2bc93bd38a4c2962022021a9e52063a3f5246e1ee950d597f8517fd932247070239e1caafb2cdd13f9850121039dd446bbc85db6917f39c0b4c295b0f8cce76d1926fa76d7b84e3f7ff1c5eec5ffffffff0220a10700000000001976a91448c819246ae5645ceecd41fbe1aa6202a0a9b5ca88ac0090b20800000000001976a914aab76ba4877d696590d94ea3e02948b55294815188ac0000000000"
38
+ "0100000001863957ca797bf847eae50f6999e4c3616dc64b1e6661b16d9da2b57d184724e4010000006a473044022047857f444cce2e8c54c76d4a5f9a680734f331a387fc40fc088c4d684f6f25d402200d89d0c563e8f1cd00c0e820840160244432e7c957cb00dd15806bd3d59802d10121039dd446bbc85db6917f39c0b4c295b0f8cce76d1926fa76d7b84e3f7ff1c5eec5ffffffff0220a10700000000001976a91448c819246ae5645ceecd41fbe1aa6202a0a9b5ca88ac0090b20800000000001976a914aab76ba4877d696590d94ea3e02948b55294815188ac0000000000"
39
39
  ],
40
40
  [
41
41
  "from",
@@ -72,7 +72,7 @@
72
72
  1
73
73
  ],
74
74
  "serialize",
75
- "0100000002b3028cf4ae5b4b6d8f79ab6fc0dd251b28ab28287d33861e35c90f6e5684dba9000000006b48304502210090c2c8c849ec8b7d5505257b5b55fedb4ed8406e37cafe7ceab34acd90108c1f02206ba3c96c281c058a164f3fed02751d781be6b82695ce2877a881946f27c727b20121030253c73236acf5ea9085d408220141197f6094de07426bd0d32c7a543614fdd7ffffffffb3028cf4ae5b4b6d8f79ab6fc0dd251b28ab28287d33861e35c90f6e5684dba9010000006a47304402205eb5bbebc4e493617cb706cbe0112dade9454315a32982ba829a3ad4e10a1a5402200c02dd485a87b2a39981534b953f7ec84cba81cf9533ac0bf9daba82eeff1c2b012102977a001a0a7bbfd1f8a647c7d46e13e8f6920635b328390b43b3303977101149ffffffff01a02c1000000000001976a91493abf1e9e4a20c125b93f93ee39efc16b6e4bc4688ac0000000000"
75
+ "0100000002b3028cf4ae5b4b6d8f79ab6fc0dd251b28ab28287d33861e35c90f6e5684dba9000000006b483045022100cc1fae21210d4705c5c9e44524c3f7da755e702b256611c526c377665aa09f2c02205a6385842e96b5c957013b80dcbe50d710ad5794db483f46b596e9ee0d67d7300121030253c73236acf5ea9085d408220141197f6094de07426bd0d32c7a543614fdd7ffffffffb3028cf4ae5b4b6d8f79ab6fc0dd251b28ab28287d33861e35c90f6e5684dba9010000006b483045022100dc1eccd6d1aa300fb7cc82525703c87bc565f38631c9f1dc9f08caabbf02ea9f02202a672a28fe28a6883d22ad072fd08460fbf7301fd5e9fc9862ed4b85b1832711012102977a001a0a7bbfd1f8a647c7d46e13e8f6920635b328390b43b3303977101149ffffffff01a02c1000000000001976a91493abf1e9e4a20c125b93f93ee39efc16b6e4bc4688ac0000000000"
76
76
  ],
77
77
  [
78
78
  "from",
@@ -90,6 +90,6 @@
90
90
  "sign",
91
91
  ["cPwWtDztEgRCMCU8pMQp4HgphvyadrAsYBrCjXUZuDSmnZkyoyNF", 1],
92
92
  "serialize",
93
- "0100000001dc8b68f2b4263d77ee30468da161242be499283a21dfd7eb38a4a9cdce130ef5010000006b483045022100de7b9696752beac176bc7acf0b4d4ab0862130fdbc4b41fffb46aceb849d248002206d9ce77b1a3c027c7e7a13ee4d73195c5d5c4d015db0397233233e12b3ff2860012103e26b47e7c0d8946954bf9dd4bc7f9e415437eb98271d05f69e78cef8fc6c9a54ffffffff01301b0f00000000001976a914f50f9826ef186074c6fe206cca6b71472ff07ba888ac0000000000"
93
+ "0100000001dc8b68f2b4263d77ee30468da161242be499283a21dfd7eb38a4a9cdce130ef5010000006b483045022100c4f7dbca18ba553218960441e670594d3aa3561fcddd539baf3afa70e923aefd022078741b569f73702aae37ce660d584aa66dd2f3bad921492668e373d07592495a012103e26b47e7c0d8946954bf9dd4bc7f9e415437eb98271d05f69e78cef8fc6c9a54ffffffff01301b0f00000000001976a914f50f9826ef186074c6fe206cca6b71472ff07ba888ac0000000000"
94
94
  ]
95
95
  ]
@@ -28,7 +28,7 @@ describe('MultiSigInput', function () {
28
28
 
29
29
  it('can parse list of signature buffers, from TX signed with key 1 and 2', function () {
30
30
  var transaction = new Transaction(
31
- '010000000140c1ae9d6933e4a08594f814ba73a4e94d19c8a83f45784b1684b3a3f84ee66600000000920047304402207031af27ed2b2440f11b803e0c311c257f5b69b94d1b231428d7157085d7f6c20220132dbdebaa417c2f54790bcdcc3730bd1b943fe9aa71e504b13be674111eecd301483045022100f6f1d3c135ac3ff8a81614a56142cf5aa68efde447955373980f8fc73068f3bb0220497f40851cc930a7783159fde902108ad3d936879413e448b7fcb7803930663d01ffffffff0140420f000000000017a91419438da7d16709643be5abd8df62ca4034a489a7870000000000',
31
+ '010000000140c1ae9d6933e4a08594f814ba73a4e94d19c8a83f45784b1684b3a3f84ee666000000009200483045022100e5218e00433c9b1acef6514c9793638f2d39dfb0ee533981de62b7dedf23a6dd022078db45cd64c33b1bf3c971b32b5ecdb778ca71ef1d986b08adbab040b01a987b0147304402204572f05fb95c710118c61ef84b0dcd724f683ac4be0d13ac4464ed3815e1d00002202857d0bc273d7daab16fe7c033073a38aea36e994c3dde6fda569174251bc86b01ffffffff0140420f000000000017a91419438da7d16709643be5abd8df62ca4034a489a7870000000000',
32
32
  );
33
33
 
34
34
  var inputObj = transaction.inputs[0].toObject();
@@ -59,7 +59,7 @@ describe('MultiSigInput', function () {
59
59
  });
60
60
  it('can parse list of signature buffers, from TX signed with key 3 and 1', function () {
61
61
  var transaction = new Transaction(
62
- '010000000140c1ae9d6933e4a08594f814ba73a4e94d19c8a83f45784b1684b3a3f84ee66600000000910047304402207031af27ed2b2440f11b803e0c311c257f5b69b94d1b231428d7157085d7f6c20220132dbdebaa417c2f54790bcdcc3730bd1b943fe9aa71e504b13be674111eecd301473044022059e3652eb43cb42a65f633dd6ecd1014350a164f89cb44104f926b93affbe09f02206bdf93eddf0c2fadd9ea1b9ab273f90e15a03e821fe5de87e457d1940b569dc001ffffffff0140420f000000000017a91419438da7d16709643be5abd8df62ca4034a489a7870000000000',
62
+ '010000000140c1ae9d6933e4a08594f814ba73a4e94d19c8a83f45784b1684b3a3f84ee666000000009100473044022015237aecef3fcc33c8f9e2bda1dc4f3a41d972825509a9186d290f51d845228d022074e8d43f406261fc28cabd37760bb7cc0d46fa66b1e39d74104703c1dc114c790147304402204572f05fb95c710118c61ef84b0dcd724f683ac4be0d13ac4464ed3815e1d00002202857d0bc273d7daab16fe7c033073a38aea36e994c3dde6fda569174251bc86b01ffffffff0140420f000000000017a91419438da7d16709643be5abd8df62ca4034a489a7870000000000',
63
63
  );
64
64
 
65
65
  var inputObj = transaction.inputs[0].toObject();
@@ -26,7 +26,7 @@ describe('sighash', function () {
26
26
  var sighash = Transaction.Sighash.sighash(tx, Signature.SIGHASH_ALL, 0);
27
27
  sighash
28
28
  .toString('hex')
29
- .should.equal('09edc84f4bbf481368554aadb182f2944808cc26f294cbb67679641d135fc41c');
29
+ .should.equal('82bb65a2191a2ec6f5de5563cd74bc786b4f045ae323c0af46d8fb23b021ddac');
30
30
  });
31
31
 
32
32
  var zeroBN = BN.Zero;
@@ -263,7 +263,7 @@ describe('Transaction', function () {
263
263
  transaction
264
264
  .serialize()
265
265
  .should.equal(
266
- '01000000015884e5db9de218238671572340b207ee85b628074e7e467096c267266baf77a4000000006b483045022100ad567a4950bb1ac380696c8f96eac46944c6bc0bc73bc4f253eddb924cec96da02201d6c4dde7ce0da6cb566da76381b483ca1e23b1aad22ce3a063557f18d17e58001210223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5effffffff02000000000000000014006a1167656e6573697320697320636f6d696e670093860100000000001976a914073b7eae2823efa349e3b9155b8a735526463a0f88ac0000000000',
266
+ '01000000015884e5db9de218238671572340b207ee85b628074e7e467096c267266baf77a4000000006b48304502210081f662b81425c201f3e1e4e8ce1a7e742fc7da3f7f3aad4119f8b7864b98288102203042fbb503d8c4b31d5eb1fe903e49177a2ec99654b4faf5edc7335b79a7ebf301210223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5effffffff02000000000000000014006a1167656e6573697320697320636f6d696e670093860100000000001976a914073b7eae2823efa349e3b9155b8a735526463a0f88ac0000000000',
267
267
  );
268
268
  });
269
269