Skip to content

oxor-io/zk-layer-vote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zk-layer-vote

This repo contains source files of a cross-chain voting protocol for ETHGlobal Istanbul 2023.

Frontend

https://6559b054b025a87e3173ea8c--zk-layer-vote.netlify.app

Installation

Frontend module

  1. npm install - Install all dependencies
  2. npm run build - Build the project
  3. npm start - Start the frontend server

Backend module

  1. npm install - Install all dependencies
  2. docker-compose up - Run Redis in Docker
  3. npm start - Start the backend server

On-chain module

  1. npm install - Install all dependencies
  2. hardhat compile - Compile the smart contracts
  3. hardhat migrate - Deploy the smart contracts

ZK Proof generator

  1. npm install - Install all dependencies
  2. node generate.js - Generate the zero-knowledge proofs

Deployments

Twitter

Contract addresses

Sepolia

Scroll-sepolia

XDC-testnet

Arbitrum-sepolia

Polygon-zkEVM-testnet

Gnosis-mainnet

Celo-alfajores

Base-goerli

Linea-testnet

Introduction

Problem

  • For voting in DAO protocols, voting tokens (VTs) are required.

  • What happens if VTs are scattered across multiple networks simultaneously?

  • Two problems arise:

    1. The complexity of synchronizing voting results from multiple networks concurrently.
    2. The inability to deploy VTs in other networks due to bridge architecture limitations (converting VTs into ERC20 tokens).

Examples

  • 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.

Solution

A crosschain governance protocol that:

  1. Uses a trustless & universal architecture supporting multiple L2 networks, with VT on L1.

  2. Uses default ERC-20 to eliminate conflicts in the bridge architecture.

  3. Shifts the execution of L2-voting mechanisms to the ZKP-module, instead of using VT.

  4. Implements ZKP to validate the accurate delivery of L2 State data.

Architecture

ArchitectureScheme

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.

Demonstration

Future track

  1. Improving SNARK proofs aggregation.

  2. Implementing custom plugins for voting mechanisms:

    • OpenZeppelin Governor | Ethereum | link
    • Aragon | Ethereum | link
    • Tally | Ethereum | link
    • Guild | Ethereum | link
    • Llama | Ethereum | link
    • Colony | Ethereum | link
    • Snapshot | Ethereum | link

About

This repo contains source files of a cross-chain voting protocol for ETHGlobal Istanbul 2023.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published