Skip to content

A JavaScript library to derive bitcoin addresses from extended public keys. Includes a CLI.

License

Notifications You must be signed in to change notification settings

swan-bitcoin/xpub-tool

Repository files navigation

Swan's Address Derivation Tool

A small JavaScript library and accompanying cli tool that derives bitcoin addresses from extended public keys. Built upon caravan and bitcoinjs-lib.

For more details refer to the individual packages:

  • xpub-lib - address derivation and validation library
  • xpub-cli - command-line interface

Relevant BIPs and Educational Resources

  • BIP 32 - Hierarchical Deterministic Wallets
  • BIP 44 - Multi-Account Hierarchy for Deterministic Wallets
  • BIP 49 - Derivation scheme for P2WPKH-nested-in-P2SH based accounts
  • BIP 84 - Derivation scheme for P2WPKH based accounts
  • BIP 86 - Key Derivation for Single Key P2TR Outputs

For a detailed explanation on derivation paths refer to learn me a bitcoin.

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.

License: MIT