Skip to content
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

Add module for generic vector accumulators in common #10

Merged
merged 2 commits into from
Aug 28, 2024
Merged

Conversation

bigspider
Copy link
Collaborator

@bigspider bigspider commented Aug 13, 2024

Adds a generic module for a "Merkleized vector" data structure, that allows to produce proofs of inclusion, and also to modify an element of the vector, producing a proof of update. While it would be possible to produce accumulators that allow appending elements (therefore changing the length of the vector), that's probably overkill and would add significant complexity - therefore, only modifying existing elements is supported here.

This will be used by both the vanadium-client-sdk (the prover holding the outsourced memory), and the VM app (the verifier) in order to handle commit and retrieval of memory pages that the VM outsources to the client.

The module is implemented in a generic way, allowing to plug an implementation of a hash function externally (this will allow the VM to use a bolos-accelerated hash function via ecalls, while the client can use what's available natively on the host).

Moreover, I tried to keep it generic, so that accumulators different than plain Merkle trees could be added in the future, while keeping the same interface.

Closes: #4

@bigspider bigspider force-pushed the merkle branch 2 times, most recently from bb29779 to 36ac89a Compare August 14, 2024 10:13
@bigspider bigspider marked this pull request as ready for review August 14, 2024 10:14
@bigspider bigspider mentioned this pull request Aug 28, 2024
@bigspider bigspider merged commit c81142e into master Aug 28, 2024
8 checks passed
@bigspider bigspider deleted the merkle branch August 28, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a generic, reusable Merkle tree module to the common crate
1 participant