python-slip10
raw JSON → 1.1.0 verified Mon Apr 27 auth: no python
A reference implementation of the SLIP-0010 specification that generalizes BIP-0032 hierarchical deterministic wallet derivation for curves secp256k1, NIST P-256, ed25519, and curve25519. Current version 1.1.0, stable maintenance.
pip install slip10 Common errors
error ImportError: cannot import name 'derive_node' from 'slip10' ↓
cause Older version of slip10 (pre-1.0.0) did not export derive_node.
fix
Upgrade to slip10>=1.0.0: pip install --upgrade slip10
error ValueError: invalid path element at index 0: 44 ↓
cause Passing the path as raw integers without hardened bit for hardened keys.
fix
Include the hardened flag: path=[44 | 0x80000000, ...]
error TypeError: derive_node() missing 1 required positional argument: 'curve' ↓
cause In version 1.1.0, curve is required when calling derive_node without defaults.
fix
Pass curve parameter: derive_node(seed, path, curve=BIP32Curve.SECP256K1)
Warnings
breaking In version 1.0.0, the derive_node function did not accept the 'curve' parameter; it defaulted to secp256k1. In 1.1.0, the curve parameter is required if not using the default. Code without explicit curve may break if default changes. ↓
fix Always pass curve=BIP32Curve.SECP256K1 (or your desired curve) when calling derive_node.
gotcha The return order from derive_node is (chain_code, private_key, public_key). Many users expect (private_key, chain_code, public_code) or similar. ↓
fix Unpack as: chain_code, private_key, public_key = derive_node(...).
gotcha The path argument uses hardened derivation with the '| 0x80000000' pattern (not apostrophe notation). Using integers without the OR may derive non-hardened keys unintentionally. ↓
fix Use path=[44 | 0x80000000, ...] for hardened derivation.
Imports
- derive_node
from slip10 import derive_node
Quickstart
from slip10 import derive_node
from slip10 import BIP32Curve
# BIP-32 test vector for secp256k1
seed = bytes.fromhex('000102030405060708090a0b0c0d0e0f')
chain_code, private_key, public_key = derive_node(
seed,
path=[44 | 0x80000000, 0 | 0x80000000],
curve=BIP32Curve.SECP256K1
)
print(private_key.hex())
print(public_key.hex())