arkworks-rs / crypto-primitives

Interfaces and implementations of cryptographic primitives, along with R1CS constraints for them
https://www.arkworks.rs
Apache License 2.0
165 stars 79 forks source link

Implement path pruning and multiple openings #124

Closed WizardOfMenlo closed 5 months ago

WizardOfMenlo commented 9 months ago

When opening many leaves of the same Merkle tree, one easy optimization is to do path pruning. Roughly, the authentication paths of the leaves will share some nodes, so it is not required to send the duplicates. This would involve:

  1. Adding a batch_open method to the Merkle tree
  2. Add a BatchedPath struct for multiple paths, with corresponding verification interface.

Again, this is a significant saving in practice for some things I am working on, and it would be nice to have it in arkworks :)