BitcoinJS v4.0.0 Release Notes

  • added

    • ➕ Added bip32 dependency as a primary export (#1073)
    • ➕ Added ECPair.fromPrivateKey (#1070)
    • ➕ Added payments export, with support for p2pkh, p2pk, p2ms, p2sh, p2wpkh, p2wsh and embed payment types (#1096, #1119)
    • ➕ Added script.signature.encode/decode for script signatures (#459)

    🔄 changed

    • ECPair.prototype.sign now returns a 64-byte signature Buffer, not an ECSignature object (#1084)
    • ECPair (and all ECDSA code) now uses tiny-secp256k1, which uses the libsecp256k1 library (#1070)
    • 🛠 TransactionBuilder internal variables are now __ prefixed to discourage public usage (#1038)
    • 0️⃣ TransactionBuilder now defaults to version 2 transaction versions (#1036)
    • script.decompile now returns [Buffer] or null, if decompilation failed (#1039)

    🛠 fixed

    • 🛠 Fixed TransactionBuilder rejecting uncompressed public keys to comply with BIP143 (#987)

    removed

    • ✂ Removed Node 4/5 LTS support (#1080)
    • ✂ Removed ECPair.fromPublicKeyBuffer, use ECPair.fromPublicKey (#1070)
    • ✂ Removed ECPair.prototype.getAddress, use payments.p2pkh instead (#1085)
    • ✂ Removed ECPair.prototype.getPrivateKey, use ECPair.prototype.privateKey property (#1070)
    • ✂ Removed ECPair.prototype.getPublicKey, use ECPair.prototype.publicKey property (#1070)
    • ✂ Removed ECPair.prototype.getNetwork, use ECPair.prototype.network property (#1070)
    • ✂ Removed ECSignature, use script.signature.encode/decode instead (#459)
    • ✂ Removed HDNode, use bip32 export instead (#1073)
    • ✂ Removed bufferutils (#1035)
    • ✂ Removed networks.litecoin, BYO non-Bitcoin networks instead (#1095)
    • ✂ Removed script.isCanonicalSignature, use script.isCanonicalScriptSignature instead (#1094)
    • Removed script.*.input/output/check functions (templates), use payments.* instead (templates previously added in #681, #682) (#1119)
    • ✂ Removed dependency bigi, uses bn.js internally now (via tiny-secp256k1) (#1070, #1112)
    • ✂ Removed public access to ECPair constructor, use exported functions ECPair.fromPrivateKey, ECPair.fromWIF, ECPair.makeRandom, or ECPair.fromPublicKey (#1070)