-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement domain separation for compact sparse Merkle tree #35
Comments
I think the only method we need to support this for (at least for now) is merge(). This would cover the SMT use case as well as the program hashing use case in the VM (where we need to differentiate between I'm thinking the new function could look like this: pub fn merge_in_domain(values: &[RpoDigest; 2], domain: Felt) -> RpoDigest The |
Closed by #40 |
sorry to hijack the closed issue. can we document why we didn't implement the domain separation in for the compact SMT? |
We do use it in compact SMT but only for computing leaf nodes, which are computed using |
As part of the design in #22 for a tiered compact SMT, we need to create domain separation between internal nodes and leaf nodes i.e. each type of node should be hashed differently.
The rule that was proposed by @bobbinth is the following:
hash(left,right)
whereright
andleft
are the left and right child, respectively.hash(r,v)
wherer
is the remainingkey
(i.e. with the prefix leading to the current position removed) andv
is the values associated withkey
. Further, we set one of the capacity registers to the depth i.e. 16, 32, 48 or 64.At the moment, accessing the capacity registers externally is not possible to realize point 2. The following issue aims at exposing some methods from RPO so that point 2 above can be implemented in the final implementation of our compact SMT #22 .
The text was updated successfully, but these errors were encountered: