This repo contains source files of a cross-chain voting protocol for ETHGlobal Istanbul 2023.
https://6559b054b025a87e3173ea8c--zk-layer-vote.netlify.app
npm install
- Install all dependenciesnpm run build
- Build the projectnpm start
- Start the frontend server
npm install
- Install all dependenciesdocker-compose up
- Run Redis in Dockernpm start
- Start the backend server
npm install
- Install all dependencieshardhat compile
- Compile the smart contractshardhat migrate
- Deploy the smart contracts
npm install
- Install all dependenciesnode generate.js
- Generate the zero-knowledge proofs
- VotesTokenL1 - 0x4d389dA3786036ee0b9aba8E4B99891a925d88D0
- GovernerL1 - 0xD7A1DC78F0E90Ab2645E1DbECf6135D17c7dA411
- StateRootL1 - 0xbb8c8E79c34C6420716A6937bF7E3B9226Cc81f5
- TokenL2 - 0xC007267DF5f0f7aEc5fb90CF03b56F051Bc6C89e
- DelegateL2 - 0x4d389dA3786036ee0b9aba8E4B99891a925d88D0
- TokenL2 - 0xbb8c8E79c34C6420716A6937bF7E3B9226Cc81f5
- DelegateL2 - 0x491A7D1A203980Fd5d2cdE093893FcdCf994291e
- TokenL2 - 0xC007267DF5f0f7aEc5fb90CF03b56F051Bc6C89e
- DelegateL2 - 0x4d389dA3786036ee0b9aba8E4B99891a925d88D0
- TokenL2 - 0xC007267DF5f0f7aEc5fb90CF03b56F051Bc6C89e
- DelegateL2 - 0x4d389dA3786036ee0b9aba8E4B99891a925d88D0
- TokenL2 - 0xbb8c8E79c34C6420716A6937bF7E3B9226Cc81f5
- DelegateL2 - 0x491A7D1A203980Fd5d2cdE093893FcdCf994291e
- TokenL2 - 0xC007267DF5f0f7aEc5fb90CF03b56F051Bc6C89e
- DelegateL2 - 0x4d389dA3786036ee0b9aba8E4B99891a925d88D0
- TokenL2 - 0x6c9373BaD4d213Ea0C796cCF039102B43341df24
- DelegateL2 - 0x507d16b08562Bc341775657C18eA2123EFc69FD1
- TokenL2 - 0xC007267DF5f0f7aEc5fb90CF03b56F051Bc6C89e
- DelegateL2 - 0x4d389dA3786036ee0b9aba8E4B99891a925d88D0
-
For voting in DAO protocols, voting tokens (VTs) are required.
-
What happens if VTs are scattered across multiple networks simultaneously?
-
Two problems arise:
- The complexity of synchronizing voting results from multiple networks concurrently.
- The inability to deploy VTs in other networks due to bridge architecture limitations (converting VTs into ERC20 tokens).
- Uniswap V3 |
UNI
token | OpenZeppelin Governor + Snapshot - Lido V2 |
LDO
token | Aragon - Curve |
CRV
token | Aragon - ENS |
ENS
token | Snapshot + Tally - Balancer |
BAL
token | Snapshot - … and any other protocols with a VTs in L1 that lack implementations in L2.
A crosschain governance protocol that:
-
Uses a trustless & universal architecture supporting multiple L2 networks, with VT on L1.
-
Uses default ERC-20 to eliminate conflicts in the bridge architecture.
-
Shifts the execution of L2-voting mechanisms to the ZKP-module, instead of using VT.
-
Implements ZKP to validate the accurate delivery of L2 State data.
Step 1. VT → Bridge → ERC-20
Step 2. We use standard ERC-20 (or delegate storage), aggregate information about balances recorded in the snapshot, and send it to the Frontend for further use.
Step 3. Through the Frontend, the Proof Generator receives information about ChainId
, Voter Address
, and Vote
; based on these values, the Proving System generates a SNARK proof and commits it to the votes aggregator on L1.
Step 4. The main Voting Contract accounts for votes from all networks, incorporates them into the quorum, and distributes them across the proposal options. Voting is finished.