MerklePatriciaTrie is an efficient and robust implementation of the trie data structure in Go. This trie is tailored for Ethereum-like systems but can be used in a variety of applications where data integrity, proof generation, and optimized storage are crucial.
-
Not Production Ready: This codebase is still in its development phase and should not be considered production-ready.
-
Documentation in Progress: While we strive to provide comprehensive documentation, it's not final. We appreciate your patience and any contributions to improve it.
-
Optimization Pending: The code, while functional, is yet to be optimized for performance. Future releases will focus on this aspect.
- PebbleDB: A lightweight key-value store integrated for managing and preserving the data.
- MPTMemoryStorage: A custom in-memory storage solution, handy for generating proofs and extremely beneficial during unit testing.
Our trie supports various operations, like:
- Put: To insert a key-value pair.
- Get: To retrieve the value for a given key.
- Hash: To calculate the hash of the entire trie.
- Proof: To generate a proof of inclusion for a specific key.
- Commit: To make all the changes permanent and return the root hash.
- Del: To delete a key-value pair from the trie.