All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Further optimise performance of getting public keys (#218)
- Tweak precompute window size for
secp256k1(#217)- This can improve performance on some devices.
- Add
fromSeedfunction toSLIP10Node,BIP44Node,BIP44CoinTypeNode(#212)- This is only supported for
secp256k1anded25519at the moment.
- This is only supported for
- Optimise performance of getting public keys (#213)
- Public keys are now re-used when possible, or lazily computed otherwise.
- Tweak precompute window size for
ed25519(#209)- This can improve performance on some devices.
- Bump
@metamask/utilsfrom^10.0.1to^11.0.1(#205)
- Export
CryptographicFunctionstype (#202)
- Add network property to
SLIP10Node,BIP44Node, andBIP44CoinTypeNode(#200)- The network property is only used to determine which BIP-32 extended key version to use.
- For backwards compatibility, the property is optional, and defaults to
mainnet.
- Add option for custom cryptographic functions (#197)
- It's now possible to specify custom functions (
hmacSha512andpbkdf2Sha512) to improve performance.
- It's now possible to specify custom functions (
- Add
extendedKeyproperty toSLIP10Node(#196)- This property can only be accessed on
SLIP10Nodes usingsecp256k1.
- This property can only be accessed on
- BREAKING: Bump minimum Node version to
18.20(#198) - Use WebCrypto API if available (#197)
- Bump
@metamask/utilsfrom9.0.0to9.3.0(#191)
- Bump
@metamask/utilsfrom^8.3.0to^9.0.0(#181)
- Fix ESM imports (#177)
- Add support for Cardano key derivation according to CIP3-Icarus (#158, #170, #171, #172)
- Export
getBIP44CoinTypeToAddressPathTuplefunction (#173)
- Replace
@noble/ed25519and@noble/secp256k1with@noble/curves(#154) - Bump several MetaMask dependencies (#151, #165, #167)
- BREAKING: Disallow importing from
./distpaths (#147) - Export
mnemonicPhraseToBytesandcreateBip39KeyFromSeed(#149)
- Add support for Node.js with ESM (#147)
- Remove
postinstallscript (#146)- This caused installation to fail.
- BREAKING: Build the package as both CJS and ESM (#140)
- Distribution files have been moved from
disttodist/cjs(anddist/esm). If you are explicitly importing fromdist, you have to update the import.
- Distribution files have been moved from
- Bump
@metamask/utilsto6.2.0(#140)
- Fix
isValidBIP32PathSegmentto correctly check if BIP-32 path segment is<= 2^31-1(#134)
- Add
isValidBIP32PathSegmentfunction (#131)
- Bump
@metamask/utilsto6.0.1(#132)
- BREAKING: Add SLIP-10 (
slip10:) path type (#124)bip32:can no longer be used to derive ed25519 keys
- Handle errors when resulting public or private key is invalid (#120)
- Rather than throwing an error, a new key will be derived instead, as per the SLIP-10 or BIP-32 specification
- Improve extended key validation (#121)
- Validate that master private key and seed are within bounds (#118)
- Allow zero private key for
ed25519(#122)- Previously a zero private key
0x000..000would be rejected when using ed25519, but all private keys are valid for ed25519
- Previously a zero private key
- Add missing curve parameter (#110)
- This fixes a bug introduced in 6.2.0, when using the ed25519 curve.
- Accept BIP-39 secret recovery phrase as Uint8Array (#107)
- Secret recovery phrases are now accepted both as a string in the
bip39:...format, and asUint8Arrayin the format used by@metamask/scure-bip39, in all functions that accept secret recovery phrases.
- Secret recovery phrases are now accepted both as a string in the
- Update BIP-39 implementation from
@scure/bip39to MetaMask fork version@metamask/scure-bip39(#101)- The
@metamask/scure-bip39fork accepts secret recovery phrases inUint8Arrayformat making it possible to use more secure patterns of passing secret recovery phrases around. This change is non-breaking however, as themnemonicToSeedfunction used in this package still accepts secret recovery phrases in string format.
- The
- BREAKING: Rename all occurrences of
BufferwithBytesorUint8Array(#84)- All
[...]Bufferfields have been replaced with[...]Bytes, e.g.,BIP44Node.privateKeyBufferis nowBIP44Node.privateKeyBytes. - This change does not affect the string fields, like
BIP44Node.privateKey.
- All
- BREAKING: Swap out Buffer with browser-compatible Uint8Array (#83)
- All functions returning
Buffers now returnUint8Arrays instead.
- All functions returning
- Bump @metamask/utils to 3.3.0 (#85)
- Replace postinstall script with Yarn plugin (#74)
- Add convenience field for getting the compressed public key (#71)
- Add master fingerprint field to
SLIP10Node(#68)
- BREAKING: Bump minimum Node version to 16 and migrate to Yarn 3 (#70)
- Allow a depth larger than 5 for SLIP-10 nodes (#69)
- NOTE: This version is a significant rewrite of this package, and virtually all existing usage will break upon migrating from a previous major version. All pre-existing functionality is supported through different means, and various new features have been added.
- Add extended public (
xpub) and private (xprv) keys (#58) - Add support for public key derivation (#56)
- Add support for non-secp256k1 curves via
SLIP10Nodeclass (#43, #37, #53)- Add support for ed25519 curve.
- With this and other changes in this release, this package offers full SLIP-10 support for all curves except nist256p1.
- These changes were made possible using the
@noble/*suite of cryptography packages.
- Add extended key to BIP-44 coin type node (#59)
- Add convenience methods to get public keys and addresses (#50)
- Enable deriving hardened
changeandaddress_indexusingBIP44CoinTypeNode(#37)
- BREAKING: Change key representation format (#58, #54)
- Encode string keys in hexadecimal instead of Base64.
- Always return a
SLIP10Node(or child class) object from derivation functions.
- BREAKING: Separate private keys and chain code into separate fields (#54)
- BREAKING: Use named arguments instead of positional arguments in various functions (#56)
- BREAKING: Make all derivation functions async (#43, #54)
- All key derivation functions are now async, and node objects are initialized via a static, async
.from(...)method. This is because some cryptographic dependencies are async.
- All key derivation functions are now async, and node objects are initialized via a static, async
- Update documentation to match new implementation (#60, #49)
- BREAKING: Refactor package API (#25)
- The new API is designed to make it harder to derive incorrect keys.
- The previous exports of this package can no longer be accessed from the main entry file.
- For the new API, please see the README.
- BREAKING: Bump minimum Node.js version to >=12.0.0 (#20)
- Add reference implementation tests (#25)
- The key derivation of this package is now tested against the BIP-32 specification and
ethereumjs-walletand@metamask/eth-hd-keyring. - The key derivation was found to be sound.
- The key derivation of this package is now tested against the BIP-32 specification and
2.0.1 - 2021-02-27
- Correctly type
deriveKeyFromPathparentKeyparam as optional (#14) - Only accept lowercase BIP-39 seed phrases in
deriveKeyFromPath(#15)
2.0.0 - 2021-02-25
- BREAKING: Add input validation to
deriveKeyFromPath(#3, #4) - BREAKING: Change
deriveKeyFromPathparameter order (#3) - Migrate to TypeScript, update types (#10)
1.0.0 - 2020-09-03
- Initial release.