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

On-chain tally verification #115

Merged
merged 1 commit into from
Jun 11, 2020
Merged

On-chain tally verification #115

merged 1 commit into from
Jun 11, 2020

Conversation

weijiekoh
Copy link
Contributor

@weijiekoh weijiekoh commented Jun 9, 2020

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.

@weijiekoh weijiekoh self-assigned this Jun 9, 2020
@weijiekoh weijiekoh added the enhancement New feature or request label Jun 9, 2020
@weijiekoh weijiekoh added this to Needs review in Minimum Viable MACI Jun 9, 2020
@weijiekoh weijiekoh marked this pull request as ready for review June 9, 2020 15:50
@weijiekoh weijiekoh moved this from Needs review to Done in Minimum Viable MACI Jun 11, 2020
@weijiekoh weijiekoh merged commit 007aea5 into master Jun 11, 2020
@corydickson corydickson deleted the feat/tally-proofs branch June 7, 2022 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant