BIP32 is a minimalistic Python implementation of the Bitcoin HD wallet (Hierarchical Deterministic Wallet) specification. The current version is 5.0.0, released in November 2025. The library maintains an active development cycle, with occasional major releases that often introduce breaking changes, typically driven by updates to Python versions or the implementation of stricter sanity checks.
pip install bip32Verified import paths — ran on the pinned version, not inferred.
Initializes a BIP32 wallet from a seed and demonstrates deriving extended private and public keys using both list and string-based derivation paths. It also shows how to instantiate from an extended public key for public-only derivation.
Review the official changelog (`https://github.com/darosior/python-bip32/blob/master/CHANGELOG.md`) for details on API changes and required code modifications.
Ensure your Python environment meets the new requirements (e.g., Python >=3.9 for 5.x), and update your `coincurve` installation if needed.
Update method calls to the new names and ensure all inputs conform to the stricter validation rules. Refer to the `CHANGELOG.md` for exact renames.
To derive hardened keys, you must initialize the `BIP32` instance using `from_seed` or `from_xpriv` (an extended private key).
Before installing `bip32`, ensure `libsecp256k1` and its development headers are installed on your system. Consult `coincurve`'s documentation for platform-specific installation instructions if `pip install bip32` fails.
pip install bip32
from bip32 import BIP32 bip32_instance = BIP32.from_seed(seed_bytes)
Ensure your seed is a `bytes` object with a length between 16 and 64 bytes (inclusive).
Derive hardened child keys only from `BIP32` instances that were created from a private key (e.g., `from_seed` or `from_xpriv`), or use a non-hardened index if deriving from a public key.