@maci-protocol/website 0.0.0-ci.a577366 → 0.0.0-ci.a73cfa9
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/LICENSE +1 -2
- package/blog/2024-02-28-maci-v1.2.0.md +2 -2
- package/blog/2024-08-10-maci-v2.md +1 -1
- package/blog/2025-03-21-roadmap-2025.md +1 -1
- package/blog/2025-08-18-maci-aragon-plugin.md +107 -0
- package/blog/2025-09-05-maci-coordinator-service.md +167 -0
- package/docusaurus.config.ts +9 -3
- package/package.json +16 -15
- package/src/pages/roadmap.md +39 -80
- package/static/img/circuits/MACI-Circuits.excalidraw +79 -79
- package/static/img/circuits/ecdh.svg +1 -1
- package/static/img/circuits/messageToCommand.svg +1 -1
- package/static/img/circuits/messageValidator.svg +1 -1
- package/static/img/circuits/privToPubkey.svg +1 -1
- package/static/img/circuits/processMessages.svg +1 -1
- package/static/img/circuits/processMessagesInputHasher.svg +1 -1
- package/static/img/circuits/processMessages_2_0.svg +1 -1
- package/static/img/circuits/processOne.svg +1 -1
- package/static/img/circuits/processTopup.svg +1 -1
- package/static/img/circuits/quinBatchLeavesExists.svg +1 -1
- package/static/img/circuits/quinCheckRoot.svg +1 -1
- package/static/img/circuits/quinGeneratePathIndices.svg +1 -1
- package/static/img/circuits/quinSelector.svg +1 -1
- package/static/img/circuits/resultsCommitmentVerifier.svg +1 -1
- package/static/img/circuits/splicer.svg +1 -1
- package/static/img/circuits/tallyInputHasher.svg +1 -1
- package/static/img/circuits/tallyVotes.svg +1 -1
- package/static/img/circuits/verifySignature.svg +1 -1
- package/versioned_docs/version-v0.x/introduction.md +0 -4
- package/versioned_docs/version-v0.x/quadratic-vote-tallying-circuit.md +16 -16
- package/versioned_docs/version-v1.2/circuits.md +8 -8
- package/versioned_docs/version-v1.2/contributing/contributing.md +4 -4
- package/versioned_docs/version-v1.2/deployment.md +1 -1
- package/versioned_docs/version-v1.2/integrating.md +1 -1
- package/versioned_docs/version-v1.2/key-change.md +1 -1
- package/versioned_docs/version-v1.2/poll-types.md +1 -1
- package/versioned_docs/version-v1.2/testing-in-detail.md +3 -3
- package/versioned_docs/version-v1.2/testing.md +1 -1
- package/versioned_docs/version-v1.2/topup.md +1 -1
- package/versioned_docs/version-v1.2/typedoc/core/index.md +2 -2
- package/versioned_docs/version-v1.2/versioning.md +3 -3
- package/versioned_docs/version-v1.2/workflow.md +1 -1
- package/versioned_docs/version-v2.x/contributing/contributing.md +4 -4
- package/versioned_docs/version-v2.x/core-concepts/key-change.md +1 -1
- package/versioned_docs/version-v2.x/core-concepts/merkle-trees.md +1 -1
- package/versioned_docs/version-v2.x/core-concepts/poll-types.md +1 -1
- package/versioned_docs/version-v2.x/core-concepts/workflow.md +1 -1
- package/versioned_docs/version-v2.x/guides/integrating.md +1 -1
- package/versioned_docs/version-v2.x/guides/testing/testing-in-detail.md +3 -3
- package/versioned_docs/version-v2.x/guides/testing/testing.md +1 -1
- package/versioned_docs/version-v2.x/processes/versioning.md +3 -3
- package/versioned_docs/version-v2.x/supported-networks/deployed-contracts.md +7 -7
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/AccQueue.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/MACI.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/MessageProcessor.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Params.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Poll.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/PollFactory.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Tally.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/VkRegistry.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/VoiceCreditProxy.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/processMessages.md +4 -4
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/tallyVotes.md +2 -2
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +3 -3
- package/versioned_docs/version-v3.x/contributing/contributing.md +11 -5
- package/versioned_docs/version-v3.x/core-concepts/key-change.md +29 -29
- package/versioned_docs/version-v3.x/core-concepts/maci-keys.md +1 -1
- package/versioned_docs/version-v3.x/core-concepts/poll-types.md +33 -9
- package/versioned_docs/version-v3.x/core-concepts/polls.md +34 -10
- package/versioned_docs/version-v3.x/core-concepts/spec.md +40 -106
- package/versioned_docs/version-v3.x/core-concepts/workflow.md +2 -2
- package/versioned_docs/version-v3.x/guides/compile-circuits.md +36 -20
- package/versioned_docs/version-v3.x/guides/integrating.md +10 -10
- package/versioned_docs/version-v3.x/guides/sdk.md +121 -0
- package/versioned_docs/version-v3.x/guides/testing/testing-in-detail.md +4 -4
- package/versioned_docs/version-v3.x/guides/testing/testing-introduction.md +38 -6
- package/versioned_docs/version-v3.x/guides/troubleshooting.md +64 -19
- package/versioned_docs/version-v3.x/processes/versioning.md +3 -3
- package/versioned_docs/version-v3.x/quick-start.md +29 -21
- package/versioned_docs/version-v3.x/resources.md +1 -0
- package/versioned_docs/version-v3.x/security/audit.md +2 -2
- package/versioned_docs/version-v3.x/security/trusted-setup.md +36 -36
- package/versioned_docs/version-v3.x/supported-networks/costs.md +725 -0
- package/versioned_docs/version-v3.x/supported-networks/deployed-contracts.md +9 -9
- package/versioned_docs/version-v3.x/supported-networks/supported-networks.md +16 -0
- package/versioned_docs/version-v3.x/technical-references/coordinator-service/index.md +15 -1
- package/versioned_docs/version-v3.x/technical-references/coordinator-service/installation.md +5 -33
- package/versioned_docs/version-v3.x/technical-references/coordinator-service/usage.md +64 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/MACI.md +7 -7
- 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/Policies.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Poll.md +8 -8
- 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 +4 -4
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/VkRegistry.md +8 -8
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/VoiceCreditProxy.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/technical-references.md +8 -8
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/joinPoll.md +4 -4
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/processMessages.md +81 -17
- 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 +6 -6
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/utilities.md +9 -9
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +3 -3
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/
|
|
8
|
+
[**Repo link**](https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/coordinator)
|
|
9
9
|
|
|
10
|
-
This circuit allows the coordinator to prove that they have correctly processed each message in reverse order, in a consecutive batch of 5 ^
|
|
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/main/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
|
|
@@ -18,10 +18,74 @@ The pre-requisites for this circuit are:
|
|
|
18
18
|
|
|
19
19
|
This circuit requires the coordinator's private key, hence a proof for this circuit can only be generated by the coordinator. The private key is needed in order to generate the ECDH shared key used to decrypt the messages.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
```mermaid
|
|
22
|
+
flowchart LR
|
|
23
|
+
parameters(["MessageProcessorQv - Parameters"])
|
|
24
|
+
parameters --> stateTreeDepth["stateTreeDepth"]
|
|
25
|
+
parameters --> batchSize["batchSize"]
|
|
26
|
+
parameters --> voteOptionTreeDepth["voteOptionTreeDepth"]
|
|
27
|
+
|
|
28
|
+
stateTreeDepth & batchSize & voteOptionTreeDepth --> publicInputs["Public inputs"]
|
|
29
|
+
|
|
30
|
+
subgraph publicInputs
|
|
31
|
+
direction LR
|
|
32
|
+
totalSignups ~~~ index
|
|
33
|
+
batchEndIndex ~~~ currentSbCommitment
|
|
34
|
+
newSbCommitment ~~~ outputBatchHash
|
|
35
|
+
actualStateTreeDepth ~~~ coordinatorPublicKeyHash
|
|
36
|
+
voteOptions
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
publicInputs --> privateInputs
|
|
40
|
+
|
|
41
|
+
subgraph privateInputs
|
|
42
|
+
direction LR
|
|
43
|
+
inputBatchHash ~~~ messages
|
|
44
|
+
coordinatorPrivateKey ~~~ encryptionPublicKeys
|
|
45
|
+
currentStateRoot ~~~ currentStateLeaves
|
|
46
|
+
currentStateLeavesPathElements ~~~ currentSbSalt
|
|
47
|
+
newSbSalt ~~~ currentBallotRoot
|
|
48
|
+
currentBallots ~~~ currentBallotsPathElements
|
|
49
|
+
currentVoteWeights ~~~ currentVoteWeightsPathElements
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
privateInputs --> step1["1 - Verify currentSbCommitment"]
|
|
53
|
+
step1 --> step1B["hash(currentStateRoot, currentBallotRoot, currentSbSalt)"]
|
|
54
|
+
|
|
55
|
+
privateInputs --> step2["2 – Check voteOptions upper-bound"]
|
|
56
|
+
step2 --> step2B["voteOptions <= 5 ** voteOptionTreeDepth"]
|
|
57
|
+
|
|
58
|
+
privateInputs --> step3["3 – Ensure totalSignups within capacity"]
|
|
59
|
+
step3 --> step3B["totalSignups <= 2 ** stateTreeDepth"]
|
|
60
|
+
|
|
61
|
+
privateInputs --> step4["4 – Hash each message + pub-key"]
|
|
62
|
+
step4 --> step4B["MessageHasher template loop"]
|
|
63
|
+
|
|
64
|
+
privateInputs --> step5["5 – Build and verify chainHash"]
|
|
65
|
+
step5 --> step5B["PoseidonHasher template loop + Mux1"]
|
|
66
|
+
|
|
67
|
+
privateInputs --> step6["6 – Derive & verify coordinator pubKey"]
|
|
68
|
+
step6 --> step6B["PrivateToPublicKey -> derivedPublicKeyHash == coordinatorPublicKeyHash"]
|
|
69
|
+
|
|
70
|
+
privateInputs --> step7["7 – Decrypt each message to a command using MessageToCommand"]
|
|
71
|
+
step7 --> step7B["MessageToCommand template loop"]
|
|
72
|
+
|
|
73
|
+
privateInputs --> step8["8 – Process messages in reverse order"]
|
|
74
|
+
step8 --> step8B["SingleMessageProcessorQv template loop"]
|
|
75
|
+
|
|
76
|
+
privateInputs --> step9["9 – Compute newSbCommitment"]
|
|
77
|
+
step9 --> step9B["hash(stateRoot, ballotRoot, newSbSalt)"]
|
|
78
|
+
|
|
79
|
+
privateInputs --> step10["10 – Verify provided newSbCommitment"]
|
|
80
|
+
step10 --> step10B["equality with computed commitment"]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
:::info
|
|
84
|
+
A version working with non quadratic voting (non-qv) is also [available](https://github.com/privacy-scaling-explorations/maci/blob/main/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.
|
|
85
|
+
:::
|
|
22
86
|
|
|
23
87
|
:::info
|
|
24
|
-
A version working with
|
|
88
|
+
A version working with full credits voting (full) is also [available](https://github.com/privacy-scaling-explorations/maci/blob/main/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
89
|
:::
|
|
26
90
|
|
|
27
91
|
#### Parameters
|
|
@@ -36,17 +100,17 @@ A version working with non quadratic voting (non-qv) is also [available](https:/
|
|
|
36
100
|
|
|
37
101
|
| Input signal | Description |
|
|
38
102
|
| -------------------------------- | --------------------------------------------------------------------------------------- |
|
|
39
|
-
| `
|
|
103
|
+
| `totalSignups` | Number of users that have completed the sign up |
|
|
40
104
|
| `index` | The batch index of current message batch |
|
|
41
105
|
| `pollEndTimestamp` | The Unix timestamp at which the poll ends |
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
106
|
+
| `messageRoot` | The root of the message tree |
|
|
107
|
+
| `messages` | The batch of messages as an array of arrays |
|
|
108
|
+
| `messageSubrootPathElements` | As described below |
|
|
45
109
|
| `coordinatorPublicKeyHash` | $\mathsf{poseidon_2}([cPk_x, cPk_y])$ |
|
|
46
110
|
| `newSbCommitment` | As described below |
|
|
47
|
-
| `
|
|
111
|
+
| `coordinatorPrivateKey` | The coordinator's private key |
|
|
48
112
|
| `batchEndIndex` | The last batch index |
|
|
49
|
-
| `
|
|
113
|
+
| `encryptionPublicKeys` | The public keys used to generate shared ECDH encryption keys to encrypt the messages |
|
|
50
114
|
| `currentStateRoot` | The state root before the commands are applied |
|
|
51
115
|
| `currentStateLeaves` | The state leaves upon which messages are applied |
|
|
52
116
|
| `currentStateLeavesPathElements` | The Merkle path to each incremental state root |
|
|
@@ -74,9 +138,9 @@ The salt used to produce `currentSbCommitment` (see above).
|
|
|
74
138
|
|
|
75
139
|
The salt used to produce `newSbCommitment` (see above).
|
|
76
140
|
|
|
77
|
-
##### `
|
|
141
|
+
##### `messageSubrootPathElements`
|
|
78
142
|
|
|
79
|
-
The index of each message in `
|
|
143
|
+
The index of each message in `messages` is consecutive. As such, in order to prove that each message in `messages` is indeed a leaf of the message tree, we compute the subtree root of `messages`, and then verify that the subtree root is indeed a subroot of `messageRoot`.
|
|
80
144
|
|
|
81
145
|
A simplified example using a tree of arity 2:
|
|
82
146
|
|
|
@@ -92,7 +156,7 @@ A simplified example using a tree of arity 2:
|
|
|
92
156
|
|
|
93
157
|
To prove that `a...d` are leaves of the tree with root `r`, we prove that the leaves have the subroot `s` with depth 2, and _then_ prove that `s` is a member of `r` at depth 1.
|
|
94
158
|
|
|
95
|
-
The implementation for this is in the `QuinBatchLeavesExists` circuit in `https://github.com/privacy-scaling-explorations/maci/blob/
|
|
159
|
+
The implementation for this is in the `QuinBatchLeavesExists` circuit in `https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/trees/incrementalQuinTree.circom`.
|
|
96
160
|
|
|
97
161
|
This method requires fewer circuit constraints than if we verified a Merkle proof for each leaf.
|
|
98
162
|
|
|
@@ -100,7 +164,7 @@ This method requires fewer circuit constraints than if we verified a Merkle proo
|
|
|
100
164
|
|
|
101
165
|
1. That the prover knows the preimage to `currentSbCommitment` (that is, the state root, ballot root, and `currentSbSalt`)
|
|
102
166
|
2. That `maxVoteOptions <= (5 ^ voteOptionTreeDepth)`
|
|
103
|
-
3. That `
|
|
104
|
-
4. That `coordinatorPublicKeyHash` is a hash of public key that is correctly derived from `
|
|
105
|
-
5. That each message in `
|
|
167
|
+
3. That `totalSignups <= (2 ^ stateTreeDepth)`
|
|
168
|
+
4. That `coordinatorPublicKeyHash` is a hash of public key that is correctly derived from `coordinatorPrivateKey`
|
|
169
|
+
5. That each message in `messages` exists in the message tree
|
|
106
170
|
6. That after decrypting and applying each message, in reverse order, to the corresponding state and ballot leaves, the new state root, new ballot root, and `newSbSalt` are the preimage to `newSbCommitment`
|
|
@@ -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.
|
|
@@ -5,7 +5,7 @@ sidebar_label: Tally Votes Circuit
|
|
|
5
5
|
sidebar_position: 4
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
[**Repo link**](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
8
|
+
[**Repo link**](https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/core)
|
|
9
9
|
|
|
10
10
|
#### Parameters
|
|
11
11
|
|
|
@@ -15,17 +15,17 @@ 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/
|
|
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/main/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
|
|
25
25
|
|
|
26
26
|
| Input signal | Description |
|
|
27
27
|
| --------------------------------------- | ---------------------------------------------------------------- |
|
|
28
|
-
| `
|
|
28
|
+
| `totalSignups` | The number of users that signup |
|
|
29
29
|
| `index` | Start index of given batch |
|
|
30
30
|
| `sbCommitment` | Described below |
|
|
31
31
|
| `currentTallyCommitment` | Described below |
|
|
@@ -72,8 +72,8 @@ $poseidon_3([tc_r, tc_t, tc_p])$
|
|
|
72
72
|
#### Statements that the circuit proves
|
|
73
73
|
|
|
74
74
|
1. That the coordinator knows the preimage of `sbCommitment`
|
|
75
|
-
2. That `index` is less than or equal to `
|
|
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 **
|
|
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 ** 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
|
|
|
@@ -15,7 +15,7 @@ It outputs one field element, which is the SHA256 hash of the following inputs:
|
|
|
15
15
|
|
|
16
16
|
1. `packedVals`
|
|
17
17
|
2. `pollEndTimestamp`
|
|
18
|
-
3. `
|
|
18
|
+
3. `messageRoot`
|
|
19
19
|
4. `coordinatorPubKeyHash`
|
|
20
20
|
5. `newSbCommitment`
|
|
21
21
|
6. `currentSbCommitment`
|
|
@@ -35,15 +35,15 @@ 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
|
|
|
42
|
-
####
|
|
42
|
+
#### QuinaryCheckRoot
|
|
43
43
|
|
|
44
44
|
Utility circuit that given a quin Merkle root and a list of leaves, check if the root is the correct result of inserting all the leaves into the tree in the given order.
|
|
45
45
|
|
|
46
|
-

|
|
47
47
|
|
|
48
48
|
#### CalculateTotal
|
|
49
49
|
|
|
@@ -100,11 +100,11 @@ Utility circuit used to unpack an input element.
|
|
|
100
100
|
|
|
101
101
|

|
|
102
102
|
|
|
103
|
-
####
|
|
103
|
+
#### QuinarySelector
|
|
104
104
|
|
|
105
105
|
Utility circuit used to select one element from an array of n elements at a given index.
|
|
106
106
|
|
|
107
|
-

|
|
108
108
|
|
|
109
109
|
#### Splicer
|
|
110
110
|
|
|
@@ -118,11 +118,11 @@ Utility circuit used to check if a batch of leaves exists in a quinary tree.
|
|
|
118
118
|
|
|
119
119
|

|
|
120
120
|
|
|
121
|
-
####
|
|
121
|
+
#### QuinaryGeneratePathIndices
|
|
122
122
|
|
|
123
123
|
Utility circuit used to generate the indices needed to traverse the tree until we find the leaf we are looking for.
|
|
124
124
|
|
|
125
|
-

|
|
126
126
|
|
|
127
127
|
#### ProcessOne
|
|
128
128
|
|
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/
|
|
8
|
+
MACI has three main zk-SNARK [circuits](https://github.com/privacy-scaling-explorations/maci/tree/main/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/
|
|
11
|
-
2. TallyVotes.circom, which counts votes from users' ballots, batch by batch. [QV](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
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/main/circuits/circom/coordinator/qv/MessageProcessor.circom), [non-QV](https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/coordinator/non-qv/MessageProcessor.circom), [Full](https://github.com/privacy-scaling-explorations/maci/blob/main/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/main/circuits/circom/coordinator/qv/VoteTally.circom) and [non-QV](https://github.com/privacy-scaling-explorations/maci/blob/main/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.
|