-
Notifications
You must be signed in to change notification settings - Fork 158
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 mtree_verify
instruction
#848
Labels
assembly
Related to Miden assembly
Comments
vlopes11
added a commit
that referenced
this issue
Apr 13, 2023
This commit introduces `mtree_verify`, a function that will perform a raw [Operation::MpVerify]. It will not manipulate or consume elements of the stack, and will be optimal in terms of efficiency - consuming a single cycle. It aims to support algorithms for multiple tree implementations - such as Tiered Sparse Merkle tree - that will need to check for Merkle openings while preserving the stack elements. closes #848
Merged
vlopes11
added a commit
that referenced
this issue
Apr 13, 2023
This commit introduces `mtree_verify`, a function that will perform a raw [Operation::MpVerify]. It will not manipulate or consume elements of the stack, and will be optimal in terms of efficiency - consuming a single cycle. It aims to support algorithms for multiple tree implementations - such as Tiered Sparse Merkle tree - that will need to check for Merkle openings while preserving the stack elements. closes #848
Closed by #850. |
frisitano
pushed a commit
that referenced
this issue
Apr 14, 2023
This commit introduces `mtree_verify`, a function that will perform a raw [Operation::MpVerify]. It will not manipulate or consume elements of the stack, and will be optimal in terms of efficiency - consuming a single cycle. It aims to support algorithms for multiple tree implementations - such as Tiered Sparse Merkle tree - that will need to check for Merkle openings while preserving the stack elements. closes #848
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, we have an
mtree_get
instruction which retrieves a leaf from a Merkle tree at the specified index/depth combination. Internally, this instruction relies onMPVERIFY
VM operation which verifies a Merkle path.In some cases, it would be beneficial to have access to the raw
MPVERIFY
operation as node values may already be on the stack (this is the case, for example, for our SMT implementation in #808). So, I'm thinking we should add anmtree_verify
instruction to Miden assembly and this instruction would just callMPVERIFY
(and thus take a single cycle). Stack transition for this instruction would be:That is, the state of the stack would remain unchanged, but the execution will fail if a Merkle path from$V$ to $R$ for the specified $d$ (depth) and $i$ (index) could not be verified.
The text was updated successfully, but these errors were encountered: