#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 67359/week @ 2024-07-23 69210/week @ 2024-07-30 79573/week @ 2024-08-06 66633/week @ 2024-08-13 60911/week @ 2024-08-20 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 53898/week @ 2024-11-05

926,770 downloads per month
Used in 1,701 crates (88 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
~69K SLoC