-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac18799
commit 06ec8ec
Showing
1 changed file
with
21 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,23 @@ | ||
# A ZkVM optimized binary Patricia Merkle Trie with external node storage, and multi node transactions | ||
# A ZkVM Optimized Binary Patricia Merkle Trie | ||
|
||
#### TODO | ||
This project implements a binary Patricia Merkle trie optimized for use in zero-knowledge virtual machines (ZkVMs). The trie's API closely matches that of `std::HashMap`, allowing for familiar and intuitive usage. | ||
|
||
- delete node method | ||
- documentation | ||
## Features | ||
|
||
- Pluggable external node storage for use with any key-value database | ||
- Multi-node transactions | ||
- Succinct Merkle proofs of pre-transaction tree state (Snapshot) | ||
- Incremental recalculation of post-transaction Merkle root | ||
- Efficient Snapshot Merkle root verification | ||
- `no_std` compatible | ||
|
||
## Transactional Operations and Merkle Proofs | ||
|
||
Operations (`get`, `insert`, `entry` API) on the trie are performed within Transactions. After executing a transaction, you can obtain the new Merkle root of the trie and a snapshot. The snapshot contains only the parts of the pre-transaction trie that the transaction depended on. | ||
|
||
This allows you to verify the correctness of the operations on the trie without requiring the whole trie. You only need the Snapshot, which contains the minimum amount of data required to verify all operations in a Transaction. You can easily verify the transactions by rerunning the transaction logic against the Snapshot in a zkVM or other verifiable or trusted environment. | ||
|
||
## Performance Characteristics | ||
|
||
This trie is optimized for 32-bit zkVMs and small proof sizes, not real hardware. It is a binary trie, not a standard base-16 trie, we are trading an increased number of branches that must be traversed for smaller proofs. | ||
This is a great tradeoff for a zkVM, not so much for an SSD. When using this trie, it is recommended to maintain a cache key-value database and only use the trie for proof generation and verification. |