Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SWUbanner

Mnemo

Hex.pm

Elixir implementation of BIP39.

(...) implementation of a mnemonic code or mnemonic sentence -- a group of easy to remember words -- for the generation of deterministic wallets.

mnemo library exposes the following interfaces:

  • Generate random English mnemonic
  • Generate English mnemonic for pre-existing binary entropy
  • Convert English mnemonic back to its binary entropy
  • Derive a PBKDF2 hex-encoded seed from any mnemonic

The library is tested against reference vectors from Trezor's implementation. Additionally, a simple property test guarantees mnemonic <-> entropy <-> mnemonic correctness.

Examples

iex(1)> Mnemo.generate
"seminar depart parent awake canal relief age emotion swap area always near voyage exist idea aunt around burst uphold web tumble mimic reopen note"
iex(1)> mnemonic = "insect miracle play mad cream upgrade engage march absorb pyramid december observe jazz senior
 betray family valve peasant cargo marriage table laundry melody morning"
iex(2)> Mnemo.entropy(mnemonic, hex: true)
"7511ae9942d32fdd52943e00d5e0e2cc377787455a94f114448ac42dcefb62a4"
iex(1)> Mnemo.mnemonic :crypto.strong_rand_bytes(16)
"emotion enroll aspect taxi nerve warrior become lens cactus stand stage pretty"
iex(1)> Mnemo.generate |> Mnemo.seed
"18a644cfd59eb0b509b0a73639b01e836e9e5a09f1f473a7f1b967acebc1908a9c8afe4ad8fabe7928d11ea422ffabec42db07ca7085131196b7d3fb6a1d9bc4"

Installation

The package can be installed by adding mnemo to your list of dependencies in mix.exs:

def deps do
  [
    {:mnemo, "~> 0.1.0"}
  ]
end

Documentation

Documentation can be generated locally with ExDoc.

The docs can be found at https://hexdocs.pm/mnemo.

About

💰 Elixir implementation of BIP39 Mnemonics

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages