booklearner / mnemonic

OCaml implementation of mnemonic code for generating deterministic keys (i.e. BIP-0039)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mnemonic

mnemonic is an OCaml implementation of mnemonic code for generating deterministic keys in other words, it is an implementation of BIP-0039 (Bitcoin Improvement Proposal) which introduces a mechanism to generate mnemonics (group of words) and convert them into a binary seed.

See also the reference implementation written in Python.

Development

For a quick introduction to OCaml, browse the official documentation. For a deeper understanding, check out Real World OCaml.

Install opam, then follow instructions below to install dependencies, build the project, and run it.

; opam install .
; dune build

Usage

mnemonic can be used as a standalone CLI tool to generate keys

; dune build @install
; mnemonic --help
mnemonic [options]
  -l  Specify the length of the mnemonic phrase (default is 24).
  -o  Specify the file to write the output to (default is stdout).
  --version  Display the version of the currently installed mnemonic.
  -help  Display this list of options
  --help  Display this list of options

To use as a library in another codebase, install mnemonic from opam.

; opam install mnemonic

dune:

(library
  (name <your library name>)
  (libraries mnemonic))

<program>.ml

open Mnemonic

(* TODO: add usage examples *)

TODO

  • finalize the exposed interface functions in a .mli file
  • test against reference implementation test suite
  • publish mnemonic to opam

License

BSD-3-Clause

About

OCaml implementation of mnemonic code for generating deterministic keys (i.e. BIP-0039)

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:OCaml 100.0%