PageRenderTime 80ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/CHANGELOG.md

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