UNPKG

15.3 kBMarkdownView Raw
1# 5.1.5
2__added__
3- `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.
4
5# 5.1.4
6__changed__
7- `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.
8
9# 5.1.3
10__changed__
11- TypeScript types: Made Signer and SignerAsync use any for network since we only check for equivalence. (#1448)
12- TypeScript types: Made the args for addInput and addOutput for Psbt actually accept updateInput and updateOutput parameters. (#1449)
13
14# 5.1.2
15__added__
16- `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)
17
18# 5.1.1
19__changed__
20- Name inconsistencies for Psbt class. (Quick fix)
21
22# 5.1.0
23__added__
24- A new `Psbt` class for creating, distributing, combining, signing, and compiling Transactions (#1425)
25- 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)
26
27__changed__
28- `TransactionBuilder`: Migrate to stricter type checks during sign by switching to a single object parameter (#1416)
29- `tests`: Use regtest-client as separate library (#1421)
30
31# 5.0.5
32__added__
33- Added `ECPairInterface` `Stack` and `StackElement` interfaces to the main index.ts export (TypeScript only affected)
34
35# 5.0.4
36__added__
37- low R value support for ECPair, bip32, and TransactionBuilder (default off) via `txb.setLowR()` (#1385)
38
39__fixed__
40- Fixed Various TypeScript types that have been pushed out since v5.0.0 (#1388)
41
42# 5.0.0
43__added__
44- TypeScript support (#1319)
45- `Block.prototype.checkTxRoots` will check the merkleRoot and witnessCommit if it exists against the transactions array. (e52abec) (0426c66)
46
47__changed__
48- `Transaction.prototype.getHash` now has `forWitness?: boolean` which when true returns the hash for wtxid (a652d04)
49- `Block.calculateMerkleRoot` now has `forWitness?: boolean` which when true returns the witness commit (a652d04)
50
51__removed__
52- `Block.prototype.checkMerkleRoot` was removed, please use `checkTxRoots` (0426c66)
53
54# 4.0.5
55__fixed__
56- Fixed bug where Angular apps break due to lack of crypto at build time. Reverted #1373 and added (6bead5d).
57
58# 4.0.4
59__fixed__
60- Fixed bug where Electron v4 breaks due to lack of `'rmd160'` alias for ripemd160 hash. (#1373)
61
62# 4.0.3
63__fixed__
64- Fixed `TransactionBuilder` to require that the Transaction has outputs before signing (#1151)
65- Fixed `payments.p2sh`, which now takes the network from the redeem attribute if one is not given in the object argument (#1232)
66- Fixed `Block.calculateTarget` to allow for exponents up to 29 (#1285)
67- Fixed some low priority rarely occurring bugs with multisig payments and `TransactionBuilder` multisig processing (#1307)
68
69__added__
70- Regtest network object to `networks` (#1261)
71
72# 4.0.2
73__fixed__
74- Fixed `TransactionBuilder` not throwing when payment type validation should fail (#1195)
75
76__removed__
77- Removed rogue `package.json` from `src/payments` (#1216)
78
79# 4.0.1
80__fixed__
81- Fixed `tiny-secp256k1` dependency version (used `ecurve`) (#1139)
82- Fixed `TransactionBuilder` throwing when trying to sign `P2WSH(P2WPKH)` (#1135)
83
84# 4.0.0
85__added__
86- Added [`bip32`](https://github.com/bitcoinjs/bip32) dependency as a primary export (#1073)
87- Added `ECPair.fromPrivateKey` (#1070)
88- Added `payments` export, with support for `p2pkh`, `p2pk`, `p2ms`, `p2sh`, `p2wpkh`, `p2wsh` and `embed` payment types (#1096, #1119)
89- Added `script.signature.encode/decode` for script signatures (#459)
90
91__changed__
92- `ECPair.prototype.sign` now returns a 64-byte signature `Buffer`, not an `ECSignature` object (#1084)
93- `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)
94- `TransactionBuilder` internal variables are now `__` prefixed to discourage public usage (#1038)
95- `TransactionBuilder` now defaults to version 2 transaction versions (#1036)
96- `script.decompile` now returns `[Buffer]` or `null`, if decompilation failed (#1039)
97
98__fixed__
99- Fixed `TransactionBuilder` rejecting uncompressed public keys to comply with BIP143 (#987)
100
101__removed__
102- Removed Node 4/5 LTS support (#1080)
103- Removed `ECPair.fromPublicKeyBuffer`, use `ECPair.fromPublicKey` (#1070)
104- Removed `ECPair.prototype.getAddress`, use `payments.p2pkh` instead (#1085)
105- Removed `ECPair.prototype.getPrivateKey`, use `ECPair.prototype.privateKey` property (#1070)
106- Removed `ECPair.prototype.getPublicKey`, use `ECPair.prototype.publicKey` property (#1070)
107- Removed `ECPair.prototype.getNetwork`, use `ECPair.prototype.network` property (#1070)
108- Removed `ECSignature`, use `script.signature.encode/decode` instead (#459)
109- Removed `HDNode`, use `bip32` export instead (#1073)
110- Removed `bufferutils` (#1035)
111- Removed `networks.litecoin`, BYO non-Bitcoin networks instead (#1095)
112- Removed `script.isCanonicalSignature`, use `script.isCanonicalScriptSignature` instead (#1094)
113- Removed `script.*.input/output/check` functions (`templates`), use `payments.*` instead (`templates` previously added in #681, #682) (#1119)
114- Removed dependency `bigi`, uses `bn.js` internally now (via `tiny-secp256k1`) (#1070, #1112)
115- Removed public access to `ECPair` constructor, use exported functions `ECPair.fromPrivateKey`, `ECPair.fromWIF`, `ECPair.makeRandom`, or `ECPair.fromPublicKey` (#1070)
116
117# 3.3.2
118__fixed__
119- Fixed `decodeStack` arbitrarily supporting non-Array arguments (#942)
120
121# 3.3.1
122__changed__
123- Increased the `TransactionBuilder` `maximumFeeRate` from 1000 to 2500 satoshis/byte. (#931)
124
125# 3.3.0
126__added__
127- Added `ECSignature.prototype.toRSBuffer`/`ECSignature.fromRSBuffer` (#915)
128- Added support to `TransactionBuilder` for 64-byte signatures via `.sign` (#915)
129- Added support to `TransactionBuilder` for the `.publicKey` standard as an alternative to `.getPublicKey()` (#915)
130
131# 3.2.1
132__fixed__
133- Fixed `script.scripthash.input.check` recursion (#898)
134- Fixed `TransactionBuilder` sometimes ignoring witness value (#901)
135- Fixed `script.witnessScriptHash.input` implementation (previously used the P2SH impl.) (#911)
136
137# 3.2.0
138__added__
139- Added `address.fromBech32/toBech32` (#846)
140
141# 3.1.0
142__added__
143- Added `Transaction.prototype.virtualSize` (#811)
144- Added `Transaction.prototype.weight` (#811)
145
146# 3.0.0
147From this release users can expect out-of-the-box Segregated Witness support.
148The majority of breaking changes have been in how `script` encoding/decoding occurs, with the introduction of witness stacks.
149
150__added__
151- Added `script.types` enums (#679)
152- Added `script.*.*.{check,encode,decode[,encodeStack,decodeStack]}` functions (#681, #682)
153- Added minimal `TransactionBuilder.prototype.build` absurd fee-safety (#696)
154- Added `script.(decompile/compile)PushOnly` and `script.toStack` functions (#700)
155- Added `Transaction.prototype.toBuffer` Segregated Witness serialization support (#684, #701)
156- Added `Transaction.prototype.hasWitnesses` (#718)
157- Added `script.witnessCommitment.*` template
158- Added `TransactionBuilder.prototype.sign` now has two additional parameters, `witnessValue`, and `witnessScript`
159- Added `Transaction.hashForWitnessV0` and `Transaction.setWitness` (5c2fdb60436714f18440dc709f0be065928c1e49)
160
161__fixed__
162- Fixed `script` must compile minimally (#638)
163- Fixed `Transaction` and `Block` versions should be Int32, signed integers (#662)
164
165__removed__
166- Removed `ecdsa.calcPubKeyRecoveryParam`, `ecdsa.recoverPubKey` (#456)
167- Removed `buffer-equals`/`buffer-compare` dependencies (#650)
168- Removed `HDNode.prototype.toString` (#665)
169- Removed `dogecoin` network (#675)
170- Removed `message` export, moved to [`bitcoinjs-message`](https://github.com/bitcoinjs/bitcoinjs-message) (#456)
171
172__renamed__
173- Removed `script.*` functions in favour of `bitcoin.script.*.(input/output).(encode/decode/check)` style (#682)
174
175# 2.3.0
176__added__
177- Added `HDNode.prototype.isNeutered` (#536)
178- Added `HDNode.prototype.derivePath` (#538)
179- Added typeforce checking for `HDNode.prototype.derive*` (#539)
180- Added `Transaction.prototype.isCoinbase` (#578)
181- Added `Block.prototype.checkMerkleRoot` (#580)
182- Added `Block.calculateMerkleRoot` (#580)
183- Added `TransactionBuilder.prototype.setVersion` (#599)
184- Added `script.isWitnessPubKeyHashOutput` (#602)
185- Added `script.isWitnessScriptHashOutput` (#602)
186- Added `script.witnessPubKeyHashOutput` (#602)
187- Added `script.witnessScriptHashOutput` (#602)
188- Added `script.witnessScriptHashInput` (#602)
189
190__fixed__
191- Fixed "BIP32 is undefined" when network list given to `HDNode` but no compatible version found (#550)
192- Fixed `writePushDataInt` output to adhere to minimal data push policy (#617)
193
194
195# 2.2.0
196__added__
197- Added `Block.calculateTarget` for difficulty calculations (#509)
198- Added `Block.prototype.checkProofOfWork` (#509)
199- Added `opcodes.OP_CHECKLOCKTIMEVERIFY` alias for `OP_NOP2` (#511)
200- Added `script.number.[encode/decode]` for CScriptNum-encoded `Buffer`s (#516)
201- Added `TransactionBuilder.prototype.setLockTime` (#507)
202
203__fixed__
204- Bumped `typeforce` version to fix erroneous error message from `types.Hash*bit` types (#534)
205
206
207# 2.1.4
208__fixed__
209- script.isPubKeyHashOutput and script.isScriptHashOutput no longer allow for non-minimal data pushes (per bitcoin/bitcoin `IsStandard` policy) (#499)
210- TransactionBuilder.addOutput now allows for SIGHASH_SINGLE, throwing if the contract is violated (#504)
211- remove use of `const`, use ES5 only (#502)
212
213
214# 2.1.3
215__fixed__
216- Bumped typeforce to 1.5.5 (see #493)
217
218
219# 2.1.2
220__fixed__
221- Add missing CHANGELOG entry for 2.1.1
222
223
224# 2.1.1
225__changed__
226- removed use of `buffer-reverse`, dependency only kept for `bufferutils.reverse`, to be deprecated (#478)
227
228__fixed__
229- `isMultisigOutput` no longer allows data chunks for `m`/`n` (#482)
230- `isMultisigOutput`'s `n` value must now match the number of public keys (as per bitcoin/bitcoin) (#484)
231
232
233# 2.1.0
234From this release users should use the HDNode directly (compared to accessing `.keyPair`) when performing ECDSA operations such as `sign` or `verify`.
235Ideally you shoud not have to directly access `HDNode` internals for general usage, as it can often be confusing and error prone.
236
237__added__
238- `ECPair.prototype.getNetwork`
239- `HDNode.prototype.getNetwork`, wraps the underyling keyPair's `getNetwork` method
240- `HDNode.prototype.getPublicKeyBuffer`, wraps the underyling keyPair's `getPublicKeyBuffer` method
241- `HDNode.prototype.sign`, wraps the underlying keyPair's `sign` method
242- `HDNode.prototype.verify`, wraps the underlying keyPair's `verify` method
243
244
245# 2.0.0
246In 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.
247
248The `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.
249Several other cumbersome modules have been removed, with their new independent modules recommended for usage instead for greater modularity in your projects.
250
251-----------------------------
252
253Backward incompatible changes:
254
255__added__
256- 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
257- 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
258- export `ECPair`, a merged replacement for `ECKey`/`ECPubKey`, invalid types will throw via `typeforce`
259
260__changed__
261- `address.toOutputScript`, `ECPair.prototype.fromWIF` and `HDNode.prototype.fromBase58` no longer automatically detect the network, `networks.bitcoin` is always assumed unless given.
262- `assert` was used for type checking, now replaced by `typeforce`
263- `BIP66` compliant strict DER signature validation was added to `ECSignature.fromDER`, changing the exact exception messages slightly, see #448.
264
265- `new HDNode(d/Q, chainCode, network)` -> `new HDNode(keyPair, chainCode)`, now uses `ECPair`
266- `HDNode.prototype.toBase58(false)` -> `HDNode.prototype.neutered().toBase58()` for exporting an extended public key
267- `HDNode.prototype.toBase58(true)` -> `HDNode.prototype.toBase58()` for exporting an extended private key
268
269- `Transaction.prototype.hashForSignature(prevOutScript, inIndex, hashType)` -> `Transaction.prototype.hashForSignature(inIndex, prevOutScript, hashType)`
270- `Transaction.prototype.addInput(hash, ...)`: `hash` could be a string, Transaction or Buffer -> `hash` can now **only** be a `Buffer`.
271- `Transaction.prototype.addOutput(scriptPubKey, ...)`: `scriptPubKey ` could be a string, `Address` or a `Buffer` -> `scriptPubKey` can now **only** be a `Buffer`.
272- `TransactionBuilder` API unchanged.
273
274__removed__
275- export `Address`, `strings` are now used, benchwith no performance loss for most use cases
276- export `base58check`, use [`bs58check`](https://github.com/bitcoinjs/bs58check) instead
277- export `ecdsa`, use [`ecurve`](https://github.com/cryptocoinjs/ecurve) instead
278- export `ECKey`, use new export `ECPair` instead
279- export `ECPubKey`, use new export `ECPair` instead
280- export `Wallet`, see README.md#complementing-libraries instead
281- export `Script`, use new utility export `script` instead (#438 for more information)
282
283- `crypto.HmacSHA256 `, use [node crypto](https://nodejs.org/api/crypto.html) instead
284- `crypto.HmacSHA512 `, use [node crypto](https://nodejs.org/api/crypto.html) instead
285
286- `Transaction.prototype.sign`, use `TransactionBuilder.prototype.sign`
287- `Transaction.prototype.signInput`, use `TransactionBuilder.prototype.sign`
288- `Transaction.prototype.validateInput`, use `Transaction.prototype.hashForSignature` and `ECPair.verify`
289
290- `HDNode.fromBuffer`, use `HDNode.fromBase58` instead
291- `HDNode.fromHex`, use `HDNode.fromBase58` instead
292- `HDNode.toBuffer`, use `HDNode.prototype.toBase58` instead
293- `HDNode.toHex`, use `HDNode.prototype.toBase58` instead
294
295- `networks.*.magic`, see the comment [here](https://github.com/bitcoinjs/bitcoinjs-lib/pull/432/files#r36715792)
296- `networks.[viacoin|viacointestnet|gamerscoin|jumbucks|zetacoin]`, import these yourself (see #383/a0e6ee7)
297- `networks.*.estimateFee`, out-dated
298
299__renamed__
300- `Message` -> `message`
301- `scripts` -> `script`
302- `scripts.dataOutput ` -> `script.nullDataOutput` (per [convention](https://org/en/glossary/null-data-transaction))