@btc-vision/bitcoin 7.0.0-alpha.1 → 7.0.0-alpha.3
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.
- package/README.md +334 -161
- package/browser/address.d.ts +5 -1
- package/browser/address.d.ts.map +1 -1
- package/browser/branded.d.ts +3 -14
- package/browser/branded.d.ts.map +1 -1
- package/browser/ecc/context.d.ts +22 -21
- package/browser/ecc/context.d.ts.map +1 -1
- package/browser/ecc/index.d.ts +1 -1
- package/browser/ecc/index.d.ts.map +1 -1
- package/browser/ecc/types.d.ts +10 -123
- package/browser/ecc/types.d.ts.map +1 -1
- package/browser/index.d.ts +3 -2
- package/browser/index.d.ts.map +1 -1
- package/browser/index.js +6465 -4692
- package/browser/opcodes.d.ts +11 -0
- package/browser/opcodes.d.ts.map +1 -1
- package/browser/payments/p2tr.d.ts.map +1 -1
- package/browser/psbt/PsbtCache.d.ts +54 -0
- package/browser/psbt/PsbtCache.d.ts.map +1 -0
- package/browser/psbt/PsbtFinalizer.d.ts +21 -0
- package/browser/psbt/PsbtFinalizer.d.ts.map +1 -0
- package/browser/psbt/PsbtSigner.d.ts +32 -0
- package/browser/psbt/PsbtSigner.d.ts.map +1 -0
- package/browser/psbt/PsbtTransaction.d.ts +25 -0
- package/browser/psbt/PsbtTransaction.d.ts.map +1 -0
- package/browser/psbt/types.d.ts +4 -70
- package/browser/psbt/types.d.ts.map +1 -1
- package/browser/psbt/validation.d.ts +1 -1
- package/browser/psbt/validation.d.ts.map +1 -1
- package/browser/psbt.d.ts +26 -40
- package/browser/psbt.d.ts.map +1 -1
- package/browser/script.d.ts.map +1 -1
- package/browser/transaction.d.ts +4 -4
- package/browser/transaction.d.ts.map +1 -1
- package/browser/types.d.ts +5 -3
- package/browser/types.d.ts.map +1 -1
- package/browser/workers/index.d.ts +3 -50
- package/browser/workers/index.d.ts.map +1 -1
- package/browser/workers/index.node.d.ts +24 -0
- package/browser/workers/index.node.d.ts.map +1 -0
- package/build/address.d.ts +5 -1
- package/build/address.d.ts.map +1 -1
- package/build/address.js +29 -17
- package/build/address.js.map +1 -1
- package/build/branded.d.ts +3 -14
- package/build/branded.d.ts.map +1 -1
- package/build/branded.js +0 -5
- package/build/branded.js.map +1 -1
- package/build/ecc/context.d.ts +22 -21
- package/build/ecc/context.d.ts.map +1 -1
- package/build/ecc/context.js +23 -95
- package/build/ecc/context.js.map +1 -1
- package/build/ecc/index.d.ts +1 -1
- package/build/ecc/index.d.ts.map +1 -1
- package/build/ecc/types.d.ts +7 -126
- package/build/ecc/types.d.ts.map +1 -1
- package/build/ecc/types.js +4 -1
- package/build/ecc/types.js.map +1 -1
- package/build/index.d.ts +3 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/opcodes.d.ts +11 -0
- package/build/opcodes.d.ts.map +1 -1
- package/build/opcodes.js +19 -4
- package/build/opcodes.js.map +1 -1
- package/build/payments/p2tr.d.ts.map +1 -1
- package/build/payments/p2tr.js +2 -3
- package/build/payments/p2tr.js.map +1 -1
- package/build/psbt/PsbtCache.d.ts +54 -0
- package/build/psbt/PsbtCache.d.ts.map +1 -0
- package/build/psbt/PsbtCache.js +249 -0
- package/build/psbt/PsbtCache.js.map +1 -0
- package/build/psbt/PsbtFinalizer.d.ts +21 -0
- package/build/psbt/PsbtFinalizer.d.ts.map +1 -0
- package/build/psbt/PsbtFinalizer.js +157 -0
- package/build/psbt/PsbtFinalizer.js.map +1 -0
- package/build/psbt/PsbtSigner.d.ts +32 -0
- package/build/psbt/PsbtSigner.d.ts.map +1 -0
- package/build/psbt/PsbtSigner.js +192 -0
- package/build/psbt/PsbtSigner.js.map +1 -0
- package/build/psbt/PsbtTransaction.d.ts +25 -0
- package/build/psbt/PsbtTransaction.d.ts.map +1 -0
- package/build/psbt/PsbtTransaction.js +61 -0
- package/build/psbt/PsbtTransaction.js.map +1 -0
- package/build/psbt/types.d.ts +4 -70
- package/build/psbt/types.d.ts.map +1 -1
- package/build/psbt/validation.d.ts +1 -1
- package/build/psbt/validation.d.ts.map +1 -1
- package/build/psbt.d.ts +26 -40
- package/build/psbt.d.ts.map +1 -1
- package/build/psbt.js +177 -799
- package/build/psbt.js.map +1 -1
- package/build/script.d.ts.map +1 -1
- package/build/script.js +2 -2
- package/build/script.js.map +1 -1
- package/build/transaction.d.ts +4 -4
- package/build/transaction.d.ts.map +1 -1
- package/build/transaction.js +5 -4
- package/build/transaction.js.map +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/build/types.d.ts +5 -3
- package/build/types.d.ts.map +1 -1
- package/build/types.js +9 -0
- package/build/types.js.map +1 -1
- package/build/workers/WorkerSigningPool.js +1 -1
- package/build/workers/WorkerSigningPool.js.map +1 -1
- package/build/workers/index.d.ts +3 -3
- package/build/workers/index.d.ts.map +1 -1
- package/build/workers/index.js +0 -3
- package/build/workers/index.js.map +1 -1
- package/build/workers/index.node.d.ts +24 -0
- package/build/workers/index.node.d.ts.map +1 -0
- package/build/workers/index.node.js +26 -0
- package/build/workers/index.node.js.map +1 -0
- package/package.json +27 -8
- package/src/address.ts +41 -18
- package/src/branded.ts +15 -13
- package/src/ecc/context.ts +30 -133
- package/src/ecc/index.ts +2 -2
- package/src/ecc/types.ts +7 -138
- package/src/index.ts +36 -2
- package/src/opcodes.ts +21 -4
- package/src/payments/p2tr.ts +2 -2
- package/src/psbt/PsbtCache.ts +325 -0
- package/src/psbt/PsbtFinalizer.ts +213 -0
- package/src/psbt/PsbtSigner.ts +302 -0
- package/src/psbt/PsbtTransaction.ts +82 -0
- package/src/psbt/types.ts +4 -86
- package/src/psbt/validation.ts +1 -1
- package/src/psbt.ts +348 -1197
- package/src/script.ts +2 -2
- package/src/transaction.ts +9 -8
- package/src/types.ts +14 -1
- package/src/workers/WorkerSigningPool.ts +1 -1
- package/src/workers/index.node.ts +27 -0
- package/src/workers/index.ts +7 -9
- package/test/address.spec.ts +2 -2
- package/test/bitcoin.core.spec.ts +5 -2
- package/test/browser/payments.spec.ts +151 -0
- package/test/browser/psbt.spec.ts +1510 -0
- package/test/browser/script.spec.ts +223 -0
- package/test/browser/setup.ts +13 -0
- package/test/browser/workers-signing.spec.ts +537 -0
- package/test/crypto.spec.ts +2 -2
- package/test/fixtures/core/base58_encode_decode.json +12 -48
- package/test/fixtures/core/base58_keys_invalid.json +50 -150
- package/test/fixtures/core/sighash.json +1 -3
- package/test/fixtures/core/tx_valid.json +133 -501
- package/test/fixtures/embed.json +3 -11
- package/test/fixtures/p2ms.json +21 -91
- package/test/fixtures/p2pk.json +5 -24
- package/test/fixtures/p2pkh.json +7 -36
- package/test/fixtures/p2sh.json +8 -54
- package/test/fixtures/p2tr.json +2 -6
- package/test/fixtures/p2wpkh.json +7 -36
- package/test/fixtures/p2wsh.json +14 -59
- package/test/fixtures/psbt.json +2 -6
- package/test/fixtures/script.json +12 -48
- package/test/integration/addresses.spec.ts +11 -5
- package/test/integration/bip32.spec.ts +1 -1
- package/test/integration/cltv.spec.ts +10 -6
- package/test/integration/csv.spec.ts +10 -9
- package/test/integration/payments.spec.ts +8 -4
- package/test/integration/taproot.spec.ts +26 -6
- package/test/integration/transactions.spec.ts +22 -8
- package/test/payments.spec.ts +1 -1
- package/test/payments.utils.ts +1 -1
- package/test/psbt.spec.ts +250 -64
- package/test/script_signature.spec.ts +1 -1
- package/test/transaction.spec.ts +18 -5
- package/test/tsconfig.json +6 -20
- package/test/workers-pool.spec.ts +22 -23
- package/test/workers-signing.spec.ts +7 -3
- package/test/workers.spec.ts +6 -7
- package/typedoc.json +11 -1
- package/vitest.config.browser.ts +68 -0
- package/browser/ecpair.d.ts +0 -99
- package/src/ecpair.d.ts +0 -99
- package/test/taproot-cache.spec.ts +0 -694
package/test/fixtures/embed.json
CHANGED
|
@@ -62,9 +62,7 @@
|
|
|
62
62
|
"options": {},
|
|
63
63
|
"arguments": {
|
|
64
64
|
"output": "OP_RETURN a3b1 47db",
|
|
65
|
-
"data": [
|
|
66
|
-
"a3b1"
|
|
67
|
-
]
|
|
65
|
+
"data": ["a3b1"]
|
|
68
66
|
}
|
|
69
67
|
},
|
|
70
68
|
{
|
|
@@ -78,14 +76,8 @@
|
|
|
78
76
|
],
|
|
79
77
|
"dynamic": {
|
|
80
78
|
"depends": {
|
|
81
|
-
"data": [
|
|
82
|
-
|
|
83
|
-
"output"
|
|
84
|
-
],
|
|
85
|
-
"output": [
|
|
86
|
-
"output",
|
|
87
|
-
"data"
|
|
88
|
-
]
|
|
79
|
+
"data": ["data", "output"],
|
|
80
|
+
"output": ["output", "data"]
|
|
89
81
|
},
|
|
90
82
|
"details": [
|
|
91
83
|
{
|
package/test/fixtures/p2ms.json
CHANGED
|
@@ -52,10 +52,7 @@
|
|
|
52
52
|
"030000000000000000000000000000000000000000000000000000000000000002",
|
|
53
53
|
"030000000000000000000000000000000000000000000000000000000000000003"
|
|
54
54
|
],
|
|
55
|
-
"signatures": [
|
|
56
|
-
"300602010002010001",
|
|
57
|
-
"300602010102010001"
|
|
58
|
-
]
|
|
55
|
+
"signatures": ["300602010002010001", "300602010102010001"]
|
|
59
56
|
},
|
|
60
57
|
"expected": {
|
|
61
58
|
"m": 2,
|
|
@@ -67,10 +64,7 @@
|
|
|
67
64
|
"030000000000000000000000000000000000000000000000000000000000000002",
|
|
68
65
|
"030000000000000000000000000000000000000000000000000000000000000003"
|
|
69
66
|
],
|
|
70
|
-
"signatures": [
|
|
71
|
-
"300602010002010001",
|
|
72
|
-
"300602010102010001"
|
|
73
|
-
],
|
|
67
|
+
"signatures": ["300602010002010001", "300602010102010001"],
|
|
74
68
|
"input": "OP_0 300602010002010001 300602010102010001",
|
|
75
69
|
"witness": []
|
|
76
70
|
}
|
|
@@ -79,10 +73,7 @@
|
|
|
79
73
|
"description": "input/output from output/signatures",
|
|
80
74
|
"arguments": {
|
|
81
75
|
"output": "OP_2 030000000000000000000000000000000000000000000000000000000000000001 030000000000000000000000000000000000000000000000000000000000000002 030000000000000000000000000000000000000000000000000000000000000003 OP_3 OP_CHECKMULTISIG",
|
|
82
|
-
"signatures": [
|
|
83
|
-
"300602010002010001",
|
|
84
|
-
"300602010102010001"
|
|
85
|
-
]
|
|
76
|
+
"signatures": ["300602010002010001", "300602010102010001"]
|
|
86
77
|
},
|
|
87
78
|
"expected": {
|
|
88
79
|
"m": 2,
|
|
@@ -94,10 +85,7 @@
|
|
|
94
85
|
"030000000000000000000000000000000000000000000000000000000000000002",
|
|
95
86
|
"030000000000000000000000000000000000000000000000000000000000000003"
|
|
96
87
|
],
|
|
97
|
-
"signatures": [
|
|
98
|
-
"300602010002010001",
|
|
99
|
-
"300602010102010001"
|
|
100
|
-
],
|
|
88
|
+
"signatures": ["300602010002010001", "300602010102010001"],
|
|
101
89
|
"input": "OP_0 300602010002010001 300602010102010001",
|
|
102
90
|
"witness": []
|
|
103
91
|
}
|
|
@@ -118,10 +106,7 @@
|
|
|
118
106
|
"030000000000000000000000000000000000000000000000000000000000000002",
|
|
119
107
|
"030000000000000000000000000000000000000000000000000000000000000003"
|
|
120
108
|
],
|
|
121
|
-
"signatures": [
|
|
122
|
-
"300602010002010001",
|
|
123
|
-
"300602010102010001"
|
|
124
|
-
],
|
|
109
|
+
"signatures": ["300602010002010001", "300602010102010001"],
|
|
125
110
|
"input": "OP_0 300602010002010001 300602010102010001",
|
|
126
111
|
"witness": []
|
|
127
112
|
}
|
|
@@ -144,10 +129,7 @@
|
|
|
144
129
|
"030000000000000000000000000000000000000000000000000000000000000001",
|
|
145
130
|
"030000000000000000000000000000000000000000000000000000000000000002"
|
|
146
131
|
],
|
|
147
|
-
"signatures": [
|
|
148
|
-
0,
|
|
149
|
-
"300602010102010001"
|
|
150
|
-
],
|
|
132
|
+
"signatures": [0, "300602010102010001"],
|
|
151
133
|
"input": "OP_0 OP_0 300602010102010001",
|
|
152
134
|
"witness": []
|
|
153
135
|
}
|
|
@@ -156,10 +138,7 @@
|
|
|
156
138
|
"description": "input/output from output/signatures, even if incomplete",
|
|
157
139
|
"arguments": {
|
|
158
140
|
"output": "OP_2 030000000000000000000000000000000000000000000000000000000000000001 030000000000000000000000000000000000000000000000000000000000000002 OP_2 OP_CHECKMULTISIG",
|
|
159
|
-
"signatures": [
|
|
160
|
-
0,
|
|
161
|
-
"300602010102010001"
|
|
162
|
-
]
|
|
141
|
+
"signatures": [0, "300602010102010001"]
|
|
163
142
|
},
|
|
164
143
|
"options": {
|
|
165
144
|
"allowIncomplete": true
|
|
@@ -173,10 +152,7 @@
|
|
|
173
152
|
"030000000000000000000000000000000000000000000000000000000000000001",
|
|
174
153
|
"030000000000000000000000000000000000000000000000000000000000000002"
|
|
175
154
|
],
|
|
176
|
-
"signatures": [
|
|
177
|
-
0,
|
|
178
|
-
"300602010102010001"
|
|
179
|
-
],
|
|
155
|
+
"signatures": [0, "300602010102010001"],
|
|
180
156
|
"input": "OP_0 OP_0 300602010102010001",
|
|
181
157
|
"witness": []
|
|
182
158
|
}
|
|
@@ -277,9 +253,7 @@
|
|
|
277
253
|
"exception": "Pubkeys mismatch",
|
|
278
254
|
"options": {},
|
|
279
255
|
"arguments": {
|
|
280
|
-
"pubkeys": [
|
|
281
|
-
"030000000000000000000000000000000000000000000000000000000000000001"
|
|
282
|
-
],
|
|
256
|
+
"pubkeys": ["030000000000000000000000000000000000000000000000000000000000000001"],
|
|
283
257
|
"output": "OP_1 030000000000000000000000000000000000000000000000000000000000000002 OP_1 OP_CHECKMULTISIG"
|
|
284
258
|
}
|
|
285
259
|
},
|
|
@@ -312,9 +286,7 @@
|
|
|
312
286
|
"030000000000000000000000000000000000000000000000000000000000000001",
|
|
313
287
|
"030000000000000000000000000000000000000000000000000000000000000001"
|
|
314
288
|
],
|
|
315
|
-
"signatures": [
|
|
316
|
-
"300602010002010001"
|
|
317
|
-
]
|
|
289
|
+
"signatures": ["300602010002010001"]
|
|
318
290
|
}
|
|
319
291
|
},
|
|
320
292
|
{
|
|
@@ -325,9 +297,7 @@
|
|
|
325
297
|
"030000000000000000000000000000000000000000000000000000000000000001",
|
|
326
298
|
"030000000000000000000000000000000000000000000000000000000000000001"
|
|
327
299
|
],
|
|
328
|
-
"signatures": [
|
|
329
|
-
"300602010002010001"
|
|
330
|
-
],
|
|
300
|
+
"signatures": ["300602010002010001"],
|
|
331
301
|
"input": "OP_0 300602010002010101"
|
|
332
302
|
}
|
|
333
303
|
},
|
|
@@ -339,11 +309,7 @@
|
|
|
339
309
|
"030000000000000000000000000000000000000000000000000000000000000001",
|
|
340
310
|
"030000000000000000000000000000000000000000000000000000000000000001"
|
|
341
311
|
],
|
|
342
|
-
"signatures": [
|
|
343
|
-
"300602010002010001",
|
|
344
|
-
"300602010002010001",
|
|
345
|
-
"300602010002010001"
|
|
346
|
-
]
|
|
312
|
+
"signatures": ["300602010002010001", "300602010002010001", "300602010002010001"]
|
|
347
313
|
}
|
|
348
314
|
},
|
|
349
315
|
{
|
|
@@ -363,53 +329,20 @@
|
|
|
363
329
|
"exception": "Input has invalid signature\\(s\\)",
|
|
364
330
|
"arguments": {
|
|
365
331
|
"m": 1,
|
|
366
|
-
"pubkeys": [
|
|
367
|
-
"030000000000000000000000000000000000000000000000000000000000000001"
|
|
368
|
-
],
|
|
332
|
+
"pubkeys": ["030000000000000000000000000000000000000000000000000000000000000001"],
|
|
369
333
|
"input": "OP_0 ffffffffffffffff"
|
|
370
334
|
}
|
|
371
335
|
}
|
|
372
336
|
],
|
|
373
337
|
"dynamic": {
|
|
374
338
|
"depends": {
|
|
375
|
-
"m": [
|
|
376
|
-
|
|
377
|
-
],
|
|
378
|
-
"
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
"pubkeys"
|
|
383
|
-
]
|
|
384
|
-
],
|
|
385
|
-
"output": [
|
|
386
|
-
"output",
|
|
387
|
-
[
|
|
388
|
-
"m",
|
|
389
|
-
"pubkeys"
|
|
390
|
-
]
|
|
391
|
-
],
|
|
392
|
-
"pubkeys": [
|
|
393
|
-
"output"
|
|
394
|
-
],
|
|
395
|
-
"signatures": [
|
|
396
|
-
[
|
|
397
|
-
"input",
|
|
398
|
-
"output"
|
|
399
|
-
]
|
|
400
|
-
],
|
|
401
|
-
"input": [
|
|
402
|
-
[
|
|
403
|
-
"signatures",
|
|
404
|
-
"output"
|
|
405
|
-
]
|
|
406
|
-
],
|
|
407
|
-
"witness": [
|
|
408
|
-
[
|
|
409
|
-
"input",
|
|
410
|
-
"output"
|
|
411
|
-
]
|
|
412
|
-
]
|
|
339
|
+
"m": ["output"],
|
|
340
|
+
"n": ["output", ["m", "pubkeys"]],
|
|
341
|
+
"output": ["output", ["m", "pubkeys"]],
|
|
342
|
+
"pubkeys": ["output"],
|
|
343
|
+
"signatures": [["input", "output"]],
|
|
344
|
+
"input": [["signatures", "output"]],
|
|
345
|
+
"witness": [["input", "output"]]
|
|
413
346
|
},
|
|
414
347
|
"details": [
|
|
415
348
|
{
|
|
@@ -422,10 +355,7 @@
|
|
|
422
355
|
"030000000000000000000000000000000000000000000000000000000000000002",
|
|
423
356
|
"030000000000000000000000000000000000000000000000000000000000000003"
|
|
424
357
|
],
|
|
425
|
-
"signatures": [
|
|
426
|
-
"300602010002010001",
|
|
427
|
-
"300602010102010001"
|
|
428
|
-
],
|
|
358
|
+
"signatures": ["300602010002010001", "300602010102010001"],
|
|
429
359
|
"input": "OP_0 300602010002010001 300602010102010001",
|
|
430
360
|
"witness": []
|
|
431
361
|
}
|
package/test/fixtures/p2pk.json
CHANGED
|
@@ -132,30 +132,11 @@
|
|
|
132
132
|
],
|
|
133
133
|
"dynamic": {
|
|
134
134
|
"depends": {
|
|
135
|
-
"output": [
|
|
136
|
-
|
|
137
|
-
],
|
|
138
|
-
"
|
|
139
|
-
|
|
140
|
-
],
|
|
141
|
-
"signature": [
|
|
142
|
-
[
|
|
143
|
-
"input",
|
|
144
|
-
"output"
|
|
145
|
-
]
|
|
146
|
-
],
|
|
147
|
-
"input": [
|
|
148
|
-
[
|
|
149
|
-
"signature",
|
|
150
|
-
"output"
|
|
151
|
-
]
|
|
152
|
-
],
|
|
153
|
-
"witness": [
|
|
154
|
-
[
|
|
155
|
-
"input",
|
|
156
|
-
"output"
|
|
157
|
-
]
|
|
158
|
-
]
|
|
135
|
+
"output": ["pubkey"],
|
|
136
|
+
"pubkey": ["output"],
|
|
137
|
+
"signature": [["input", "output"]],
|
|
138
|
+
"input": [["signature", "output"]],
|
|
139
|
+
"witness": [["input", "output"]]
|
|
159
140
|
},
|
|
160
141
|
"details": [
|
|
161
142
|
{
|
package/test/fixtures/p2pkh.json
CHANGED
|
@@ -223,42 +223,13 @@
|
|
|
223
223
|
],
|
|
224
224
|
"dynamic": {
|
|
225
225
|
"depends": {
|
|
226
|
-
"address": [
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
]
|
|
233
|
-
"hash": [
|
|
234
|
-
"address",
|
|
235
|
-
"output",
|
|
236
|
-
"hash",
|
|
237
|
-
"pubkey",
|
|
238
|
-
"input"
|
|
239
|
-
],
|
|
240
|
-
"output": [
|
|
241
|
-
"address",
|
|
242
|
-
"output",
|
|
243
|
-
"hash",
|
|
244
|
-
"pubkey",
|
|
245
|
-
"input"
|
|
246
|
-
],
|
|
247
|
-
"pubkey": [
|
|
248
|
-
"input"
|
|
249
|
-
],
|
|
250
|
-
"signature": [
|
|
251
|
-
"input"
|
|
252
|
-
],
|
|
253
|
-
"input": [
|
|
254
|
-
[
|
|
255
|
-
"pubkey",
|
|
256
|
-
"signature"
|
|
257
|
-
]
|
|
258
|
-
],
|
|
259
|
-
"witness": [
|
|
260
|
-
"input"
|
|
261
|
-
]
|
|
226
|
+
"address": ["address", "output", "hash", "pubkey", "input"],
|
|
227
|
+
"hash": ["address", "output", "hash", "pubkey", "input"],
|
|
228
|
+
"output": ["address", "output", "hash", "pubkey", "input"],
|
|
229
|
+
"pubkey": ["input"],
|
|
230
|
+
"signature": ["input"],
|
|
231
|
+
"input": [["pubkey", "signature"]],
|
|
232
|
+
"witness": ["input"]
|
|
262
233
|
},
|
|
263
234
|
"details": [
|
|
264
235
|
{
|
package/test/fixtures/p2sh.json
CHANGED
|
@@ -415,60 +415,14 @@
|
|
|
415
415
|
],
|
|
416
416
|
"dynamic": {
|
|
417
417
|
"depends": {
|
|
418
|
-
"address": [
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
]
|
|
427
|
-
],
|
|
428
|
-
"hash": [
|
|
429
|
-
"address",
|
|
430
|
-
"output",
|
|
431
|
-
"hash",
|
|
432
|
-
"redeem.output",
|
|
433
|
-
[
|
|
434
|
-
"input",
|
|
435
|
-
"witness"
|
|
436
|
-
]
|
|
437
|
-
],
|
|
438
|
-
"output": [
|
|
439
|
-
"address",
|
|
440
|
-
"output",
|
|
441
|
-
"hash",
|
|
442
|
-
"redeem.output",
|
|
443
|
-
[
|
|
444
|
-
"input",
|
|
445
|
-
"witness"
|
|
446
|
-
]
|
|
447
|
-
],
|
|
448
|
-
"redeem.output": [
|
|
449
|
-
[
|
|
450
|
-
"input",
|
|
451
|
-
"witness"
|
|
452
|
-
]
|
|
453
|
-
],
|
|
454
|
-
"redeem.input": [
|
|
455
|
-
[
|
|
456
|
-
"input",
|
|
457
|
-
"witness"
|
|
458
|
-
]
|
|
459
|
-
],
|
|
460
|
-
"redeem.witness": [
|
|
461
|
-
[
|
|
462
|
-
"input",
|
|
463
|
-
"witness"
|
|
464
|
-
]
|
|
465
|
-
],
|
|
466
|
-
"input": [
|
|
467
|
-
"redeem"
|
|
468
|
-
],
|
|
469
|
-
"witness": [
|
|
470
|
-
"redeem"
|
|
471
|
-
]
|
|
418
|
+
"address": ["address", "output", "hash", "redeem.output", ["input", "witness"]],
|
|
419
|
+
"hash": ["address", "output", "hash", "redeem.output", ["input", "witness"]],
|
|
420
|
+
"output": ["address", "output", "hash", "redeem.output", ["input", "witness"]],
|
|
421
|
+
"redeem.output": [["input", "witness"]],
|
|
422
|
+
"redeem.input": [["input", "witness"]],
|
|
423
|
+
"redeem.witness": [["input", "witness"]],
|
|
424
|
+
"input": ["redeem"],
|
|
425
|
+
"witness": ["redeem"]
|
|
472
426
|
},
|
|
473
427
|
"details": [
|
|
474
428
|
{
|
package/test/fixtures/p2tr.json
CHANGED
|
@@ -63,9 +63,7 @@
|
|
|
63
63
|
"description": "address, output and signature from pubkey and witness",
|
|
64
64
|
"arguments": {
|
|
65
65
|
"pubkey": "ab610d22c801def8a1e02368d1b92018970eb52a729919705e8a1a2f60c750f5",
|
|
66
|
-
"witness": [
|
|
67
|
-
"300602010002010001"
|
|
68
|
-
]
|
|
66
|
+
"witness": ["300602010002010001"]
|
|
69
67
|
},
|
|
70
68
|
"expected": {
|
|
71
69
|
"name": "p2tr",
|
|
@@ -73,9 +71,7 @@
|
|
|
73
71
|
"output": "OP_1 ab610d22c801def8a1e02368d1b92018970eb52a729919705e8a1a2f60c750f5",
|
|
74
72
|
"input": null,
|
|
75
73
|
"signature": "300602010002010001",
|
|
76
|
-
"witness": [
|
|
77
|
-
"300602010002010001"
|
|
78
|
-
]
|
|
74
|
+
"witness": ["300602010002010001"]
|
|
79
75
|
}
|
|
80
76
|
},
|
|
81
77
|
{
|
|
@@ -234,42 +234,13 @@
|
|
|
234
234
|
],
|
|
235
235
|
"dynamic": {
|
|
236
236
|
"depends": {
|
|
237
|
-
"address": [
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
]
|
|
244
|
-
"hash": [
|
|
245
|
-
"address",
|
|
246
|
-
"output",
|
|
247
|
-
"hash",
|
|
248
|
-
"pubkey",
|
|
249
|
-
"witness"
|
|
250
|
-
],
|
|
251
|
-
"output": [
|
|
252
|
-
"address",
|
|
253
|
-
"output",
|
|
254
|
-
"hash",
|
|
255
|
-
"pubkey",
|
|
256
|
-
"witness"
|
|
257
|
-
],
|
|
258
|
-
"pubkey": [
|
|
259
|
-
"witness"
|
|
260
|
-
],
|
|
261
|
-
"signature": [
|
|
262
|
-
"witness"
|
|
263
|
-
],
|
|
264
|
-
"input": [
|
|
265
|
-
"witness"
|
|
266
|
-
],
|
|
267
|
-
"witness": [
|
|
268
|
-
[
|
|
269
|
-
"pubkey",
|
|
270
|
-
"signature"
|
|
271
|
-
]
|
|
272
|
-
]
|
|
237
|
+
"address": ["address", "output", "hash", "pubkey", "witness"],
|
|
238
|
+
"hash": ["address", "output", "hash", "pubkey", "witness"],
|
|
239
|
+
"output": ["address", "output", "hash", "pubkey", "witness"],
|
|
240
|
+
"pubkey": ["witness"],
|
|
241
|
+
"signature": ["witness"],
|
|
242
|
+
"input": ["witness"],
|
|
243
|
+
"witness": [["pubkey", "signature"]]
|
|
273
244
|
},
|
|
274
245
|
"details": [
|
|
275
246
|
{
|
package/test/fixtures/p2wsh.json
CHANGED
|
@@ -296,9 +296,7 @@
|
|
|
296
296
|
"output": "OP_TRUE",
|
|
297
297
|
"input": "OP_0"
|
|
298
298
|
},
|
|
299
|
-
"witness": [
|
|
300
|
-
"02ffff"
|
|
301
|
-
]
|
|
299
|
+
"witness": ["02ffff"]
|
|
302
300
|
}
|
|
303
301
|
},
|
|
304
302
|
{
|
|
@@ -306,14 +304,9 @@
|
|
|
306
304
|
"arguments": {
|
|
307
305
|
"redeem": {
|
|
308
306
|
"output": "OP_TRUE",
|
|
309
|
-
"witness": [
|
|
310
|
-
"01"
|
|
311
|
-
]
|
|
307
|
+
"witness": ["01"]
|
|
312
308
|
},
|
|
313
|
-
"witness": [
|
|
314
|
-
"00",
|
|
315
|
-
"02ffff"
|
|
316
|
-
]
|
|
309
|
+
"witness": ["00", "02ffff"]
|
|
317
310
|
}
|
|
318
311
|
},
|
|
319
312
|
{
|
|
@@ -321,13 +314,9 @@
|
|
|
321
314
|
"arguments": {
|
|
322
315
|
"redeem": {
|
|
323
316
|
"output": "OP_TRUE",
|
|
324
|
-
"witness": [
|
|
325
|
-
"04000000ff"
|
|
326
|
-
]
|
|
317
|
+
"witness": ["04000000ff"]
|
|
327
318
|
},
|
|
328
|
-
"witness": [
|
|
329
|
-
"04000000ee"
|
|
330
|
-
]
|
|
319
|
+
"witness": ["04000000ee"]
|
|
331
320
|
}
|
|
332
321
|
},
|
|
333
322
|
{
|
|
@@ -336,9 +325,7 @@
|
|
|
336
325
|
"redeem": {
|
|
337
326
|
"output": "OP_TRUE",
|
|
338
327
|
"input": "01",
|
|
339
|
-
"witness": [
|
|
340
|
-
"01"
|
|
341
|
-
]
|
|
328
|
+
"witness": ["01"]
|
|
342
329
|
}
|
|
343
330
|
}
|
|
344
331
|
},
|
|
@@ -405,50 +392,18 @@
|
|
|
405
392
|
],
|
|
406
393
|
"dynamic": {
|
|
407
394
|
"depends": {
|
|
408
|
-
"address": [
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
]
|
|
415
|
-
"hash": [
|
|
416
|
-
"address",
|
|
417
|
-
"output",
|
|
418
|
-
"hash",
|
|
419
|
-
"redeem.output",
|
|
420
|
-
"witness"
|
|
421
|
-
],
|
|
422
|
-
"output": [
|
|
423
|
-
"address",
|
|
424
|
-
"output",
|
|
425
|
-
"hash",
|
|
426
|
-
"redeem.output",
|
|
427
|
-
"witness"
|
|
428
|
-
],
|
|
429
|
-
"redeem.output": [
|
|
430
|
-
"witness"
|
|
431
|
-
],
|
|
432
|
-
"redeem.input": [
|
|
433
|
-
[
|
|
434
|
-
"input",
|
|
435
|
-
"witness"
|
|
436
|
-
],
|
|
437
|
-
"witness"
|
|
438
|
-
],
|
|
439
|
-
"input": [
|
|
440
|
-
"witness"
|
|
441
|
-
],
|
|
442
|
-
"witness": [
|
|
443
|
-
"redeem"
|
|
444
|
-
]
|
|
395
|
+
"address": ["address", "output", "hash", "redeem.output", "witness"],
|
|
396
|
+
"hash": ["address", "output", "hash", "redeem.output", "witness"],
|
|
397
|
+
"output": ["address", "output", "hash", "redeem.output", "witness"],
|
|
398
|
+
"redeem.output": ["witness"],
|
|
399
|
+
"redeem.input": [["input", "witness"], "witness"],
|
|
400
|
+
"input": ["witness"],
|
|
401
|
+
"witness": ["redeem"]
|
|
445
402
|
},
|
|
446
403
|
"details": [
|
|
447
404
|
{
|
|
448
405
|
"description": "p2wsh-p2pkh",
|
|
449
|
-
"disabled": [
|
|
450
|
-
"redeem.input"
|
|
451
|
-
],
|
|
406
|
+
"disabled": ["redeem.input"],
|
|
452
407
|
"address": "bc1qusxlgq9quu27ucxs7a2fg8nv0pycdzvxsjk9npyupupxw3y892ss2cq5ar",
|
|
453
408
|
"hash": "e40df400a0e715ee60d0f754941e6c784986898684ac59849c0f026744872aa1",
|
|
454
409
|
"output": "OP_0 e40df400a0e715ee60d0f754941e6c784986898684ac59849c0f026744872aa1",
|
package/test/fixtures/psbt.json
CHANGED
|
@@ -760,9 +760,7 @@
|
|
|
760
760
|
"description": "allows signing non-whitelisted sighashtype when explicitly passed in",
|
|
761
761
|
"shouldSign": {
|
|
762
762
|
"psbt": "cHNidP8BADMBAAAAAYaq+PdOUY2PnV9kZKa82XlqrPByOqwH2TRg2+LQdqs2AAAAAAD/////AAAAAAAAAQEgAOH1BQAAAAAXqRSTNeWHqa9INvSnQ120SZeJc+6JSocBAwSBAAAAAQQWABQvLKRyDqYsPYImhD3eURpDGL10RwAA",
|
|
763
|
-
"sighashTypes": [
|
|
764
|
-
129
|
|
765
|
-
],
|
|
763
|
+
"sighashTypes": [129],
|
|
766
764
|
"inputToCheck": 0,
|
|
767
765
|
"WIF": "KxnAnQh6UJBxLF8Weup77yn8tWhLHhDhnXeyJuzmmcZA5aRdMJni"
|
|
768
766
|
}
|
|
@@ -772,9 +770,7 @@
|
|
|
772
770
|
"isTaproot": true,
|
|
773
771
|
"shouldSign": {
|
|
774
772
|
"psbt": "cHNidP8BAF4CAAAAAf17fGksrz9eKGx1nSU3RX4vcwr7bfNdQzPZ9dSEkWBcAAAAAAD/////AZBBBgAAAAAAIlEgPLBe/d3922lmXjTIt52b9NG1HFDC9jzPCTn111AG8TQAAAAAAAEBK6BoBgAAAAAAIlEgPLBe/d3922lmXjTIt52b9NG1HFDC9jzPCTn111AG8TQBAwSDAAAAARcgWzC4qnD37J3WaDEbZPRihBXdI0gN68BGutJykDcHR6wBGCDlDrX1cnzwZvmcyLBH8M6NiS9lk7JVwM58wZZVOzmuMwAA",
|
|
775
|
-
"sighashTypes": [
|
|
776
|
-
131
|
|
777
|
-
],
|
|
773
|
+
"sighashTypes": [131],
|
|
778
774
|
"inputToCheck": 0,
|
|
779
775
|
"WIF": "KypUz2y1jdgzM8HGDUx9DYLmyzd8EWhruvLX2J5iSL7MiAcc7dBG",
|
|
780
776
|
"result": "cHNidP8BAF4CAAAAAf17fGksrz9eKGx1nSU3RX4vcwr7bfNdQzPZ9dSEkWBcAAAAAAD/////AZBBBgAAAAAAIlEgPLBe/d3922lmXjTIt52b9NG1HFDC9jzPCTn111AG8TQAAAAAAAEBK6BoBgAAAAAAIlEgPLBe/d3922lmXjTIt52b9NG1HFDC9jzPCTn111AG8TQBAwSDAAAAARNBqgjqjSQVTf41zgZ1H9Lq3CKQt0nq1APST8FpwGifNjyUHMS0MbFnIxA70SXTEOoSJePyOXTW+u59fzLpxekL2oMBFyBbMLiqcPfsndZoMRtk9GKEFd0jSA3rwEa60nKQNwdHrAEYIOUOtfVyfPBm+ZzIsEfwzo2JL2WTslXAznzBllU7Oa4zAAA="
|