Private Voting on Snapshot X
Last updated
Last updated
Snapshot X is a voting protocol implemented fully on-chain. It enables automatic transacting following the passing of a proposal (as part of, e.g., DAO governance). For extensive documentation of Snapshot X, refer to the technical documentation.
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.
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 CryptosatPrivateVoting
contract.
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.
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_voting
library. 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.
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 _winner
field that is updated on-chain by the Cryptosat backend.