View Source BitcoinLib.Key.HD.SeedPhrase (BitcoinLib v0.2.0-pre3)

A seed phrase can generate a private key. It is a human friendly way to store private keys for disaster recovery.

Link to this section Summary

Functions

Convert a set of 50 or 99 dice rolls into a 12 or 24 word list

Convert a set of 50 or 99 dice rolls into a 12 or 24 word list

Convert a seed phrase into a seed, with a optional passphrase

Create a seed phrase out of entropy

Link to this section Functions

Link to this function

from_dice_rolls!(dice_rolls)

View Source
@spec from_dice_rolls!(binary()) :: binary()

Convert a set of 50 or 99 dice rolls into a 12 or 24 word list

examples

Examples

iex> "12345612345612345612345612345612345612345612345612" ...> |> BitcoinLib.Key.HD.SeedPhrase.from_dice_rolls!() "blue involve cook print twist crystal razor february caution private slim medal"

Link to this function

from_dice_rolls(dice_rolls)

View Source
@spec from_dice_rolls(binary()) :: {:ok, binary()} | {:error, binary()}

Convert a set of 50 or 99 dice rolls into a 12 or 24 word list

examples

Examples

iex> "12345612345612345612345612345612345612345612345612" ...> |> BitcoinLib.Key.HD.SeedPhrase.from_dice_rolls()

Link to this function

to_seed(seed_phrase, passphrase \\ "")

View Source
@spec to_seed(binary(), binary()) :: binary()

Convert a seed phrase into a seed, with a optional passphrase

See https://learnmeabitcoin.com/technical/mnemonic#mnemonic-to-seed

examples

Examples

iex> "brick giggle panic mammal document foam gym canvas wheel among room analyst" ...> |> BitcoinLib.Key.HD.SeedPhrase.to_seed() "7e4803bd0278e223532f5833d81605bedc5e16f39c49bdfff322ca83d444892ddb091969761ea406bee99d6ab613fad6a99a6d4beba66897b252f00c9dd7b364"

Link to this function

wordlist_from_entropy(entropy)

View Source
@spec wordlist_from_entropy(integer()) :: binary()

Create a seed phrase out of entropy

examples

Examples

iex> 101_750_443_022_601_924_635_824_320_539_097_414_732 ...> |> BitcoinLib.Key.HD.SeedPhrase.wordlist_from_entropy() "erode gloom apart system broom lemon dismiss post artist slot humor occur"