Skip to content

Commit 0d0c1c4

Browse files
committed
Merge branch 'master' of https://github.com/bitcoinjs/bitcoinjs-lib into typos
2 parents 4802803 + 791fa01 commit 0d0c1c4

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ Which you can then import as an ESM module:
102102
<script type="module">import "/scripts/bitcoinjs-lib.js"</script>
103103
````
104104

105+
#### Using Taproot:
106+
When utilizing Taproot features with bitcoinjs-lib, you may need to include an additional ECC (Elliptic Curve Cryptography) library. The commonly used `tiny-secp256k1` library, however, might lead to compatibility issues due to its reliance on WASM (WebAssembly). The following alternatives may be used instead, though they may be significantly slower for high volume of signing and pubkey deriving operations.
107+
108+
#### Alternatives for ECC Library:
109+
1. `@bitcoinjs-lib/tiny-secp256k1-asmjs`
110+
A version of `tiny-secp256k1` compiled to ASM.js directly from the WASM version, potentially better supported in browsers. This is the slowest option.
111+
2. `@bitcoinerlab/secp256k1`
112+
Another alternative library for ECC functionality. This requires access to the global `BigInt` primitive.
113+
For advantages and detailed comparison of these libraries, visit: [tiny-secp256k1 GitHub page](https://github.com/bitcoinjs/tiny-secp256k1).
114+
105115
**NOTE**: We use Node Maintenance LTS features, if you need strict ES5, use [`--transform babelify`](https://github.com/babel/babelify) in conjunction with your `browserify` step (using an [`es2015`](https://babeljs.io/docs/plugins/preset-es2015/) preset).
106116

107117
**WARNING**: iOS devices have [problems](https://github.com/feross/buffer/issues/136), use at least [buffer@5.0.5](https://github.com/feross/buffer/pull/155) or greater, and enforce the test suites (for `Buffer`, and any other dependency) pass before use.

src/psbt/bip371.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function checkTaprootScriptPubkey(outputData, newOutputData) {
9797
const { script: scriptPubkey } = outputData;
9898
const script = getTaprootScripPubkey(tapInternalKey, tapTree);
9999
if (scriptPubkey && !scriptPubkey.equals(script))
100-
throw new Error('Error adding output. Script or address missmatch.');
100+
throw new Error('Error adding output. Script or address mismatch.');
101101
}
102102
}
103103
function getTaprootScripPubkey(tapInternalKey, tapTree) {

test/fixtures/psbt.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@
615615
"address": "bc1p3efq8ujsj0qr5xvms7mv89p8cz0crqdtuxe9ms6grqgxc9sgsntslthf6w",
616616
"value": 410000
617617
},
618-
"exception": "Error adding output. Script or address missmatch."
618+
"exception": "Error adding output. Script or address mismatch."
619619
},
620620
{
621621
"description": "Adds taproot output with both taproot and non-taproot fields",

ts_src/psbt/bip371.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ function checkTaprootScriptPubkey(
129129
const { script: scriptPubkey } = outputData as any;
130130
const script = getTaprootScripPubkey(tapInternalKey, tapTree);
131131
if (scriptPubkey && !scriptPubkey.equals(script))
132-
throw new Error('Error adding output. Script or address missmatch.');
132+
throw new Error('Error adding output. Script or address mismatch.');
133133
}
134134
}
135135

0 commit comments

Comments
 (0)