@maci-protocol/website 0.0.0-ci.85bba2d → 0.0.0-ci.86ec64f

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.
Files changed (89) hide show
  1. package/blog/2024-02-28-maci-v1.2.0.md +1 -1
  2. package/blog/2025-03-21-roadmap-2025.md +1 -1
  3. package/docusaurus.config.ts +9 -3
  4. package/package.json +15 -14
  5. package/static/img/circuits/MACI-Circuits.excalidraw +51 -51
  6. package/static/img/circuits/processMessages.svg +1 -1
  7. package/static/img/circuits/processMessages_2_0.svg +1 -1
  8. package/static/img/circuits/processOne.svg +1 -1
  9. package/static/img/circuits/processTopup.svg +1 -1
  10. package/static/img/circuits/quinBatchLeavesExists.svg +1 -1
  11. package/static/img/circuits/quinCheckRoot.svg +1 -1
  12. package/static/img/circuits/quinGeneratePathIndices.svg +1 -1
  13. package/static/img/circuits/quinSelector.svg +1 -1
  14. package/static/img/circuits/resultsCommitmentVerifier.svg +1 -1
  15. package/static/img/circuits/splicer.svg +1 -1
  16. package/static/img/circuits/tallyVotes.svg +1 -1
  17. package/versioned_docs/version-v0.x/introduction.md +0 -4
  18. package/versioned_docs/version-v0.x/quadratic-vote-tallying-circuit.md +16 -16
  19. package/versioned_docs/version-v1.2/circuits.md +8 -8
  20. package/versioned_docs/version-v1.2/contributing/contributing.md +4 -4
  21. package/versioned_docs/version-v1.2/deployment.md +1 -1
  22. package/versioned_docs/version-v1.2/integrating.md +1 -1
  23. package/versioned_docs/version-v1.2/key-change.md +1 -1
  24. package/versioned_docs/version-v1.2/poll-types.md +1 -1
  25. package/versioned_docs/version-v1.2/testing-in-detail.md +3 -3
  26. package/versioned_docs/version-v1.2/testing.md +1 -1
  27. package/versioned_docs/version-v1.2/topup.md +1 -1
  28. package/versioned_docs/version-v1.2/typedoc/core/index.md +2 -2
  29. package/versioned_docs/version-v1.2/versioning.md +3 -3
  30. package/versioned_docs/version-v1.2/workflow.md +1 -1
  31. package/versioned_docs/version-v2.x/contributing/contributing.md +4 -4
  32. package/versioned_docs/version-v2.x/core-concepts/key-change.md +1 -1
  33. package/versioned_docs/version-v2.x/core-concepts/merkle-trees.md +1 -1
  34. package/versioned_docs/version-v2.x/core-concepts/poll-types.md +1 -1
  35. package/versioned_docs/version-v2.x/core-concepts/workflow.md +1 -1
  36. package/versioned_docs/version-v2.x/guides/integrating.md +1 -1
  37. package/versioned_docs/version-v2.x/guides/testing/testing-in-detail.md +3 -3
  38. package/versioned_docs/version-v2.x/guides/testing/testing.md +1 -1
  39. package/versioned_docs/version-v2.x/processes/versioning.md +3 -3
  40. package/versioned_docs/version-v2.x/supported-networks/deployed-contracts.md +7 -7
  41. package/versioned_docs/version-v2.x/technical-references/smart-contracts/AccQueue.md +1 -1
  42. package/versioned_docs/version-v2.x/technical-references/smart-contracts/MACI.md +1 -1
  43. package/versioned_docs/version-v2.x/technical-references/smart-contracts/MessageProcessor.md +1 -1
  44. package/versioned_docs/version-v2.x/technical-references/smart-contracts/Params.md +1 -1
  45. package/versioned_docs/version-v2.x/technical-references/smart-contracts/Poll.md +1 -1
  46. package/versioned_docs/version-v2.x/technical-references/smart-contracts/PollFactory.md +1 -1
  47. package/versioned_docs/version-v2.x/technical-references/smart-contracts/Tally.md +1 -1
  48. package/versioned_docs/version-v2.x/technical-references/smart-contracts/VkRegistry.md +1 -1
  49. package/versioned_docs/version-v2.x/technical-references/smart-contracts/VoiceCreditProxy.md +1 -1
  50. package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/processMessages.md +4 -4
  51. package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/tallyVotes.md +2 -2
  52. package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +3 -3
  53. package/versioned_docs/version-v3.x/contributing/contributing.md +4 -4
  54. package/versioned_docs/version-v3.x/core-concepts/key-change.md +4 -4
  55. package/versioned_docs/version-v3.x/core-concepts/maci-keys.md +1 -1
  56. package/versioned_docs/version-v3.x/core-concepts/poll-types.md +31 -7
  57. package/versioned_docs/version-v3.x/core-concepts/polls.md +31 -7
  58. package/versioned_docs/version-v3.x/core-concepts/spec.md +8 -8
  59. package/versioned_docs/version-v3.x/core-concepts/workflow.md +2 -2
  60. package/versioned_docs/version-v3.x/guides/compile-circuits.md +31 -15
  61. package/versioned_docs/version-v3.x/guides/integrating.md +2 -2
  62. package/versioned_docs/version-v3.x/guides/sdk.md +121 -0
  63. package/versioned_docs/version-v3.x/guides/testing/testing-in-detail.md +3 -3
  64. package/versioned_docs/version-v3.x/guides/testing/testing-introduction.md +38 -6
  65. package/versioned_docs/version-v3.x/guides/troubleshooting.md +53 -8
  66. package/versioned_docs/version-v3.x/processes/versioning.md +3 -3
  67. package/versioned_docs/version-v3.x/quick-start.md +24 -16
  68. package/versioned_docs/version-v3.x/resources.md +1 -0
  69. package/versioned_docs/version-v3.x/security/audit.md +2 -2
  70. package/versioned_docs/version-v3.x/security/trusted-setup.md +36 -36
  71. package/versioned_docs/version-v3.x/supported-networks/costs.md +725 -0
  72. package/versioned_docs/version-v3.x/supported-networks/deployed-contracts.md +8 -8
  73. package/versioned_docs/version-v3.x/supported-networks/supported-networks.md +16 -0
  74. package/versioned_docs/version-v3.x/technical-references/smart-contracts/MACI.md +2 -2
  75. package/versioned_docs/version-v3.x/technical-references/smart-contracts/MessageProcessor.md +1 -1
  76. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Params.md +2 -2
  77. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Policies.md +1 -1
  78. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Poll.md +1 -1
  79. package/versioned_docs/version-v3.x/technical-references/smart-contracts/PollFactory.md +1 -1
  80. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Tally.md +2 -2
  81. package/versioned_docs/version-v3.x/technical-references/smart-contracts/VkRegistry.md +4 -4
  82. package/versioned_docs/version-v3.x/technical-references/smart-contracts/VoiceCreditProxy.md +1 -1
  83. package/versioned_docs/version-v3.x/technical-references/technical-references.md +8 -8
  84. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/joinPoll.md +1 -1
  85. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/processMessages.md +69 -5
  86. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/setup.md +3 -3
  87. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/tallyVotes.md +4 -4
  88. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/utilities.md +8 -8
  89. 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/main/packages/contracts/contracts/VerifyingKeysRegistry.sol)
11
+ - [PoseidonHashers](https://github.com/privacy-scaling-explorations/maci/blob/main/packages/contracts/contracts/crypto/Hasher.sol)
12
+ - [PollFactory](https://github.com/privacy-scaling-explorations/maci/blob/main/packages/contracts/contracts/PollFactory.sol)
13
+ - [MessageProcessorFactory](https://github.com/privacy-scaling-explorations/maci/blob/main/packages/contracts/contracts/MessageProcessorFactory.sol)
14
+ - [TallyFactory](https://github.com/privacy-scaling-explorations/maci/blob/main/packages/contracts/contracts/TallyFactory.sol)
15
+ - [Verifier](https://github.com/privacy-scaling-explorations/maci/blob/main/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/main/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/ProcessMessages_6-9-2-3/processMessages_6-9-2-3.zkey -t ./zkeys/TallyVotes_6-2-3/tallyVotes_6-2-3.zkey
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/main/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 or non 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)
@@ -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/main/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/utils/Params.sol)
9
+ Code location: [Params.sol](https://github.com/privacy-scaling-explorations/maci/blob/main/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 intStateTreeDepth;
17
+ uint8 tallyProcessingStateTreeDepth;
18
18
  uint8 voteOptionTreeDepth;
19
19
  }
20
20
 
@@ -21,7 +21,7 @@ The MACI repository comes with several out-of-the-box options:
21
21
  - `HatsPolicy` - This allows gatekeeping signups to only users who have a specific [Hat](https://www.hatsprotocol.xyz/).
22
22
  - `GitcoinPassportPolicy` - This allows gatekeeping signups to only users who have a specific [Gitcoin Passport](https://passport.gitcoin.co/) score.
23
23
  - `ZupassPolicy` - This allows gatekeeping signups only to users who have a valid [Zupass PCD ticket](https://github.com/proofcarryingdata/zupass).
24
- - `SemaphorePolicy` - This allows gatekeeping signups only to users who can prove they are part of a [Semaphore](https://semaphore.pse.dev/) group.
24
+ - `SemaphorePolicy` - This allows gatekeeping signups only to users who can prove they are part of a [Semaphore](https://semaphore.pse.main/) group.
25
25
 
26
26
  You can find all of the latest policy contracts here:
27
27
  https://github.com/privacy-scaling-explorations/excubiae/tree/main/packages/contracts/contracts/extensions
@@ -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/main/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/main/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/main/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/main/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 processMessages circuit
15
- - `tallyVks` - The keys for the tallyVotes circuit
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 voting and non quadratic voting.
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
 
@@ -6,7 +6,7 @@ sidebar_position: 7
6
6
  ---
7
7
 
8
8
  :::info
9
- Code location: [InitialVoiceCreditProxy](https://github.com/privacy-scaling-explorations/maci/tree/dev/contracts/contracts/initialVoiceCreditProxy)
9
+ Code location: [InitialVoiceCreditProxy](https://github.com/privacy-scaling-explorations/maci/tree/main/contracts/contracts/initialVoiceCreditProxy)
10
10
  :::
11
11
 
12
12
  The VoiceCreditProxy contract is used to assign voice credits to users. Whichever implementation should the MACI deployers use, this must implement a view function that returns the balance for a user, such as the one below:
@@ -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/maci-contracts) NPM 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/maci-cli)
33
- - [`@maci-core`](https://www.npmjs.com/package/maci-core)
34
- - [`@maci-crypto`](https://www.npmjs.com/package/maci-crypto)
35
- - [`@maci-domainobjs`](https://www.npmjs.com/package/maci-domainobjs)
36
- - [`@maci-integrationtests`](https://www.npmjs.com/package/maci-integrationtests)
37
- - [`@maci-sdk`](https://www.npmjs.com/package/maci-sdk)
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/maci-circuits) NPM 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/)
@@ -5,7 +5,7 @@ sidebar_label: Join Poll Circuit
5
5
  sidebar_position: 6
6
6
  ---
7
7
 
8
- [**Repo link**](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/voter)
8
+ [**Repo link**](https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/voter)
9
9
 
10
10
  ## PollJoining
11
11
 
@@ -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/core)
8
+ [**Repo link**](https://github.com/privacy-scaling-explorations/maci/blob/main/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 [`processMessages`](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/core/qv/processMessages.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.
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
- ![ProcessMessages](/img/circuits/processMessages_2_0.svg)
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 non quadratic voting (non-qv) is also [available](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/core/non-qv/processMessages.circom). This version is called `processMessagesNonQV` and is to be used when the Poll is not using the quadratic voting feature. Note that by default MACI works with quadratic voting.
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
@@ -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/dev/circuits/circom/trees/incrementalQuinTree.circom`.
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
 
@@ -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
- - **INT_STATE_TREE_DEPTH** = how many ballots can be processed per batch when tallying the results (`5 ** INT_STATE_TREE_DEPTH` ballots)
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:processMessages` to run the tests for the `processMessages` circuit.
94
- - `pnpm run test:tallyVotes` to run the tests for the `tallyVotes` circuit.
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/dev/circuits/circom/core)
8
+ [**Repo link**](https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/core)
9
9
 
10
10
  #### Parameters
11
11
 
@@ -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
- ![TallyVotes](/img/circuits/tallyVotes.svg)
18
+ ![VoteTally](/img/circuits/tallyVotes.svg)
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/core/non-qv/tallyVotes.circom). This version is called `tallyVotesNonQv` and is to be used when the Poll is not using the quadratic voting feature. Note that by default MACI works with quadratic voting.
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
@@ -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 ** intStateTreeDepth)`
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 `processMessages` circuit to hash its inputs.
10
+ A utility circuit used by the main `MessageProcessor` circuit to hash its inputs.
11
11
 
12
12
  ![ProcessMessagesInputHasher](/img/circuits/processMessagesInputHasher.svg)
13
13
 
@@ -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 `tallyVotes` circuit to verify that the results commitment is correct.
38
+ A utility circuit used by the main `VoteTally` circuit to verify that the results commitment is correct.
39
39
 
40
40
  ![ResultsCommitmentVerifier](/img/circuits/resultsCommitmentVerifier.svg)
41
41
 
42
- #### QuinCheckRoot
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
- ![QuinCheckRoot](/img/circuits/quinCheckRoot.svg)
46
+ ![QuinaryCheckRoot](/img/circuits/quinCheckRoot.svg)
47
47
 
48
48
  #### CalculateTotal
49
49
 
@@ -100,11 +100,11 @@ Utility circuit used to unpack an input element.
100
100
 
101
101
  ![UnpackElement](/img/circuits/unpackElement.svg)
102
102
 
103
- #### QuinSelector
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
- ![QuinSelector](/img/circuits/quinSelector.svg)
107
+ ![QuinarySelector](/img/circuits/quinSelector.svg)
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
  ![QuinBatchLeavesExists](/img/circuits/quinBatchLeavesExists.svg)
120
120
 
121
- #### QuinGeneratePathIndices
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
- ![QuinGeneratePathIndices](/img/circuits/quinGeneratePathIndices.svg)
125
+ ![QuinaryGeneratePathIndices](/img/circuits/quinGeneratePathIndices.svg)
126
126
 
127
127
  #### ProcessOne
128
128
 
@@ -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/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/dev/circuits/circom/core/qv/processMessages.circom) and [non-QV](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/core/non-qv/processMessages.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/core/qv/tallyVotes.circom) and [non-QV](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/core/non-qv/tallyVotes.circom) versions are available.
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.