Expand description
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);
Structs
The primary type in this crate, most tasks require creating or using one.