Closed rymnc closed 7 months ago
As per internal discussion, this feature will not be pursued since only one state transition proof may be accepted per block, and it would require an indexer to accept and aggregate registrations to the membership set.
Problem
The rln-contract is stateless, i.e we do not store the whole tree onchain, but we only store the commitments, and emit them as events for users to sync from scratch.
For users who just want to verify proofs, they have to sync the whole tree to know the current root
Proposed solution
We make use of a "merkle state transition proof" where we accept a merkle proof of the state before making an insertion, and the merkle proof of the state after the insertion. This will allow having the root of the new state onchain, while maintaining lower gas costs than having the whole tree onchain.
The proposed state transition circuit is as follows -