WARNING - THIS IS A DRAFT
This repository contains two Circom circuits:
auto_tally.circom: A circuit for automatic tallying of votes.auto_vote_submission.circom: A circuit for automatic vote submission with additional checks.
The auto_tally.circom circuit is designed to automatically tally votes based on predefined constraints. It includes the following checks:
Keccak<HashChainValue, Result> = ParamsHash: Computes the Keccak hash ofHashChainValueconcatenated withResultand compares it withParamsHash.HashChain<(encVote, pubKey)[]> = HashChainValue: Generates a hash chain of encrypted votes and public keys and compares it withHashChainValue.Enc<Vote, DHKey> = _encVote: Encrypts the vote using a Diffie-Hellman key and compares it with_encVote.Sum<Vote> = Result: Computes the sum of votes and compares it withResult.
The auto_vote_submission.circom circuit facilitates automatic vote submission with additional checks. It includes the following constraints:
Keccak<voteContextHash, delegatorEmbeddingHash, _encVote> = publicInput1: Computes the Keccak hash ofvoteContextHash,delegatorEmbeddingHash, and_encVoteand compares it withpublicInput1.Enc<Vote, DHKey> = _encVote: Encrypts the vote using a Diffie-Hellman key and compares it with_encVote.Model<voteContext, delegatorEmbedding> = Vote: Models the vote context and delegator embedding and compares it with the vote.Keccak<voteContext> = voteContextHash: Computes the Keccak hash of the vote context and compares it withvoteContextHash.Keccak<delegatorEmbedding> = delegatorEmbeddingHash: Computes the Keccak hash of the delegator embedding and compares it withdelegatorEmbeddingHash.
For more information on integrating these circuits into MACI circuits, refer to the MACI documentation.