{"id":7987,"library":"bip-utils","title":"bip-utils","description":"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.","status":"active","version":"2.12.1","language":"en","source_language":"en","source_url":"https://github.com/ebellocchia/bip_utils","tags":["cryptocurrency","bip32","bip39","bip44","bip49","bip84","mnemonic","wallet","bitcoin","ethereum"],"install":[{"cmd":"pip install bip-utils","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Used by default for secp256k1 curve for performance; can cause compilation issues on some systems.","package":"coincurve","optional":false},{"reason":"Required for ed25519-blake2b curve operations.","package":"ed25519-blake2b-fork","optional":false},{"reason":"Provides cryptographic functions.","package":"pycryptodome","optional":false},{"reason":"For CBOR encoding/decoding.","package":"cbor2","optional":false},{"reason":"For CRC computation.","package":"crcmod","optional":false},{"reason":"Alternative to coincurve for secp256k1, or for nist256p1 curve.","package":"ecdsa","optional":false},{"reason":"For ed25519 curve.","package":"pynacl","optional":false},{"reason":"For sr25519 curve.","package":"py-sr25519-bindings","optional":false}],"imports":[{"symbol":"Bip39MnemonicGenerator","correct":"from bip_utils import Bip39MnemonicGenerator"},{"symbol":"Bip39SeedGenerator","correct":"from bip_utils import Bip39SeedGenerator"},{"symbol":"Bip44","correct":"from bip_utils import Bip44"},{"symbol":"Bip44Coins","correct":"from bip_utils import Bip44Coins"},{"symbol":"Bip39WordsNum","correct":"from bip_utils import Bip39WordsNum"},{"note":"The class 'NeoAddrEncoder' was renamed to 'NeoLegacyAddrEncoder' in v2.10.0 to avoid confusion with new Neo N3 address encoding.","wrong":"from bip_utils import NeoAddrEncoder","symbol":"NeoAddrEncoder","correct":"from bip_utils import NeoLegacyAddrEncoder"}],"quickstart":{"code":"from bip_utils import Bip39MnemonicGenerator, Bip39SeedGenerator, Bip44, Bip44Coins, Bip39WordsNum\n\n# 1. Generate a random BIP39 mnemonic of 12 words\nmnemonic = Bip39MnemonicGenerator().FromWordsNumber(Bip39WordsNum.WORDS_NUM_12)\nprint(f\"Generated Mnemonic: {mnemonic}\")\n\n# 2. Generate a seed from the mnemonic (optional passphrase)\n# For production, use a strong passphrase, or an empty string if none.\n# os.environ.get('BIP_MNEMONIC_PASSPHRASE', '')\npassphrase = \"\"\nseed_bytes = Bip39SeedGenerator(mnemonic).Generate(passphrase)\nprint(f\"Generated Seed (hex): {seed_bytes.hex()}\")\n\n# 3. Derive a Bitcoin (BIP44) address from the seed\nbip44_mst_ctx = Bip44.FromSeed(seed_bytes, Bip44Coins.BITCOIN)\nbip44_acc_ctx = bip44_mst_ctx.Purpose().Coin().Account(0) # Account 0\nbip44_chain_ctx = bip44_acc_ctx.Change(0) # External chain\nbip44_addr_ctx = bip44_chain_ctx.AddressIndex(0) # First address\n\nprint(f\"Bitcoin BIP44 Address: {bip44_addr_ctx.PublicKey().ToAddress()}\")","lang":"python","description":"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."},"warnings":[{"fix":"Replace `NeoAddrEncoder` with `NeoLegacyAddrEncoder` in your code.","message":"The `NeoAddrEncoder` class was renamed to `NeoLegacyAddrEncoder` in `v2.10.0`. Using the old name will result in a `NameError`.","severity":"breaking","affected_versions":">=2.10.0"},{"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.","message":"The `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.","severity":"breaking","affected_versions":">=2.12.1"},{"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.","message":"Installation of `coincurve` (a default dependency for secp256k1 operations) can fail due to requiring compilation tools (e.g., C++ compiler).","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"The 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.","severity":"breaking","affected_versions":">=2.2.0"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Change `from bip_utils import NeoAddrEncoder` to `from bip_utils import NeoLegacyAddrEncoder` and update all usages of `NeoAddrEncoder` in your code.","cause":"The `NeoAddrEncoder` class was renamed to `NeoLegacyAddrEncoder` in `bip-utils` v2.10.0.","error":"NameError: name 'NeoAddrEncoder' is not defined"},{"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.","cause":"The `ed25519-blake2b` dependency was replaced by `ed25519-blake2b-fork` in `bip-utils` v2.12.1.","error":"ModuleNotFoundError: No module named 'ed25519_blake2b'"},{"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`.","cause":"The `coincurve` package requires specific C/C++ compilation tools that are missing on your system.","error":"ERROR: Failed building wheel for coincurve"}]}