Comment on page
Private Voting on Snapshot X
Cryptosat extends SnapshotX with the capability of casting votes privately. While the final election result is disclosed and acted upon by the smart contract, the individual votes are protected and hidden from public view.
SnapshotX and Cryptosat integration diagram
Today, Cryptosat relies on its Private Voting library implemented in Rust to implement tallying aboard the satellite. The satellite public key and Cryptosat's encryption API can be used by voters to encrypt their votes. Privacy is guaranteed since the votes can only be decrypted in space, and the votes are never sent back to earth, just the final result.
In the future, and in order to maintain compatibility with the non-private on-chain version of Snapshot X, Cryptosat will run an EVM aboard its satellite, executing a replica of the Snapshot X on-chain smart contract.
Authentication is done using existing Snapshot X authentication mechanisms. Using Cryptosat's Private Voting doesn't change the authentication methods.
Today, we implement a simple voting strategy where each token has 1 voting power.
All methods are exposed via the
- 1.Admin - Initializes Ballot: Admin triggers
init(minimum voters: int)method to initialize the ballot. Can only be triggered by a designated wallet address. The minimum number of voters must be equal or bigger than 2.
- 2.Voting phase: Each voter encrypts their vote using the published satellite private key. The front-end application can implement this functionality using Cryptosat's
private_votinglibrary. For example
encrypted_vote = encrypt_message(pubkey, "candidate-1");Then, the voter calls the
vote(encrypted_vote)method, with the encrypted vote as a parameter.
- 3.Admin - Finalizes Ballot: By triggering the
finalize()method, the admin can finalize the vote tally after the minimum number of votes has been cast. The winning option will is revealed through the Cryptosat smart contract
_winnerfield that is updated on-chain by the Cryptosat backend.