newsence
來源篩選

Exploring coordinator hiding in ZK voting: homomorphic tally without decrypting individual votes

ethresear.ch

I’ve been exploring a different design space for private onchain voting, specifically around what the coordinator should and shouldn’t see, and whether voter addresses appear onchain at all. ## Motivation Most ZK voting schemes (like MACI) focus on **anti collusion**: preventing voters from proving how they voted to a briber. The coordinator decrypts all votes at the end to compute the tally, which is fine under this threat model. I was curious about a stricter model where the tallying coordinator is not trusted with per vote plaintext visibility. **Why does this matter?** - **Coordinator insider risk**: Even a trusted coordinator can be compromised, bribed, or coerced into leaking individual votes - **Data minimization**: If you don’t need per vote data, don’t collect it - **Governance manipulation**: Knowing how specific parties voted mid process could enable targeted pressure or strategic changes In contexts where the coordinator is a DAO multisig, a third party service, or any entity with potential conflicts of interest, hiding individual votes from the coordinator may be a meaningful property. ## Design Overview The system I built uses: - **Relayed transactions** so voter addresses never appear onchain - **ElGamal encryption on BabyJubJub** for votes - **Homomorphic addition** of encrypted votes (no per vote decryption) - **Groth16 proofs** for both vote validity and tally correctness - **Native token weighted voting** for DAO governance use cases ### Vote Submission Each voter encrypts their choice with the coordinator’s public key and submits a Groth16 proof showing: - Membership in a Merkle tree of eligible voters - Correct nullifier derivation (prevents double voting) - Valid EdDSA signature The coordinator relays the transaction onchain, so the voter’s EOA never appears as a transaction sender. ### Tally Instead of decrypting each vote, the coordinator: 1. Homomorphically sums all encrypted votes 2. Decrypts only the aggregate using BSGS (baby step giant step) 3. Generates a tally proof verifying correct aggregation and decryption ``` MACI style: Enc(v1) → Dec(v1), Enc(v2) → Dec(v2), … → sum This system: Enc(v1) + Enc(v2) + … = Enc(sum) → Dec(sum) → BSGS → result ``` The discrete log is bounded by the maximum total voting weight (currently hardcoded to 1,000,000), making BSGS feasible with minimal computation. ## Comparison with MACI | | MACI | This approach | |—|------|---------------| | **Coordinator sees individual votes** | Yes (decrypts each) | Not by design (only aggregate decryption performed) | | **Voter address onchain** | Yes (voter calls contract) | No (coordinator relays) | | **Blockchain scan reveals voters** | Yes (EOAs visible) | No (only coordinator address) | | **Anti collusion** | Yes (key rotation) | Partial (no receipt, but no key rotation) | | **Weight based voting** | Requires customization | Native (token weighted) | | **Tally complexity** | O(n) decryptions | O(1) decryption + BSGS | These are different threat models, not competing implementations: - **MACI**: “Protect the voter from external pressure”, anti bribery centered - **This approach**: “Limit what everyone, including the coordinator, can learn”, data minimization centered ## Limitations (Honest Assessment) **Coordinator single key**: Currently the coordinator holds a single decryption key. The protocol only performs aggregate decryption, but a malicious coordinator could technically decrypt individual ciphertexts. Threshold ElGamal (k of n) would eliminate this capability, so no individual keyholder could decrypt alone. **No anti collusion**: Without MACI’s key rotation mechanism, a voter could potentially prove how they voted. This is an intentional scope decision: the threat model prioritizes coordinator hiding over bribery resistance. **Relayer censorship**: The coordinator relays all votes, which introduces a censorship surface. A malicious coordinator could selectively refuse to submit votes. ## Questions 1. Are there known attacks on this model I should consider? 2. Any thoughts on combining coordinator hiding with stronger anti collusion? 3. Does the relayer model introduce assumptions I’m underestimating? I have a working implementation with onchain verification on Sepolia. Happy to share the demo walkthrough if useful for context: github.com/0xgumi/Commitra samples/demo/walkthrough.md 36332ee56 # Demo Walkthrough: End-to-End Vote Lifecycle This document traces a **complete vote session** on the Commitra demo environment, from vote creation to on-chain tally finalization. This walkthrough is based on the public demo environment, which intentionally simplifies certain assumptions while preserving the full verification model. Every step includes either a **browser screenshot** or an **on-chain transaction link**, allowing independent verification without access to any source code. **Network:** Ethereum Sepolia **Vote session:** voteId = 123 **Title:** Governance Proposal: Community Fund Allocation --- ## Step 1. Vote creation This file has been truncated. show original Feedback welcome. 1 post - 1 participant Read full topic

newsence

探索零知識證明投票中的協調者隱藏:無需解密單獨選票的同態計票方案

ethresear.ch
8 天前

AI 生成摘要

我一直在探索一種不同的鏈上隱私投票設計空間,特別是圍繞協調者應該與不應該看到什麼,以及投票者地址是否出現在鏈上。我對一種更嚴格的模型感到好奇,在這種模型中,計票協調者不被信任擁有單獨選票的明文可見性。

探索零知識投票中的協調者隱藏:無需解密個別選票的同態計票 - zk-s[nt]arks - Ethereum Research

在許多零知識(ZK)投票方案中,協調者(Coordinator)扮演著至關重要的角色。然而,這也帶來了潛在的隱私風險,特別是如果協調者能夠存取個別選票。本文探討了一種旨在增強隱私的技術:協調者隱藏(Coordinator Hiding),其重點在於如何在不解密單獨選票的情況下實現同態計票(Homomorphic Tallying)。

核心挑戰

傳統的 ZK 投票系統通常依賴協調者來處理選票並產生計票結果。如果協調者可以解密每張選票,他們就可能:

  1. 洩露選民隱私。
  2. 根據中間結果操縱投票過程。

同態計票的解決方案

同態加密(Homomorphic Encryption, HE)允許對加密數據進行運算,其結果解密後與對明文進行相同運算的結果一致。在投票場景中:

  • 加密選票: 每位選民提交其選擇的加密版本。
  • 聚合: 系統(或協調者)在不解密的情況下,將所有加密選票相加。
  • 解密結果: 僅對最終的聚合結果進行解密,從而得出總票數。

關鍵優勢

  1. 個別選票隱私: 由於協調者只解密最終總和,因此無法得知任何特定選民的選擇。
  2. 可驗證性: 結合 zk-SNARKs,協調者可以證明計票過程是正確執行的,而無需揭露輸入數據。

實作考量

要有效實施無需解密個別選票的協調者隱藏,需要考慮以下幾點:

  • 閾值解密(Threshold Decryption): 將解密密鑰分配給多個參與方,確保沒有單一實體可以單方面解密結果。
  • 零知識證明(Zero-Knowledge Proofs): 選民必須提供證明,確保其加密選票是有效的(例如,符合格式要求,且未超出投票限制)。
  • 效能開銷: 同態運算和生成相關的 ZK 證明在計算上可能非常耗時,需要針對大規模投票進行優化。

結論

透過結合同態加密與零知識證明,我們可以構建出更強大的投票系統,在不犧牲可驗證性的前提下,實現更高層級的協調者隱私。這種方法確保了即使是處理數據的實體,也無法窺探選民的個人選擇,從而增強了去中心化治理系統的信任基礎。