https://github.com/bitcoinjs/bip32
A BIP32 compatible library.
https://github.com/bitcoinjs/bip32
bip32 bitcoin bitcoinjs bitcoinjs-lib ecdsa
Last synced: about 1 year ago
JSON representation
A BIP32 compatible library.
- Host: GitHub
- URL: https://github.com/bitcoinjs/bip32
- Owner: bitcoinjs
- License: mit
- Created: 2015-06-23T06:31:54.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-09-19T09:57:53.000Z (over 1 year ago)
- Last Synced: 2025-04-13T04:58:03.217Z (about 1 year ago)
- Topics: bip32, bitcoin, bitcoinjs, bitcoinjs-lib, ecdsa
- Language: JavaScript
- Homepage:
- Size: 476 KB
- Stars: 191
- Watchers: 7
- Forks: 128
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# bip32
[](https://github.com/bitcoinjs/bip32/actions/workflows/main_ci.yml) [](https://www.npmjs.org/package/bip32) [](https://github.com/prettier/prettier)
A [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) compatible library written in TypeScript with transpiled JavaScript committed to git.
## Example
TypeScript
``` typescript
import BIP32Factory from 'bip32';
import * as ecc from 'tiny-secp256k1';
import { BIP32Interface } from 'bip32';
// You must wrap a tiny-secp256k1 compatible implementation
const bip32 = BIP32Factory(ecc);
const node: BIP32Interface = bip32.fromBase58('xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi');
const child: BIP32Interface = node.derivePath('m/0/0');
// ...
```
NodeJS
``` javascript
const ecc = require('tiny-secp256k1')
const { BIP32Factory } = require('bip32')
// You must wrap a tiny-secp256k1 compatible implementation
const bip32 = BIP32Factory(ecc)
const node = bip32.fromBase58('xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi')
const child = node.derivePath('m/0/0')
```
## LICENSE [MIT](LICENSE)
A derivation (and extraction for modularity) of the `HDWallet`/`HDNode` written and tested by [bitcoinjs-lib](https://github.com/bitcoinjs/bitcoinjs-lib) contributors since 2014.