This note describes potential improvements for the miden-crypto crate. The improvements can be broken down into 3 groups:
The purposes of these improvements is to make the APIs of the crate more intuitive and also to implement "low-hanging-fruit" performance optimizations. The changes include:
open()
consistently for generating Merkle proofs).The purpose of these imporvements is to speed up various aspects of our existing Merkle data structures. Specifically:
Smt
data structure but may also be useful for regular Merkle trees and MRR. There is discussion of how this can be achieved in #222.Currently, our Sparse Merkle tree implementation (i.e., the Smt
struct) has a purely in-memory representation. This will work fine when the amount of data stored in the tree is dozens of GB, but will break down when we'll need to store hundreds of GB in an Smt
(as we may need for the nullifier tree in the Miden rollup). The purpose of these improvements would be to develop an approach which implements a variant of our Smt
struct which can efficiently accommodate up to several terabytes of data inserted into it.
One of the metrics we are interested in optimizing here is performing as few disk reads/writes as possible when looking up values or updating values in an Smt
.