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 Dec 1, 2022. It is now read-only.
Hi ,
Apologies for posting here , had no other way of contacting or asking a question.
I am attempting to recreate a regular merkle tree using smtree in this project https://github.com/Vee-Emm/smtreeDemo
Are the hashes being created in a different way when using Sparse Merkle tree?
Is there a way to generate a regular MT using the smtree library or if there is an expectation of that being inlcuded in the future . If pointed in the right direction , I can attempt to help contribute towards that effort.
Please do let me know .
Thanks a bunch !
vee-Emm
The text was updated successfully, but these errors were encountered:
Update : It appears that the Issue #13 was created to add support for simple merkle trees.
But it appears that there is a bug in the implementation . I am unable to find out the root cause .
Any push in the right direction would be appreciated !
Hi @Vee-Emm
spent some time to explore the issue and realized that pymerkle is not pure concatenation of child nodes to parents but to defend against second-preimage attacks:
Before computing the hash of a leaf, prepends the corresponding record with 0x00
Before computing the hash of any interior node, prepends both of its parents' hashes with 0x01,
While the current MTreeNodeSmt defines merging of two nodes as pure concatenation then hash (no prepending bytes). But this is normal, in our lib you can define templates based on your desired functionality by just implementing a few traits (i.e., Mergeable in our case).
Note that to be fully compatible with pymerkle (for a non balanced Merkle tree) you need to define how padding works for the non-existing right most leaves. I could create that template for you if you prefer and enable it by default to our lib.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi ,
Apologies for posting here , had no other way of contacting or asking a question.
I am attempting to recreate a regular merkle tree using smtree in this project
https://github.com/Vee-Emm/smtreeDemo
This is a pymerkle implementation of tree generation .
https://github.com/Vee-Emm/smtreeDemo/blob/master/generateTree.py
However the hashes created from this function prints different values for the internal nodes.
https://github.com/Vee-Emm/smtreeDemo/blob/master/src/main.rs#L112
Are the hashes being created in a different way when using Sparse Merkle tree?
Is there a way to generate a regular MT using the smtree library or if there is an expectation of that being inlcuded in the future . If pointed in the right direction , I can attempt to help contribute towards that effort.
Please do let me know .
Thanks a bunch !
vee-Emm
The text was updated successfully, but these errors were encountered: