You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 11, 2023. It is now read-only.
Currently, the proof sets generated by the Binary Merkle Tree and the Binary Merkle Sum Tree (PR #8) include the leaf for which the proof being generated.
E.g. given the tree:
N3
/ \
/ \
N1 N2
/ \ / \
L1 L2 L3 L4
A proof for leaf L2 will include: L2, L1, and N2. To be compliant with the RFC specification, we need to modify the logic such that proofs are generated without the leaf for which we are generating the proof (i.e. L2).
The currently implemented algorithm imposes a restriction where the leaf at the given proof index must be included in the proof set. This is a corollary of the algorithm, resulting from the way it generates the proof set and maintains order. The algorithm checks the length of the proof set against the height of the tree's head (the most recently joined subtree); This check is logically sound only when the proof set includes the leaf at the proof index when pushing in the tree.
Therefore, we must change the algorithm to calculate proof sets independently of the tree operations (push, join, etc.). This may be best achieved once the algorithm also uses persistent storage.
The text was updated successfully, but these errors were encountered:
Yes, I just checked the code and this issue is still relevant. It will be a very simple fix at this point (now that we use storage backing), so I can tackle this one as part of a tech debt ticket this week.
Currently, the proof sets generated by the Binary Merkle Tree and the Binary Merkle Sum Tree (PR #8) include the leaf for which the proof being generated.
E.g. given the tree:
A proof for leaf L2 will include: L2, L1, and N2. To be compliant with the RFC specification, we need to modify the logic such that proofs are generated without the leaf for which we are generating the proof (i.e. L2).
The currently implemented algorithm imposes a restriction where the leaf at the given proof index must be included in the proof set. This is a corollary of the algorithm, resulting from the way it generates the proof set and maintains order. The algorithm checks the length of the proof set against the height of the tree's head (the most recently joined subtree); This check is logically sound only when the proof set includes the leaf at the proof index when pushing in the tree.
Therefore, we must change the algorithm to calculate proof sets independently of the tree operations (push, join, etc.). This may be best achieved once the algorithm also uses persistent storage.
The text was updated successfully, but these errors were encountered: