Skip to main content

BIP Utility Library

PyPI - Version PyPI - Python Version GitHub License
Code Coverage Code Analysis Build & Test Test Requirements
Codecov Codacy grade CodeFactor Grade

Introduction

This package allows generating mnemonics, seeds, private/public keys and addresses for different types of cryptocurrencies. In particular:

  • Mnemonic and seed generation as defined by BIP-0039
  • Shamir's secret sharing of the seed into mnemonic shares as defined by SLIP-0039
  • Private key encryption/decryption as defined by BIP-0038
  • Deterministic entropy derivation (e.g. mnemonics, keys and passwords for other wallets) as defined by BIP-0085
  • Keys derivation as defined by:
  • Derivation of a hierarchy of keys as defined by:
  • Mnemonic and seed generation for Substrate (Polkadot/Kusama ecosystem)
  • Keys derivation for Substrate (Polkadot/Kusama ecosystem, same as Polkadot-JS)
  • Keys and addresses generation for Cardano (Byron-Legacy, Byron-Icarus and Shelley, same as Ledger and AdaLite/Yoroi wallets)
  • Mnemonic and seed generation for Monero (legacy and Polyseed)
  • Keys and addresses/subaddresses generation for Monero (same as the official Monero wallet)
  • Mnemonic and seed generation for Algorand (Algorand 25-word mnemonic)
  • Mnemonic and seed generation like Electrum wallet (v1 and v2)
  • Keys derivation like Electrum wallet (v1 and v2)
  • Generation of keys from a passphrase chosen by the user ("brainwallet")

Other implemented functionalities:

  • Parse BIP-0032 derivation paths
  • Parse Substrate derivation paths
  • Extended key serialization as defined by SLIP-0032
  • Encode/Decode addresses for all the supported coins
  • Encode/Decode WIF
  • Encode/Decode Nostr keys in npub/nsec format as defined by NIP-19
  • Encode/Decode base58 and base58 monero
  • Encode/Decode ss58
  • Encode/Decode bech32 and bech32m
  • Encode/Decode Bitcoin Cash bech32
  • Get token account addresses for SPL tokens (i.e. Solana tokens)

Package dependencies:

Please note that, for the py-sr25519-bindings library, Rust is required to be installed.

Supported coins

Supported BIP coins:

  • Akash Network
  • Algorand
  • Aptos
  • Arbitrum
  • Avalanche (all the 3 chains)
  • Axelar
  • Band Protocol
  • Binance Chain
  • Binance Smart Chain
  • Bitcoin (and related test net)
  • Bitcoin Cash (and related test net)
  • Bitcoin Cash Simple Ledger Protocol (and related test net)
  • BitcoinSV (and related test net)
  • Cardano (Byron-Legacy, Byron-Icarus and Shelley)
  • Celestia
  • Celo
  • Certik
  • Cosmos
  • Cronos POS (formerly Crypto.org Chain)
  • Dash (and related test net)
  • Digibyte
  • Dogecoin (and related test net)
  • dYdX
  • eCash (and related test net)
  • Elrond (MultiversX)
  • EOS
  • Ergo (and related test net)
  • Ethereum
  • Ethereum Classic
  • Fantom Opera
  • Filecoin
  • Fetch.ai
  • Harmony One (Ethereum and Cosmos addresses)
  • Huobi Heco Chain
  • IRIS Network
  • Kaspa (and related test net)
  • Kava
  • Kusama (based on BIP44 and ed25519 SLIP-0010, like TrustWallet, it won't generate the same addresses as Polkadot-JS)
  • Litecoin (and related test net)
  • Mavryk
  • Metis
  • Monero (based on BIP44 and secp256k1 or ed25519 SLIP-0010, it won't generate the same addresses as the official wallets, but it supports subaddresses generation)
  • Nano
  • Near Protocol
  • NEO (legacy and N3)
  • Neutron
  • Nimiq
  • Nostr (NIP-06)
  • OKEx Chain (Ethereum and Cosmos addresses)
  • Ontology
  • Optimism
  • Osmosis
  • Pi Network
  • Polkadot (based on BIP44 and ed25519 SLIP-0010, like TrustWallet, it won't generate the same addresses as Polkadot-JS)
  • Polygon
  • Ripple
  • Secret Network
  • Solana
  • Stafi (Cosmos)
  • Stellar
  • Sui (only ed25519)
  • Terra
  • Tezos
  • Theta Network
  • THORChain
  • Ton
  • Tron
  • VeChain
  • Verge
  • Zcash (and related test net)
  • Zilliqa

Supported Substrate coins:

  • Acala
  • Bifrost
  • Chainx
  • Edgeware
  • Karura
  • Kusama
  • Moonbeam
  • Moonriver
  • Phala Network
  • Plasm Network
  • Sora
  • Stafi
  • Polkadot
  • Generic Substrate coin

For what regards Monero, it's also possible to generate the same addresses as the official wallets without using BIP44 derivation.

Clearly, for those coins that support Smart Contracts (e.g. Ethereum, Tron, ...), the generated keys and addresses are valid for all the related tokens.

Install the package

The package can be simply installed via pip:

pip install bip_utils

NOTE: if you have problems building the ed25519_blake2b library (it usually happens on Windows), you can try one of the prebuilt wheels here.

Test and Coverage

Install develop dependencies:

pip install -r requirements-dev.txt

To run tests:

python -m unittest discover

To run tests with coverage:

coverage run -m unittest discover
coverage report -m

To run code analysis:

mypy .
ruff check .

tox can also be used for testing and code analysis (check tox.ini for the environments).

Modules description

Documentation

The library documentation is available at ebellocchia.github.io/bip_utils.

Code examples

For some complete code examples (from mnemonic to keys generation), refer to the examples folder.

Buy me a coffee

You know, I'm Italian and I love drinking coffee (especially while coding 😃). So, if you'd like to buy me one:

  • BTC: bc1qqxwmzs7qyatpht84hqmavkag0r3gnalyjxqr9d
  • EVM: 0xbe6Ce1d8fc6e72173f00A63FF493dFdFdb664FbF

Thank you very much for your support.

License

This software is available under the MIT license.

Metadata

Release files for bip-utils 2.14.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bip-utils 2.14.0
File Size Uploaded Provenance Actions
bip_utils-2.14.0.tar.gz 667.8 kB With provenance Details for bip_utils-2.14.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bip-utils 2.14.0
File Interpreter ABI Platform Actions
bip_utils-2.14.0-py3-none-any.whl Python 3 none any Details for bip_utils-2.14.0-py3-none-any.whl

Total release size: 1.3 MB

Release files / bip_utils-2.14.0.tar.gz

Download URL bip_utils-2.14.0.tar.gz
Size 667.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7b9d5e1e6d938d063b9f75bfd780dc9b46d82b7af91466788f1d499d580ffe4f
BLAKE2b-256 checksum
How to use checksums
7ba51d1d82be4c7a0e148f44b4348b10070a8e9a13023551042da69462be1042
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / bip_utils-2.14.0-py3-none-any.whl

Download URL bip_utils-2.14.0-py3-none-any.whl
Size 675.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b95cb2b77a36d5c6dffc434edb3b00d1fee1617c5d6db455073f09cb7312c0dd
BLAKE2b-256 checksum
How to use checksums
2ae1fdd1d01173dcf2386f0e5618ba06ac4cf8229fa776d2cb0a76dea57a4101
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Security for bip-utils 2.14.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bip_utils-2.14.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.14.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page