🛠️ Building private voting isn’t easy—but it’s worth it!
We know this can get technical, so we’ll keep it as clear and to the point as possible. We’ll break down the requirements and how we’re designing a system for secure, private, and verifiable voting.
Ready?
🧩 The core requirements:
› Encrypt votes client-side & store them encrypted on-chain
› Keep vote values hidden while markets are live
› Decrypt votes only after the market closes
› Tie each vote to its user to update reputation accurately
Here's how we make it happen. 👇
🔐 First, encryption:
→We use TLE (Time-Lock Encryption) offered by the Drand Network (@drand_loe) which allows us to use a public key to encrypt votes which would ONLY be decrypt-able by a private key which is released in the future by the Drand Network.
→Users encrypt their votes off-chain using Drand's public key + a salt value. This ensures votes are private and are difficult to guess. When encrypted, the votes are submitted as a ciphertext to the contract.
What happens when voting ends? 🤔
📊 After the market closes:
› Olas Coordinator decrypts the individual votes using the private key released by Drand
› Olas Coordinator aggregates the votes, creates a Merkle Tree and calculates the final tally.
› Aggregation results (i.e. the Merkle Root, Final Tally) are submitted back to the contract on-chain
› Olas contract uses a randomness oracle (currently experimenting with @pragmaoracle, @cartridge_gg VRF and @chainlink VRF for our randomness needs) to select votes at random which are decrypted and verified against the Merkle Tree to achieve a statistical certainty that votes were correctly aggregated.
Still, there’s more to refine.
For now, encrypted votes become public after market settles.
Full privacy? That’s next! We’re exploring advanced cryptography techniques like homomorphic encryption to keep votes private forever. More on this in future updates. 💭