Skip to content

Simple demo to allow only users of gold groups to vote anonymously in a ballot.

License

Notifications You must be signed in to change notification settings

interep-project/voting-app

Repository files navigation

Interep Voting App

Simple demo to allow only users of gold groups to vote anonymously in a ballot.

Github license Linter eslint Code style prettier Repository top language

Interep is made of several components. The purpose of this demo is to show how to start integrating contracts and libraries, and how these components interact. This demo consists of a frontend, where users can create their own zero-knowledge proof for anonymous voting, and a backend, where an admin receives the anonymous proofs and sends transactions for onchain voting.

Components

flowchart TD
    subgraph in [Interep]
    inwa([Web App]) --- insid
    insid[/Semaphore ID/] --->|Allows users \nto join groups| rs
    rs{{"Back-end\n(Reputation Service)"}} --->|Stores Merkle trees| db[(MongoDB)]
    rs -->|Saves Merkle roots \nevery N minutes| ic{{Interep Contract}}
    ic --- isc{{Semaphore Contracts}}
    rs --- api{API}
    end
    subgraph cl [Client]
    cwa([Web App]) --- csid
    api -->|Provides group data| cwa
    csid[/Semaphore ID/] --->|Allows users \nto generate zk-proofs| cbe{{Back-end}}
    cbe -->|Sends transaction| cc{{Client Contract}}
    cc -->|Verifies zk-proofs| ic
    end
Loading

* Groups are Merkle trees
* Group members are Merkle tree leaves
* Merkle tree leaves are Semaphore IDs
* Semaphore IDs are used to join groups and generate ZK proofs

Usage

1. Setup

1.1 Voting App

Clone this repository and install its dependencies:

git clone https://github.com/interep-project/voting-app.git && cd voting-app && yarn

1.2 Interep Contracts & Reputation Service

Clone the contracts and reputation-service repositories and install their dependencies.

2. Compile

Compile the smart contracts on voting-app and contracts:

yarn compile

3. Deploy

3.1 Local network

Start an Hardhat network on contracts:

yarn start

3.2 Deploy contracts

Deploy the smart contracts on voting-app and contracts:

yarn deploy --network localhost

4. Web apps

Start the web apps on voting-app and reputation-service:

yarn dev

About

Simple demo to allow only users of gold groups to vote anonymously in a ballot.

Resources

License

Stars

Watchers

Forks