@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.
Files changed (104) hide show
  1. package/LICENSE +1 -2
  2. package/blog/2024-02-28-maci-v1.2.0.md +2 -2
  3. package/blog/2024-08-10-maci-v2.md +1 -1
  4. package/blog/2025-03-21-roadmap-2025.md +1 -1
  5. package/blog/2025-08-18-maci-aragon-plugin.md +107 -0
  6. package/blog/2025-09-05-maci-coordinator-service.md +167 -0
  7. package/docusaurus.config.ts +9 -3
  8. package/package.json +16 -15
  9. package/src/pages/roadmap.md +39 -80
  10. package/static/img/circuits/MACI-Circuits.excalidraw +79 -79
  11. package/static/img/circuits/ecdh.svg +1 -1
  12. package/static/img/circuits/messageToCommand.svg +1 -1
  13. package/static/img/circuits/messageValidator.svg +1 -1
  14. package/static/img/circuits/privToPubkey.svg +1 -1
  15. package/static/img/circuits/processMessages.svg +1 -1
  16. package/static/img/circuits/processMessagesInputHasher.svg +1 -1
  17. package/static/img/circuits/processMessages_2_0.svg +1 -1
  18. package/static/img/circuits/processOne.svg +1 -1
  19. package/static/img/circuits/processTopup.svg +1 -1
  20. package/static/img/circuits/quinBatchLeavesExists.svg +1 -1
  21. package/static/img/circuits/quinCheckRoot.svg +1 -1
  22. package/static/img/circuits/quinGeneratePathIndices.svg +1 -1
  23. package/static/img/circuits/quinSelector.svg +1 -1
  24. package/static/img/circuits/resultsCommitmentVerifier.svg +1 -1
  25. package/static/img/circuits/splicer.svg +1 -1
  26. package/static/img/circuits/tallyInputHasher.svg +1 -1
  27. package/static/img/circuits/tallyVotes.svg +1 -1
  28. package/static/img/circuits/verifySignature.svg +1 -1
  29. package/versioned_docs/version-v0.x/introduction.md +0 -4
  30. package/versioned_docs/version-v0.x/quadratic-vote-tallying-circuit.md +16 -16
  31. package/versioned_docs/version-v1.2/circuits.md +8 -8
  32. package/versioned_docs/version-v1.2/contributing/contributing.md +4 -4
  33. package/versioned_docs/version-v1.2/deployment.md +1 -1
  34. package/versioned_docs/version-v1.2/integrating.md +1 -1
  35. package/versioned_docs/version-v1.2/key-change.md +1 -1
  36. package/versioned_docs/version-v1.2/poll-types.md +1 -1
  37. package/versioned_docs/version-v1.2/testing-in-detail.md +3 -3
  38. package/versioned_docs/version-v1.2/testing.md +1 -1
  39. package/versioned_docs/version-v1.2/topup.md +1 -1
  40. package/versioned_docs/version-v1.2/typedoc/core/index.md +2 -2
  41. package/versioned_docs/version-v1.2/versioning.md +3 -3
  42. package/versioned_docs/version-v1.2/workflow.md +1 -1
  43. package/versioned_docs/version-v2.x/contributing/contributing.md +4 -4
  44. package/versioned_docs/version-v2.x/core-concepts/key-change.md +1 -1
  45. package/versioned_docs/version-v2.x/core-concepts/merkle-trees.md +1 -1
  46. package/versioned_docs/version-v2.x/core-concepts/poll-types.md +1 -1
  47. package/versioned_docs/version-v2.x/core-concepts/workflow.md +1 -1
  48. package/versioned_docs/version-v2.x/guides/integrating.md +1 -1
  49. package/versioned_docs/version-v2.x/guides/testing/testing-in-detail.md +3 -3
  50. package/versioned_docs/version-v2.x/guides/testing/testing.md +1 -1
  51. package/versioned_docs/version-v2.x/processes/versioning.md +3 -3
  52. package/versioned_docs/version-v2.x/supported-networks/deployed-contracts.md +7 -7
  53. package/versioned_docs/version-v2.x/technical-references/smart-contracts/AccQueue.md +1 -1
  54. package/versioned_docs/version-v2.x/technical-references/smart-contracts/MACI.md +1 -1
  55. package/versioned_docs/version-v2.x/technical-references/smart-contracts/MessageProcessor.md +1 -1
  56. package/versioned_docs/version-v2.x/technical-references/smart-contracts/Params.md +1 -1
  57. package/versioned_docs/version-v2.x/technical-references/smart-contracts/Poll.md +1 -1
  58. package/versioned_docs/version-v2.x/technical-references/smart-contracts/PollFactory.md +1 -1
  59. package/versioned_docs/version-v2.x/technical-references/smart-contracts/Tally.md +1 -1
  60. package/versioned_docs/version-v2.x/technical-references/smart-contracts/VkRegistry.md +1 -1
  61. package/versioned_docs/version-v2.x/technical-references/smart-contracts/VoiceCreditProxy.md +1 -1
  62. package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/processMessages.md +4 -4
  63. package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/tallyVotes.md +2 -2
  64. package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +3 -3
  65. package/versioned_docs/version-v3.x/contributing/contributing.md +11 -5
  66. package/versioned_docs/version-v3.x/core-concepts/key-change.md +29 -29
  67. package/versioned_docs/version-v3.x/core-concepts/maci-keys.md +1 -1
  68. package/versioned_docs/version-v3.x/core-concepts/poll-types.md +33 -9
  69. package/versioned_docs/version-v3.x/core-concepts/polls.md +34 -10
  70. package/versioned_docs/version-v3.x/core-concepts/spec.md +40 -106
  71. package/versioned_docs/version-v3.x/core-concepts/workflow.md +2 -2
  72. package/versioned_docs/version-v3.x/guides/compile-circuits.md +36 -20
  73. package/versioned_docs/version-v3.x/guides/integrating.md +10 -10
  74. package/versioned_docs/version-v3.x/guides/sdk.md +121 -0
  75. package/versioned_docs/version-v3.x/guides/testing/testing-in-detail.md +4 -4
  76. package/versioned_docs/version-v3.x/guides/testing/testing-introduction.md +38 -6
  77. package/versioned_docs/version-v3.x/guides/troubleshooting.md +64 -19
  78. package/versioned_docs/version-v3.x/processes/versioning.md +3 -3
  79. package/versioned_docs/version-v3.x/quick-start.md +29 -21
  80. package/versioned_docs/version-v3.x/resources.md +1 -0
  81. package/versioned_docs/version-v3.x/security/audit.md +2 -2
  82. package/versioned_docs/version-v3.x/security/trusted-setup.md +36 -36
  83. package/versioned_docs/version-v3.x/supported-networks/costs.md +725 -0
  84. package/versioned_docs/version-v3.x/supported-networks/deployed-contracts.md +9 -9
  85. package/versioned_docs/version-v3.x/supported-networks/supported-networks.md +16 -0
  86. package/versioned_docs/version-v3.x/technical-references/coordinator-service/index.md +15 -1
  87. package/versioned_docs/version-v3.x/technical-references/coordinator-service/installation.md +5 -33
  88. package/versioned_docs/version-v3.x/technical-references/coordinator-service/usage.md +64 -0
  89. package/versioned_docs/version-v3.x/technical-references/smart-contracts/MACI.md +7 -7
  90. package/versioned_docs/version-v3.x/technical-references/smart-contracts/MessageProcessor.md +1 -1
  91. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Params.md +2 -2
  92. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Policies.md +1 -1
  93. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Poll.md +8 -8
  94. package/versioned_docs/version-v3.x/technical-references/smart-contracts/PollFactory.md +1 -1
  95. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Tally.md +4 -4
  96. package/versioned_docs/version-v3.x/technical-references/smart-contracts/VkRegistry.md +8 -8
  97. package/versioned_docs/version-v3.x/technical-references/smart-contracts/VoiceCreditProxy.md +1 -1
  98. package/versioned_docs/version-v3.x/technical-references/technical-references.md +8 -8
  99. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/joinPoll.md +4 -4
  100. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/processMessages.md +81 -17
  101. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/setup.md +3 -3
  102. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/tallyVotes.md +6 -6
  103. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/utilities.md +9 -9
  104. 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
- - [VkRegistry](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/VkRegistry.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,11 +25,11 @@ 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
32
- You should change the -vk parameter to the VkRegistry address for the chain you are deploying to. Also you might need to modify the parameters based on the circuit configuration. Please refer to the [circuits page](/docs/technical-references/zk-snark-circuits/setup) for more information. Also you can add `-uq false` if you want to check non quadratic voting keys.
32
+ You should change the -vk parameter to the VerifyingKeysRegistry address for the chain you are deploying to. Also you might need to modify the parameters based on the circuit configuration. Please refer to the [circuits page](/docs/technical-references/zk-snark-circuits/setup) for more information. Also you can add `-uq false` if you want to check non quadratic voting keys.
33
33
  :::
34
34
 
35
35
  ## Contract Addresses
@@ -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
 
@@ -7,4 +7,18 @@ sidebar_position: 1
7
7
 
8
8
  # Coordinator Service
9
9
 
10
- Welcome to the Coordinator Service technical reference. Here you will find the technical details of the Coordinator Service, including the API endpoints and code examples.
10
+ Welcome to the Coordinator Service technical reference. This guide describes how the Coordinator Service works, its workflow, and how to interact with it. For more technical code documentation regarding API endpoints and data transfer objects, please refer to the [API documentation](https://coordinator.maci.vote/api).
11
+
12
+ ## Responsibilities
13
+
14
+ A MACI coordinator is responsible for running voting processes. In quadratic funding rounds or authority election rounds, the coordinator is the entity that defines who can vote, which projects or candidates are eligible for funding, and the duration of the voting round.
15
+
16
+ First of all, the coordinator needs to deploy the MACI smart contracts with the desired configuration: gatekeeper policy, which defines who can sign up as a voter; the state Merkle tree depth which defines the maximum number of voters; and the voting mode which defines how votes will be counted (more info in [Poll types](https://maci.pse.dev/docs/core-concepts/poll-types#quadratic-voting)).
17
+
18
+ After deploying the MACI contracts, the coordinator can deploy a poll (which represents a voting process). To deploy the poll, the coordinator needs to specify: the gatekeeper policy, which defines who can join the poll as a voter; the start and end dates of the poll; the number of options to vote for; the maximum number of votes per voter; and the voting mode.
19
+
20
+ The coordinator will then wait until the poll ends, after which they will need to finalize the poll. This involves processing all published messages, extracting the votes, tallying them, and submitting the results on-chain.
21
+
22
+ ## Conclusion
23
+
24
+ In the following documents, we will go through the details of setting up the Coordinator Service and how to interact with it to perform the tasks described above.
@@ -5,39 +5,11 @@ sidebar_label: Installation
5
5
  sidebar_position: 2
6
6
  ---
7
7
 
8
- 1. Add `.env` file (see `.env.example`).
9
- 2. Generate RSA key pair with `pnpm run generate-keypair`.
10
- 3. Download zkey files using `pnpm run download-zkeys:{type}` (only test type is available for now).
11
- 4. Make sure you copied RSA public key to your application. This will be needed for encrypting `Authorization` header and coordinator private key for proof generation. Also it can be accessed through API method `GET v1/proof/publicKey`.
12
- 5. Run `pnpm run start` to run the service.
13
- 6. All API calls must be called with `Authorization` header, where the value is encrypted with RSA public key you generated before. Header value contains message signature and message digest created by `COORDINATOR_ADDRESSES`. The format is `publicEncrypt({signature}:{digest})`.
14
- Make sure you set `COORDINATOR_ADDRESSES` env variable and sign any message with the addresses from your application (see [AccountSignatureGuard](./ts/auth/AccountSignatureGuard.service.ts)).
15
- 7. Proofs can be generated with `POST v1/proof/generate` API method or with Websockets (see [dto spec](./ts/proof/dto.ts), [controller](./ts/app.controller.ts) and [wsgateway](./ts/events/events.gateway.ts)).
16
-
17
- ## Subgraph deployment
18
-
19
- It is possible to deploy subgraph using coordinator service.
20
-
21
- First, you need to setup subgraph and create a project. [Subgraph dashboard](https://thegraph.com/studio/).
22
-
23
- Then, set env variables:
8
+ There are two ways to run the coordinator service: building it from source or using Docker. Both methods require you to clone the MACI repository and move to the project root directory.
24
9
 
10
+ ```bash
11
+ git clone https://github.com/privacy-scaling-explorations/maci
12
+ cd maci
25
13
  ```
26
- # Subgraph name
27
- SUBGRAPH_NAME="maci-subgraph"
28
-
29
- # Subgraph provider url
30
- SUBGRAPH_PROVIDER_URL=https://api.studio.thegraph.com/deploy/
31
-
32
- # Subgraph deploy key
33
- SUBGRAPH_DEPLOY_KEY=*******
34
14
 
35
- # Subgraph project folder
36
- SUBGRAPH_FOLDER=../subgraph
37
- ```
38
-
39
- After deployment, subgraph url will be available in studio dashboard and you can use this type of url to get latest deployed version in your application:
40
-
41
- ```
42
- https://api.studio.thegraph.com/.../{SUBGRAPH_NAME}/version/latest
43
- ```
15
+ You need to check the latest [README.md](https://github.com/privacy-ethereum/maci/tree/main/apps/coordinator) instructions in the coordinator service app for detailed information about requirements and steps to install, build, and run the service.
@@ -0,0 +1,64 @@
1
+ ---
2
+ title: Usage
3
+ description: Learn how to interact with a running MACI coordinator service instance.
4
+ sidebar_label: Usage
5
+ sidebar_position: 3
6
+ ---
7
+
8
+ After setting up and running the MACI coordinator service, you can interact with it through its RESTful API. The service provides various endpoints for deployment and finalization of polls. Please refer to the API documentation at [https://coordinator.maci.vote/api](https://coordinator.maci.vote/api) for the exact request format and required parameters for all endpoint calls described below.
9
+
10
+ # Authentication
11
+
12
+ The coordinator service uses a custom signature authentication mechanism to guard the deploy endpoints. To interact with these endpoints, you need to:
13
+
14
+ 1. Make sure you have run the command to set up and generate the RSA keypair, as described in the instructions section.
15
+
16
+ 2. Ensure that your Ethereum public key is set in the `.env` file under the `COORDINATOR_ADDRESSES` variable.
17
+
18
+ 3. Get the RSA public key from the coordinator service with [https://coordinator.maci.vote/v1/proof/publicKey](https://coordinator.maci.vote/v1/proof/publicKey).
19
+
20
+ 4. Sign a message such as "authenticate-me" using the coordinator's Ethereum private key.
21
+
22
+ 5. Encrypt both the message (also called digest) and its signature using the RSA public key. For example, you can use RSA public-key encryption in the format:
23
+
24
+ ```javascript
25
+ const payload: string = "signature:digest";
26
+ ```
27
+
28
+ Then encrypt this payload using the coordinator’s RSA public key.
29
+
30
+ # Deploy MACI
31
+
32
+ To deploy the set of MACI smart contracts, you need to call the endpoint [https://coordinator.maci.vote/v1/deploy/maci](https://coordinator.maci.vote/v1/deploy/maci) with a POST request. The request body should include the necessary parameters for the deployment, such as the gatekeeper policy, state tree depth, and voting mode.
33
+
34
+ # Deploy Poll
35
+
36
+ To deploy a new poll to an existing MACI instance, you need to call the endpoint [https://coordinator.maci.vote/v1/deploy/poll](https://coordinator.maci.vote/v1/deploy/poll) with a POST request. The request body should include the necessary parameters for the poll deployment, such as the gatekeeper policy, start and end dates, number of options, and voting mode.
37
+
38
+ # Deploy Subgraph
39
+
40
+ To deploy a subgraph for a MACI instance and its corresponding polls, you need to call the endpoint [https://coordinator.maci.vote/v1/subgraph/deploy](https://coordinator.maci.vote/v1/subgraph/deploy) with a POST request. The request body should include the necessary parameters for the subgraph deployment, such as the MACI contract address and the subgraph name.
41
+
42
+ # Finalize Poll
43
+
44
+ To finalize a poll, you need to follow a series of steps that involve processing messages, merging state trees, generating proofs, and submitting the final tally on-chain. The Coordinator Service provides endpoints for each of these steps.
45
+
46
+ ## Merge
47
+
48
+ To merge the published messages and create the required state tree, you need to call the endpoint [https://coordinator.maci.vote/v1/proof/merge](https://coordinator.maci.vote/v1/proof/merge) with a POST request. The request body should include the necessary parameters for the merge operation, such as the MACI contract address and the poll ID.
49
+
50
+ ## Generate
51
+
52
+ Once the Merkle trees are ready, you can generate the zk-SNARK proof for the final tally by calling the endpoint [https://coordinator.maci.vote/v1/proof/generate](https://coordinator.maci.vote/v1/proof/generate) with a POST request. The request body should include the necessary parameters for the proof generation, such as the MACI contract address and the poll ID.
53
+
54
+ ## Submit
55
+
56
+ After generating the proof, you can submit the final tally on-chain by calling the endpoint [https://coordinator.maci.vote/v1/proof/submit](https://coordinator.maci.vote/v1/proof/submit) with a POST request. The request body should include the necessary parameters for the submission, such as the MACI contract address, poll ID, and the generated proof.
57
+
58
+ # Schedule Poll
59
+
60
+ After deploying a poll, you can schedule it to be finalized automatically after it ends. Make sure to set the MACI coordinator private key in the `.env` file. To do so, you need to call the endpoint [https://coordinator.maci.vote/v1/schedule/poll](https://coordinator.maci.vote/v1/schedule/poll) with a POST request. The request body should include the necessary parameters for scheduling the poll, such as the MACI contract address and the poll ID.
61
+
62
+ # Health
63
+
64
+ To check that the env variables are set correctly and the service is running, you can call the health endpoint [https://coordinator.maci.vote/v1/health](https://coordinator.maci.vote/v1/health) with a GET request. This endpoint will return a status message indicating the rapidsnark access, redis database connection, zkeys access, and the MACI coordinator address with its funds in each MACI-compatible network.
@@ -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.
@@ -62,12 +62,12 @@ This function does the following:
62
62
  - hashes the public key and inserts it into the state tree.
63
63
 
64
64
  ```ts
65
- function signUp(PubKey memory _pubKey, bytes memory _signUpPolicyData) public virtual {
65
+ function signUp(PublicKey memory _publicKey, bytes memory _signUpPolicyData) public virtual {
66
66
  // ensure we do not have more signups than what the circuits support
67
67
  if (leanIMTData.size >= maxSignups) revert TooManySignups();
68
68
 
69
69
  // ensure that the public key is on the baby jubjub curve
70
- if (!CurveBabyJubJub.isOnCurve(_pubKey.x, _pubKey.y)) {
70
+ if (!CurveBabyJubJub.isOnCurve(_publicKey.x, _publicKey.y)) {
71
71
  revert InvalidPubKey();
72
72
  }
73
73
 
@@ -76,13 +76,13 @@ function signUp(PubKey memory _pubKey, bytes memory _signUpPolicyData) public vi
76
76
  signUpPolicy.register(msg.sender, _signUpPolicyData);
77
77
 
78
78
  // Hash the public key and insert it into the tree.
79
- uint256 pubKeyHash = hashLeftRight(_pubKey.x, _pubKey.y);
79
+ uint256 pubKeyHash = hashLeftRight(_publicKey.x, _publicKey.y);
80
80
  uint256 stateRoot = InternalLeanIMT._insert(leanIMTData, pubKeyHash);
81
81
 
82
82
  // Store the current state tree root in the array
83
83
  stateRootsOnSignUp.push(stateRoot);
84
84
 
85
- emit SignUp(leanIMTData.size - 1, block.timestamp, _pubKey.x, _pubKey.y);
85
+ emit SignUp(leanIMTData.size - 1, block.timestamp, _publicKey.x, _publicKey.y);
86
86
  }
87
87
  ```
88
88
 
@@ -149,12 +149,12 @@ 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)
156
156
  - `voteOptions`: the number of vote options for the poll
157
157
 
158
158
  :::info
159
- Please be advised that the number of signups in the MACI contract (number of leaves in the merkle tree holding MACI's state) considers the initial zero leaf as one signup. For this reason, when accounting for the real users signed up to MACI, you should subtract one from the value returned from the `numSignUps` function.
159
+ Please be advised that the number of signups in the MACI contract (number of leaves in the merkle tree holding MACI's state) considers the initial zero leaf as one signup. For this reason, when accounting for the real users signed up to MACI, you should subtract one from the value returned from the `totalSignups` function.
160
160
  :::
@@ -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.
@@ -26,7 +26,7 @@ The `joinPoll` function looks as follows:
26
26
  /// @inheritdoc IPoll
27
27
  function joinPoll(
28
28
  uint256 _nullifier,
29
- PubKey calldata _pubKey,
29
+ PublicKey calldata _publicKey,
30
30
  uint256 _stateRootIndex,
31
31
  uint256[8] calldata _proof,
32
32
  bytes memory _signUpPolicyData,
@@ -41,7 +41,7 @@ The `joinPoll` function looks as follows:
41
41
  pollNullifiers[_nullifier] = true;
42
42
 
43
43
  // Verify user's proof
44
- if (!verifyJoiningPollProof(_nullifier, _stateRootIndex, _pubKey, _proof)) {
44
+ if (!verifyJoiningPollProof(_nullifier, _stateRootIndex, _publicKey, _proof)) {
45
45
  revert InvalidPollProof();
46
46
  }
47
47
 
@@ -55,7 +55,7 @@ The `joinPoll` function looks as follows:
55
55
  );
56
56
 
57
57
  // Store user in the pollStateTree
58
- uint256 stateLeaf = hashStateLeaf(StateLeaf(_pubKey, voiceCreditBalance, block.timestamp));
58
+ uint256 stateLeaf = hashStateLeaf(StateLeaf(_publicKey, voiceCreditBalance, block.timestamp));
59
59
 
60
60
  uint256 stateRoot = InternalLazyIMT._insert(pollStateTree, stateLeaf);
61
61
 
@@ -63,7 +63,7 @@ The `joinPoll` function looks as follows:
63
63
  pollStateRootsOnJoin.push(stateRoot);
64
64
 
65
65
  uint256 pollStateIndex = pollStateTree.numberOfLeaves - 1;
66
- emit PollJoined(_pubKey.x, _pubKey.y, voiceCreditBalance, block.timestamp, _nullifier, pollStateIndex);
66
+ emit PollJoined(_publicKey.x, _publicKey.y, voiceCreditBalance, block.timestamp, _nullifier, pollStateIndex);
67
67
  }
68
68
  ```
69
69
 
@@ -72,7 +72,7 @@ The `joinPoll` function looks as follows:
72
72
  The `publishMessage` function looks as follows:
73
73
 
74
74
  ```ts
75
- function publishMessage(Message calldata _message, PubKey calldata _encPubKey) public virtual isOpenForVoting {
75
+ function publishMessage(Message calldata _message, PublicKey calldata _encPubKey) public virtual isOpenForVoting {
76
76
  // check if the public key is on the curve
77
77
  if (!CurveBabyJubJub.isOnCurve(_encPubKey.x, _encPubKey.y)) {
78
78
  revert InvalidPubKey();
@@ -84,7 +84,7 @@ function publishMessage(Message calldata _message, PubKey calldata _encPubKey) p
84
84
  }
85
85
 
86
86
  // compute current message hash
87
- uint256 messageHash = hashMessageAndEncPubKey(_message, _encPubKey);
87
+ uint256 messageHash = hashMessageAndPublicKey(_message, _encPubKey);
88
88
 
89
89
  // update current message chain hash
90
90
  updateChainHash(messageHash);
@@ -96,7 +96,7 @@ function publishMessage(Message calldata _message, PubKey calldata _encPubKey) p
96
96
  The `publishMessageBatch` function looks as follows:
97
97
 
98
98
  ```ts
99
- function publishMessageBatch(Message[] calldata _messages, PubKey[] calldata _encPubKeys) public virtual {
99
+ function publishMessageBatch(Message[] calldata _messages, PublicKey[] calldata _encPubKeys) public virtual {
100
100
  if (_messages.length != _encPubKeys.length) {
101
101
  revert InvalidBatchLength();
102
102
  }
@@ -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.
@@ -16,14 +16,14 @@ This contract should be deployed alongside a `Poll`, with the the constructor ac
16
16
  ```ts
17
17
  constructor(
18
18
  address _verifier,
19
- address _vkRegistry,
19
+ address _verifyingKeysRegistry,
20
20
  address _poll,
21
21
  address _mp,
22
22
  address _tallyOwner,
23
23
  Mode _mode
24
24
  ) payable {
25
25
  verifier = IVerifier(_verifier);
26
- vkRegistry = IVkRegistry(_vkRegistry);
26
+ vkRegistry = IVkRegistry(_verifyingKeysRegistry);
27
27
  poll = IPoll(_poll);
28
28
  messageProcessor = IMessageProcessor(_mp);
29
29
  mode = _mode;
@@ -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
 
@@ -1,24 +1,24 @@
1
1
  ---
2
- title: VkRegistry Smart Contract
3
- description: VkRegistry smart contract
4
- sidebar_label: VkRegistry
2
+ title: VerifyingKeysRegistry Smart Contract
3
+ description: VerifyingKeysRegistry smart contract
4
+ sidebar_label: VerifyingKeysRegistry
5
5
  sidebar_position: 8
6
6
  ---
7
7
 
8
8
  :::info
9
- Code location: [VkRegistry.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/VkRegistry.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
- The VkRegistry is a contract that holds the verifying keys for the zk-SNARK circuits. It holds four different sets of keys:
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
 
@@ -21,8 +21,8 @@ Users need to provide a valid proof to the Poll smart contract to join a poll, a
21
21
 
22
22
  | Input signal | Description |
23
23
  | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
24
- | `privKey` | The user's private key |
25
- | `pollPubKey` | The poll's public key |
24
+ | `privateKey` | The user's private key |
25
+ | `pollPublicKey` | The poll's public key |
26
26
  | `siblings` | The siblings for the merkle tree inclusion proof |
27
27
  | `indices` | The indices for the merkle tree inclusion proof |
28
28
  | `nullifier` | The nullifier |
@@ -44,7 +44,7 @@ Users will use this circuit to anonymously prove that they joined a poll. This c
44
44
 
45
45
  | Input signal | Description |
46
46
  | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
47
- | `privKey` | The user's private key |
47
+ | `privateKey` | The user's private key |
48
48
  | `voiceCreditsBalance` | The user's initial voice credits balance |
49
49
  | `pathElements` | The path elements for the merkle tree inclusion proof |
50
50
  | `pathIndices` | The path indices for the merkle tree inclusion proof |