@maci-protocol/website 0.0.0-ci.eb89f0b → 0.0.0-ci.ebb44e9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docusaurus.config.ts +2 -2
- package/package.json +12 -12
- package/versioned_docs/version-v0.x/quadratic-vote-tallying-circuit.md +16 -16
- package/versioned_docs/version-v3.x/core-concepts/maci-keys.md +1 -1
- package/versioned_docs/version-v3.x/core-concepts/poll-types.md +31 -7
- package/versioned_docs/version-v3.x/core-concepts/polls.md +31 -7
- package/versioned_docs/version-v3.x/core-concepts/spec.md +8 -8
- package/versioned_docs/version-v3.x/core-concepts/workflow.md +1 -1
- package/versioned_docs/version-v3.x/guides/compile-circuits.md +31 -15
- package/versioned_docs/version-v3.x/guides/integrating.md +1 -1
- package/versioned_docs/version-v3.x/guides/sdk.md +121 -0
- package/versioned_docs/version-v3.x/guides/testing/testing-in-detail.md +1 -1
- package/versioned_docs/version-v3.x/guides/testing/testing-introduction.md +34 -2
- package/versioned_docs/version-v3.x/guides/troubleshooting.md +51 -6
- package/versioned_docs/version-v3.x/quick-start.md +24 -16
- package/versioned_docs/version-v3.x/resources.md +1 -0
- package/versioned_docs/version-v3.x/security/trusted-setup.md +35 -35
- package/versioned_docs/version-v3.x/supported-networks/costs.md +725 -0
- package/versioned_docs/version-v3.x/supported-networks/deployed-contracts.md +8 -8
- package/versioned_docs/version-v3.x/supported-networks/supported-networks.md +16 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/MACI.md +2 -2
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/MessageProcessor.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Params.md +2 -2
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Poll.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/PollFactory.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Tally.md +2 -2
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/VkRegistry.md +4 -4
- package/versioned_docs/version-v3.x/technical-references/technical-references.md +8 -8
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/processMessages.md +7 -3
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/setup.md +3 -3
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/tallyVotes.md +3 -3
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/utilities.md +2 -2
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +3 -3
|
@@ -7,14 +7,14 @@ sidebar_position: 2
|
|
|
7
7
|
|
|
8
8
|
There are a number of MACI's smart contracts which can be re-used by different deployments. These are the following:
|
|
9
9
|
|
|
10
|
-
- [VerifyingKeysRegistry](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/VerifyingKeysRegistry.sol)
|
|
11
|
-
- [PoseidonHashers](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/crypto/Hasher.sol)
|
|
12
|
-
- [PollFactory](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/PollFactory.sol)
|
|
13
|
-
- [MessageProcessorFactory](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/MessageProcessorFactory.sol)
|
|
14
|
-
- [TallyFactory](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/TallyFactory.sol)
|
|
15
|
-
- [Verifier](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/crypto/Verifier.sol)
|
|
10
|
+
- [VerifyingKeysRegistry](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/VerifyingKeysRegistry.sol)
|
|
11
|
+
- [PoseidonHashers](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/crypto/Hasher.sol)
|
|
12
|
+
- [PollFactory](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/PollFactory.sol)
|
|
13
|
+
- [MessageProcessorFactory](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/MessageProcessorFactory.sol)
|
|
14
|
+
- [TallyFactory](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/TallyFactory.sol)
|
|
15
|
+
- [Verifier](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/crypto/Verifier.sol)
|
|
16
16
|
- [FreeForAllPolicy](https://github.com/privacy-scaling-explorations/excubiae/tree/main/packages/contracts/contracts/extensions/freeForAll)
|
|
17
|
-
- [ConstantInitialVoiceCreditProxy](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.sol) - if you are happy to work with a fixed amount of credits
|
|
17
|
+
- [ConstantInitialVoiceCreditProxy](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.sol) - if you are happy to work with a fixed amount of credits
|
|
18
18
|
|
|
19
19
|
VkRegistries can be re-used by different protocols to share the same set of verifying keys. Please be advised that you should be verifying that those verifying keys are the ones that have undergone a trusted setup ceremony.
|
|
20
20
|
|
|
@@ -25,7 +25,7 @@ In order to verify you will need the following:
|
|
|
25
25
|
- run checkVerifyingKeys with the cli (see below)
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
cd cli && node build/ts/index.js checkVerifyingKeys -q false -vk 0x74569d524a193daC0D3Df17B9E207C916174745b -s 6 -i 2 -m 9 -v 3 -b 2 -p ./zkeys/
|
|
28
|
+
cd cli && node build/ts/index.js checkVerifyingKeys -q false -vk 0x74569d524a193daC0D3Df17B9E207C916174745b -s 6 -i 2 -m 9 -v 3 -b 2 -p ./zkeys/MessageProcessorQv_6-9-2-3/MessageProcessorQv_6-9-2-3.zkey -t ./zkeys/VoteTallyQv_6-2-3/tallyVotes_6-2-3.zkey
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
:::info
|
|
@@ -23,6 +23,14 @@ MACI has been tested on the following EVM networks:
|
|
|
23
23
|
- Gnosis Chiado
|
|
24
24
|
- Polygon
|
|
25
25
|
- Polygon Amoy
|
|
26
|
+
- Scroll
|
|
27
|
+
- Scroll Sepolia
|
|
28
|
+
- Linea
|
|
29
|
+
- Linea Sepolia
|
|
30
|
+
- Zksync Era
|
|
31
|
+
- Zksync Sepolia
|
|
32
|
+
- Polygon Zkevm
|
|
33
|
+
- Polygon Cardona Zkevm
|
|
26
34
|
|
|
27
35
|
We recommend using either Optimism, Arbitrum or Base. Please open an issue/PR if you intend to use other EVM networks and would like to contribute to this record of deployed and verified contracts as well as benchmarks, that would be greatly appreciated.
|
|
28
36
|
|
|
@@ -42,6 +50,14 @@ For better UX, MACI clients should be sending votes (messages) in batches. Depen
|
|
|
42
50
|
| Gnosis Chiado | 50 | 15921753 | 0.0000188313 ETH ($0.05) |
|
|
43
51
|
| Polygon | 85 | 26915773 | 0.0002193417259598 ETH ($0.54) |
|
|
44
52
|
| Polygon Amoy | 89 | 28192368 | 0.00017069180975304 ETH ($0.43) |
|
|
53
|
+
| Scroll | 62 | 19447318 | 0.000233368 ETH ($0.61) |
|
|
54
|
+
| Scroll Sepolia | 62 | 19447318 | 0.000233368 ETH ($0.61) |
|
|
55
|
+
| Linea | 14 | 4438205 | 0.00005325846 ETH ($0.1382) |
|
|
56
|
+
| Linea Sepolia | 14 | 4438205 | 0.00005325846 ETH ($0.1382) |
|
|
57
|
+
| Zksync Era | 2 | 24000690 | 0.00028801 ETH ($0.75) |
|
|
58
|
+
| Zksync Sepolia | 2 | 24000690 | 0.00028801 ETH ($0.75) |
|
|
59
|
+
| Polygon Zkevm | 6 | 1917872 | 0.00006904 ETH ($0.18) |
|
|
60
|
+
| Polygon Cardona | 6 | 1917872 | 0.00006904 ETH ($0.18) |
|
|
45
61
|
|
|
46
62
|
## Test yourself
|
|
47
63
|
|
|
@@ -6,7 +6,7 @@ sidebar_position: 1
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
:::info
|
|
9
|
-
Code location: [MACI.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/MACI.sol)
|
|
9
|
+
Code location: [MACI.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/MACI.sol)
|
|
10
10
|
:::
|
|
11
11
|
|
|
12
12
|
`MACI.sol` is the core contract of the project, as it provides the base layer for user signups and Polls to be created.
|
|
@@ -149,7 +149,7 @@ Polls require the following information:
|
|
|
149
149
|
- `coordinatorPubKey`: the public key of the poll's coordinator
|
|
150
150
|
- `verifier`: the address of the zk-SNARK verifier contract
|
|
151
151
|
- `vkRegistry`: the address of the vk registry contract
|
|
152
|
-
- `mode`: the mode of the poll, to set whether it supports quadratic voting
|
|
152
|
+
- `mode`: the mode of the poll, to set whether it supports quadratic voting, non quadratic voting, full credits voting
|
|
153
153
|
- `signUpPolicy`: the address of the sign up policy contract
|
|
154
154
|
- `initialVoiceCreditProxy`: the address of the initial voice credit proxy contract
|
|
155
155
|
- `relayers`: the addresses of the relayers for the poll (if offchain voting is enabled)
|
package/versioned_docs/version-v3.x/technical-references/smart-contracts/MessageProcessor.md
CHANGED
|
@@ -6,7 +6,7 @@ sidebar_position: 4
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
:::info
|
|
9
|
-
Code location: [MessageProcessor.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/MessageProcessor.sol)
|
|
9
|
+
Code location: [MessageProcessor.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/MessageProcessor.sol)
|
|
10
10
|
:::
|
|
11
11
|
|
|
12
12
|
This contract is used to prepare parameters for the zk-SNARK circuits as well as for verifying proofs. It should be deployed alongside a `Poll`.
|
|
@@ -6,7 +6,7 @@ sidebar_position: 9
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
:::info
|
|
9
|
-
Code location: [Params.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/
|
|
9
|
+
Code location: [Params.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/utilities/Params.sol)
|
|
10
10
|
:::
|
|
11
11
|
|
|
12
12
|
A contract holding three structs:
|
|
@@ -14,7 +14,7 @@ A contract holding three structs:
|
|
|
14
14
|
```ts
|
|
15
15
|
/// @notice A struct holding the depths of the merkle trees
|
|
16
16
|
struct TreeDepths {
|
|
17
|
-
uint8
|
|
17
|
+
uint8 tallyProcessingStateTreeDepth;
|
|
18
18
|
uint8 voteOptionTreeDepth;
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -6,7 +6,7 @@ sidebar_position: 2
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
:::info
|
|
9
|
-
Code location: [Poll.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/Poll.sol)
|
|
9
|
+
Code location: [Poll.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/Poll.sol)
|
|
10
10
|
:::
|
|
11
11
|
|
|
12
12
|
This contract allows users to submit their votes.
|
|
@@ -6,7 +6,7 @@ sidebar_position: 3
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
:::info
|
|
9
|
-
Code location: [PollFactory.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/PollFactory.sol)
|
|
9
|
+
Code location: [PollFactory.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/PollFactory.sol)
|
|
10
10
|
:::
|
|
11
11
|
|
|
12
12
|
`PollFactory` is a smart contract that is used to deploy new Polls. This is used by MACI inside the `deployPoll` function.
|
|
@@ -6,7 +6,7 @@ sidebar_position: 5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
:::info
|
|
9
|
-
Code location: [Tally.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/Tally.sol)
|
|
9
|
+
Code location: [Tally.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/Tally.sol)
|
|
10
10
|
:::
|
|
11
11
|
|
|
12
12
|
The `Tally` contract is used by the coordinator to submit commitments to the tally results via the `tallyVotes` function. This is done in batches and the final commitment can be used by the users to verify the validity of the results.
|
|
@@ -34,7 +34,7 @@ This contract should be deployed alongside a `Poll`, with the the constructor ac
|
|
|
34
34
|
- `vkRegistry` - The address of the vkRegistry contract
|
|
35
35
|
- `poll` - The address of the poll contract
|
|
36
36
|
- `messageProcessor` - The address of the messageProcessor contract
|
|
37
|
-
- `mode` - The mode of the tally contract - depending on this, the commitments will be processed differently, and it must equal the Poll mode (quadratic vs non quadratic voting)
|
|
37
|
+
- `mode` - The mode of the tally contract - depending on this, the commitments will be processed differently, and it must equal the Poll mode (quadratic vs non quadratic vs full credits voting)
|
|
38
38
|
|
|
39
39
|
Users can use the verification functions to verify the Tally results. These are as follows:
|
|
40
40
|
|
|
@@ -6,19 +6,19 @@ sidebar_position: 8
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
:::info
|
|
9
|
-
Code location: [VerifyingKeysRegistry.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/VerifyingKeysRegistry.sol)
|
|
9
|
+
Code location: [VerifyingKeysRegistry.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/VerifyingKeysRegistry.sol)
|
|
10
10
|
:::
|
|
11
11
|
|
|
12
12
|
The VerifyingKeysRegistry is a contract that holds the verifying keys for the zk-SNARK circuits. It holds four different sets of keys:
|
|
13
13
|
|
|
14
|
-
- `processVks` - The keys for the
|
|
15
|
-
- `tallyVks` - The keys for the
|
|
14
|
+
- `processVks` - The keys for the MessageProcessor circuit
|
|
15
|
+
- `tallyVks` - The keys for the VoteTally circuit
|
|
16
16
|
- `pollJoiningVk` - The key for the poll joining circuit
|
|
17
17
|
- `pollJoinedVk` - The key for the poll joined circuit
|
|
18
18
|
|
|
19
19
|
Each circuit will have a signature which is its compile-time constants represented as a uint256.
|
|
20
20
|
|
|
21
|
-
Please note that each Verifying Key should be set with the corresponding mode. Available modes are quadratic
|
|
21
|
+
Please note that each Verifying Key should be set with the corresponding mode. Available modes are quadratic, non quadratic and full credits voting.
|
|
22
22
|
|
|
23
23
|
The contract owner can set them using the `setVerifyingKeysBatch` function:
|
|
24
24
|
|
|
@@ -19,7 +19,7 @@ The MACI smart contracts handle the on-chain aspects - both the functionality an
|
|
|
19
19
|
|
|
20
20
|
The MACI smart contracts are written in [Solidity](https://soliditylang.org/).
|
|
21
21
|
|
|
22
|
-
Contracts are released through the [`@maci-contracts`](https://www.npmjs.com/package
|
|
22
|
+
Contracts are released through the [`@maci-protocol/contracts`](https://www.npmjs.com/package/@maci-protocol/contracts) NPM package.
|
|
23
23
|
|
|
24
24
|
[Learn more about MACI contracts](/docs/technical-references/smart-contracts/)
|
|
25
25
|
|
|
@@ -29,12 +29,12 @@ The TypeScript libraries manage the business logic between the smart contracts a
|
|
|
29
29
|
|
|
30
30
|
The MACI [TypeScript](https://www.typescriptlang.org/) libraries are released through the following NPM packages:
|
|
31
31
|
|
|
32
|
-
- [`@maci-cli`](https://www.npmjs.com/package
|
|
33
|
-
- [`@maci-core`](https://www.npmjs.com/package
|
|
34
|
-
- [`@maci-crypto`](https://www.npmjs.com/package
|
|
35
|
-
- [`@maci-domainobjs`](https://www.npmjs.com/package
|
|
36
|
-
- [`@maci-integrationtests`](https://www.npmjs.com/package
|
|
37
|
-
- [`@maci-sdk`](https://www.npmjs.com/package
|
|
32
|
+
- [`@maci-protocol/cli`](https://www.npmjs.com/package/@maci-protocol/cli)
|
|
33
|
+
- [`@maci-protocol/core`](https://www.npmjs.com/package/@maci-protocol/core)
|
|
34
|
+
- [`@maci-protocol/crypto`](https://www.npmjs.com/package/@maci-protocol/crypto)
|
|
35
|
+
- [`@maci-protocol/domainobjs`](https://www.npmjs.com/package/@maci-protocol/domainobjs)
|
|
36
|
+
- [`@maci-protocol/integrationtests`](https://www.npmjs.com/package/@maci-protocol/integrationtests)
|
|
37
|
+
- [`@maci-protocol/sdk`](https://www.npmjs.com/package/@maci-protocol/sdk)
|
|
38
38
|
|
|
39
39
|
## Circuits
|
|
40
40
|
|
|
@@ -43,6 +43,6 @@ MACI has multiple circuits that ensure all off-chain computation is completed co
|
|
|
43
43
|
The circuits for these zero-knowledge proofs are written
|
|
44
44
|
in [Circom](https://iden3.io/circom).
|
|
45
45
|
|
|
46
|
-
The MACI circuits are released through the [`@maci-circuits`](https://www.npmjs.com/package
|
|
46
|
+
The MACI circuits are released through the [`@maci-protocol/circuits`](https://www.npmjs.com/package/@maci-protocol/circuits) NPM package.
|
|
47
47
|
|
|
48
48
|
[Learn more about MACI circuits](/docs/technical-references/zk-snark-circuits/)
|
package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/processMessages.md
CHANGED
|
@@ -5,11 +5,11 @@ sidebar_label: Process Messages Circuit
|
|
|
5
5
|
sidebar_position: 3
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
[**Repo link**](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/
|
|
8
|
+
[**Repo link**](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/coordinator)
|
|
9
9
|
|
|
10
10
|
This circuit allows the coordinator to prove that they have correctly processed each message in reverse order, in a consecutive batch of 5 ^ messageBatchDepth messages to the respective state leaf within the state tree. Coordinators would use this circuit to prove correct execution at the end of each Poll.
|
|
11
11
|
|
|
12
|
-
The [`
|
|
12
|
+
The [`MessageProcessorQv`](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/coordinator/qv/MessageProcessor.circom) circuit will try to decrypt the messages, and based on the content of the message, update within itself the trees, to generate a proof that the coordinator's off-chain processing was done correctly. In other words, the circuit takes a final state, an initial state, and the leaves (messages and user signups) - it processes these messages via the different state transitions to finally check that the expected state is correct.
|
|
13
13
|
The pre-requisites for this circuit are:
|
|
14
14
|
|
|
15
15
|
- the related Poll has ended
|
|
@@ -21,7 +21,11 @@ This circuit requires the coordinator's private key, hence a proof for this circ
|
|
|
21
21
|

|
|
22
22
|
|
|
23
23
|
:::info
|
|
24
|
-
A version working with non quadratic voting (non-qv) is also [available](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/
|
|
24
|
+
A version working with non quadratic voting (non-qv) is also [available](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/coordinator/non-qv/MessageProcessor.circom). This version is called `MessageProcessorNonQV` and is to be used when the Poll is not using the quadratic voting feature. Note that by default MACI works with quadratic voting.
|
|
25
|
+
:::
|
|
26
|
+
|
|
27
|
+
:::info
|
|
28
|
+
A version working with full credits voting (full) is also [available](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/coordinator/full/MessageProcessor.circom). This version is called `MessageProcessorFull` and is to be used when the Poll is not using the quadratic or non quadratic voting features. Note that by default MACI works with quadratic voting.
|
|
25
29
|
:::
|
|
26
30
|
|
|
27
31
|
#### Parameters
|
|
@@ -37,7 +37,7 @@ MACI's circuits are parameterized, and thus can be configured to support differe
|
|
|
37
37
|
- **STATE_TREE_DEPTH** = how many users the system supports
|
|
38
38
|
- **VOTE_OPTIONS_TREE_DEPTH** = how many vote options the system supports
|
|
39
39
|
- **MESSAGE_BATCH_SIZE** = how many messages in a batch the circuit should process
|
|
40
|
-
- **
|
|
40
|
+
- **TALLY_PROCESSING_STATE_TREE_DEPTH** = how many ballots can be processed per batch when tallying the results (`2 ** TALLY_PROCESSING_STATE_TREE_DEPTH` ballots)
|
|
41
41
|
|
|
42
42
|
Please refer to the individual circuit documentation for more details on the inner working of each circuit and where parameters fit.
|
|
43
43
|
|
|
@@ -90,7 +90,7 @@ To test the circuits package, please use `pnpm run test`. This will run all of t
|
|
|
90
90
|
|
|
91
91
|
To run individual tests, you can use the following commands (for all other circuits please refer to the `package.json` scripts section):
|
|
92
92
|
|
|
93
|
-
- `pnpm run test:
|
|
94
|
-
- `pnpm run test:
|
|
93
|
+
- `pnpm run test:messageProcessor` to run the tests for the `MessageProcessor` circuit.
|
|
94
|
+
- `pnpm run test:voteTally` to run the tests for the `VoteTally` circuit.
|
|
95
95
|
|
|
96
96
|
More details on testing are provided in the [testing section](/docs/guides/testing/testing-introduction) of the documentation.
|
|
@@ -15,10 +15,10 @@ sidebar_position: 4
|
|
|
15
15
|
| 1 | State leaf batch depth | Allows $(5^{n})$ users' votes to be processed per batch. |
|
|
16
16
|
| 2 | Vote option tree depth | Allows $(5^{n})$ vote options. |
|
|
17
17
|
|
|
18
|
-

|
|
19
19
|
|
|
20
20
|
:::info
|
|
21
|
-
A version working with non quadratic voting (non-qv) is also [available](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/
|
|
21
|
+
A version working with non quadratic and full credits voting (non-qv, full) is also [available](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/coordinator/non-qv/VoteTally.circom). This version is called `tallyVotes` and is to be used when the Poll is not using the quadratic voting feature. Note that by default MACI works with quadratic voting.
|
|
22
22
|
:::
|
|
23
23
|
|
|
24
24
|
#### Input signals
|
|
@@ -73,7 +73,7 @@ $poseidon_3([tc_r, tc_t, tc_p])$
|
|
|
73
73
|
|
|
74
74
|
1. That the coordinator knows the preimage of `sbCommitment`
|
|
75
75
|
2. That `index` is less than or equal to `totalSignups`
|
|
76
|
-
3. That each ballot in `ballots` is in a member of the ballot tree with the Merkle root `ballotRoot` at indices `batchStartIndex` to `batchStartIndex + (5 **
|
|
76
|
+
3. That each ballot in `ballots` is in a member of the ballot tree with the Merkle root `ballotRoot` at indices `batchStartIndex` to `batchStartIndex + (5 ** tallyProcessingStateTreeDepth)`
|
|
77
77
|
4. That each set of votes (`votes[i]`) has the Merkle root $blt_r$ whose value equals `ballots[i][1]`
|
|
78
78
|
5. That the tally is valid, which is:
|
|
79
79
|
- That the sum of votes per vote option is correct
|
|
@@ -7,7 +7,7 @@ sidebar_position: 5
|
|
|
7
7
|
|
|
8
8
|
#### Process Messages Input Hasher
|
|
9
9
|
|
|
10
|
-
A utility circuit used by the main `
|
|
10
|
+
A utility circuit used by the main `MessageProcessor` circuit to hash its inputs.
|
|
11
11
|
|
|
12
12
|

|
|
13
13
|
|
|
@@ -35,7 +35,7 @@ It outputs one field element, which is the SHA256 hash of the following inputs:
|
|
|
35
35
|
|
|
36
36
|
#### ResultsCommitmentVerifier
|
|
37
37
|
|
|
38
|
-
A utility circuit used by the main `
|
|
38
|
+
A utility circuit used by the main `VoteTally` circuit to verify that the results commitment is correct.
|
|
39
39
|
|
|
40
40
|

|
|
41
41
|
|
package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/zk-snark-circuits.md
CHANGED
|
@@ -5,10 +5,10 @@ sidebar_label: zk-SNARK Circuits
|
|
|
5
5
|
sidebar_position: 1
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
MACI has three main zk-SNARK [circuits](https://github.com/privacy-scaling-explorations/maci/tree/dev/circuits):
|
|
8
|
+
MACI has three main zk-SNARK [circuits](https://github.com/privacy-scaling-explorations/maci/tree/dev/packages/circuits):
|
|
9
9
|
|
|
10
|
-
1. ProcessMessages.circom, which takes a batch of encrypted messages, decrypts them, and generates a proof that the coordinator's local processing was performed correctly. [QV](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/
|
|
11
|
-
2. TallyVotes.circom, which counts votes from users' ballots, batch by batch. [QV](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/
|
|
10
|
+
1. ProcessMessages.circom, which takes a batch of encrypted messages, decrypts them, and generates a proof that the coordinator's local processing was performed correctly. [QV](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/coordinator/qv/MessageProcessor.circom), [non-QV](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/coordinator/non-qv/MessageProcessor.circom), [Full](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/coordinator/full/MessageProcessor.circom) versions are available.
|
|
11
|
+
2. TallyVotes.circom, which counts votes from users' ballots, batch by batch. [QV](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/coordinator/qv/VoteTally.circom) and [non-QV](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/coordinator/non-qv/VoteTally.circom) versions are available.
|
|
12
12
|
3. PollJoining.circom, which allows users to prove they know a private key for a public key signed up to the MACI smart contract, and to register to a specific poll.
|
|
13
13
|
|
|
14
14
|
The rest of the circuits are utilities templates that are required for the main circuits to work correctly. These include utilities such as float math, conversion of private keys, and Poseidon hashing/encryption.
|