12 releases (2 stable)
2.0.0 | Oct 7, 2024 |
---|---|
1.0.1 |
|
1.0.0 | Jun 15, 2022 |
0.8.2 | Sep 29, 2021 |
0.6.1 | Mar 19, 2019 |
#3 in #hd-wallet
275,240 downloads per month
Used in 1,707 crates
(89 directly)
84KB
1K
SLoC
tiny-bip39
This is a fork of the bip39
crate with fixes for v0.6.
Changes
See the releases for changes since the fork.
Documentation
This crate supports multiple languages, all are enabled by default, you can choose to specify them with feature flags:
chinese-simplified
chinese-traditional
french
italian
japanese
korean
spanish
English is always enabled.
lib.rs
:
This is a Rust implementation of the bip39 standard for Bitcoin HD wallet mnemonic phrases.
Quickstart
use bip39::{Mnemonic, MnemonicType, Language, Seed};
/// create a new randomly generated mnemonic phrase
let mnemonic = Mnemonic::new(MnemonicType::Words12, Language::English);
/// get the phrase
let phrase: &str = mnemonic.phrase();
println!("phrase: {}", phrase);
/// get the HD wallet seed
let seed = Seed::new(&mnemonic, "");
// get the HD wallet seed as raw bytes
let seed_bytes: &[u8] = seed.as_bytes();
// print the HD wallet seed as a hex string
println!("{:X}", seed);
Dependencies
~1.9–2.7MB
~70K SLoC