-
Notifications
You must be signed in to change notification settings - Fork 119
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
MerkleProof
should not include position or leaf value
#658
Comments
I tend to keep it in the original form. But this comment is valuable:
|
Forgot to mention: currently jellyfish/merkle_tree/src/macros.rs Lines 81 to 90 in 92714a4
Instead |
My opinion has changed. We should make these changes along with #642 |
We will go with two kind of Merkle proof: with and without leaf. |
This issue is an opinionated suggestion. Others may disagree.
MerkleProof
struct contains:These items should not be in the merkle proof. Instead,
MerkleTree::verify
should take them as separate args. If the leaf value is large then the size of the merkle proof is unnecessarily large.First copy of index position is
pos
field in `MerkleProof struct:jellyfish/merkle_tree/src/internal.rs
Lines 139 to 150 in 92714a4
Digging into
MerklePath
we seejellyfish/merkle_tree/src/internal.rs
Line 84 in 92714a4
where
MerkleNode
is an enumjellyfish/merkle_tree/src/internal.rs
Line 25 in 92714a4
with
Leaf
variantjellyfish/merkle_tree/src/internal.rs
Lines 37 to 47 in 92714a4
where we find a second copy of
pos
and the leaf valueelem
.If, as I suggest, we remove these occurrences of
pos
thenMerkleProof
becomes just a wrapper forMerklePath
. In that case we should eliminate the wrapper and just useMerklePath
.I suggest that
MerklePath
be an opaque struct. No need to expose the fact that it's aVec<MerkleNode>
.The text was updated successfully, but these errors were encountered: