#bip-39 #mnemonic #bitcoin


A fork of the bip39 crate with fixes to v0.6. Rust implementation of BIP-0039

1 unstable release

Uses old Rust 2015

0.6.2 Sep 4, 2019

#31 in #bip-39


722 lines


This is a fork of the bip39 crate with fixes for v0.6.


See the changelog file, or the Github releases for specific tags.


Add bip39 to your Cargo file, and then refer to the documentation for use.

Only an English wordlist is included at the moment, but support for other languages is already present in the code.

A set of simple tests have been written but they only generate new mnemonics and validate a selection of known valid mnemonics generated by other tools


This is a Rust implementation of the bip39 standard for Bitcoin HD wallet mnemonic phrases.


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);


~72K SLoC