-
Notifications
You must be signed in to change notification settings - Fork 13
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
Added docs about Merkle Tree #10
Conversation
Sparse Merkle Trees (SMTs) offer several benefits: | ||
|
||
1) **Efficiency**: They allow efficient storage of large, sparse datasets with minimal memory overhead. | ||
2) **Security**: Like traditional Merkle trees, they provide tamper-proof data structure and enable cryptographic verification of data integrity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does Sparse Merkle Tree have the same security issue with Merkle Tree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it does. It means if any unauthorized changes are made, they will be detected in the root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I mentioned security issue, I meant Sparse Merkle Tree have the same Merkle Tree vulnerability that would lead to a false proof.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
### Ways to store Merkle Tree on IPFS | ||
Here are different ways you could store a Merkle Tree on IPFS: | ||
|
||
1) **JSON Serialization**: One of the simplest ways to store a Merkle Tree in IPFS is to convert the Merkle Tree to a JSON structure and then save that to IPFS. This is a straightforward method but can be inefficient for large trees, as the entire tree needs to be retrieved even if you're only interested in certain parts of it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we consider BSON and define a structure to store Merkle tree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
All standart merkle tree functions can be implemented along with these 'key' functions. | ||
|
||
#### Zero nodes | ||
For each level, zero nodes remain constant and can be generated during the initialization of the Merkle Tree. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For each level, zero nodes remain constant and can be generated during the initialization of the Merkle Tree. | |
For each level, zero nodes remain constant and can be generated during the initialization of the Merkle Tree. | |
Please format the code with MD formatter first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Over all LGTM, just some minor issues need to be fixed and the security concern. |
000c56b
to
573a515
Compare
Feature type
Feature description
Pull request checklist
Please check if your PR fulfills the following requirements: