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

Turn this crate into a workspace #58

Closed
moCello opened this issue Jun 15, 2023 · 1 comment · Fixed by #59
Closed

Turn this crate into a workspace #58

moCello opened this issue Jun 15, 2023 · 1 comment · Fixed by #59

Comments

@moCello
Copy link
Member

moCello commented Jun 15, 2023

Summary

Separate the generic implementation of a merkle tree from the hash- and type-specific implementations of the Aggregate trait.
With this change we will have one crate for the generic merkle tree that exposes Aggregate, Tree, Opening and Walk and each their own crate for the specific implementations of the Aggregate trait.
So far this will result in having crates for:

  • dusk-merkle
  • poseidon merkle tree
  • blake3 merkle tree (edit: I decided to add the blake3 implementation as an example under the generic dusk-merkle crate and not as its own)

The generic crate dusk-merkle will be at the root of the workspace and poseidon-merkle (name can be changed) will become a member.

Relevant Context

See #56 for more context

@moCello
Copy link
Member Author

moCello commented Jun 22, 2023

While working on this, I came across another issue that is worth noting.

With the previous setup we were able to add the opening proof creation in zero-knowledge as a method on the Opening struct, making it possible to call the gadget method on Opening in the same way as we call the verify method, which seems logical since they mimic one another:

opening.verify(leaf);
opening.gadget(&mut composer, leaf);

With the creation of a workspace and the division into the generic merkle tree and the poseidon merkle tree, we have no access to Opening anymore in poseidon-merkle and we need to create a new function opening_gadget that takes the opening as a parameter:

opening_gadget(&mut composer, &opening, leaf);

This is not a huge drawback of course but I felt it is worth mentioning in the re-designing process.

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 a pull request may close this issue.

1 participant