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

[TASK] Add method for querying a relayer's merkle tree for a merkle path proof #516

Open
drewstone opened this issue May 16, 2023 · 1 comment
Labels
difficulty: challenging 🏴‍☠️ feature ➕ Tasks that are functional additions or enhancements p3 🔵 Issues should be resolved eventually

Comments

@drewstone
Copy link
Contributor

Overview

In an ideal world where a relayer can be trusted (wink wink SGX), it would be a huge performance improvement to be able to get a user's merkle path for a record/note commitment from the node storing all the leaves. This would eliminate the need for the client to download and cache all leaves locally, since they can just query this relayer for their proofs.

Description

Extend the leaf caching relayer with an API that fetches the Merkle path for a given leaf / set of leaves.

Acceptance Criteria

  • The API should have a get_merkle_path method which takes a leaf (or set of leaves) and returns the Merkle path for the leaf(s).
  • The method should return an error if the leaf is not present in the Merkle tree.
  • Implement tests to ensure that the get_merkle_path function works as expected, returning the correct Merkle path for existing leaves and returning an error for non-existing leaves.
@drewstone
Copy link
Contributor Author

The eventual goal is to run part of this inside SGX. We can also consider adding a method for doing the entire proof generation in the relayer as well, which we will also only consider in a trusted environment like SGX.

@shekohex shekohex added p3 🔵 Issues should be resolved eventually feature ➕ Tasks that are functional additions or enhancements difficulty: challenging 🏴‍☠️ labels May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: challenging 🏴‍☠️ feature ➕ Tasks that are functional additions or enhancements p3 🔵 Issues should be resolved eventually
Projects
None yet
Development

No branches or pull requests

2 participants