BlockKeys v0.1.3 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.Bip32Mnemonic.entropy_from_phrase("baby shadow city tower diamond magnet avocado champion crash...")
<<81, 207, 16, 37, 21, 79, 241, 161, 228, 226, 129, 30, 238, 242, 43, 248, 23,
150, 111, 135, 12, 220, 228, 66, 200, 175, 200, 11, 201, 238, 18, 145>>
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.Bip32Mnemonic.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"
Link to this function