#bip39 #bitcoin #mnemonic

tiny-bip39

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

3 releases

0.6.2 Apr 16, 2019
0.6.1 Mar 19, 2019
0.6.0 Feb 20, 2019

#72 in Cryptocurrencies

Download history 658/week @ 2019-08-08 894/week @ 2019-08-15 929/week @ 2019-08-22 912/week @ 2019-08-29 918/week @ 2019-09-05 1100/week @ 2019-09-12 1424/week @ 2019-09-19 1031/week @ 2019-09-26 1508/week @ 2019-10-03 2060/week @ 2019-10-10 1912/week @ 2019-10-17 2334/week @ 2019-10-24 1926/week @ 2019-10-31 1892/week @ 2019-11-07 1972/week @ 2019-11-14

2,109 downloads per month
Used in 12 crates (9 directly)

MIT/Apache

82KB
667 lines

tiny-bip39

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

Changes

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

Documentation

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


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

~2MB
~33K SLoC