@maci-protocol/website 0.0.0-ci.570f4fe → 0.0.0-ci.5af126c
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 +1 -1
- package/blog/2024-08-10-maci-v2.md +1 -1
- package/blog/2024-12-01-maci-getting-started.md +1 -1
- package/blog/2025-03-21-roadmap-2025.md +1 -1
- package/docusaurus.config.ts +2 -2
- package/package.json +5 -5
- 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/static/img/relayer-diagram.png +0 -0
- package/versioned_docs/version-v0.x/quadratic-vote-tallying-circuit.md +16 -16
- package/versioned_docs/version-v3.x/core-concepts/coordinator-service.md +16 -0
- package/versioned_docs/version-v3.x/core-concepts/key-change.md +28 -28
- package/versioned_docs/version-v3.x/core-concepts/maci-keys.md +1 -1
- package/versioned_docs/version-v3.x/core-concepts/offchain-voting.md +14 -0
- 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 +43 -109
- package/versioned_docs/version-v3.x/core-concepts/state-leaf.md +2 -2
- package/versioned_docs/version-v3.x/core-concepts/workflow.md +8 -2
- package/versioned_docs/version-v3.x/guides/compile-circuits.md +36 -20
- package/versioned_docs/version-v3.x/guides/integrating.md +9 -9
- package/versioned_docs/version-v3.x/guides/testing/testing-in-detail.md +2 -2
- package/versioned_docs/version-v3.x/guides/testing/testing-introduction.md +8 -2
- package/versioned_docs/version-v3.x/guides/troubleshooting.md +62 -17
- 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 +35 -35
- package/versioned_docs/version-v3.x/supported-networks/costs.md +419 -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/_category_.json +8 -0
- package/versioned_docs/version-v3.x/technical-references/coordinator-service/index.md +10 -0
- package/versioned_docs/version-v3.x/technical-references/coordinator-service/installation.md +43 -0
- package/versioned_docs/version-v3.x/technical-references/offchain-relayer/_category_.json +8 -0
- package/versioned_docs/version-v3.x/technical-references/offchain-relayer/index.md +51 -0
- package/versioned_docs/version-v3.x/technical-references/offchain-relayer/installation.md +109 -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/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/zk-snark-circuits/joinPoll.md +3 -4
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/processMessages.md +19 -15
- 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 +5 -5
- 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
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: MACI Deployment and Operation Costs
|
|
3
|
+
description: MACI Deployment and Operation Costs
|
|
4
|
+
sidebar_label: MACI Deployment and Operation Costs
|
|
5
|
+
sidebar_position: 3
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Notes
|
|
9
|
+
|
|
10
|
+
- Prices are estimates and will vary based on actual gas prices and ETH/USD exchange rates.
|
|
11
|
+
- These values assume a consistent gas price across operations, which may vary on-chain.
|
|
12
|
+
|
|
13
|
+
## Costs on Polygon zkEVM
|
|
14
|
+
|
|
15
|
+
Below are the estimated costs for various MACI operations and deployments, assuming:
|
|
16
|
+
|
|
17
|
+
- **Gas price**: 0.012 gwei
|
|
18
|
+
- **ETH price**: $2595
|
|
19
|
+
|
|
20
|
+
<details>
|
|
21
|
+
<summary>Contract calls cost</summary>
|
|
22
|
+
|
|
23
|
+
| Contract | Method | Min | Max | Avg | USD (avg) |
|
|
24
|
+
| ---------------------------------------- | -------------------------- | ------- | ------- | ------- | --------- |
|
|
25
|
+
| AnonAadhaarCheckerFactory | deploy | - | - | 125971 | 0.00402 |
|
|
26
|
+
| AnonAadhaarPolicy | enforce | - | - | 38141 | 0.00122 |
|
|
27
|
+
| AnonAadhaarPolicy | setTarget | 50133 | 50167 | 50149 | 0.0016 |
|
|
28
|
+
| AnonAadhaarPolicyFactory | deploy | - | - | 129387 | 0.00413 |
|
|
29
|
+
| ConstantInitialVoiceCreditProxyFactory | deploy | - | - | 118665 | 0.00379 |
|
|
30
|
+
| EASCheckerFactory | deploy | - | - | 155556 | 0.00497 |
|
|
31
|
+
| EASPolicyFactory | deploy | - | - | 129387 | 0.00413 |
|
|
32
|
+
| ERC20CheckerFactory | deploy | - | - | 125959 | 0.00402 |
|
|
33
|
+
| ERC20PolicyFactory | deploy | - | - | 129365 | 0.00413 |
|
|
34
|
+
| ERC20VotesCheckerFactory | deploy | - | - | 154673 | 0.00494 |
|
|
35
|
+
| ERC20VotesInitialVoiceCreditProxyFactory | deploy | - | - | 176590 | 0.00564 |
|
|
36
|
+
| ERC20VotesPolicyFactory | deploy | - | - | 129365 | 0.00413 |
|
|
37
|
+
| FreeForAllCheckerFactory | deploy | - | - | 89376 | 0.00286 |
|
|
38
|
+
| FreeForAllPolicyFactory | deploy | 129375 | 129387 | 129386 | 0.00413 |
|
|
39
|
+
| GitcoinPassportCheckerFactory | deploy | - | - | 125937 | 0.00402 |
|
|
40
|
+
| GitcoinPassportPolicyFactory | deploy | - | - | 129365 | 0.00413 |
|
|
41
|
+
| HatsCheckerFactory | deploy | - | - | 169023 | 0.0054 |
|
|
42
|
+
| HatsPolicyFactory | deploy | - | - | 129387 | 0.00413 |
|
|
43
|
+
| MACI | deployPoll | 1580765 | 1583829 | 1581626 | 0.05052 |
|
|
44
|
+
| MACI | signUp | 197667 | 730480 | 315320 | 0.01007 |
|
|
45
|
+
| MerkleProofCheckerFactory | deploy | - | - | 119047 | 0.0038 |
|
|
46
|
+
| MerkleProofPolicyFactory | deploy | - | - | 129387 | 0.00413 |
|
|
47
|
+
| MessageProcessor | processMessages | 252019 | 252918 | 252319 | 0.00806 |
|
|
48
|
+
| Poll | joinPoll | 282314 | 503970 | 334837 | 0.0107 |
|
|
49
|
+
| Poll | mergeState | 198686 | 354005 | 255089 | 0.00815 |
|
|
50
|
+
| Poll | padLastBatch | - | - | 81884 | 0.00262 |
|
|
51
|
+
| Poll | publishMessage | - | - | 358725 | 0.01146 |
|
|
52
|
+
| Poll | publishMessageBatch | - | - | 671490 | 0.02145 |
|
|
53
|
+
| Poll | relayMessagesBatch | - | - | 155235 | 0.00496 |
|
|
54
|
+
| PollFactory | deploy | - | - | 1099100 | 0.03511 |
|
|
55
|
+
| SemaphoreCheckerFactory | deploy | - | - | 106047 | 0.00339 |
|
|
56
|
+
| SemaphorePolicyFactory | deploy | - | - | 129387 | 0.00413 |
|
|
57
|
+
| Tally | addTallyResults | 7311562 | 7844012 | 7577787 | 0.24207 |
|
|
58
|
+
| Tally | tallyVotes | 147262 | 204522 | 161585 | 0.00516 |
|
|
59
|
+
| TokenCheckerFactory | deploy | - | - | 97197 | 0.0031 |
|
|
60
|
+
| TokenPolicyFactory | deploy | - | - | 129387 | 0.00413 |
|
|
61
|
+
| VerifyingKeysRegistry | setPollJoinedVerifyingKey | - | - | 453033 | 0.01447 |
|
|
62
|
+
| VerifyingKeysRegistry | setPollJoiningVerifyingKey | - | - | 453011 | 0.01447 |
|
|
63
|
+
| VerifyingKeysRegistry | setVerifyingKeys | 885514 | 885526 | 885517 | 0.02829 |
|
|
64
|
+
| VerifyingKeysRegistry | setVerifyingKeysBatch | - | - | 1787720 | 0.05711 |
|
|
65
|
+
| ZupassCheckerFactory | deploy | - | - | 206318 | 0.00659 |
|
|
66
|
+
| ZupassPolicyFactory | deploy | - | - | 129365 | 0.00413 |
|
|
67
|
+
|
|
68
|
+
</details>
|
|
69
|
+
|
|
70
|
+
<details>
|
|
71
|
+
<summary>Deployment cost</summary>
|
|
72
|
+
|
|
73
|
+
| Deployments | Min Gas | Max Gas | Avg Gas | % of Limit | USD (avg) |
|
|
74
|
+
| ---------------------------------------- | ------- | ------- | ------- | ---------- | --------- |
|
|
75
|
+
| AnonAadhaarCheckerFactory | - | - | 567621 | 1.9% | 0.01813 |
|
|
76
|
+
| AnonAadhaarPolicyFactory | - | - | 759390 | 2.5% | 0.02426 |
|
|
77
|
+
| ConstantInitialVoiceCreditProxyFactory | - | - | 379812 | 1.3% | 0.01213 |
|
|
78
|
+
| EASCheckerFactory | - | - | 623304 | 2.1% | 0.01991 |
|
|
79
|
+
| EASPolicyFactory | - | - | 690560 | 2.3% | 0.02206 |
|
|
80
|
+
| ERC20CheckerFactory | - | - | 446429 | 1.5% | 0.01426 |
|
|
81
|
+
| ERC20PolicyFactory | - | - | 684892 | 2.3% | 0.02188 |
|
|
82
|
+
| ERC20VotesCheckerFactory | - | - | 464123 | 1.5% | 0.01483 |
|
|
83
|
+
| ERC20VotesInitialVoiceCreditProxyFactory | - | - | 482127 | 1.6% | 0.01540 |
|
|
84
|
+
| ERC20VotesPolicyFactory | - | - | 685960 | 2.3% | 0.02191 |
|
|
85
|
+
| FreeForAllCheckerFactory | - | - | 329927 | 1.1% | 0.01054 |
|
|
86
|
+
| FreeForAllPolicyFactory | - | - | 653501 | 2.2% | 0.02088 |
|
|
87
|
+
| GitcoinPassportCheckerFactory | - | - | 463912 | 1.5% | 0.01482 |
|
|
88
|
+
| GitcoinPassportPolicyFactory | - | - | 687052 | 2.3% | 0.02195 |
|
|
89
|
+
| Hasher | - | - | 426472 | 1.4% | 0.01362 |
|
|
90
|
+
| HatsCheckerFactory | - | - | 572538 | 1.9% | 0.01829 |
|
|
91
|
+
| HatsPolicyFactory | - | - | 684664 | 2.3% | 0.02187 |
|
|
92
|
+
| MACI | 1803354 | 1803438 | 1803408 | 6.0% | 0.05761 |
|
|
93
|
+
| MerkleProofCheckerFactory | - | - | 491985 | 1.6% | 0.01572 |
|
|
94
|
+
| MerkleProofPolicyFactory | - | - | 686188 | 2.3% | 0.02192 |
|
|
95
|
+
| MessageProcessorFactory | 1818377 | 1818401 | 1818398 | 6.1% | 0.05809 |
|
|
96
|
+
| PollFactory | 3720635 | 3720683 | 3720678 | 12.4% | 0.11885 |
|
|
97
|
+
| PoseidonT3 | - | - | 2157126 | 7.2% | 0.06891 |
|
|
98
|
+
| PoseidonT4 | - | - | 2745274 | 9.2% | 0.0877 |
|
|
99
|
+
| PoseidonT5 | - | - | 3569887 | 11.9% | 0.11404 |
|
|
100
|
+
| PoseidonT6 | - | - | 4261625 | 14.2% | 0.13613 |
|
|
101
|
+
| SemaphoreCheckerFactory | - | - | 557606 | 1.9% | 0.01781 |
|
|
102
|
+
| SemaphorePolicyFactory | - | - | 749517 | 2.5% | 0.02394 |
|
|
103
|
+
| TallyFactory | 2176647 | 2176671 | 2176668 | 7.3% | 0.06953 |
|
|
104
|
+
| TokenCheckerFactory | - | - | 435769 | 1.5% | 0.01392 |
|
|
105
|
+
| TokenPolicyFactory | - | - | 690920 | 2.3% | 0.02207 |
|
|
106
|
+
| Utilities | - | - | 664356 | 2.2% | 0.02122 |
|
|
107
|
+
| Verifier | - | - | 775226 | 2.6% | 0.02476 |
|
|
108
|
+
| VerifyingKeysRegistry | - | - | 1755862 | 5.9% | 0.05609 |
|
|
109
|
+
| ZupassCheckerFactory | - | - | 640425 | 2.1% | 0.02046 |
|
|
110
|
+
| ZupassGroth16Verifier | - | - | 1108706 | 3.7% | 0.03542 |
|
|
111
|
+
| ZupassPolicyFactory | - | - | 785744 | 2.6% | 0.0251 |
|
|
112
|
+
|
|
113
|
+
</details>
|
|
114
|
+
|
|
115
|
+
## Costs on Scroll
|
|
116
|
+
|
|
117
|
+
Below are the estimated costs for various MACI operations and deployments, assuming:
|
|
118
|
+
|
|
119
|
+
- **Gas price**: 0.016 gwei
|
|
120
|
+
- **ETH price**: $2493
|
|
121
|
+
|
|
122
|
+
<details>
|
|
123
|
+
<summary>Contract calls cost</summary>
|
|
124
|
+
|
|
125
|
+
| Contract | Method | Min | Max | Avg | USD (avg) |
|
|
126
|
+
| ---------------------------------------- | -------------------------- | ------- | ------- | ------- | --------- |
|
|
127
|
+
| AnonAadhaarCheckerFactory | deploy | - | - | 125971 | 0.00496 |
|
|
128
|
+
| AnonAadhaarPolicy | enforce | - | - | 38141 | 0.0016 |
|
|
129
|
+
| AnonAadhaarPolicy | setTarget | 50133 | 50167 | 50149 | 0.00208 |
|
|
130
|
+
| AnonAadhaarPolicyFactory | deploy | - | - | 129387 | 0.00512 |
|
|
131
|
+
| ConstantInitialVoiceCreditProxyFactory | deploy | - | - | 118665 | 0.0048 |
|
|
132
|
+
| EASCheckerFactory | deploy | - | - | 155556 | 0.00624 |
|
|
133
|
+
| EASPolicyFactory | deploy | - | - | 129387 | 0.00512 |
|
|
134
|
+
| ERC20CheckerFactory | deploy | - | - | 125959 | 0.00496 |
|
|
135
|
+
| ERC20PolicyFactory | deploy | - | - | 129365 | 0.00512 |
|
|
136
|
+
| ERC20VotesCheckerFactory | deploy | - | - | 154673 | 0.00624 |
|
|
137
|
+
| ERC20VotesInitialVoiceCreditProxyFactory | deploy | - | - | 176590 | 0.00704 |
|
|
138
|
+
| ERC20VotesPolicyFactory | deploy | - | - | 129365 | 0.00512 |
|
|
139
|
+
| FreeForAllCheckerFactory | deploy | - | - | 89376 | 0.00352 |
|
|
140
|
+
| FreeForAllPolicyFactory | deploy | 129375 | 129387 | 129386 | 0.00512 |
|
|
141
|
+
| GitcoinPassportCheckerFactory | deploy | - | - | 125937 | 0.00496 |
|
|
142
|
+
| GitcoinPassportPolicyFactory | deploy | - | - | 129365 | 0.00512 |
|
|
143
|
+
| HatsCheckerFactory | deploy | - | - | 169023 | 0.00672 |
|
|
144
|
+
| HatsPolicyFactory | deploy | - | - | 129387 | 0.00512 |
|
|
145
|
+
| MACI | deployPoll | 1580765 | 1583829 | 1581630 | 0.06304 |
|
|
146
|
+
| MACI | signUp | 197667 | 730492 | 315320 | 0.01264 |
|
|
147
|
+
| MerkleProofCheckerFactory | deploy | - | - | 119047 | 0.0048 |
|
|
148
|
+
| MerkleProofPolicyFactory | deploy | - | - | 129387 | 0.00512 |
|
|
149
|
+
| MessageProcessor | processMessages | 252007 | 252918 | 252317 | 0.01008 |
|
|
150
|
+
| Poll | joinPoll | 282314 | 503970 | 334835 | 0.01328 |
|
|
151
|
+
| Poll | mergeState | 198686 | 354005 | 255089 | 0.01024 |
|
|
152
|
+
| Poll | padLastBatch | - | - | 81884 | 0.0032 |
|
|
153
|
+
| Poll | publishMessage | - | - | 358725 | 0.01424 |
|
|
154
|
+
| Poll | publishMessageBatch | - | - | 671502 | 0.02672 |
|
|
155
|
+
| Poll | relayMessagesBatch | - | - | 155235 | 0.00624 |
|
|
156
|
+
| PollFactory | deploy | - | - | 1099088 | 0.04384 |
|
|
157
|
+
| SemaphoreCheckerFactory | deploy | - | - | 106047 | 0.00416 |
|
|
158
|
+
| SemaphorePolicyFactory | deploy | - | - | 129387 | 0.00512 |
|
|
159
|
+
| Tally | addTallyResults | 7311562 | 7844012 | 7577787 | 0.30224 |
|
|
160
|
+
| Tally | tallyVotes | 147262 | 204522 | 161585 | 0.0064 |
|
|
161
|
+
| TokenCheckerFactory | deploy | - | - | 97197 | 0.00384 |
|
|
162
|
+
| TokenPolicyFactory | deploy | - | - | 129387 | 0.00512 |
|
|
163
|
+
| VerifyingKeysRegistry | setPollJoinedVerifyingKey | - | - | 453033 | 0.01808 |
|
|
164
|
+
| VerifyingKeysRegistry | setPollJoiningVerifyingKey | - | - | 453011 | 0.01808 |
|
|
165
|
+
| VerifyingKeysRegistry | setVerifyingKeys | 885514 | 885526 | 885517 | 0.03536 |
|
|
166
|
+
| VerifyingKeysRegistry | setVerifyingKeysBatch | - | - | 1787720 | 0.07136 |
|
|
167
|
+
| ZupassCheckerFactory | deploy | - | - | 206318 | 0.00816 |
|
|
168
|
+
| ZupassPolicyFactory | deploy | - | - | 129365 | 0.00512 |
|
|
169
|
+
|
|
170
|
+
</details>
|
|
171
|
+
|
|
172
|
+
<details>
|
|
173
|
+
<summary>Deployment cost</summary>
|
|
174
|
+
|
|
175
|
+
| Deployments | Min Gas | Max Gas | Avg Gas | % of Block Limit | USD (avg) |
|
|
176
|
+
| ---------------------------------------- | ------- | ------- | ------- | ---------------- | --------- |
|
|
177
|
+
| AnonAadhaarCheckerFactory | - | - | 567621 | 1.9 % | 0.02272 |
|
|
178
|
+
| AnonAadhaarPolicyFactory | - | - | 759390 | 2.5 % | 0.03024 |
|
|
179
|
+
| ConstantInitialVoiceCreditProxyFactory | - | - | 379812 | 1.3 % | 0.0152 |
|
|
180
|
+
| EASCheckerFactory | - | - | 623304 | 2.1 % | 0.0248 |
|
|
181
|
+
| EASPolicyFactory | - | - | 690560 | 2.3 % | 0.02752 |
|
|
182
|
+
| ERC20CheckerFactory | - | - | 446429 | 1.5 % | 0.01776 |
|
|
183
|
+
| ERC20PolicyFactory | - | - | 684892 | 2.3 % | 0.02736 |
|
|
184
|
+
| ERC20VotesCheckerFactory | - | - | 464123 | 1.5 % | 0.01856 |
|
|
185
|
+
| ERC20VotesInitialVoiceCreditProxyFactory | - | - | 482127 | 1.6 % | 0.0192 |
|
|
186
|
+
| ERC20VotesPolicyFactory | - | - | 685960 | 2.3 % | 0.02736 |
|
|
187
|
+
| FreeForAllCheckerFactory | - | - | 329927 | 1.1 % | 0.01312 |
|
|
188
|
+
| FreeForAllPolicyFactory | - | - | 653501 | 2.2 % | 0.02608 |
|
|
189
|
+
| GitcoinPassportCheckerFactory | - | - | 463912 | 1.5 % | 0.01856 |
|
|
190
|
+
| GitcoinPassportPolicyFactory | - | - | 687052 | 2.3 % | 0.02736 |
|
|
191
|
+
| Hasher | - | - | 426472 | 1.4 % | 0.01696 |
|
|
192
|
+
| HatsCheckerFactory | - | - | 572538 | 1.9 % | 0.02288 |
|
|
193
|
+
| HatsPolicyFactory | - | - | 684664 | 2.3 % | 0.02736 |
|
|
194
|
+
| MACI | 1803354 | 1803438 | 1803408 | 6.0 % | 0.072 |
|
|
195
|
+
| MerkleProofCheckerFactory | - | - | 491985 | 1.6 % | 0.01968 |
|
|
196
|
+
| MerkleProofPolicyFactory | - | - | 686188 | 2.3 % | 0.02736 |
|
|
197
|
+
| MessageProcessorFactory | 1818377 | 1818401 | 1818398 | 6.1 % | 0.07248 |
|
|
198
|
+
| PollFactory | 3720635 | 3720683 | 3720678 | 12.4 % | 0.14848 |
|
|
199
|
+
| PoseidonT3 | - | - | 2157126 | 7.2 % | 0.08608 |
|
|
200
|
+
| PoseidonT4 | - | - | 2745274 | 9.2 % | 0.1096 |
|
|
201
|
+
| PoseidonT5 | - | - | 3569887 | 11.9 % | 0.1424 |
|
|
202
|
+
| PoseidonT6 | - | - | 4261625 | 14.2 % | 0.17008 |
|
|
203
|
+
| SemaphoreCheckerFactory | - | - | 557606 | 1.9 % | 0.02224 |
|
|
204
|
+
| SemaphorePolicyFactory | - | - | 749517 | 2.5 % | 0.02992 |
|
|
205
|
+
| TallyFactory | 2176647 | 2176671 | 2176668 | 7.3 % | 0.08688 |
|
|
206
|
+
| TokenCheckerFactory | - | - | 435769 | 1.5 % | 0.01744 |
|
|
207
|
+
| TokenPolicyFactory | - | - | 690920 | 2.3 % | 0.02752 |
|
|
208
|
+
| Utilities | - | - | 664356 | 2.2 % | 0.02656 |
|
|
209
|
+
| Verifier | - | - | 775226 | 2.6 % | 0.03088 |
|
|
210
|
+
| VerifyingKeysRegistry | - | - | 1755862 | 5.9 % | 0.07008 |
|
|
211
|
+
| ZupassCheckerFactory | - | - | 640425 | 2.1 % | 0.0256 |
|
|
212
|
+
| ZupassGroth16Verifier | - | - | 1108706 | 3.7 % | 0.04416 |
|
|
213
|
+
| ZupassPolicyFactory | - | - | 785744 | 2.6 % | 0.03136 |
|
|
214
|
+
|
|
215
|
+
</details>
|
|
216
|
+
|
|
217
|
+
## Costs on Linea
|
|
218
|
+
|
|
219
|
+
Below are the estimated costs for various MACI operations and deployments, assuming:
|
|
220
|
+
|
|
221
|
+
- **Gas price**: 0.04 gwei
|
|
222
|
+
- **ETH price**: $2508
|
|
223
|
+
|
|
224
|
+
<details>
|
|
225
|
+
<summary>Contract calls cost</summary>
|
|
226
|
+
|
|
227
|
+
| Contract | Method | Min | Max | Avg | USD (avg) |
|
|
228
|
+
| ---------------------------------------- | -------------------------- | ------- | ------- | ------- | --------- |
|
|
229
|
+
| AnonAadhaarCheckerFactory | deploy | - | - | 125971 | 0.0126 |
|
|
230
|
+
| AnonAadhaarPolicy | enforce | - | - | 38141 | 0.0038 |
|
|
231
|
+
| AnonAadhaarPolicy | setTarget | 50133 | 50167 | 50149 | 0.005 |
|
|
232
|
+
| AnonAadhaarPolicyFactory | deploy | - | - | 129387 | 0.013 |
|
|
233
|
+
| ConstantInitialVoiceCreditProxyFactory | deploy | - | - | 118665 | 0.0119 |
|
|
234
|
+
| EASCheckerFactory | deploy | - | - | 155556 | 0.0156 |
|
|
235
|
+
| EASPolicyFactory | deploy | - | - | 129387 | 0.013 |
|
|
236
|
+
| ERC20CheckerFactory | deploy | - | - | 125959 | 0.0126 |
|
|
237
|
+
| ERC20PolicyFactory | deploy | - | - | 129365 | 0.013 |
|
|
238
|
+
| ERC20VotesCheckerFactory | deploy | - | - | 154673 | 0.0155 |
|
|
239
|
+
| ERC20VotesInitialVoiceCreditProxyFactory | deploy | - | - | 176590 | 0.0177 |
|
|
240
|
+
| ERC20VotesPolicyFactory | deploy | - | - | 129365 | 0.013 |
|
|
241
|
+
| FreeForAllCheckerFactory | deploy | - | - | 89376 | 0.009 |
|
|
242
|
+
| FreeForAllPolicyFactory | deploy | 129375 | 129387 | 129386 | 0.013 |
|
|
243
|
+
| GitcoinPassportCheckerFactory | deploy | - | - | 125937 | 0.0126 |
|
|
244
|
+
| GitcoinPassportPolicyFactory | deploy | - | - | 129365 | 0.013 |
|
|
245
|
+
| HatsCheckerFactory | deploy | - | - | 169023 | 0.017 |
|
|
246
|
+
| HatsPolicyFactory | deploy | - | - | 129387 | 0.013 |
|
|
247
|
+
| MACI | deployPoll | 1580765 | 1583829 | 1581626 | 0.1587 |
|
|
248
|
+
| MACI | signUp | 197667 | 730504 | 315320 | 0.0316 |
|
|
249
|
+
| MerkleProofCheckerFactory | deploy | - | - | 119047 | 0.0119 |
|
|
250
|
+
| MerkleProofPolicyFactory | deploy | - | - | 129387 | 0.013 |
|
|
251
|
+
| MessageProcessor | processMessages | 252019 | 252918 | 252319 | 0.0253 |
|
|
252
|
+
| Poll | joinPoll | 282314 | 503970 | 334838 | 0.0336 |
|
|
253
|
+
| Poll | mergeState | 198686 | 354005 | 255089 | 0.0256 |
|
|
254
|
+
| Poll | padLastBatch | - | - | 81884 | 0.0082 |
|
|
255
|
+
| Poll | publishMessage | - | - | 358737 | 0.0360 |
|
|
256
|
+
| Poll | publishMessageBatch | - | - | 671538 | 0.0674 |
|
|
257
|
+
| Poll | relayMessagesBatch | - | - | 155223 | 0.0156 |
|
|
258
|
+
| PollFactory | deploy | - | - | 1099100 | 0.1103 |
|
|
259
|
+
| SemaphoreCheckerFactory | deploy | - | - | 106047 | 0.0106 |
|
|
260
|
+
| SemaphorePolicyFactory | deploy | - | - | 129387 | 0.013 |
|
|
261
|
+
| Tally | addTallyResults | 7311562 | 7844012 | 7577787 | 0.7604 |
|
|
262
|
+
| Tally | tallyVotes | 147262 | 204522 | 161584 | 0.0162 |
|
|
263
|
+
| TokenCheckerFactory | deploy | - | - | 97197 | 0.0098 |
|
|
264
|
+
| TokenPolicyFactory | deploy | - | - | 129387 | 0.013 |
|
|
265
|
+
| VerifyingKeysRegistry | setPollJoinedVerifyingKey | - | - | 453033 | 0.0455 |
|
|
266
|
+
| VerifyingKeysRegistry | setPollJoiningVerifyingKey | - | - | 453011 | 0.0455 |
|
|
267
|
+
| VerifyingKeysRegistry | setVerifyingKeys | 885514 | 885526 | 885517 | 0.0889 |
|
|
268
|
+
| VerifyingKeysRegistry | setVerifyingKeysBatch | - | - | 1787720 | 0.1794 |
|
|
269
|
+
| ZupassCheckerFactory | deploy | - | - | 206318 | 0.0207 |
|
|
270
|
+
| ZupassPolicyFactory | deploy | - | - | 129365 | 0.013 |
|
|
271
|
+
|
|
272
|
+
</details>
|
|
273
|
+
|
|
274
|
+
<details>
|
|
275
|
+
<summary>Deployment cost</summary>
|
|
276
|
+
|
|
277
|
+
| Deployments | Min Gas | Max Gas | Avg Gas | % of Block Limit | USD (avg) |
|
|
278
|
+
| ---------------------------------------- | ------- | ------- | ------- | ---------------- | --------- |
|
|
279
|
+
| AnonAadhaarCheckerFactory | - | - | 567621 | 1.9 % | 0.057 |
|
|
280
|
+
| AnonAadhaarPolicyFactory | - | - | 759390 | 2.5 % | 0.0762 |
|
|
281
|
+
| ConstantInitialVoiceCreditProxyFactory | - | - | 379812 | 1.3 % | 0.0381 |
|
|
282
|
+
| EASCheckerFactory | - | - | 623304 | 2.1 % | 0.0625 |
|
|
283
|
+
| EASPolicyFactory | - | - | 690560 | 2.3 % | 0.0693 |
|
|
284
|
+
| ERC20CheckerFactory | - | - | 446429 | 1.5 % | 0.0448 |
|
|
285
|
+
| ERC20PolicyFactory | - | - | 684892 | 2.3 % | 0.0687 |
|
|
286
|
+
| ERC20VotesCheckerFactory | - | - | 464123 | 1.5 % | 0.0466 |
|
|
287
|
+
| ERC20VotesInitialVoiceCreditProxyFactory | - | - | 482127 | 1.6 % | 0.0484 |
|
|
288
|
+
| ERC20VotesPolicyFactory | - | - | 685960 | 2.3 % | 0.0688 |
|
|
289
|
+
| FreeForAllCheckerFactory | - | - | 329927 | 1.1 % | 0.0331 |
|
|
290
|
+
| FreeForAllPolicyFactory | - | - | 653501 | 2.2 % | 0.0656 |
|
|
291
|
+
| GitcoinPassportCheckerFactory | - | - | 463912 | 1.5 % | 0.0466 |
|
|
292
|
+
| GitcoinPassportPolicyFactory | - | - | 687052 | 2.3 % | 0.0689 |
|
|
293
|
+
| Hasher | - | - | 426472 | 1.4 % | 0.0428 |
|
|
294
|
+
| HatsCheckerFactory | - | - | 572538 | 1.9 % | 0.0575 |
|
|
295
|
+
| HatsPolicyFactory | - | - | 684664 | 2.3 % | 0.0687 |
|
|
296
|
+
| MACI | 1803354 | 1803438 | 1803408 | 6.0 % | 0.181 |
|
|
297
|
+
| MerkleProofCheckerFactory | - | - | 491985 | 1.6 % | 0.0494 |
|
|
298
|
+
| MerkleProofPolicyFactory | - | - | 686188 | 2.3 % | 0.0689 |
|
|
299
|
+
| MessageProcessorFactory | 1818377 | 1818401 | 1818398 | 6.1 % | 0.1825 |
|
|
300
|
+
| PollFactory | 3720635 | 3720683 | 3720678 | 12.4 % | 0.3734 |
|
|
301
|
+
| PoseidonT3 | - | - | 2157126 | 7.2 % | 0.2165 |
|
|
302
|
+
| PoseidonT4 | - | - | 2745274 | 9.2 % | 0.2755 |
|
|
303
|
+
| PoseidonT5 | - | - | 3569887 | 11.9 % | 0.3582 |
|
|
304
|
+
| PoseidonT6 | - | - | 4261625 | 14.2 % | 0.4277 |
|
|
305
|
+
| SemaphoreCheckerFactory | - | - | 557606 | 1.9 % | 0.0560 |
|
|
306
|
+
| SemaphorePolicyFactory | - | - | 749517 | 2.5 % | 0.0752 |
|
|
307
|
+
| TallyFactory | 2176647 | 2176671 | 2176668 | 7.3 % | 0.2184 |
|
|
308
|
+
| TokenCheckerFactory | - | - | 435769 | 1.5 % | 0.0437 |
|
|
309
|
+
| TokenPolicyFactory | - | - | 690920 | 2.3 % | 0.0693 |
|
|
310
|
+
| Utilities | - | - | 664356 | 2.2 % | 0.0667 |
|
|
311
|
+
| Verifier | - | - | 775226 | 2.6 % | 0.0778 |
|
|
312
|
+
| VerifyingKeysRegistry | - | - | 1755862 | 5.9 % | 0.1762 |
|
|
313
|
+
| ZupassCheckerFactory | - | - | 640425 | 2.1 % | 0.0643 |
|
|
314
|
+
| ZupassGroth16Verifier | - | - | 1108706 | 3.7 % | 0.1113 |
|
|
315
|
+
| ZupassPolicyFactory | - | - | 785744 | 2.6 % | 0.0788 |
|
|
316
|
+
|
|
317
|
+
</details>
|
|
318
|
+
|
|
319
|
+
## Costs on ZkSync Era
|
|
320
|
+
|
|
321
|
+
Below are the estimated costs for various MACI operations and deployments, assuming:
|
|
322
|
+
|
|
323
|
+
- **Gas price**: 0.04 gwei
|
|
324
|
+
- **ETH price**: $2508
|
|
325
|
+
|
|
326
|
+
<details>
|
|
327
|
+
<summary>Contract calls cost</summary>
|
|
328
|
+
|
|
329
|
+
| Contract | Method | Min | Max | Avg | USD (avg) |
|
|
330
|
+
| ---------------------------------------- | -------------------------- | ------- | ------- | ------- | --------- |
|
|
331
|
+
| AnonAadhaarCheckerFactory | deploy | - | - | 125971 | 0.0126 |
|
|
332
|
+
| AnonAadhaarPolicy | enforce | - | - | 38141 | 0.0038 |
|
|
333
|
+
| AnonAadhaarPolicy | setTarget | 50133 | 50167 | 50149 | 0.005 |
|
|
334
|
+
| AnonAadhaarPolicyFactory | deploy | - | - | 129387 | 0.013 |
|
|
335
|
+
| ConstantInitialVoiceCreditProxyFactory | deploy | - | - | 118665 | 0.0119 |
|
|
336
|
+
| EASCheckerFactory | deploy | - | - | 155556 | 0.0156 |
|
|
337
|
+
| EASPolicyFactory | deploy | - | - | 129387 | 0.013 |
|
|
338
|
+
| ERC20CheckerFactory | deploy | - | - | 125959 | 0.0126 |
|
|
339
|
+
| ERC20PolicyFactory | deploy | - | - | 129365 | 0.013 |
|
|
340
|
+
| ERC20VotesCheckerFactory | deploy | - | - | 154673 | 0.0155 |
|
|
341
|
+
| ERC20VotesInitialVoiceCreditProxyFactory | deploy | - | - | 176590 | 0.0177 |
|
|
342
|
+
| ERC20VotesPolicyFactory | deploy | - | - | 129365 | 0.013 |
|
|
343
|
+
| FreeForAllCheckerFactory | deploy | - | - | 89376 | 0.009 |
|
|
344
|
+
| FreeForAllPolicyFactory | deploy | 129375 | 129387 | 129386 | 0.013 |
|
|
345
|
+
| GitcoinPassportCheckerFactory | deploy | - | - | 125937 | 0.0126 |
|
|
346
|
+
| GitcoinPassportPolicyFactory | deploy | - | - | 129365 | 0.013 |
|
|
347
|
+
| HatsCheckerFactory | deploy | - | - | 169023 | 0.017 |
|
|
348
|
+
| HatsPolicyFactory | deploy | - | - | 129387 | 0.013 |
|
|
349
|
+
| MACI | deployPoll | 1580765 | 1583829 | 1581626 | 0.1587 |
|
|
350
|
+
| MACI | signUp | 197667 | 730504 | 315320 | 0.0316 |
|
|
351
|
+
| MerkleProofCheckerFactory | deploy | - | - | 119047 | 0.0119 |
|
|
352
|
+
| MerkleProofPolicyFactory | deploy | - | - | 129387 | 0.013 |
|
|
353
|
+
| MessageProcessor | processMessages | 252019 | 252918 | 252319 | 0.0253 |
|
|
354
|
+
| Poll | joinPoll | 282314 | 503970 | 334838 | 0.0336 |
|
|
355
|
+
| Poll | mergeState | 198686 | 354005 | 255089 | 0.0256 |
|
|
356
|
+
| Poll | padLastBatch | - | - | 81884 | 0.0082 |
|
|
357
|
+
| Poll | publishMessage | - | - | 358737 | 0.0360 |
|
|
358
|
+
| Poll | publishMessageBatch | - | - | 671538 | 0.0674 |
|
|
359
|
+
| Poll | relayMessagesBatch | - | - | 155223 | 0.0156 |
|
|
360
|
+
| PollFactory | deploy | - | - | 1099100 | 0.1103 |
|
|
361
|
+
| SemaphoreCheckerFactory | deploy | - | - | 106047 | 0.0106 |
|
|
362
|
+
| SemaphorePolicyFactory | deploy | - | - | 129387 | 0.013 |
|
|
363
|
+
| Tally | addTallyResults | 7311562 | 7844012 | 7577787 | 0.7604 |
|
|
364
|
+
| Tally | tallyVotes | 147262 | 204522 | 161584 | 0.0162 |
|
|
365
|
+
| TokenCheckerFactory | deploy | - | - | 97197 | 0.0098 |
|
|
366
|
+
| TokenPolicyFactory | deploy | - | - | 129387 | 0.013 |
|
|
367
|
+
| VerifyingKeysRegistry | setPollJoinedVerifyingKey | - | - | 453033 | 0.0455 |
|
|
368
|
+
| VerifyingKeysRegistry | setPollJoiningVerifyingKey | - | - | 453011 | 0.0455 |
|
|
369
|
+
| VerifyingKeysRegistry | setVerifyingKeys | 885514 | 885526 | 885517 | 0.0889 |
|
|
370
|
+
| VerifyingKeysRegistry | setVerifyingKeysBatch | - | - | 1787720 | 0.1794 |
|
|
371
|
+
| ZupassCheckerFactory | deploy | - | - | 206318 | 0.0207 |
|
|
372
|
+
| ZupassPolicyFactory | deploy | - | - | 129365 | 0.013 |
|
|
373
|
+
|
|
374
|
+
</details>
|
|
375
|
+
|
|
376
|
+
<details>
|
|
377
|
+
<summary>Deployment cost</summary>
|
|
378
|
+
|
|
379
|
+
| Deployments | Min Gas | Max Gas | Avg Gas | % of Block Limit | USD (avg) |
|
|
380
|
+
| ---------------------------------------- | ------- | ------- | ------- | ---------------- | --------- |
|
|
381
|
+
| AnonAadhaarCheckerFactory | - | - | 567621 | 1.9 % | 0.057 |
|
|
382
|
+
| AnonAadhaarPolicyFactory | - | - | 759390 | 2.5 % | 0.0762 |
|
|
383
|
+
| ConstantInitialVoiceCreditProxyFactory | - | - | 379812 | 1.3 % | 0.0381 |
|
|
384
|
+
| EASCheckerFactory | - | - | 623304 | 2.1 % | 0.0625 |
|
|
385
|
+
| EASPolicyFactory | - | - | 690560 | 2.3 % | 0.0693 |
|
|
386
|
+
| ERC20CheckerFactory | - | - | 446429 | 1.5 % | 0.0448 |
|
|
387
|
+
| ERC20PolicyFactory | - | - | 684892 | 2.3 % | 0.0687 |
|
|
388
|
+
| ERC20VotesCheckerFactory | - | - | 464123 | 1.5 % | 0.0466 |
|
|
389
|
+
| ERC20VotesInitialVoiceCreditProxyFactory | - | - | 482127 | 1.6 % | 0.0484 |
|
|
390
|
+
| ERC20VotesPolicyFactory | - | - | 685960 | 2.3 % | 0.0688 |
|
|
391
|
+
| FreeForAllCheckerFactory | - | - | 329927 | 1.1 % | 0.0331 |
|
|
392
|
+
| FreeForAllPolicyFactory | - | - | 653501 | 2.2 % | 0.0656 |
|
|
393
|
+
| GitcoinPassportCheckerFactory | - | - | 463912 | 1.5 % | 0.0466 |
|
|
394
|
+
| GitcoinPassportPolicyFactory | - | - | 687052 | 2.3 % | 0.0689 |
|
|
395
|
+
| Hasher | - | - | 426472 | 1.4 % | 0.0428 |
|
|
396
|
+
| HatsCheckerFactory | - | - | 572538 | 1.9 % | 0.0575 |
|
|
397
|
+
| HatsPolicyFactory | - | - | 684664 | 2.3 % | 0.0687 |
|
|
398
|
+
| MACI | 1803354 | 1803438 | 1803408 | 6.0 % | 0.181 |
|
|
399
|
+
| MerkleProofCheckerFactory | - | - | 491985 | 1.6 % | 0.0494 |
|
|
400
|
+
| MerkleProofPolicyFactory | - | - | 686188 | 2.3 % | 0.0689 |
|
|
401
|
+
| MessageProcessorFactory | 1818377 | 1818401 | 1818398 | 6.1 % | 0.1825 |
|
|
402
|
+
| PollFactory | 3720635 | 3720683 | 3720678 | 12.4 % | 0.3734 |
|
|
403
|
+
| PoseidonT3 | - | - | 2157126 | 7.2 % | 0.2165 |
|
|
404
|
+
| PoseidonT4 | - | - | 2745274 | 9.2 % | 0.2755 |
|
|
405
|
+
| PoseidonT5 | - | - | 3569887 | 11.9 % | 0.3582 |
|
|
406
|
+
| PoseidonT6 | - | - | 4261625 | 14.2 % | 0.4277 |
|
|
407
|
+
| SemaphoreCheckerFactory | - | - | 557606 | 1.9 % | 0.0560 |
|
|
408
|
+
| SemaphorePolicyFactory | - | - | 749517 | 2.5 % | 0.0752 |
|
|
409
|
+
| TallyFactory | 2176647 | 2176671 | 2176668 | 7.3 % | 0.2184 |
|
|
410
|
+
| TokenCheckerFactory | - | - | 435769 | 1.5 % | 0.0437 |
|
|
411
|
+
| TokenPolicyFactory | - | - | 690920 | 2.3 % | 0.0693 |
|
|
412
|
+
| Utilities | - | - | 664356 | 2.2 % | 0.0667 |
|
|
413
|
+
| Verifier | - | - | 775226 | 2.6 % | 0.0778 |
|
|
414
|
+
| VerifyingKeysRegistry | - | - | 1755862 | 5.9 % | 0.1762 |
|
|
415
|
+
| ZupassCheckerFactory | - | - | 640425 | 2.1 % | 0.0643 |
|
|
416
|
+
| ZupassGroth16Verifier | - | - | 1108706 | 3.7 % | 0.1113 |
|
|
417
|
+
| ZupassPolicyFactory | - | - | 785744 | 2.6 % | 0.0788 |
|
|
418
|
+
|
|
419
|
+
</details>
|
|
@@ -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
|
-
- [
|
|
11
|
-
- [PoseidonHashers](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/crypto/Hasher.sol)
|
|
12
|
-
- [PollFactory](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/PollFactory.sol)
|
|
13
|
-
- [MessageProcessorFactory](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/MessageProcessorFactory.sol)
|
|
14
|
-
- [TallyFactory](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/TallyFactory.sol)
|
|
15
|
-
- [Verifier](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/crypto/Verifier.sol)
|
|
10
|
+
- [VerifyingKeysRegistry](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/VerifyingKeysRegistry.sol)
|
|
11
|
+
- [PoseidonHashers](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/crypto/Hasher.sol)
|
|
12
|
+
- [PollFactory](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/PollFactory.sol)
|
|
13
|
+
- [MessageProcessorFactory](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/MessageProcessorFactory.sol)
|
|
14
|
+
- [TallyFactory](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/TallyFactory.sol)
|
|
15
|
+
- [Verifier](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/crypto/Verifier.sol)
|
|
16
16
|
- [FreeForAllPolicy](https://github.com/privacy-scaling-explorations/excubiae/tree/main/packages/contracts/contracts/extensions/freeForAll)
|
|
17
|
-
- [ConstantInitialVoiceCreditProxy](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.sol) - if you are happy to work with a fixed amount of credits
|
|
17
|
+
- [ConstantInitialVoiceCreditProxy](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.sol) - if you are happy to work with a fixed amount of credits
|
|
18
18
|
|
|
19
19
|
VkRegistries can be re-used by different protocols to share the same set of verifying keys. Please be advised that you should be verifying that those verifying keys are the ones that have undergone a trusted setup ceremony.
|
|
20
20
|
|
|
@@ -25,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/
|
|
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
|
|
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
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"label": "Coordinator Service",
|
|
3
|
+
"position": 1,
|
|
4
|
+
"link": {
|
|
5
|
+
"type": "generated-index",
|
|
6
|
+
"description": "The Coordinator Service is a backend service that aims to automate MACI-related operations, such as contracts deployment, proof generation and poll finalisation."
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Introduction
|
|
3
|
+
description: The Coordinator Service is a service that allows to automate MACI coordinator tasks.
|
|
4
|
+
sidebar_label: Introduction
|
|
5
|
+
sidebar_position: 1
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Coordinator Service
|
|
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.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Installation and setup
|
|
3
|
+
description: Learn how to install and setup the Coordinator Service.
|
|
4
|
+
sidebar_label: Installation
|
|
5
|
+
sidebar_position: 2
|
|
6
|
+
---
|
|
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:
|
|
24
|
+
|
|
25
|
+
```
|
|
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
|
+
|
|
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
|
+
```
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Introduction
|
|
3
|
+
description: The Offchain Relayer is a service that allows users to vote on MACI polls free of charge.
|
|
4
|
+
sidebar_label: Introduction
|
|
5
|
+
sidebar_position: 1
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Coordinator Service
|
|
9
|
+
|
|
10
|
+
Welcome to the Offchain Relayer technical reference. Here you will find the technical details of the Offchain Relayer: how to set it up and and how to use it.
|
|
11
|
+
|
|
12
|
+
## Flow Diagram
|
|
13
|
+
|
|
14
|
+
Below is a high-level diagram illustrating the flow of the Relayer Service:
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
## High-Level Overview of the Relayer:
|
|
19
|
+
|
|
20
|
+
### Functionality
|
|
21
|
+
|
|
22
|
+
The Relayer serves as an intermediary between users and the MACI system. It performs the following tasks:
|
|
23
|
+
|
|
24
|
+
- Allows users to send messages without having to pay gas fees by processing these messages off-chain.
|
|
25
|
+
- Receives user messages.
|
|
26
|
+
- Prepare messages batches and upload it to IPFS
|
|
27
|
+
- Submits the message hashes to the Poll contract with IPFS hash of the batch.
|
|
28
|
+
|
|
29
|
+
This process ensures that user actions are recorded on-chain without compromising their privacy.
|
|
30
|
+
|
|
31
|
+
### Privacy Preservation
|
|
32
|
+
|
|
33
|
+
By verifying the zero-knowledge proofs, the Relayer ensures that only authorized users can send messages.
|
|
34
|
+
Users must know the pre-image to a state leaf in the poll state tree.
|
|
35
|
+
|
|
36
|
+
### Decentralization and Trust
|
|
37
|
+
|
|
38
|
+
It's recommended that the coordinator only runs this service for now. That is because if the service malfunctions and batch hashes are pushed on chain without the messages actually being stored on ipfs, then polls can't be finalized.
|
|
39
|
+
|
|
40
|
+
### Integration with MACI Components
|
|
41
|
+
|
|
42
|
+
The Relayer interacts with other components of the MACI system, such as the **Coordinator** and the on-chain smart contracts:
|
|
43
|
+
|
|
44
|
+
- The **Coordinator** fetches all the messages stored in IPFS and uses them as regular on-chain messages.
|
|
45
|
+
- This ensures that user messages are properly processed and recorded, contributing to the overall functionality and security of the voting protocol.
|
|
46
|
+
|
|
47
|
+
### Additional Information
|
|
48
|
+
|
|
49
|
+
For more details, you can read the following post on EthResearch:
|
|
50
|
+
|
|
51
|
+
[MACI with Mostly Off-Chain Happy Path](https://ethresear.ch/t/maci-with-mostly-off-chain-happy-path/19527)
|