@btc-vision/bitcoin 6.3.0 → 6.3.2
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/.babelrc +4 -0
- package/.gitattributes +2 -0
- package/.nyc_output/6368a5b2-daa5-4821-8ed0-b742d6fc7eab.json +1 -0
- package/.nyc_output/processinfo/6368a5b2-daa5-4821-8ed0-b742d6fc7eab.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -0
- package/.prettierrc.json +12 -0
- package/CHANGELOG.md +403 -0
- package/CONTRIBUTING.md +83 -0
- package/browser/address.d.ts +16 -0
- package/{src → browser}/bip66.d.ts +6 -7
- package/{src → browser}/block.d.ts +29 -30
- package/{src → browser}/bufferutils.d.ts +34 -54
- package/browser/crypto/crypto.d.ts +1 -0
- package/{src → browser}/crypto.d.ts +13 -18
- package/browser/ecc_lib.d.ts +3 -0
- package/browser/hooks/AdvancedSignatureManager.d.ts +16 -0
- package/{src → browser}/hooks/HookedSigner.d.ts +4 -4
- package/browser/hooks/SignatureManager.d.ts +13 -0
- package/browser/index.d.ts +58 -0
- package/browser/index.js +2 -0
- package/browser/index.js.LICENSE.txt +14 -0
- package/browser/merkle.d.ts +1 -0
- package/browser/networks.d.ts +23 -0
- package/{src → browser}/ops.d.ts +126 -126
- package/browser/payments/bip341.d.ts +23 -0
- package/browser/payments/embed.d.ts +2 -0
- package/browser/payments/index.d.ts +41 -0
- package/{src → browser}/payments/lazy.d.ts +2 -2
- package/browser/payments/p2ms.d.ts +2 -0
- package/browser/payments/p2pk.d.ts +2 -0
- package/browser/payments/p2pkh.d.ts +2 -0
- package/browser/payments/p2sh.d.ts +2 -0
- package/browser/payments/p2tr.d.ts +2 -0
- package/browser/payments/p2wpkh.d.ts +2 -0
- package/browser/payments/p2wsh.d.ts +2 -0
- package/browser/psbt/bip371.d.ts +16 -0
- package/browser/psbt/psbtutils.d.ts +26 -0
- package/{src → browser}/psbt.d.ts +167 -235
- package/browser/push_data.d.ts +7 -0
- package/browser/script.d.ts +17 -0
- package/browser/script_number.d.ts +2 -0
- package/browser/script_signature.d.ts +7 -0
- package/{src → browser}/transaction.d.ts +48 -60
- package/{src → browser}/types.d.ts +37 -54
- package/build/address.d.ts +16 -0
- package/build/address.js +148 -0
- package/build/bip66.d.ts +6 -0
- package/build/bip66.js +99 -0
- package/build/block.d.ts +29 -0
- package/build/block.js +181 -0
- package/build/bufferutils.d.ts +34 -0
- package/build/bufferutils.js +141 -0
- package/build/crypto/crypto.d.ts +1 -0
- package/build/crypto/crypto.js +1 -0
- package/build/crypto.d.ts +13 -0
- package/build/crypto.js +87 -0
- package/build/ecc_lib.d.ts +3 -0
- package/build/ecc_lib.js +61 -0
- package/build/hooks/AdvancedSignatureManager.d.ts +16 -0
- package/build/hooks/AdvancedSignatureManager.js +52 -0
- package/build/hooks/HookedSigner.d.ts +4 -0
- package/build/hooks/HookedSigner.js +64 -0
- package/build/hooks/SignatureManager.d.ts +13 -0
- package/build/hooks/SignatureManager.js +45 -0
- package/build/index.d.ts +58 -0
- package/build/index.js +32 -0
- package/build/merkle.d.ts +1 -0
- package/build/merkle.js +19 -0
- package/build/networks.d.ts +23 -0
- package/build/networks.js +121 -0
- package/build/ops.d.ts +126 -0
- package/{src → build}/ops.js +127 -131
- package/build/payments/bip341.d.ts +23 -0
- package/build/payments/bip341.js +82 -0
- package/build/payments/embed.d.ts +2 -0
- package/build/payments/embed.js +39 -0
- package/build/payments/index.d.ts +41 -0
- package/build/payments/index.js +10 -0
- package/build/payments/lazy.d.ts +2 -0
- package/{src → build}/payments/lazy.js +28 -32
- package/build/payments/p2ms.d.ts +2 -0
- package/{src → build}/payments/p2ms.js +128 -158
- package/build/payments/p2pk.d.ts +2 -0
- package/build/payments/p2pk.js +68 -0
- package/build/payments/p2pkh.d.ts +2 -0
- package/build/payments/p2pkh.js +135 -0
- package/build/payments/p2sh.d.ts +2 -0
- package/build/payments/p2sh.js +175 -0
- package/build/payments/p2tr.d.ts +2 -0
- package/build/payments/p2tr.js +254 -0
- package/build/payments/p2wpkh.d.ts +2 -0
- package/build/payments/p2wpkh.js +130 -0
- package/build/payments/p2wsh.d.ts +2 -0
- package/build/payments/p2wsh.js +180 -0
- package/build/psbt/bip371.d.ts +16 -0
- package/build/psbt/bip371.js +246 -0
- package/build/psbt/psbtutils.d.ts +26 -0
- package/build/psbt/psbtutils.js +170 -0
- package/build/psbt.d.ts +167 -0
- package/build/psbt.js +1305 -0
- package/build/push_data.d.ts +7 -0
- package/build/push_data.js +57 -0
- package/build/script.d.ts +17 -0
- package/build/script.js +167 -0
- package/build/script_number.d.ts +2 -0
- package/build/script_number.js +49 -0
- package/build/script_signature.d.ts +7 -0
- package/build/script_signature.js +49 -0
- package/build/transaction.d.ts +48 -0
- package/build/transaction.js +445 -0
- package/build/types.d.ts +37 -0
- package/build/types.js +73 -0
- package/cjs/package.json +3 -0
- package/eslint.config.js +56 -0
- package/gulpfile.js +42 -0
- package/package.json +105 -50
- package/src/{address.js → address.ts} +93 -73
- package/src/{bip66.js → bip66.ts} +23 -19
- package/src/{block.js → block.ts} +114 -105
- package/src/{bufferutils.js → bufferutils.ts} +65 -67
- package/src/crypto/crypto-browser.js +75 -0
- package/src/crypto/crypto.ts +1 -0
- package/src/crypto.ts +108 -0
- package/src/{ecc_lib.js → ecc_lib.ts} +25 -53
- package/src/hooks/{AdvancedSignatureManager.js → AdvancedSignatureManager.ts} +34 -18
- package/src/hooks/HookedSigner.ts +108 -0
- package/src/hooks/{SignatureManager.js → SignatureManager.ts} +26 -14
- package/src/index.ts +86 -0
- package/src/{merkle.js → merkle.ts} +8 -7
- package/src/networks.ts +235 -0
- package/src/ops.ts +282 -0
- package/src/payments/bip341.ts +140 -0
- package/src/payments/embed.ts +55 -0
- package/src/payments/{index.d.ts → index.ts} +20 -10
- package/src/payments/lazy.ts +28 -0
- package/src/payments/p2ms.ts +150 -0
- package/src/payments/{p2pk.js → p2pk.ts} +32 -29
- package/src/payments/{p2pkh.js → p2pkh.ts} +53 -47
- package/src/payments/{p2sh.js → p2sh.ts} +72 -71
- package/src/payments/{p2tr.js → p2tr.ts} +114 -125
- package/src/payments/{p2wpkh.js → p2wpkh.ts} +51 -56
- package/src/payments/{p2wsh.js → p2wsh.ts} +69 -81
- package/src/psbt/{bip371.js → bip371.ts} +195 -178
- package/src/psbt/psbtutils.ts +299 -0
- package/src/{psbt.js → psbt.ts} +1048 -699
- package/src/{push_data.js → push_data.ts} +35 -21
- package/src/{script.js → script.ts} +93 -77
- package/src/{script_number.js → script_number.ts} +15 -21
- package/src/{script_signature.js → script_signature.ts} +26 -14
- package/src/{transaction.js → transaction.ts} +247 -167
- package/src/types.ts +122 -0
- package/test/address.spec.js +124 -0
- package/test/address.spec.ts +177 -0
- package/test/bitcoin.core.spec.js +170 -0
- package/test/bitcoin.core.spec.ts +234 -0
- package/test/block.spec.js +141 -0
- package/test/block.spec.ts +194 -0
- package/test/bufferutils.spec.js +427 -0
- package/test/bufferutils.spec.ts +513 -0
- package/test/crypto.spec.js +41 -0
- package/test/crypto.spec.ts +55 -0
- package/test/fixtures/address.json +329 -0
- package/test/fixtures/block.json +148 -0
- package/test/fixtures/bufferutils.json +102 -0
- package/test/fixtures/core/README.md +26 -0
- package/test/fixtures/core/base58_encode_decode.json +50 -0
- package/test/fixtures/core/base58_keys_invalid.json +152 -0
- package/test/fixtures/core/base58_keys_valid.json +452 -0
- package/test/fixtures/core/blocks.json +27 -0
- package/test/fixtures/core/sig_canonical.json +7 -0
- package/test/fixtures/core/sig_noncanonical.json +33 -0
- package/test/fixtures/core/sighash.json +3505 -0
- package/test/fixtures/core/tx_valid.json +2023 -0
- package/test/fixtures/crypto.json +43 -0
- package/test/fixtures/ecdsa.json +217 -0
- package/test/fixtures/ecpair.json +141 -0
- package/test/fixtures/embed.json +108 -0
- package/test/fixtures/p2ms.json +434 -0
- package/test/fixtures/p2pk.json +179 -0
- package/test/fixtures/p2pkh.json +276 -0
- package/test/fixtures/p2sh.json +508 -0
- package/test/fixtures/p2tr.json +1198 -0
- package/test/fixtures/p2wpkh.json +290 -0
- package/test/fixtures/p2wsh.json +489 -0
- package/test/fixtures/psbt.json +924 -0
- package/test/fixtures/script.json +465 -0
- package/test/fixtures/script_number.json +225 -0
- package/test/fixtures/signature.json +140 -0
- package/test/fixtures/transaction.json +916 -0
- package/test/integration/_regtest.js +7 -0
- package/test/integration/_regtest.ts +6 -0
- package/test/integration/addresses.spec.js +116 -0
- package/test/integration/addresses.spec.ts +154 -0
- package/test/integration/bip32.spec.js +85 -0
- package/test/integration/bip32.spec.ts +151 -0
- package/test/integration/blocks.spec.js +26 -0
- package/test/integration/blocks.spec.ts +28 -0
- package/test/integration/cltv.spec.js +199 -0
- package/test/integration/cltv.spec.ts +283 -0
- package/test/integration/csv.spec.js +362 -0
- package/test/integration/csv.spec.ts +527 -0
- package/test/integration/payments.spec.js +98 -0
- package/test/integration/payments.spec.ts +135 -0
- package/test/integration/taproot.spec.js +532 -0
- package/test/integration/taproot.spec.ts +707 -0
- package/test/integration/transactions.spec.js +561 -0
- package/test/integration/transactions.spec.ts +769 -0
- package/test/payments.spec.js +97 -0
- package/test/payments.spec.ts +125 -0
- package/test/payments.utils.js +190 -0
- package/test/payments.utils.ts +208 -0
- package/test/psbt.spec.js +1044 -0
- package/test/psbt.spec.ts +1414 -0
- package/test/script.spec.js +151 -0
- package/test/script.spec.ts +210 -0
- package/test/script_number.spec.js +24 -0
- package/test/script_number.spec.ts +29 -0
- package/test/script_signature.spec.js +52 -0
- package/test/script_signature.spec.ts +66 -0
- package/test/transaction.spec.js +269 -0
- package/test/transaction.spec.ts +387 -0
- package/test/ts-node-register.js +5 -0
- package/test/tsconfig.json +45 -0
- package/test/types.spec.js +46 -0
- package/test/types.spec.ts +58 -0
- package/tsconfig.base.json +27 -0
- package/tsconfig.json +19 -0
- package/tsconfig.webpack.json +18 -0
- package/webpack.config.js +79 -0
- package/src/address.d.ts +0 -42
- package/src/crypto.js +0 -128
- package/src/ecc_lib.d.ts +0 -17
- package/src/hooks/AdvancedSignatureManager.d.ts +0 -44
- package/src/hooks/HookedSigner.js +0 -90
- package/src/hooks/SignatureManager.d.ts +0 -35
- package/src/index.d.ts +0 -42
- package/src/index.js +0 -87
- package/src/merkle.d.ts +0 -10
- package/src/networks.d.ts +0 -29
- package/src/networks.js +0 -71
- package/src/payments/bip341.d.ts +0 -49
- package/src/payments/bip341.js +0 -124
- package/src/payments/embed.d.ts +0 -9
- package/src/payments/embed.js +0 -54
- package/src/payments/index.js +0 -69
- package/src/payments/p2ms.d.ts +0 -9
- package/src/payments/p2pk.d.ts +0 -10
- package/src/payments/p2pkh.d.ts +0 -10
- package/src/payments/p2sh.d.ts +0 -10
- package/src/payments/p2tr.d.ts +0 -10
- package/src/payments/p2wpkh.d.ts +0 -10
- package/src/payments/p2wsh.d.ts +0 -10
- package/src/psbt/bip371.d.ts +0 -42
- package/src/psbt/psbtutils.d.ts +0 -64
- package/src/psbt/psbtutils.js +0 -191
- package/src/push_data.d.ts +0 -29
- package/src/script.d.ts +0 -42
- package/src/script_number.d.ts +0 -19
- package/src/script_signature.d.ts +0 -21
- package/src/types.js +0 -106
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"parent":null,"pid":78344,"argv":["C:\\Program Files\\nodejs\\node.exe","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\node_modules\\mocha\\bin\\mocha.js"],"execArgv":[],"cwd":"C:\\Users\\felix\\Desktop\\moto\\bitcoin","time":1735543317036,"ppid":66896,"coverageFilename":"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\.nyc_output\\6368a5b2-daa5-4821-8ed0-b742d6fc7eab.json","externalId":"","uuid":"6368a5b2-daa5-4821-8ed0-b742d6fc7eab","files":["C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\address.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\networks.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\index.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\embed.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\script.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\bip66.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\ops.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\push_data.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\script_number.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\script_signature.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\types.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\lazy.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\p2ms.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\p2pk.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\p2pkh.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\crypto.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\p2sh.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\p2wpkh.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\p2wsh.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\p2tr.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\ecc_lib.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\bip341.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\bufferutils.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\index.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\block.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\merkle.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\transaction.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\psbt.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\psbt\\bip371.js","C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\psbt\\psbtutils.js"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"processes":{"6368a5b2-daa5-4821-8ed0-b742d6fc7eab":{"parent":null,"children":[]}},"files":{"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\address.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\networks.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\index.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\embed.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\script.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\bip66.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\ops.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\push_data.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\script_number.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\script_signature.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\types.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\lazy.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\p2ms.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\p2pk.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\p2pkh.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\crypto.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\p2sh.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\p2wpkh.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\p2wsh.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\p2tr.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\ecc_lib.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\payments\\bip341.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\bufferutils.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\index.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\block.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\merkle.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\transaction.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\psbt.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\psbt\\bip371.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"],"C:\\Users\\felix\\Desktop\\moto\\bitcoin\\src\\psbt\\psbtutils.js":["6368a5b2-daa5-4821-8ed0-b742d6fc7eab"]},"externalIds":{}}
|
package/.prettierrc.json
ADDED
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
# 6.1.6
|
|
2
|
+
__fixed__
|
|
3
|
+
- Fix sighash treatment when signing taproot script sign scripts using Psbt (#2104)
|
|
4
|
+
- Fix error for invalid scripts in toASM (#2097)
|
|
5
|
+
- Fix mutation of input to addOutput method on Psbt (#2091)
|
|
6
|
+
|
|
7
|
+
# 6.1.5
|
|
8
|
+
__fixed__
|
|
9
|
+
- Updated bip174 dependency to fix issue with unknownKeyVals. (#1979)
|
|
10
|
+
|
|
11
|
+
# 6.1.4
|
|
12
|
+
__changed__
|
|
13
|
+
- Changed internal usage of the Buffer API to match with newer broken bundlers that don't follow spec. The new usage is still compatible with older versions of Buffer, so there shouldn't be any breakage. The public API interface was not changed. (#1975)
|
|
14
|
+
|
|
15
|
+
# 6.1.3
|
|
16
|
+
__fixed__
|
|
17
|
+
- validateSignaturesOfInput for taproot inputs returned false for valid signatures in specific cases. (#1934)
|
|
18
|
+
|
|
19
|
+
# 6.1.2
|
|
20
|
+
__fixed__
|
|
21
|
+
- validateSignaturesOfInput for taproot inputs returned true for invalid signatures in specific cases. (#1932)
|
|
22
|
+
|
|
23
|
+
# 6.1.1
|
|
24
|
+
__added__
|
|
25
|
+
- add example using BIP86 vector to verify the sending to and from a BIP86 generated taproot address
|
|
26
|
+
|
|
27
|
+
__fixed__
|
|
28
|
+
- support for 65 byte taproot signature
|
|
29
|
+
- prevent the creation of unspendable scripts in bitcoinjs-lib by implementing checks for resource limitations
|
|
30
|
+
- use `Buffer.from()` instead of `Buffer.of()`
|
|
31
|
+
|
|
32
|
+
__changed__
|
|
33
|
+
- performance: precompute the taproot hashes
|
|
34
|
+
- performance: switch from `create-hash` and `ripemd160` to noble-hashes
|
|
35
|
+
|
|
36
|
+
__removed__
|
|
37
|
+
- types: removed unused methods `privateAdd` and `privateNegate` from `TinySecp256k1Interface`
|
|
38
|
+
|
|
39
|
+
# 6.1.0
|
|
40
|
+
__added__
|
|
41
|
+
- taproot support for payments (p2tr) and PSBT. See taproot.spec.ts integration test for examples. (#1742)
|
|
42
|
+
|
|
43
|
+
# 6.0.2
|
|
44
|
+
__fixed__
|
|
45
|
+
- p2sh payment now uses empty Buffer for redeem.output when redeemScript is OP_FALSE (#1802)
|
|
46
|
+
- Fix ripemd160 hashing fallback issue (#1812)
|
|
47
|
+
|
|
48
|
+
# 6.0.1
|
|
49
|
+
- No changes to public API
|
|
50
|
+
|
|
51
|
+
# 6.0.0
|
|
52
|
+
__removed__
|
|
53
|
+
- bip32: Removed the re-export. Please add as dependency to your app instead.
|
|
54
|
+
- ECPair: Please use bip32 moving forward. ecpair package was created for those who need it.
|
|
55
|
+
- TransactionBuilder: Any internal files used only in TB (classify, templates, etc.) were also removed.
|
|
56
|
+
|
|
57
|
+
__added__
|
|
58
|
+
- taproot segwit v1 address support (bech32m) via address module (#1676)
|
|
59
|
+
- hashForWitnessV1 method on Transaction class (#1745)
|
|
60
|
+
|
|
61
|
+
__fixed__
|
|
62
|
+
- Transaction version read/write differed. (#1717)
|
|
63
|
+
|
|
64
|
+
# 5.2.0
|
|
65
|
+
__changed__
|
|
66
|
+
- Updated PSBT to allow for witnessUtxo and nonWitnessUtxo simultaneously (Re: segwit psbt bug) (#1563)
|
|
67
|
+
|
|
68
|
+
__added__
|
|
69
|
+
- PSBT methods `getInputType`, `inputHasPubkey`, `inputHasHDKey`, `outputHasPubkey`, `outputHasHDKey` (#1563)
|
|
70
|
+
|
|
71
|
+
# 5.1.10
|
|
72
|
+
__fixed__
|
|
73
|
+
- Fixed psbt.signInputAsync (and consequentially all Async signing methods) not handling rejection of keypair.sign properly (#1582)
|
|
74
|
+
|
|
75
|
+
# 5.1.9
|
|
76
|
+
__fixed__
|
|
77
|
+
- Fixed errors for psbt.txOutputs getter (#1578)
|
|
78
|
+
|
|
79
|
+
# 5.1.8
|
|
80
|
+
__fixed__
|
|
81
|
+
- Throw errors when p2wsh or p2wpkh contain uncompressed pubkeys (#1573)
|
|
82
|
+
|
|
83
|
+
__added__
|
|
84
|
+
- Add txInputs and txOutputs for Psbt (#1561)
|
|
85
|
+
|
|
86
|
+
__changed__
|
|
87
|
+
- (Not exposed) Added BufferWriter to help ease maintenance of certain forks of this library (#1533)
|
|
88
|
+
|
|
89
|
+
# 5.1.7
|
|
90
|
+
__fixed__
|
|
91
|
+
- Fixed Transaction class Output interface typing for TypeScript (#1506)
|
|
92
|
+
- Add `weight()` to Block class, add optional includeWitness arg to Transaction byteLength method (#1515)
|
|
93
|
+
- Match the old TransactionBuilder behavior of allowing for multiple instances of the same pubkey to be in a p2ms script for PSBT (#1519)
|
|
94
|
+
|
|
95
|
+
__added__
|
|
96
|
+
- Allow the API consumer to pass in the finalizer functions to allow for any type of transaction to be finalized. It places the most crucial part of transaction construction on the consumer, and should be used with caution. (#1491)
|
|
97
|
+
|
|
98
|
+
# 5.1.6
|
|
99
|
+
__fixed__
|
|
100
|
+
- `PsbtOutputExtended` did not support using the address attribute properly. It is now fixed.
|
|
101
|
+
|
|
102
|
+
# 5.1.5
|
|
103
|
+
__added__
|
|
104
|
+
- `Psbt` now has `getFee(): number` for use when all inputs are finalized. It returns the satoshi fee of the transaction. Calling getFee, getFeeRate, or extractTransaction will cache these values so if you call one after the other, the second call will return immediately.
|
|
105
|
+
|
|
106
|
+
# 5.1.4
|
|
107
|
+
__changed__
|
|
108
|
+
- `Psbt` inputs using segwit scripts can now work with nonWitnessUtxo as well as the original witnessUtxo. The reasoning for this is that nonWitnessUtxo has all the information contained in the witnessUtxo, so rejecting signing even though we have all the info we need is unnecessary. Trying to sign a non-segwit script with a witnessUtxo will still throw an Error as it should.
|
|
109
|
+
|
|
110
|
+
# 5.1.3
|
|
111
|
+
__changed__
|
|
112
|
+
- TypeScript types: Made Signer and SignerAsync use any for network since we only check for equivalence. (#1448)
|
|
113
|
+
- TypeScript types: Made the args for addInput and addOutput for Psbt actually accept updateInput and updateOutput parameters. (#1449)
|
|
114
|
+
|
|
115
|
+
# 5.1.2
|
|
116
|
+
__added__
|
|
117
|
+
- `ECPair` and `bip32` objects now have a lowR boolean attribute defaulted to false. You may set it to true to ensure that the sign method uses low R values (#1442) (This is to enable low R usage in Psbt, since we decided not to give the low R flag to the Psbt class, since it makes more sense to be an attribute of the Signer interface)
|
|
118
|
+
|
|
119
|
+
# 5.1.1
|
|
120
|
+
__changed__
|
|
121
|
+
- Name inconsistencies for Psbt class. (Quick fix)
|
|
122
|
+
|
|
123
|
+
# 5.1.0
|
|
124
|
+
__added__
|
|
125
|
+
- A new `Psbt` class for creating, distributing, combining, signing, and compiling Transactions (#1425)
|
|
126
|
+
- A `name` attribute to the Payment interface. P2SH and P2WSH are nested with `'-'` as separator, and p2ms is in the format of `'p2ms(m of n)''` all others are just hard coded. (#1433)
|
|
127
|
+
|
|
128
|
+
__changed__
|
|
129
|
+
- `TransactionBuilder`: Migrate to stricter type checks during sign by switching to a single object parameter (#1416)
|
|
130
|
+
- `tests`: Use regtest-client as separate library (#1421)
|
|
131
|
+
|
|
132
|
+
# 5.0.5
|
|
133
|
+
__added__
|
|
134
|
+
- Added `ECPairInterface` `Stack` and `StackElement` interfaces to the main index.ts export (TypeScript only affected)
|
|
135
|
+
|
|
136
|
+
# 5.0.4
|
|
137
|
+
__added__
|
|
138
|
+
- low R value support for ECPair, bip32, and TransactionBuilder (default off) via `txb.setLowR()` (#1385)
|
|
139
|
+
|
|
140
|
+
__fixed__
|
|
141
|
+
- Fixed Various TypeScript types that have been pushed out since v5.0.0 (#1388)
|
|
142
|
+
|
|
143
|
+
# 5.0.0
|
|
144
|
+
__added__
|
|
145
|
+
- TypeScript support (#1319)
|
|
146
|
+
- `Block.prototype.checkTxRoots` will check the merkleRoot and witnessCommit if it exists against the transactions array. (e52abec) (0426c66)
|
|
147
|
+
|
|
148
|
+
__changed__
|
|
149
|
+
- `Transaction.prototype.getHash` now has `forWitness?: boolean` which when true returns the hash for wtxid (a652d04)
|
|
150
|
+
- `Block.calculateMerkleRoot` now has `forWitness?: boolean` which when true returns the witness commit (a652d04)
|
|
151
|
+
|
|
152
|
+
__removed__
|
|
153
|
+
- `Block.prototype.checkMerkleRoot` was removed, please use `checkTxRoots` (0426c66)
|
|
154
|
+
|
|
155
|
+
# 4.0.5
|
|
156
|
+
__fixed__
|
|
157
|
+
- Fixed bug where Angular apps break due to lack of crypto at build time. Reverted #1373 and added (6bead5d).
|
|
158
|
+
|
|
159
|
+
# 4.0.4
|
|
160
|
+
__fixed__
|
|
161
|
+
- Fixed bug where Electron v4 breaks due to lack of `'rmd160'` alias for ripemd160 hash. (#1373)
|
|
162
|
+
|
|
163
|
+
# 4.0.3
|
|
164
|
+
__fixed__
|
|
165
|
+
- Fixed `TransactionBuilder` to require that the Transaction has outputs before signing (#1151)
|
|
166
|
+
- Fixed `payments.p2sh`, which now takes the network from the redeem attribute if one is not given in the object argument (#1232)
|
|
167
|
+
- Fixed `Block.calculateTarget` to allow for exponents up to 29 (#1285)
|
|
168
|
+
- Fixed some low priority rarely occurring bugs with multisig payments and `TransactionBuilder` multisig processing (#1307)
|
|
169
|
+
|
|
170
|
+
__added__
|
|
171
|
+
- Regtest network object to `networks` (#1261)
|
|
172
|
+
|
|
173
|
+
# 4.0.2
|
|
174
|
+
__fixed__
|
|
175
|
+
- Fixed `TransactionBuilder` not throwing when payment type validation should fail (#1195)
|
|
176
|
+
|
|
177
|
+
__removed__
|
|
178
|
+
- Removed rogue `package.json` from `src/payments` (#1216)
|
|
179
|
+
|
|
180
|
+
# 4.0.1
|
|
181
|
+
__fixed__
|
|
182
|
+
- Fixed `tiny-secp256k1` dependency version (used `ecurve`) (#1139)
|
|
183
|
+
- Fixed `TransactionBuilder` throwing when trying to sign `P2WSH(P2WPKH)` (#1135)
|
|
184
|
+
|
|
185
|
+
# 4.0.0
|
|
186
|
+
__added__
|
|
187
|
+
- Added [`bip32`](https://github.com/bitcoinjs/bip32) dependency as a primary export (#1073)
|
|
188
|
+
- Added `ECPair.fromPrivateKey` (#1070)
|
|
189
|
+
- Added `payments` export, with support for `p2pkh`, `p2pk`, `p2ms`, `p2sh`, `p2wpkh`, `p2wsh` and `embed` payment types (#1096, #1119)
|
|
190
|
+
- Added `script.signature.encode/decode` for script signatures (#459)
|
|
191
|
+
|
|
192
|
+
__changed__
|
|
193
|
+
- `ECPair.prototype.sign` now returns a 64-byte signature `Buffer`, not an `ECSignature` object (#1084)
|
|
194
|
+
- `ECPair` (and all ECDSA code) now uses [`tiny-secp256k1`](https://github.com/bitcoinjs/tiny-secp256k1), which uses the [`libsecp256k1` library](https://github.com/bitcoin-core/secp256k1) (#1070)
|
|
195
|
+
- `TransactionBuilder` internal variables are now `__` prefixed to discourage public usage (#1038)
|
|
196
|
+
- `TransactionBuilder` now defaults to version 2 transaction versions (#1036)
|
|
197
|
+
- `script.decompile` now returns `[Buffer]` or `null`, if decompilation failed (#1039)
|
|
198
|
+
|
|
199
|
+
__fixed__
|
|
200
|
+
- Fixed `TransactionBuilder` rejecting uncompressed public keys to comply with BIP143 (#987)
|
|
201
|
+
|
|
202
|
+
__removed__
|
|
203
|
+
- Removed Node 4/5 LTS support (#1080)
|
|
204
|
+
- Removed `ECPair.fromPublicKeyBuffer`, use `ECPair.fromPublicKey` (#1070)
|
|
205
|
+
- Removed `ECPair.prototype.getAddress`, use `payments.p2pkh` instead (#1085)
|
|
206
|
+
- Removed `ECPair.prototype.getPrivateKey`, use `ECPair.prototype.privateKey` property (#1070)
|
|
207
|
+
- Removed `ECPair.prototype.getPublicKey`, use `ECPair.prototype.publicKey` property (#1070)
|
|
208
|
+
- Removed `ECPair.prototype.getNetwork`, use `ECPair.prototype.network` property (#1070)
|
|
209
|
+
- Removed `ECSignature`, use `script.signature.encode/decode` instead (#459)
|
|
210
|
+
- Removed `HDNode`, use `bip32` export instead (#1073)
|
|
211
|
+
- Removed `bufferutils` (#1035)
|
|
212
|
+
- Removed `networks.litecoin`, BYO non-Bitcoin networks instead (#1095)
|
|
213
|
+
- Removed `script.isCanonicalSignature`, use `script.isCanonicalScriptSignature` instead (#1094)
|
|
214
|
+
- Removed `script.*.input/output/check` functions (`templates`), use `payments.*` instead (`templates` previously added in #681, #682) (#1119)
|
|
215
|
+
- Removed dependency `bigi`, uses `bn.js` internally now (via `tiny-secp256k1`) (#1070, #1112)
|
|
216
|
+
- Removed public access to `ECPair` constructor, use exported functions `ECPair.fromPrivateKey`, `ECPair.fromWIF`, `ECPair.makeRandom`, or `ECPair.fromPublicKey` (#1070)
|
|
217
|
+
|
|
218
|
+
# 3.3.2
|
|
219
|
+
__fixed__
|
|
220
|
+
- Fixed `decodeStack` arbitrarily supporting non-Array arguments (#942)
|
|
221
|
+
|
|
222
|
+
# 3.3.1
|
|
223
|
+
__changed__
|
|
224
|
+
- Increased the `TransactionBuilder` `maximumFeeRate` from 1000 to 2500 satoshis/byte. (#931)
|
|
225
|
+
|
|
226
|
+
# 3.3.0
|
|
227
|
+
__added__
|
|
228
|
+
- Added `ECSignature.prototype.toRSBuffer`/`ECSignature.fromRSBuffer` (#915)
|
|
229
|
+
- Added support to `TransactionBuilder` for 64-byte signatures via `.sign` (#915)
|
|
230
|
+
- Added support to `TransactionBuilder` for the `.publicKey` standard as an alternative to `.getPublicKey()` (#915)
|
|
231
|
+
|
|
232
|
+
# 3.2.1
|
|
233
|
+
__fixed__
|
|
234
|
+
- Fixed `script.scripthash.input.check` recursion (#898)
|
|
235
|
+
- Fixed `TransactionBuilder` sometimes ignoring witness value (#901)
|
|
236
|
+
- Fixed `script.witnessScriptHash.input` implementation (previously used the P2SH impl.) (#911)
|
|
237
|
+
|
|
238
|
+
# 3.2.0
|
|
239
|
+
__added__
|
|
240
|
+
- Added `address.fromBech32/toBech32` (#846)
|
|
241
|
+
|
|
242
|
+
# 3.1.0
|
|
243
|
+
__added__
|
|
244
|
+
- Added `Transaction.prototype.virtualSize` (#811)
|
|
245
|
+
- Added `Transaction.prototype.weight` (#811)
|
|
246
|
+
|
|
247
|
+
# 3.0.0
|
|
248
|
+
From this release users can expect out-of-the-box Segregated Witness support.
|
|
249
|
+
The majority of breaking changes have been in how `script` encoding/decoding occurs, with the introduction of witness stacks.
|
|
250
|
+
|
|
251
|
+
__added__
|
|
252
|
+
- Added `script.types` enums (#679)
|
|
253
|
+
- Added `script.*.*.{check,encode,decode[,encodeStack,decodeStack]}` functions (#681, #682)
|
|
254
|
+
- Added minimal `TransactionBuilder.prototype.build` absurd fee-safety (#696)
|
|
255
|
+
- Added `script.(decompile/compile)PushOnly` and `script.toStack` functions (#700)
|
|
256
|
+
- Added `Transaction.prototype.toBuffer` Segregated Witness serialization support (#684, #701)
|
|
257
|
+
- Added `Transaction.prototype.hasWitnesses` (#718)
|
|
258
|
+
- Added `script.witnessCommitment.*` template
|
|
259
|
+
- Added `TransactionBuilder.prototype.sign` now has two additional parameters, `witnessValue`, and `witnessScript`
|
|
260
|
+
- Added `Transaction.hashForWitnessV0` and `Transaction.setWitness` (5c2fdb60436714f18440dc709f0be065928c1e49)
|
|
261
|
+
|
|
262
|
+
__fixed__
|
|
263
|
+
- Fixed `script` must compile minimally (#638)
|
|
264
|
+
- Fixed `Transaction` and `Block` versions should be Int32, signed integers (#662)
|
|
265
|
+
|
|
266
|
+
__removed__
|
|
267
|
+
- Removed `ecdsa.calcPubKeyRecoveryParam`, `ecdsa.recoverPubKey` (#456)
|
|
268
|
+
- Removed `buffer-equals`/`buffer-compare` dependencies (#650)
|
|
269
|
+
- Removed `HDNode.prototype.toString` (#665)
|
|
270
|
+
- Removed `dogecoin` network (#675)
|
|
271
|
+
- Removed `message` export, moved to [`bitcoinjs-message`](https://github.com/bitcoinjs/bitcoinjs-message) (#456)
|
|
272
|
+
|
|
273
|
+
__renamed__
|
|
274
|
+
- Removed `script.*` functions in favour of `bitcoin.script.*.(input/output).(encode/decode/check)` style (#682)
|
|
275
|
+
|
|
276
|
+
# 2.3.0
|
|
277
|
+
__added__
|
|
278
|
+
- Added `HDNode.prototype.isNeutered` (#536)
|
|
279
|
+
- Added `HDNode.prototype.derivePath` (#538)
|
|
280
|
+
- Added typeforce checking for `HDNode.prototype.derive*` (#539)
|
|
281
|
+
- Added `Transaction.prototype.isCoinbase` (#578)
|
|
282
|
+
- Added `Block.prototype.checkMerkleRoot` (#580)
|
|
283
|
+
- Added `Block.calculateMerkleRoot` (#580)
|
|
284
|
+
- Added `TransactionBuilder.prototype.setVersion` (#599)
|
|
285
|
+
- Added `script.isWitnessPubKeyHashOutput` (#602)
|
|
286
|
+
- Added `script.isWitnessScriptHashOutput` (#602)
|
|
287
|
+
- Added `script.witnessPubKeyHashOutput` (#602)
|
|
288
|
+
- Added `script.witnessScriptHashOutput` (#602)
|
|
289
|
+
- Added `script.witnessScriptHashInput` (#602)
|
|
290
|
+
|
|
291
|
+
__fixed__
|
|
292
|
+
- Fixed "BIP32 is undefined" when network list given to `HDNode` but no compatible version found (#550)
|
|
293
|
+
- Fixed `writePushDataInt` output to adhere to minimal data push policy (#617)
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
# 2.2.0
|
|
297
|
+
__added__
|
|
298
|
+
- Added `Block.calculateTarget` for difficulty calculations (#509)
|
|
299
|
+
- Added `Block.prototype.checkProofOfWork` (#509)
|
|
300
|
+
- Added `opcodes.OP_CHECKLOCKTIMEVERIFY` alias for `OP_NOP2` (#511)
|
|
301
|
+
- Added `script.number.[encode/decode]` for CScriptNum-encoded `Buffer`s (#516)
|
|
302
|
+
- Added `TransactionBuilder.prototype.setLockTime` (#507)
|
|
303
|
+
|
|
304
|
+
__fixed__
|
|
305
|
+
- Bumped `typeforce` version to fix erroneous error message from `types.Hash*bit` types (#534)
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
# 2.1.4
|
|
309
|
+
__fixed__
|
|
310
|
+
- script.isPubKeyHashOutput and script.isScriptHashOutput no longer allow for non-minimal data pushes (per bitcoin/bitcoin `IsStandard` policy) (#499)
|
|
311
|
+
- TransactionBuilder.addOutput now allows for SIGHASH_SINGLE, throwing if the contract is violated (#504)
|
|
312
|
+
- remove use of `const`, use ES5 only (#502)
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
# 2.1.3
|
|
316
|
+
__fixed__
|
|
317
|
+
- Bumped typeforce to 1.5.5 (see #493)
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
# 2.1.2
|
|
321
|
+
__fixed__
|
|
322
|
+
- Add missing CHANGELOG entry for 2.1.1
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
# 2.1.1
|
|
326
|
+
__changed__
|
|
327
|
+
- removed use of `buffer-reverse`, dependency only kept for `bufferutils.reverse`, to be deprecated (#478)
|
|
328
|
+
|
|
329
|
+
__fixed__
|
|
330
|
+
- `isMultisigOutput` no longer allows data chunks for `m`/`n` (#482)
|
|
331
|
+
- `isMultisigOutput`'s `n` value must now match the number of public keys (as per bitcoin/bitcoin) (#484)
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
# 2.1.0
|
|
335
|
+
From this release users should use the HDNode directly (compared to accessing `.keyPair`) when performing ECDSA operations such as `sign` or `verify`.
|
|
336
|
+
Ideally you shoud not have to directly access `HDNode` internals for general usage, as it can often be confusing and error prone.
|
|
337
|
+
|
|
338
|
+
__added__
|
|
339
|
+
- `ECPair.prototype.getNetwork`
|
|
340
|
+
- `HDNode.prototype.getNetwork`, wraps the underlying keyPair's `getNetwork` method
|
|
341
|
+
- `HDNode.prototype.getPublicKeyBuffer`, wraps the underlying keyPair's `getPublicKeyBuffer` method
|
|
342
|
+
- `HDNode.prototype.sign`, wraps the underlying keyPair's `sign` method
|
|
343
|
+
- `HDNode.prototype.verify`, wraps the underlying keyPair's `verify` method
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
# 2.0.0
|
|
347
|
+
In this release we have strived to simplify the API, [using native types](https://github.com/bitcoinjs/bitcoinjs-lib/issues/407) wherevever possible to encourage cross-compatibility with other open source community modules.
|
|
348
|
+
|
|
349
|
+
The `ecdsa` module has been removed in lieu of using a new ECDSA module (for performance and safety reasons) during the `2.x.y` major release.
|
|
350
|
+
Several other cumbersome modules have been removed, with their new independent modules recommended for usage instead for greater modularity in your projects.
|
|
351
|
+
|
|
352
|
+
-----------------------------
|
|
353
|
+
|
|
354
|
+
Backward incompatible changes:
|
|
355
|
+
|
|
356
|
+
__added__
|
|
357
|
+
- export `address`, for `address` based [utility functions](https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/src/address.js), most compatible, just without `Address` instantiation, see #401, #444
|
|
358
|
+
- export `script`, for `script` based [utility functions](https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/src/script.js), mostly compatible, just without `Script` instantiation, see #438, #444
|
|
359
|
+
- export `ECPair`, a merged replacement for `ECKey`/`ECPubKey`, invalid types will throw via `typeforce`
|
|
360
|
+
|
|
361
|
+
__changed__
|
|
362
|
+
- `address.toOutputScript`, `ECPair.prototype.fromWIF` and `HDNode.prototype.fromBase58` no longer automatically detect the network, `networks.bitcoin` is always assumed unless given.
|
|
363
|
+
- `assert` was used for type checking, now replaced by `typeforce`
|
|
364
|
+
- `BIP66` compliant strict DER signature validation was added to `ECSignature.fromDER`, changing the exact exception messages slightly, see #448.
|
|
365
|
+
|
|
366
|
+
- `new HDNode(d/Q, chainCode, network)` -> `new HDNode(keyPair, chainCode)`, now uses `ECPair`
|
|
367
|
+
- `HDNode.prototype.toBase58(false)` -> `HDNode.prototype.neutered().toBase58()` for exporting an extended public key
|
|
368
|
+
- `HDNode.prototype.toBase58(true)` -> `HDNode.prototype.toBase58()` for exporting an extended private key
|
|
369
|
+
|
|
370
|
+
- `Transaction.prototype.hashForSignature(prevOutScript, inIndex, hashType)` -> `Transaction.prototype.hashForSignature(inIndex, prevOutScript, hashType)`
|
|
371
|
+
- `Transaction.prototype.addInput(hash, ...)`: `hash` could be a string, Transaction or Buffer -> `hash` can now **only** be a `Buffer`.
|
|
372
|
+
- `Transaction.prototype.addOutput(scriptPubKey, ...)`: `scriptPubKey ` could be a string, `Address` or a `Buffer` -> `scriptPubKey` can now **only** be a `Buffer`.
|
|
373
|
+
- `TransactionBuilder` API unchanged.
|
|
374
|
+
|
|
375
|
+
__removed__
|
|
376
|
+
- export `Address`, `strings` are now used, benchwith no performance loss for most use cases
|
|
377
|
+
- export `base58check`, use [`bs58check`](https://github.com/bitcoinjs/bs58check) instead
|
|
378
|
+
- export `ecdsa`, use [`ecurve`](https://github.com/cryptocoinjs/ecurve) instead
|
|
379
|
+
- export `ECKey`, use new export `ECPair` instead
|
|
380
|
+
- export `ECPubKey`, use new export `ECPair` instead
|
|
381
|
+
- export `Wallet`, see README.md#complementing-libraries instead
|
|
382
|
+
- export `Script`, use new utility export `script` instead (#438 for more information)
|
|
383
|
+
|
|
384
|
+
- `crypto.HmacSHA256 `, use [node crypto](https://nodejs.org/api/crypto.html) instead
|
|
385
|
+
- `crypto.HmacSHA512 `, use [node crypto](https://nodejs.org/api/crypto.html) instead
|
|
386
|
+
|
|
387
|
+
- `Transaction.prototype.sign`, use `TransactionBuilder.prototype.sign`
|
|
388
|
+
- `Transaction.prototype.signInput`, use `TransactionBuilder.prototype.sign`
|
|
389
|
+
- `Transaction.prototype.validateInput`, use `Transaction.prototype.hashForSignature` and `ECPair.verify`
|
|
390
|
+
|
|
391
|
+
- `HDNode.fromBuffer`, use `HDNode.fromBase58` instead
|
|
392
|
+
- `HDNode.fromHex`, use `HDNode.fromBase58` instead
|
|
393
|
+
- `HDNode.toBuffer`, use `HDNode.prototype.toBase58` instead
|
|
394
|
+
- `HDNode.toHex`, use `HDNode.prototype.toBase58` instead
|
|
395
|
+
|
|
396
|
+
- `networks.*.magic`, see the comment [here](https://github.com/bitcoinjs/bitcoinjs-lib/pull/432/files#r36715792)
|
|
397
|
+
- `networks.[viacoin|viacointestnet|gamerscoin|jumbucks|zetacoin]`, import these yourself (see #383/a0e6ee7)
|
|
398
|
+
- `networks.*.estimateFee`, out-dated
|
|
399
|
+
|
|
400
|
+
__renamed__
|
|
401
|
+
- `Message` -> `message`
|
|
402
|
+
- `scripts` -> `script`
|
|
403
|
+
- `scripts.dataOutput ` -> `script.nullDataOutput` (per [convention](https://org/en/glossary/null-data-transaction))
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
|
|
2
|
+
[//]: # (This is partially derived from https://github.com/bitcoin/bitcoin/blob/6579d80572d2d33aceabbd3db45a6a9f809aa5e3/CONTRIBUTING.md)
|
|
3
|
+
|
|
4
|
+
# Contributing to bitcoinjs-lib
|
|
5
|
+
Firstly in terms of structure, there is no particular concept of "bitcoinjs developers" in a sense of privileged people.
|
|
6
|
+
Open source revolves around a meritocracy where contributors who help gain trust from the community.
|
|
7
|
+
|
|
8
|
+
For practical purpose, there are repository "maintainers" who are responsible for merging pull requests.
|
|
9
|
+
|
|
10
|
+
We are always accepting of pull requests, but we do adhere to specific standards in regards to coding style, test driven development and commit messages.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Communication Channels
|
|
14
|
+
GitHub is the preferred method of communication between members.
|
|
15
|
+
|
|
16
|
+
Otherwise, in order of preference:
|
|
17
|
+
* #bitcoinjs-dev:matrix.org on Matrix (A part of the #bitcoinjs-space:matrix.org "Space")
|
|
18
|
+
* #bitcoinjs on libera.chat IRC
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## Workflow
|
|
22
|
+
The codebase is maintained using the "contributor workflow" where everyone without exception contributes patch proposals using "pull requests".
|
|
23
|
+
This facilitates social contribution, easy testing and peer review.
|
|
24
|
+
|
|
25
|
+
To contribute a patch, the workflow is as follows:
|
|
26
|
+
|
|
27
|
+
1. Fork repository
|
|
28
|
+
1. Create topic branch
|
|
29
|
+
1. Commit patches
|
|
30
|
+
1. Push changes to your fork
|
|
31
|
+
1. Submit a pull request to https://github.com/bitcoinjs/bitcoinjs-lib
|
|
32
|
+
|
|
33
|
+
[Commits should be atomic](https://en.wikipedia.org/wiki/Atomic_commit#Atomic_commit_convention) and diffs easy to read.
|
|
34
|
+
|
|
35
|
+
If your pull request is accepted for merging, you may be asked by a maintainer to squash and or [rebase](https://git-scm.com/docs/git-rebase) your commits before it is merged.
|
|
36
|
+
|
|
37
|
+
Please refrain from creating several pull requests for the same change.
|
|
38
|
+
|
|
39
|
+
Patchsets should be focused:
|
|
40
|
+
|
|
41
|
+
* Adding a feature, or
|
|
42
|
+
* Fixing a bug, or
|
|
43
|
+
* Refactoring code.
|
|
44
|
+
|
|
45
|
+
If you combine these, the PR may be rejected or asked to be split up.
|
|
46
|
+
|
|
47
|
+
The length of time required for peer review is unpredictable and will vary from pull request to pull request.
|
|
48
|
+
|
|
49
|
+
Refer to the [Git manual](https://git-scm.com/doc) for any information about `git`.
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## Regarding TypeScript
|
|
53
|
+
This library is written in TypeScript with eslint, prettier, and the tsc transpiler. These tools will help during testing to notice improper logic before committing and sending a pull request.
|
|
54
|
+
|
|
55
|
+
Some rules regarding TypeScript:
|
|
56
|
+
|
|
57
|
+
* Modify the typescript source code in an IDE that will give you warnings for transpile/lint errors.
|
|
58
|
+
* Once you are done with the modifications, run `npm run format` then `npm test`
|
|
59
|
+
* Running the tests will transpile the ts files into js and d.ts files.
|
|
60
|
+
* Use `git diff` or other tools to verify that the ts and js are changing the same parts.
|
|
61
|
+
* Commit all changes to ts, js, and d.ts files.
|
|
62
|
+
* Add tests where necessary.
|
|
63
|
+
* Submit your pull request.
|
|
64
|
+
|
|
65
|
+
Using TypeScript is for preventing bugs while writing code, as well as automatically generating type definitions. However, the JS file diffs must be verified, and any unverified JS will not be published to npm.
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## We adhere to Bitcoin-Core policy
|
|
69
|
+
Bitcoin script payment/script templates are based on community consensus, but typically adhere to bitcoin-core node policy by default.
|
|
70
|
+
|
|
71
|
+
- `bitcoinjs.script.decompile` is consensus bound only, it does not reject based on policy.
|
|
72
|
+
- `bitcoinjs.script.compile` will try to adhere to bitcoin-core `IsStandard` policies rules. (eg. minimalpush in https://github.com/bitcoinjs/bitcoinjs-lib/pull/638)
|
|
73
|
+
|
|
74
|
+
Any elliptic curve `sign` operations should adhere to `IsStandard` policies, like `LOW_S`, but `verify` should not reject them [by default].
|
|
75
|
+
|
|
76
|
+
If you need non-standard rejecting `decoding`, you should use an external module, not this library.
|
|
77
|
+
|
|
78
|
+
#### TLDR
|
|
79
|
+
Where "standards compliant" refers to the default policies of bitcoin-core, we adhere to the following:
|
|
80
|
+
- Any "creation" event must create standards-compliant data (standards bound)
|
|
81
|
+
- Any "validation" event must allow for non-standards compliant data (consensus bound)
|
|
82
|
+
|
|
83
|
+
For stricter validation, use an external module which we [may have] provided.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Network } from './networks.js';
|
|
2
|
+
export interface Base58CheckResult {
|
|
3
|
+
hash: Buffer;
|
|
4
|
+
version: number;
|
|
5
|
+
}
|
|
6
|
+
export interface Bech32Result {
|
|
7
|
+
version: number;
|
|
8
|
+
prefix: string;
|
|
9
|
+
data: Buffer;
|
|
10
|
+
}
|
|
11
|
+
export declare function fromBase58Check(address: string): Base58CheckResult;
|
|
12
|
+
export declare function fromBech32(address: string): Bech32Result;
|
|
13
|
+
export declare function toBase58Check(hash: Buffer, version: number): string;
|
|
14
|
+
export declare function toBech32(data: Buffer, version: number, prefix: string): string;
|
|
15
|
+
export declare function fromOutputScript(output: Buffer, network?: Network): string;
|
|
16
|
+
export declare function toOutputScript(address: string, network?: Network): Buffer;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare function encode(r: Buffer, s: Buffer): Buffer;
|
|
1
|
+
export declare function check(buffer: Buffer): boolean;
|
|
2
|
+
export declare function decode(buffer: Buffer): {
|
|
3
|
+
r: Buffer;
|
|
4
|
+
s: Buffer;
|
|
5
|
+
};
|
|
6
|
+
export declare function encode(r: Buffer, s: Buffer): Buffer;
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
static
|
|
13
|
-
static
|
|
14
|
-
static
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
private
|
|
29
|
-
|
|
30
|
-
}
|
|
1
|
+
import { Transaction } from './transaction.js';
|
|
2
|
+
export declare class Block {
|
|
3
|
+
version: number;
|
|
4
|
+
prevHash?: Buffer;
|
|
5
|
+
merkleRoot?: Buffer;
|
|
6
|
+
timestamp: number;
|
|
7
|
+
witnessCommit?: Buffer;
|
|
8
|
+
bits: number;
|
|
9
|
+
nonce: number;
|
|
10
|
+
transactions?: Transaction[];
|
|
11
|
+
static fromBuffer(buffer: Buffer): Block;
|
|
12
|
+
static fromHex(hex: string): Block;
|
|
13
|
+
static calculateTarget(bits: number): Buffer;
|
|
14
|
+
static calculateMerkleRoot(transactions: Transaction[], forWitness?: boolean): Buffer;
|
|
15
|
+
getWitnessCommit(): Buffer | null;
|
|
16
|
+
hasWitnessCommit(): boolean;
|
|
17
|
+
hasWitness(): boolean;
|
|
18
|
+
weight(): number;
|
|
19
|
+
byteLength(headersOnly?: boolean, allowWitness?: boolean): number;
|
|
20
|
+
getHash(): Buffer;
|
|
21
|
+
getId(): string;
|
|
22
|
+
getUTCDate(): Date;
|
|
23
|
+
toBuffer(headersOnly?: boolean): Buffer;
|
|
24
|
+
toHex(headersOnly?: boolean): string;
|
|
25
|
+
checkTxRoots(): boolean;
|
|
26
|
+
checkProofOfWork(): boolean;
|
|
27
|
+
private __checkMerkleRoot;
|
|
28
|
+
private __checkWitnessCommit;
|
|
29
|
+
}
|