helium/merkerl

Name: merkerl

Owner: Helium

Description: A Merkle Tree implementation in Erlang

Created: 2018-03-06 16:19:40.0

Updated: 2018-04-30 16:59:40.0

Pushed: 2018-04-30 16:59:39.0

Homepage: null

Size: 1326

Language: Erlang

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status Coverage Status

merkerl

A library for building and using Merkle Trees.

Why yet another Merkle Tree implementation? Mostly because other implementations didn't allow for pluggable hash functions, did not support proof generation or verification, tried to support mutable trees, or some combination of the above.

Build
$ make

To build documentation:

$ make docs
Usage

Construct a merkle tree:

Values = ["foo", "bar", "baz", "dog", "cat", "bear", "plant"],
Merkle = merkerl:new(Values, fun merkerl:hash_value/1),

Generate a proof for a value in a merkle tree:

ValueHash = merkerl:hash_value("bar"),
Proof = merkerl:gen_proof(ValueHash, Merkle),

Verify a proof for a value in a merkle tree:

ok = merkerl:verify_proof(ValueHash, Merkle, Proof),

There are other functions for accessing the leaves and values from a merkle tree. For complete documentation, see the generated docs.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.