This project is about Ethereum smart contracts for running quadratic voting (QV). It can also be used as a starter to build more complicated QV applications on the minimal anti-collusion infrastructure (MACI).
yarn
to install the dependenciesyarn build
to compile the contracts and generate typechain files.yarn run test test/QuadraticVoting.ts
to run the tests.yarn start
to start localhost network.yarn hardhat run scripts/maci/0-deploy.ts --network localhost
to deploy contracts.yarn hardhat run scripts/maci/6-genProofs.ts --network localhost
to generate proofs with docker-compose. (Note that you should have this maci docker image and the generated zkeys and witnesses.)./test/runScripts0-8.sh
to run through the cycle of maci. Quadratic voting is a way of making collective decisions, a tool to elicit individual preferences over a given set of options, and also called the demand-revealing process for public goods. See "Efficient collective decision-making, marginal cost pricing, and quadratic voting" for more details.
The idea is to associate a cost with a vote. Voters buy as many votes as they wish by paying the square of the number of votes they want to cast using some currency which is called “voice credit”. Each voter pays some voice credits for her votes, and a vote pricing rule is a quadratic function:
Cost to the voter = (Number of votes)^2
The cost to the voter, which is the payment for votes, may be through either an artificial currency or real money. So our degree of freedom is the design of the voice credit and the way of applying the voting results to the app.
There are two main considerations in designing a QV app:
This project is supported by the Ethereum Foundation ESP Grants and powered by the Privacy & Scaling Explorations team, thanks a lot!