Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new contract function
MACI.verifyTallyResult()
which any contract can call to prove that they know the value of a vote tally leaf, or a batch of vote tally leaves.Refer to #108 and #91 for more information.
The gist of it is that this function accepts a Merkle proof and the vote tally salt, recomputes the result commitment, and checks whether it matches the result commitment stored on-chain.
To prove that one knows the value of a batch of vote tally leaves, do the same but the Merkle proof should be a path to the intermediate node. e.g. I can prove that I know leaves 5-9 using a Merkle proof to intermediate node 1.
See the new unit tests in
batchProcessMessageAndQuadVoteTally.test.ts
to see how this is done.