haskell-monad / sparse-merkle-tree

A sparse merkle tree lib focused on efficient on-chain proofs. Enforces ordering within the merkle tree.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sparse-merkle-tree

The merkle tree functions are located in sparse.ak.

Currently the supported functionality is:

  • Verifying a new root with an added member.
  • Verifying a new root with a removed member.
  • Verifying a member is included in the tree.
  • Verifying a member is not included in the tree.

Building

aiken build

Testing

Tests are located in sparse_test.ak

Offchain code

Since the onchain code requires a very specific implementation of the sparse merkle tree, I have added an implementation of the offchain code in rust. This implementation was forked from https://github.com/nervosnetwork/sparse-merkle-tree/tree/master and then modified to work with the on chain code.

The only thing remaining for the offchain code is to support other storage types like on disk or remote storage. If you want to contribute to further improving the offchain reach out to any of the Aiken core maintainers.

Documentation

If you're writing a library, you might want to generate an HTML documentation for it.

Use:

aiken docs

Resources

Find more on the Aiken's user manual.

About

A sparse merkle tree lib focused on efficient on-chain proofs. Enforces ordering within the merkle tree.


Languages

Language:Rust 100.0%