Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/helium/merkerl
A Merkle Tree implementation in Erlang
https://github.com/helium/merkerl
erlang merkle merkle-proof merkle-tree
Last synced: 5 days ago
JSON representation
A Merkle Tree implementation in Erlang
- Host: GitHub
- URL: https://github.com/helium/merkerl
- Owner: helium
- License: apache-2.0
- Created: 2018-03-06T16:19:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-23T11:59:45.000Z (over 3 years ago)
- Last Synced: 2024-10-19T01:47:03.653Z (25 days ago)
- Topics: erlang, merkle, merkle-proof, merkle-tree
- Language: Erlang
- Size: 2.05 MB
- Stars: 20
- Watchers: 29
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/helium/merkerl.svg?branch=master)](https://travis-ci.org/helium/merkerl)
[![Coverage Status](https://coveralls.io/repos/github/helium/merkerl/badge.svg?branch=master)](https://coveralls.io/github/helium/merkerl?branch=master)merkerl
--------A library for building and using [Merkle Trees](https://en.wikipedia.org/wiki/Merkle_tree).
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.