SLIP-10: Deterministic key generation
Warning
slip-10crate has been restructured and renamed intohd-wallet.slip-10is not likely to receive any future updates. Please, consider switching to successor library.In order to migrate to the successor
hd-wallet v0.5, include it into Cargo.toml:= "0.5"Then you'll need to change
slip_10::references in your code tohd_wallet::. For instance,slip_10::HardenedIndexbecomeshd_wallet::HardenedIndex.The functions for child wallet derivation has been moved. Derivation algorithm that is used in
slip_10crate corresponds tohd_wallet::slip10_like. E.g. if you were deriving a child key usingslip_10::derive_child_public_key, now you need to usehd_wallet::slip10_like::derive_child_public_keyinstead.If you have any problems with migration, don't hesitate to reach out to us in Discord
#locknessroom.
SLIP10 is a specification for implementing HD wallets. It aims at supporting many curves while being compatible with BIP32.
The implementation is based on generic-ec library that provides generic
elliptic curve arithmetic. The crate is no_std and no_alloc friendly.
Curves support
Implementation currently does not support ed25519 curve. All other curves are supported: both secp256k1 and secp256r1. In fact, implementation may work with any curve, but only those are covered by the SLIP10 specs.
The crate also re-exports supported curves in supported_curves module (requires enabling a feature), but any other curve implementation will work with the crate.
Features
std: enables std library support (mainly, it just implementsErrortrait for the error types)curve-secp256k1andcurve-secp256r1add curve implementation into the crate supported_curves module
Examples
Derive a master key from the seed, and then derive a child key m/1H/10:
use Secp256k1;
let seed = b"16-64 bytes of high entropy".as_slice;
let master_key = ?;
let master_key_pair = from;
let child_key_pair = derive_child_key_pair_with_path;