Skip to content

Commit

Permalink
docs(docs): improved docs, added resources (#1843)
Browse files Browse the repository at this point in the history
Co-authored-by: Crisgarner <@crisgarner>
  • Loading branch information
crisgarner authored Oct 1, 2024
1 parent b608f77 commit 6d08c1a
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 7 deletions.
10 changes: 10 additions & 0 deletions apps/website/src/content/projects.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
"github": "https://github.com/gitcoinco/MACI_QF"
}
},
{
"name": "DoraHacks Light-Weight MACI",
"description": "DoraHacks MACI is a light-weight implementation of MACI.",
"hackathon": null,
"status": "Production",
"links": {
"github": "https://github.com/dorahacksglobal/qf-maci",
"website": "https://dorahacks.io/blog/guides/maci-qv-guide/"
}
},
{
"name": "MACI Platform",
"description": "a platform that allows to run different types of vote and funding rounds using MACI.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,35 @@ sidebar_position: 9

MACI allows to conduct polls in both a quadratic voting and non quadratic voting fashion. One should be aware that the only distinction between the two happens when messages are processed and votes tallied. On top of that, the Tally smart contract has been split into two different ones, with the non quadratic voting version one being slightly smaller, due to the need of one less function.

This document will explain how to use each of these options.
This document will explain how to use each of these options. Hardhat tasks are the currently recommended way to deploy contracts and run polls but you can also use the MACI cli.

## Quadratic Voting

MACI has always worked with quadratic voting. Users signing up to MACI are assigned a number of voice credits based on certain conditions (enforced by the [initial voice credit proxy contract](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/initialVoiceCreditProxy/InitialVoiceCreditProxy.sol)), and after each vote, the number of voice credits is reduced by the square of the weight of the vote casted. For instance, if the vote weight is 5, a user must have at least 25 voice credits to cast the vote.

To run a poll with quadratic voting, the coordinator must deploy the Poll with the mode set to quadratic voting.

Using MACI's cli, one can create a MACI instance with quadratic voting by running the following command:
### Using Hardhat tasks

In the deploy-config.json file set the `useQuadraticVoting` value to **true**.

```json
"Poll": {
"pollDuration": 604800,
"coordinatorPubkey": "macipk",
"useQuadraticVoting": true
}
```

Then run the task to create a poll:

```bash
pnpm deploy-poll:NETWORK
```

### Using MACI's cli

One can create a MACI instance with quadratic voting by running the following command:

```bash
maci-cli create -uq true $OTHER_PARAMETERS
Expand Down Expand Up @@ -43,7 +63,27 @@ The non quadratic voting option is a new feature that has been added to MACI wit

To run a poll with non quadratic voting, the coordinator must set the `useQuadraticVoting` parameter to `false` when creating the MACI instance. This will make the MACI instance use the `TallyNonQv` smart contract, which is a smaller version of the `Tally` smart contract, as it does not require the checks for the quadratic voting mechanism.

Using MACI's cli, one can create a MACI instance with non quadratic voting by running the following command:
### Using Hardhat tasks

In the deploy-config.json file set the `useQuadraticVoting` value to **false**.

```json
"Poll": {
"pollDuration": 604800,
"coordinatorPubkey": "macipk",
"useQuadraticVoting": false
}
```

Then run the task to create a poll:

```bash
pnpm deploy-poll:NETWORK
```

### Using MACI's cli

One can create a MACI instance with non quadratic voting by running the following command:

```bash
maci-cli create -uq false $OTHER_PARAMETERS
Expand Down
4 changes: 2 additions & 2 deletions apps/website/versioned_docs/version-v2.x/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ MACI is an Ethereum application that provides privacy and collusion resistance f

MACI counters this problem by using encryption and zero-knowledge proofs (zk-SNARKs) to hide how each person voted while still publicly revealing the final result. User’s cannot prove which option they voted for, and therefore bribers cannot reliably trust that a user voted for their preferred option. For example, a voter can tell a briber that they are voting for option A, but in reality they voted for option B. There is no reliable way to prove which option the voter actually voted for, so the briber has less incentive to pay voters to vote their way.

Applications like [clr.fund](https://clr.fund/) build atop MACI to increase
Applications like [clr.fund](https://clr.fund/) or protocols like [Allo](https://github.com/gitcoinco/MACI_QF) build atop MACI to increase
user privacy and discourage collusion or bribery for public goods funding.

## Features
Expand All @@ -44,7 +44,7 @@ The participants of a MACI voting process are: 1) the voters and 2) a trusted co
Note that MACI presumes an identity system where each legitimate member
controls a unique Ethereum private key.

For information on MACI's latest features, please check out our [MACI v1.2.0 release post](/blog/maci-v1-2-0-release).
For information on MACI's latest features, please check out our [MACI v2.0.0 release post](/blog/2024-v2).

## Background

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ sidebar_position: 3
- [Technical Introduction to MACI 1.0](/blog/maci-1-0-technical-introduction) - Kyle Charbonnet 01/2022
- [MACI v1.1.1 Release](/blog/maci-v1-1-1-release) - ctrlc03 && chaosma 01/2023
- [MACI v1.2.0 release post](/blog/maci-v1-2-0-release) - ctrlc03 02/2024
- [MACI v2.0.0 release post](/blog/2024-v2) - ctrlc03 08/2024

## Videos

Expand All @@ -22,7 +23,10 @@ sidebar_position: 3
- [Anonymity in MACI](https://www.youtube.com/watch?v=X54LaXfJTn4) - Marija Mikić 07/2023
- [Seeing like a Voting](https://youtu.be/euhugXsTUgY?si=jNhqmvFYD9F0r-tB) - Daehyun 11/2023
- [MACI - Private Voting](https://www.youtube.com/watch?v=85bZwcQIgEo&t=1382s) - ctrlc03 03/2024
- [Construyendo votaciones privadas onchain con MACI](https://www.youtube.com/watch?v=3u5VJJsKLfg) - Cris Garner 03/2024
- [Construyendo votaciones privadas onchain con MACI](https://www.youtube.com/watch?v=3u5VJJsKLfg) - Crisgarner 03/2024
- [MACI - Starting From Scratch](https://www.youtube.com/watch?v=qVuhWlHnQF0) - Doris Chan 03/2024
- [MACI Workshop](https://www.youtube.com/watch?v=AimgqnMjG0o) - ctrlc03 04/2024
- [MACI Starter Kit Demo](https://www.youtube.com/watch?v=pYoBLLtVEoI&t=1s) - Yash 05/2024
- [MACI Tutorial Deploying Contracts and Subgraph](https://www.youtube.com/watch?v=-QA0VB9EUMk) - Crisgarner 09/2024
- [MACI Tutorial Frontend Deployment 🚀](https://www.youtube.com/watch?v=q0yS8RfwDcw) - Crisgarner 09/2024
- [Finalizing a MACI Round](https://www.youtube.com/watch?v=nlS3hOC0ljw) - Crisgarner 09/2024
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ controls a unique private key - MACI does not specifically solve for this, but a

Once a user has signed up with MACI, they are eligible to vote on open polls.

To cast a vote, a user will bundle a few variables — including a public key, their vote option, their vote amount, and a few others — into what is called a "command". Then, the user signs the command with the public key they originally used to sign up. After that, the user encrypts the signature and command together so that it is now considered a "message". If the command is properly signed by the user’s MACI public key, then the message is considered valid will be counted in the final tally. Therefore, the MACI public key can be thought of as the user’s voting username, and the signature is the voting password. If they provide the correct signature, they can submit a vote.
To cast a vote, a user will bundle a few variables — including a public key, their vote option, their vote amount, and a few others — into what is called a "command". Then, the user signs the command with the private key they originally used to sign up. After that, the user encrypts the signature and command together so that it is now considered a "message". If the command is properly signed by the user’s MACI public key, then the message is considered valid will be counted in the final tally. Therefore, the MACI public key can be thought of as the user’s voting username, and the signature is the voting password. If they provide the correct signature, they can submit a vote.

Before sending their vote on-chain, users encrypt their vote using a shared key that only the user and coordinator can know. This key scheme is designed so that every individual user shares a distinct key with the coordinator. This prevents any bribers from simply reading the transaction data to see which option a user voted for. It also allows the coordinator to decrypt user votes (so that they can tally the results).

Expand Down

0 comments on commit 6d08c1a

Please sign in to comment.