owned this note changed 2 years ago
Linked with GitHub

Process Steps

  • ✅ Signature from Metamask
  • ✅ Hash signature to obtain Baby Jubjub private key (e.g. split the 256-bit string into two 128-bit ones x1, x2 and compute poseidon([x1, x2]))
  • ✅ Submit the public key of this private key to the zkRegistry
  • Create process, which consists of the following steps:
    • ✅ Request TLCS public key and round number:
    • Form the census at the current block number:
      • Fetch data (block header, storage roots) from Ethereum node (Infura works for old blocks)
      • Generate Noir proof that the storage roots correspond to the current block number
    • Block on the preceding two steps (run as threads)
    • Submit relevant data to smart contract
  • Submit vote
    • Fetch storage proofs from Ethereum node
    • Generate proof that you are eligible to vote
    • Submit relevant data to smart contract
  • Tally
    • ✅ Request TLCS private key
    • Fetch relevant events from blockchain
    • Decrypt ballots
    • Compute tally
    • Generate proof that the tally was computed properly
    • Submit relevant data to smart contract

As we're wrapping up our private voting project for @NounsDAO, we'd like to show you our prototype 👇

Step 0) Wallet registration (strictly only once per wallet): After connecting their wallet and generating their purpose-made Baby Jubjub private key, prospective voters submit the corresponding public key to the zkRegistry using the reg-key command (alternatively it can be done via this webapp):

Step 1) Voting process creation: Anyone may create a voting process. For this, they need to submit census data together with a zero-knowledge proof, which is taken care of by the create-process command:

Step 2) Vote cast: With the voting process ID, their NFT ID and their decision in mind, a voter may submit their ballots privately with the help of storage proofs. If they are a delegate, they must explicitly supply their address, which will be passed as a private input to their zero knowledge proof of eligibility to vote. This is the purpose of the vote command:

Step 3) Tally: And after all is said and done, anyone may tally up the results and submit them to the smart contract by means of the tally command, with an accompanying ZK proof of course:

In the background, the Timelock service ensures that ballots are encrypted for the duration of the process.

All of these proofs are generated by @AztecNetwork's @NoirLang. Next stop: Private voting in the browser.

Select a repo