Skip to content

Commit 097a505

Browse files
authored
Merge branch 'master' into example/multisigtaproot
2 parents c4025df + 2013f19 commit 097a505

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ __fixed__
333333

334334
# 2.1.0
335335
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.
336+
Ideally you should not have to directly access `HDNode` internals for general usage, as it can often be confusing and error prone.
337337

338338
__added__
339339
- `ECPair.prototype.getNetwork`
@@ -344,7 +344,7 @@ __added__
344344

345345

346346
# 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.
347+
In this release we have strived to simplify the API, [using native types](https://github.com/bitcoinjs/bitcoinjs-lib/issues/407) wherever possible to encourage cross-compatibility with other open source community modules.
348348

349349
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.
350350
Several other cumbersome modules have been removed, with their new independent modules recommended for usage instead for greater modularity in your projects.

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ If you'd like to use a different (more modern) build tool than `browserify`, you
9393

9494
```sh
9595
$ npm install bitcoinjs-lib browserify
96-
$ npx browserify --standalone bitcoin - -o bitcoinjs-lib.js <<<"module.exports = require('bitcoinjs-lib');"
96+
$ npx browserify --standalone bitcoin -o bitcoinjs-lib.js <<< "module.exports = require('bitcoinjs-lib');"
9797
```
9898

9999
Which you can then import as an ESM module:
@@ -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)