webb-tools / zero-knowledge-gadgets

Zero-knowledge gadgets for Webb's cross-chain blockchain applications.
Apache License 2.0
89 stars 29 forks source link

[TASK] Update VAnchor to use new SetGadget #138

Closed lazovicff closed 2 years ago

lazovicff commented 2 years ago

VAnchor is using the old SetMembershipGadget that requires computing the diffs outside the circuit and passing them in. This means that you need to know the root beforehand, which is not an ideal way of making proofs. The root will be calculated inside the circuit, based on provided leaf pre-image and Merkle path, so the diffs will also be calculated inside the circuit.