BlockKeys v0.1.7 BlockKeys.Mnemonic View Source

BIP32 implementation responsible for generating mnemonic phrases, seeds and public / private address trees.

Link to this section Summary

Functions

Takes a string of word phrases and converts them back to 256bit entropy

Generates the 24 random manmonic words

Given a binary of entropy it will generate teh hex encoded seed

Link to this section Functions

Link to this function

entropy_from_phrase(phrase) View Source

Takes a string of word phrases and converts them back to 256bit entropy

Examples

iex> BlockKeys.Mnemonic.entropy_from_phrase("safe result wire cattle sauce luggage couple legend pause rather employ pear trigger live daring unlock music lyrics smoke mistake endorse kite obey siren"")
be16fbf0922bf9098c4bfca1764923d10e89054de77091f0af3346f49cf665fe 
Link to this function

generate_phrase(entropy \\ :crypto.strong_rand_bytes(32)) View Source

Generates the 24 random manmonic words.

Can optionally accept entropy string to used to generate a mnemonic.

Examples

iex> BlockKeys.Bip32Mnemonic.generate_phrase()
"baby shadow city tower diamond magnet avocado champion crash ..."
iex> BlockKeys.Mnemonic.generate_phrase("1234")
"couple muscle snack"

NOTE: For now the seed can be only generated from 32 bytes entropy

Link to this function

generate_seed(mnemonic, password \\ "") View Source

Given a binary of entropy it will generate teh hex encoded seed

Examples

iex> BlockKeys.Mnemonic.generate_seed("weather neither click twin monster night bridge door immense tornado crack model canal answer harbor weasel winter fan universe burden price quote tail ride"
"af7f48a70d0ecedc77df984117e336e12f0f0e681a4c95b25f4f17516d7dc4cca456e3a400bd1c6a5a604af67eb58dc6e0eb46fd520ad99ef27855d119dca517"