Mnemonic
Library for generating deterministic private keys from random words according to BIP39 standard:
Mnemonic.generate()
# "obscure appear begin host burden uncle glow tell journey autumn burden welcome"
words = Mnemonic.generate()
# "pretty element obey slab way middle brisk glory stone material hungry guess"
key = Mnemonic.mnemonic_to_entropy(words)
# AA28F65FE57F811887131CD6511DBD33
mnemonic = Mnemonic.entropy_to_mnemonic("00000000000000000000000000000000")
# "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
Mnemonic.mnemonic_to_entropy(mnemonic)
# "00000000000000000000000000000000"
TODO:
- add tests
- add examples
- add documentation
- maybe do mnemonic to seed
Installation
If available in Hex, the package can be installed
by adding mnemonic
to your list of dependencies in mix.exs
:
def deps do
[
{:mnemonic, "~> 0.2.0"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/mnemonic.