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.
aiken build
Tests are located in sparse_test.ak
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.
If you're writing a library, you might want to generate an HTML documentation for it.
Use:
aiken docs
Find more on the Aiken's user manual.