feat: Inductive Merkle Trees with completeness theorem - #44
Conversation
|
/review External: Internal: Comments: |
|
Is there a good reference for inductive Merkle trees we could use here? Or specific comments? |
🤖 AI Review (with external context)\n\nGenerating AI review...Thank you for submitting this pull request. This is a substantial and well-structured contribution toward formalizing Merkle trees. The inductive approach using a Here is a review of the changes with suggestions for improvement. High-Level SummaryThis pull request introduces a formalization of binary trees and an inductive implementation of Merkle trees built upon them. Key features include:
The overall direction is excellent, but several areas need refinement, particularly in the binary tree indexing and navigation logic, as well as completing the many Code Review and Suggestions
|
…d-zkEVM/ArkLib into BoltonBailey/InductiveMerkleTree
|
@BoltonBailey How ready is this PR to be merged? |
The completeness theorem is finished modulo the sorries in the The sorries in |
|
I think let's just put sorry's for now and we will work on it later. If you want, the next step is to state the (multi-instance) extractability property of Merkle trees, as found in the SNARG book. This can be in the next PR. |
|
Should we consider splitting off the ToVCVio portion of this PR and just having an equivalent PR to VCVio that will be more flexible to any changes in VCVio / fixed in VCVio if needed? That is, if there's a chance that we could otherwise end up with something in ArkLib/ToVCVio that ends up not really being appropriate for VCVio after changes to the latter. |
|
Ideally that whole file/folder could just be upstreamed at once. But now that I've added to it in this PR, I'd rather that happen after this PR is merged. (I guess #83 touches this file too?) |
|
LGTM? |
…M#44) * add file * progress on proof * formulate parts of completeness proof * progress on completeness * progress on completeness * push sorries down to mem_buildMerkleTree_support_iff * rewrite to push sorries into monad code * clean up and document * clean up * runWithOracle_bind * reorganize tree * clean up comments and improve readability in randomOracle theorems * mk_all
Define Merkle trees over an indexed inductive binary tree data type.
A reference for Merkle trees can be found in chapter IV of the SNARGs book. Note though, that this development generalizes to arbitrary binary tree structures.
The potential benefits of this are:
Vector,This PR includes:
OracleCompmonadrandomOracletorunWithOracle. Not sure if VCVio is undergoing a change that will change what we need here.I am marking this as ready for review, despite the presence of sorrys, since all the sorries are either not critical, or about VCVio definitions. Reviewers, please let me know if: