Zero Knowledge Governance for DAOs on Starknet

By team: Verse

Overview

Modern digital identity systems, while enabling complex online interactions, have significant weaknesses due to centralized control, making them vulnerable to coercion, hacking, and misalignment with user interests. Decentralized, cryptographic mechanisms like zkSNARKs offer solutions by enabling credible claims without a trusted authority. This shift allows users to control their identity data, enhancing security and privacy. This has been our greatest inspiration to create the Zero Knowledge Governance Solution for Starknet.

The Starknet ecosystem is home to several prominent projects like Realms and Ekubo, which are governed and managed by DAOs. These organizations are committed to the principles of transparency, decentralization, and community-driven governance. Despite these ideals, there remains a significant reluctance among community members to engage in governance. The primary concern is the visibility of their voting actions on the blockchain, which can expose sensitive information regarding their decisions and influence.

While zkSNARKs inspire us to explore technology creating secure, privacy-preserving identity systems,vbuterin’s vision for minimal anti-collusion infrastructure (MACI) provides a foundational principle for our proposal. MACI focuses on offering collusion resistance with centralized trust while ensuring blockchain guarantees of correct execution and censorship resistance. By using a trusted operator to manage keys and actions, encrypting messages to maintain vote privacy and integrity, this method prevents bribery and ensures votes are counted accurately without exposing individual choices.

Zero Knowledge (ZK) Governance building on MACI abstracts governance voting to ensure privacy and collusion resistance using encryption and zero-knowledge proofs. With a trusted coordinator managing key changes and actions, providing credible results without revealing individual votes. This approach ensures voting remains private, secure, and verifiable without exposing voters’ identities or their choices. This innovation encourages greater participation in DAO governance by safeguarding the anonymity and confidentiality of each vote, while still maintaining the integrity and trustworthiness of the voting process. When integrated into Starknet’s governance platform, this solution can significantly enhance participation rates and foster a more inclusive governance environment.

Source: MACI Introduction. Introduction to MACI | MACI

Problems with Current On-Chain Governance

DAOs in the Starknet ecosystem currently face several challenges that hinder active participation in governance:

  • Lack of Privacy: Voting actions are publicly visible on the blockchain, leading to concerns about exposing decisions and associated assets.

  • Fear of Repercussions: Members may avoid voting on sensitive or controversial issues due to potential social or financial backlash.

  • Transparency vs. Confidentiality: There is a conflict between the need for transparent governance and the desire to keep individual voting choices private.

  • Influence and Bias: Public voting records can lead to undue influence, where the votes of prominent members sway the opinions of others.

  • Low Participation Rates: The visibility of votes discourages engagement, leading to lower participation in governance processes.

  • Data Sensitivity: Voters prefer to keep their voting history and the details of their holdings confidential to avoid revealing personal strategies.

Zero Knowledge Governance Solutions for Starknet

Zero Knowledge Governance (ZK Governance) offers a comprehensive solution to these challenges by balancing the need for transparency in governance with the privacy of individual voters. Key features of ZK Governance for Starknet DAOs include:

  1. Zero-Knowledge Proofs for Voting Privacy: Utilizes zero-knowledge proofs to validate that a vote was cast by a legitimate wallet address and backed by real assets, without revealing the voter’s identity or choice. This ensures that voting is private and secure, fostering greater confidence in the voting process.

  2. Anonymity in Participation: Ensures that whether a wallet has voted, the direction of the vote (yes or no), and the amount of voting power exercised remain confidential. This privacy encourages members to participate without fear of repercussions or undue influence.

  3. Snapshot-based Asset Validation: Assets are validated at the time of voting through a snapshot taken at a specific block height, ensuring the vote’s legitimacy without exposing details on the blockchain. This method ensures that votes are cast by eligible participants without compromising their privacy.

  4. Encouraged Participation: By protecting voters from potential backlash or influence, ZK Governance promotes more active and diverse participation in governance decisions. This leads to a more robust and representative decision-making process within DAOs.

  5. Equal Voting Power: Maintains the principle of token-weighted voting without compromising voter privacy. This ensures that all stakeholders have a fair say in governance matters while protecting their anonymity.

  6. Secure and Verifiable: The integrity of the voting process is upheld through secure cryptographic methods, ensuring that all votes are counted accurately and fairly. This transparency helps build trust in the governance system.

  7. Enhanced Community Trust: By safeguarding individual privacy, ZK Governance fosters a more trusting and open community environment where members feel safe to express their opinions. This trust is crucial for the healthy functioning of DAOs in the Starknet ecosystem.

MACI on Starknet’s Governance
Detailed Introduction to MACI in Starknet Governance

Participants

  • Voters: Only holders and delegates of L1 (Ethereum) STRK and L2 (Starknet) vSTRK have the right to vote, referred to as voters. Voters need to register with MACI before they can cast their votes.
  • Trusted Coordinators: Coordinators help set up and execute MACI voting. They are responsible for deploying the MACI smart contracts, initiating the voting, tallying the final results, and completing the voting process by publishing the final results on-chain.

Codebase

  • Circom Circuits:

MACI uses multiple circuits to ensure all off-chain computations are done correctly. These circuits generate zero-knowledge proofs (zk-SNARKs) that prove the votes were tallied correctly. Specifically, they enforce that coordinators correctly executed message processing and vote counting. These proofs can then be verified by validator smart contracts on Starknet.

These zero-knowledge proof circuits are written in Circom 2.0. The main circuits include processMessages.circom and tallyVotes.circom, while other utility templates support the main circuits’ proper functioning. These utilities include floating-point arithmetic, private key transformations, and Poseidon hash/encryption among others.

  • Cairo Smart Contracts:

The MACI smart contracts handle the on-chain aspects of the voting system (functionality and storage). They provide functions for deploying votes, registering voters, and accepting votes. They also store and manage on-chain data from transactions, such as encrypted votes. Finally, they verify zk-SNARK circuit proofs so that everyone can validate the voting results.

The MACI smart contracts are written in Cairo.

  • TypeScript Libraries:

The TypeScript libraries manage the business logic between the smart contracts and circuit code. They offer various functionalities such as encryption tools, utilities, and a CLI for interacting with MACI (for operations like registration, voting, tallying, and generating proofs).

Voting Process Workflow

  • Registration:

Before voting, voters must generate a MACI key pair and send their public key to the MACI smart contract. This MACI public key serves as their identity when voting. Voters can delegate their voting rights to themselves or another address, but the message must include a signature from the MACI public key. If the voter holds STRK, the voting address is an Ethereum address. If the voter holds vSTRK, the voting address is a Starknet address.

  • Voting:

Once registered, voters can cast their votes during the open voting period. Voters bundle variables such as the public key, voting options, and the number of votes into a “command” and sign it with the MACI public key used during registration. The signed command is then encrypted along with the signature to form a “message”. If the message is correctly signed by the MACI public key, it is valid and will be included in the final tally.

Before sending the vote to Starknet, voters encrypt their votes using a shared key known only to themselves and the coordinator. This prevents anyone from viewing the vote content and allows the coordinator to decrypt the user’s vote for tallying.

  • Processing Messages:

Once voting ends, coordinators prove they have correctly decrypted each message and updated the state tree. The state tree records all valid votes, without retaining outdated messages overridden by new ones. For example, if a user first voted for option A and later changed their vote to option B, only the vote for option B is counted.

Coordinators process messages in batches to ensure on-chain proofs do not exceed data limits. A zk-SNARK proof is then created to show that the state tree contains only valid messages, providing the state tree’s hash and zk-SNARK proof.

These proofs are sent to the verifier contract on Starknet, which validates the proof. If the verifier contract returns true, it indicates the messages were processed correctly. Coordinators repeat this process until all messages are processed.

  • Tallying Results:

After all messages are processed, coordinators tally the votes of valid messages offline. A zk-SNARK proof is created to show the sum of votes in the state tree and provide the correct tally result’s hash and zk-SNARK proof.

Coordinators send these proofs to the verifier contract to ensure their validity. Once verified, users can trust that the votes were tallied correctly. Anyone can see the final tally results and proofs, but individual votes remain confidential, ensuring votes were correctly processed and counted.

  • Publishing Results:

After coordinators process all messages, tally the results, and publish zk-SNARK proofs, the voting is finalized.

At this point, the final voting results can be announced, and anyone can verify that the results were processed and calculated correctly by the coordinators.

Integration with Starknet’s Governance Platform
Starknet currently hosts a governance voting website designed to facilitate transparent decision-making within the ecosystem. Integrating ZK Governance to the existing governance platform, is to add a privacy layer to Starknet’s governance, lowering the barrier to participation and reducing the potential for collusion.

  • Increased Participation: By enhancing privacy, ZK Governance will encourage more community members to engage in governance, leading to higher participation rates and more robust decision-making processes.

  • Improved User Confidence: Addressing privacy concerns will make members feel more comfortable voting on sensitive issues without fear of exposure or backlash.

  • Enhanced Governance Quality: A more engaged community means more representative decisions that better reflect the collective interests of stakeholders.

Key deliverables will be the followings:

  1. An Anonymous Forum Section: Creating a forum section where users can discuss and deliberate without revealing their identities.

  2. Anti-Censorship/Anonymous Voting: Implementing a voting mechanism that ensures anonymity and resistance to censorship, promoting fair and free participations.

Benefits to the Starknet Ecosystem
Implementing Zero Knowledge Governance within the Starknet ecosystem will bring several advantages:

  • Higher Participation Rates: By ensuring voter privacy, ZK Governance can significantly boost participation rates in governance processes, leading to more democratic and representative outcomes.

  • Stronger Community Engagement: Addressing privacy concerns will foster a more active and involved community, which is vital for the success of DAOs.

  • Improved Decision-Making: With more members participating in governance, decisions will better reflect the community’s views and interests.

  • Enhanced Security: Zero-knowledge proofs provide a secure mechanism for voting, protecting the integrity of the governance process and reducing the risk of manipulation.

Conclusion

The Starknet ecosystem, with its leading DAOs like Realms and Ekubo, stands to greatly benefit from the adoption of Zero Knowledge Governance. By addressing privacy concerns and encouraging active participatio

n, ZK Governance will strengthen the governance framework of DAOs and contribute to a more vibrant and engaged community. We invite the Starknet community to consider this proposal and explore the potential of ZK Governance to enhance the governance processes within their DAOs.

Reference: