#bip-39 #mnemonic #bitcoin #hd-wallet

tiny-bip39

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

12 releases (2 stable)

2.0.0 Oct 7, 2024
1.0.1 Oct 4, 2024
1.0.0 Jun 15, 2022
0.8.2 Sep 29, 2021
0.6.1 Mar 19, 2019

#3 in #hd-wallet

Download history 59219/week @ 2024-08-27 65838/week @ 2024-09-03 57654/week @ 2024-09-10 202322/week @ 2024-09-17 164585/week @ 2024-09-24 508119/week @ 2024-10-01 697887/week @ 2024-10-08 541948/week @ 2024-10-15 123014/week @ 2024-10-22 72856/week @ 2024-10-29 61753/week @ 2024-11-05 64932/week @ 2024-11-12 65108/week @ 2024-11-19 60250/week @ 2024-11-26 79629/week @ 2024-12-03 58971/week @ 2024-12-10

275,240 downloads per month
Used in 1,707 crates (89 directly)

MIT AND (MIT OR Apache-2.0)

84KB
1K SLoC

tiny-bip39

Travis shield Crates.io version shield Crates.io license shield

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