https://github.com/swan-bitcoin/xpub-tool
A JavaScript library to derive bitcoin addresses from extended public keys. Includes a CLI.
https://github.com/swan-bitcoin/xpub-tool
address-derivation bip44 bip49 bip84 bip86 bitcoin p2pkh p2tr p2wpkh p2wpkh-p2sh security-critical xpub
Last synced: about 1 month ago
JSON representation
A JavaScript library to derive bitcoin addresses from extended public keys. Includes a CLI.
- Host: GitHub
- URL: https://github.com/swan-bitcoin/xpub-tool
- Owner: swan-bitcoin
- License: mit
- Created: 2020-08-20T09:48:30.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-04-03T13:33:52.000Z (6 months ago)
- Last Synced: 2025-08-14T12:58:51.231Z (about 2 months ago)
- Topics: address-derivation, bip44, bip49, bip84, bip86, bitcoin, p2pkh, p2tr, p2wpkh, p2wpkh-p2sh, security-critical, xpub
- Language: JavaScript
- Homepage:
- Size: 1.7 MB
- Stars: 47
- Watchers: 22
- Forks: 19
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Swan's Address Derivation Tool
A small JavaScript library and accompanying cli tool that derives bitcoin addresses from extended public keys. Built upon [caravan](https://github.com/caravan-bitcoin/caravan) and [bitcoinjs-lib](https://github.com/bitcoinjs/bitcoinjs-lib).
For more details refer to the individual packages:
- [`xpub-lib`](https://github.com/swan-bitcoin/xpub-tool/tree/master/packages/xpub-lib) - address derivation and validation library
- [`xpub-cli`](https://github.com/swan-bitcoin/xpub-tool/tree/master/packages/xpub-cli) - command-line interface## Relevant BIPs and Educational Resources
- [BIP 32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) - Hierarchical Deterministic Wallets
- [BIP 44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) - Multi-Account Hierarchy for Deterministic Wallets
- [BIP 49](https://github.com/bitcoin/bips/blob/master/bip-0049.mediawiki) - Derivation scheme for P2WPKH-nested-in-P2SH based accounts
- [BIP 84](https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki) - Derivation scheme for P2WPKH based accounts
- [BIP 86](https://github.com/bitcoin/bips/blob/master/bip-0086.mediawiki) - Key Derivation for Single Key P2TR OutputsFor a detailed explanation on derivation paths refer to [learn me a bitcoin](https://learnmeabitcoin.com/technical/derivation-paths).
## Publishing
The `xpub-lib` and `xpub-cli` can be published to GitHub Packages by:
1. Incrementing the version field within the package.json file within each package you want to publish.
2. Creating a new tag with SemVer sytax (i.e. v0.0.1). Needs to match `v*`.
3. Creating a new GitHub release using this tag. This will start the publish workflow.The workflow will need to be approved by another user with write access before its executed. If published successfully, the packages will be published [here](https://github.com/orgs/swan-bitcoin/packages).
## License: [MIT](./LICENSE.md)