Crate keyphrase

Source
Expand description

KeyPhrase generator for the EARTH Network. KeyPhrases are based on BIP0039 mnemonics.

§Quickstart

use keyphrase::{KeyPhrase, KeyPhraseType, Language, Seed};

/// create a new randomly generated keyphrase
let keyphrase = KeyPhrase::new(KeyPhraseType::Words12, Language::English);

/// get the phrase
let phrase: &str = keyphrase.phrase();
println!("{}", phrase);
// grocery unknown bench gold grant slim assist monster laptop cruise hamster any

/// get the HD wallet seed
let seed = Seed::new(&keyphrase, "");

// print the HD wallet seed as a hex string
println!("{:X}", seed);
// F9BF84A82DD338E08FF79096A8E9ABB3C621B61C64F4906C7FC8BD27B63CEA3773B1EA464CDE3B1272364C6F673713FCB07C97357E75C31EF787E9C251BEDB

Structs§

Bits11
KeyPhrase
Human readable backup phrases which contain most of the information needed to recreate your EARTH addresses.
Seed
The secret value used to derive HD wallet addresses from a KeyPhrase phrase.

Enums§

ErrorKind
KeyPhraseType
Determines the number of words that will be present in a KeyPhrase phrase
Language
The language determines which words will be used in a keyphrase, but also indirectly determines the binary value of each word when a KeyPhrase is turned into a Seed.