| Crates.io | bip0032 |
| lib.rs | bip0032 |
| version | 0.0.3 |
| created_at | 2022-04-14 10:28:43.907053+00 |
| updated_at | 2026-01-25 05:19:32.260977+00 |
| description | Another Rust implementation of BIP-0032 standard |
| homepage | https://github.com/koushiro/rust-bips |
| repository | https://github.com/koushiro/rust-bips |
| max_upload_size | |
| id | 567416 |
| size | 163,627 |
Another Rust implementation of BIP-0032 standard.
| Curve | Feature | Backends | Hardened | Non-hardened (private) | Non-hardened (public) | Serialization |
|---|---|---|---|---|---|---|
| secp256k1 | k256 | secp256k1 | libsecp256k1 |
k256, secp256k1, libsecp256k1 | yes | yes | yes | yes |
Seed material is typically derived from a BIP-0039 mnemonic (for example, via bip0039).
use bip0039::{Count, English, Mnemonic};
let mnemonic = <Mnemonic<English>>::generate(Count::Words12);
let seed = mnemonic.to_seed("");
The examples below assume the seed from above.
use bip0032::{DerivationPath, ExtendedPrivateKey, Version, curve::secp256k1::*};
let master = ExtendedPrivateKey::<Secp256k1Curve<K256Backend>>::new(&seed).unwrap();
let path: DerivationPath = "m/0H/1".parse().unwrap();
let child = master.derive_path(&path).unwrap();
let xprv = child
.encode_with(Version::XPRV)
.unwrap()
.to_string();
use bip0032::{DerivationPath, ExtendedPrivateKey, Version, curve::secp256k1::*};
let master = ExtendedPrivateKey::<Secp256k1Curve<K256Backend>>::new(&seed).unwrap();
let path: DerivationPath = "m/0H/1".parse().unwrap();
let child = master.derive_path(&path).unwrap();
let xpub = child
.public_key()
.encode_with(Version::XPUB)
.unwrap()
.to_string();
use bip0032::{DerivationPath, ExtendedPublicKey, Version, curve::secp256k1::*};
let parent_xpub = "xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8";
let parent: ExtendedPublicKey<Secp256k1Curve<K256Backend>> = parent_xpub.parse().unwrap();
let path: DerivationPath = "m/0/1".parse().unwrap();
let child = parent.derive_path(&path).unwrap();
let xpub = child
.encode_with(Version::XPUB)
.unwrap()
.to_string();
SLIP-0010 support is available behind the slip10 feature.
See SLIP-0010.md for details, examples, and the feature matrix.
See documentation and examples at https://docs.rs/bip0032.
', h, H)k256 (by default)secp256k1libsecp256k1p256)ed25519-dalek)no_std environmentSee benchmarks for more details
This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.