Registry / auth-security / bip-utils

bip-utils

JSON →
library2.12.1pypypi✓ verified 85d ago

bip-utils is an active Python library (current version 2.12.1) for generating mnemonics, seeds, private/public keys, and addresses across various cryptocurrencies, implementing standards like BIP-0039, BIP-0032, BIP-0044, BIP-0049, and BIP-0084. It sees frequent minor releases, adding support for new coins and improving existing functionalities.

pip install bip-utils
INSTALL
IMPORT
SIG · BIP-UTILS
B
bip-utils
auth-securitypythonv2.12.1
Install
6.1s avg
Import
628ms
Disk
60MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.12.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.647s · 59MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 6.1s · import 0.609s · 61MB
60MB installed
● package 60MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Bip39MnemonicGenerator
from bip_utils import Bip39MnemonicGenerator
Bip39SeedGenerator
from bip_utils import Bip39SeedGenerator
Bip44
from bip_utils import Bip44
Bip44Coins
from bip_utils import Bip44Coins
Bip39WordsNum
from bip_utils import Bip39WordsNum
NeoAddrEncoder
from bip_utils import NeoLegacyAddrEncoder
from bip_utils import NeoAddrEncoder
The class 'NeoAddrEncoder' was renamed to 'NeoLegacyAddrEncoder' in v2.10.0 to avoid confusion with new Neo N3 address encoding.

This quickstart demonstrates generating a 12-word BIP39 mnemonic, converting it into a seed, and then deriving the first external Bitcoin address using BIP44 derivation path standards.

from bip_utils import Bip39MnemonicGenerator, Bip39SeedGenerator, Bip44, Bip44Coins, Bip39WordsNum # 1. Generate a random BIP39 mnemonic of 12 words mnemonic = Bip39MnemonicGenerator().FromWordsNumber(Bip39WordsNum.WORDS_NUM_12) print(f"Generated Mnemonic: {mnemonic}") # 2. Generate a seed from the mnemonic (optional passphrase) # For production, use a strong passphrase, or an empty string if none. # os.environ.get('BIP_MNEMONIC_PASSPHRASE', '') passphrase = "" seed_bytes = Bip39SeedGenerator(mnemonic).Generate(passphrase) print(f"Generated Seed (hex): {seed_bytes.hex()}") # 3. Derive a Bitcoin (BIP44) address from the seed bip44_mst_ctx = Bip44.FromSeed(seed_bytes, Bip44Coins.BITCOIN) bip44_acc_ctx = bip44_mst_ctx.Purpose().Coin().Account(0) # Account 0 bip44_chain_ctx = bip44_acc_ctx.Change(0) # External chain bip44_addr_ctx = bip44_chain_ctx.AddressIndex(0) # First address print(f"Bitcoin BIP44 Address: {bip44_addr_ctx.PublicKey().ToAddress()}")
Debug
Known issues
breakingThe `NeoAddrEncoder` class was renamed to `NeoLegacyAddrEncoder` in `v2.10.0`. Using the old name will result in a `NameError`.
fix
Replace `NeoAddrEncoder` with `NeoLegacyAddrEncoder` in your code.
affects: >=2.10.0
breakingThe `ed25519-blake2b` dependency was replaced by `ed25519-blake2b-fork` in `v2.12.1`. While this change primarily improved Windows installation by including wheels, direct references or older installations might cause import issues.
fix
Ensure you are using `bip-utils>=2.12.1` and `pip install --upgrade bip-utils` to get the correct dependency. If encountering compilation issues on Windows, update pip and setuptools or refer to pre-built wheels if necessary.
affects: >=2.12.1
gotchaInstallation of `coincurve` (a default dependency for secp256k1 operations) can fail due to requiring compilation tools (e.g., C++ compiler).
fix
Ensure you have the necessary build tools installed for your OS (e.g., 'build-essential' on Debian/Ubuntu, 'Xcode Command Line Tools' on macOS, or 'Microsoft Visual C++ Build Tools' on Windows). Alternatively, you can disable `coincurve` by setting `USE_COINCURVE = False` in `bip_utils/ecc/conf.py` and then reinstalling the library, which will use the slower pure-Python `ecdsa` library instead.
affects: All versions
breakingThe generic `Bip32` class was removed and replaced by specific curve-dependent classes (e.g., `Bip32Ed25519Slip`, `Bip32Secp256k1`) starting from `v2.2.0`. Older code using `Bip32` directly will break.
fix
Migrate to the appropriate curve-specific `Bip32` implementation (e.g., `Bip32Secp256k1.FromSeed(...)`). The BIP-0044, BIP-0049, and BIP-0084 libraries internally handle the correct `Bip32` class based on the coin.
affects: >=2.2.0
Errors
Common errors & fixes
NameError: name 'NeoAddrEncoder' is not defined
The `NeoAddrEncoder` class was renamed to `NeoLegacyAddrEncoder` in `bip-utils` v2.10.0.
fix
Change `from bip_utils import NeoAddrEncoder` to `from bip_utils import NeoLegacyAddrEncoder` and update all usages of `NeoAddrEncoder` in your code.
ModuleNotFoundError: No module named 'ed25519_blake2b'
The `ed25519-blake2b` dependency was replaced by `ed25519-blake2b-fork` in `bip-utils` v2.12.1.
fix
Ensure your `bip-utils` installation is up-to-date (`pip install --upgrade bip-utils`). The new dependency `ed25519-blake2b-fork` should be installed automatically.
ERROR: Failed building wheel for coincurve
The `coincurve` package requires specific C/C++ compilation tools that are missing on your system.
fix
Install the necessary build tools for your operating system. For Debian/Ubuntu: `sudo apt-get install build-essential`. For macOS: `xcode-select --install`. For Windows: Install 'Microsoft Visual C++ Build Tools'. Alternatively, you can force `bip-utils` to use `ecdsa` (pure Python, but slower) by setting `USE_COINCURVE = False` in `bip_utils/ecc/conf.py` (after installing `ecdsa` via `pip install ecdsa`) and then reinstall `bip-utils`.
Upgrade
Version history
2.12.1latest on PyPI · released Mar 2, 2026
Audit
Dependencies
coincurverequiredUsed by default for secp256k1 curve for performance; can cause compilation issues on some systems.
ed25519-blake2b-forkrequiredRequired for ed25519-blake2b curve operations.
pycryptodomerequiredProvides cryptographic functions.
cbor2requiredFor CBOR encoding/decoding.
crcmodrequiredFor CRC computation.
ecdsarequiredAlternative to coincurve for secp256k1, or for nist256p1 curve.
pynaclrequiredFor ed25519 curve.
py-sr25519-bindingsrequiredFor sr25519 curve.
Agent activity
36 hits · last 30 days
node
32
Perplexity
1
OpenAI (training)
1
Resources
bip-utils — pip install bip-utils · libregistry