@maci-protocol/website 0.0.0-ci.ef4f2d5 → 0.0.0-ci.f03b827
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/blog/2024-02-28-maci-v1.2.0.md +1 -1
- package/blog/2025-03-21-roadmap-2025.md +1 -1
- package/docusaurus.config.ts +7 -1
- package/package.json +13 -12
- package/versioned_docs/version-v0.x/introduction.md +0 -4
- package/versioned_docs/version-v1.2/circuits.md +8 -8
- package/versioned_docs/version-v1.2/contributing/contributing.md +4 -4
- package/versioned_docs/version-v1.2/deployment.md +1 -1
- package/versioned_docs/version-v1.2/integrating.md +1 -1
- package/versioned_docs/version-v1.2/key-change.md +1 -1
- package/versioned_docs/version-v1.2/poll-types.md +1 -1
- package/versioned_docs/version-v1.2/testing-in-detail.md +3 -3
- package/versioned_docs/version-v1.2/testing.md +1 -1
- package/versioned_docs/version-v1.2/topup.md +1 -1
- package/versioned_docs/version-v1.2/typedoc/core/index.md +2 -2
- package/versioned_docs/version-v1.2/versioning.md +3 -3
- package/versioned_docs/version-v1.2/workflow.md +1 -1
- package/versioned_docs/version-v2.x/contributing/contributing.md +4 -4
- package/versioned_docs/version-v2.x/core-concepts/key-change.md +1 -1
- package/versioned_docs/version-v2.x/core-concepts/merkle-trees.md +1 -1
- package/versioned_docs/version-v2.x/core-concepts/poll-types.md +1 -1
- package/versioned_docs/version-v2.x/core-concepts/workflow.md +1 -1
- package/versioned_docs/version-v2.x/guides/integrating.md +1 -1
- package/versioned_docs/version-v2.x/guides/testing/testing-in-detail.md +3 -3
- package/versioned_docs/version-v2.x/guides/testing/testing.md +1 -1
- package/versioned_docs/version-v2.x/processes/versioning.md +3 -3
- package/versioned_docs/version-v2.x/supported-networks/deployed-contracts.md +7 -7
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/AccQueue.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/MACI.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/MessageProcessor.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Params.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Poll.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/PollFactory.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Tally.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/VkRegistry.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/VoiceCreditProxy.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/processMessages.md +4 -4
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/tallyVotes.md +2 -2
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +3 -3
- package/versioned_docs/version-v3.x/contributing/contributing.md +4 -4
- package/versioned_docs/version-v3.x/core-concepts/key-change.md +1 -1
- package/versioned_docs/version-v3.x/core-concepts/poll-types.md +1 -1
- package/versioned_docs/version-v3.x/core-concepts/polls.md +1 -1
- package/versioned_docs/version-v3.x/core-concepts/workflow.md +1 -1
- package/versioned_docs/version-v3.x/guides/integrating.md +2 -2
- package/versioned_docs/version-v3.x/guides/sdk.md +121 -0
- package/versioned_docs/version-v3.x/guides/testing/testing-in-detail.md +3 -3
- package/versioned_docs/version-v3.x/guides/testing/testing-introduction.md +27 -1
- package/versioned_docs/version-v3.x/guides/troubleshooting.md +2 -2
- package/versioned_docs/version-v3.x/processes/versioning.md +3 -3
- package/versioned_docs/version-v3.x/security/trusted-setup.md +1 -1
- package/versioned_docs/version-v3.x/supported-networks/costs.md +306 -0
- package/versioned_docs/version-v3.x/supported-networks/deployed-contracts.md +7 -7
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/MACI.md +1 -1
- 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 +1 -1
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Policies.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Poll.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/PollFactory.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Tally.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/VkRegistry.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/VoiceCreditProxy.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/technical-references.md +8 -8
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/joinPoll.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/processMessages.md +66 -6
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/tallyVotes.md +2 -2
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +3 -3
|
@@ -417,3 +417,309 @@ Below are the estimated costs for various MACI operations and deployments, assum
|
|
|
417
417
|
| ZupassPolicyFactory | - | - | 785744 | 2.6 % | 0.0788 |
|
|
418
418
|
|
|
419
419
|
</details>
|
|
420
|
+
|
|
421
|
+
## Costs on Ethereum Mainnet
|
|
422
|
+
|
|
423
|
+
Below are the estimated costs for various MACI operations and deployments, assuming:
|
|
424
|
+
|
|
425
|
+
- **Gas price**: 7 gwei
|
|
426
|
+
- **ETH price**: $2526
|
|
427
|
+
|
|
428
|
+
<details>
|
|
429
|
+
<summary>Contract calls cost</summary>
|
|
430
|
+
|
|
431
|
+
| Contract | Method | Min | Max | Avg | USD (avg) |
|
|
432
|
+
| ---------------------------------------- | -------------------------- | ------- | ------- | ------- | --------- |
|
|
433
|
+
| AnonAadhaarCheckerFactory | deploy | - | - | 125971 | 2.23 |
|
|
434
|
+
| AnonAadhaarPolicy | enforce | - | - | 38141 | 0.67 |
|
|
435
|
+
| AnonAadhaarPolicy | setTarget | 50133 | 50167 | 50149 | 0.89 |
|
|
436
|
+
| AnonAadhaarPolicyFactory | deploy | - | - | 129387 | 2.29 |
|
|
437
|
+
| ConstantInitialVoiceCreditProxyFactory | deploy | - | - | 118665 | 2.10 |
|
|
438
|
+
| EASCheckerFactory | deploy | - | - | 155556 | 2.75 |
|
|
439
|
+
| EASPolicyFactory | deploy | - | - | 129387 | 2.29 |
|
|
440
|
+
| ERC20CheckerFactory | deploy | - | - | 125959 | 2.23 |
|
|
441
|
+
| ERC20PolicyFactory | deploy | - | - | 129365 | 2.29 |
|
|
442
|
+
| ERC20VotesCheckerFactory | deploy | - | - | 154673 | 2.74 |
|
|
443
|
+
| ERC20VotesInitialVoiceCreditProxyFactory | deploy | - | - | 176590 | 3.12 |
|
|
444
|
+
| ERC20VotesPolicyFactory | deploy | - | - | 129365 | 2.29 |
|
|
445
|
+
| FreeForAllCheckerFactory | deploy | - | - | 89376 | 1.58 |
|
|
446
|
+
| FreeForAllPolicyFactory | deploy | 129375 | 129387 | 129386 | 2.29 |
|
|
447
|
+
| GitcoinPassportCheckerFactory | deploy | - | - | 125937 | 2.23 |
|
|
448
|
+
| GitcoinPassportPolicyFactory | deploy | - | - | 129365 | 2.29 |
|
|
449
|
+
| HatsCheckerFactory | deploy | - | - | 169023 | 2.99 |
|
|
450
|
+
| HatsPolicyFactory | deploy | - | - | 129387 | 2.29 |
|
|
451
|
+
| MACI | deployPoll | 1580777 | 1583817 | 1581631 | 27.98 |
|
|
452
|
+
| MACI | signUp | 197667 | 730504 | 315320 | 5.58 |
|
|
453
|
+
| MerkleProofCheckerFactory | deploy | - | - | 119047 | 2.11 |
|
|
454
|
+
| MerkleProofPolicyFactory | deploy | - | - | 129387 | 2.29 |
|
|
455
|
+
| MessageProcessor | processMessages | 252065 | 252976 | 252375 | 4.46 |
|
|
456
|
+
| Poll | joinPoll | 282314 | 503970 | 334836 | 5.92 |
|
|
457
|
+
| Poll | mergeState | 176483 | 331802 | 232886 | 4.12 |
|
|
458
|
+
| Poll | padLastBatch | - | - | 81884 | 1.45 |
|
|
459
|
+
| Poll | publishMessage | - | - | 358677 | 6.34 |
|
|
460
|
+
| Poll | publishMessageBatch | - | - | 671442 | 11.88 |
|
|
461
|
+
| Poll | relayMessagesBatch | - | - | 155223 | 2.75 |
|
|
462
|
+
| PollFactory | deploy | - | - | 1099100 | 19.44 |
|
|
463
|
+
| SemaphoreCheckerFactory | deploy | - | - | 106047 | 1.88 |
|
|
464
|
+
| SemaphorePolicyFactory | deploy | - | - | 129387 | 2.29 |
|
|
465
|
+
| Tally | addTallyResults | 7312489 | 7844939 | 7578714 | 134.05 |
|
|
466
|
+
| Tally | tallyVotes | 147320 | 204580 | 161641 | 2.86 |
|
|
467
|
+
| TokenCheckerFactory | deploy | - | - | 97197 | 1.72 |
|
|
468
|
+
| TokenPolicyFactory | deploy | - | - | 129387 | 2.29 |
|
|
469
|
+
| VerifyingKeysRegistry | setPollJoinedVerifyingKey | - | - | 453033 | 8.01 |
|
|
470
|
+
| VerifyingKeysRegistry | setPollJoiningVerifyingKey | - | - | 453011 | 8.01 |
|
|
471
|
+
| VerifyingKeysRegistry | setVerifyingKeys | 885514 | 885526 | 885517 | 15.66 |
|
|
472
|
+
| VerifyingKeysRegistry | setVerifyingKeysBatch | - | - | 1787720 | 31.62 |
|
|
473
|
+
| ZupassCheckerFactory | deploy | - | - | 206318 | 3.65 |
|
|
474
|
+
| ZupassPolicyFactory | deploy | - | - | 129365 | 2.29 |
|
|
475
|
+
|
|
476
|
+
</details>
|
|
477
|
+
|
|
478
|
+
<details>
|
|
479
|
+
<summary>Deployment cost</summary>
|
|
480
|
+
|
|
481
|
+
| Deployments | Min Gas | Max Gas | Avg Gas | % of Block Limit | USD (avg) |
|
|
482
|
+
| ---------------------------------------- | ------- | ------- | ------- | ---------------- | --------- |
|
|
483
|
+
| AnonAadhaarCheckerFactory | - | - | 567621 | 1.9 % | 10.04 |
|
|
484
|
+
| AnonAadhaarPolicyFactory | - | - | 759390 | 2.5 % | 13.43 |
|
|
485
|
+
| ConstantInitialVoiceCreditProxyFactory | - | - | 379812 | 1.3 % | 6.72 |
|
|
486
|
+
| EASCheckerFactory | - | - | 623304 | 2.1 % | 11.02 |
|
|
487
|
+
| EASPolicyFactory | - | - | 690560 | 2.3 % | 12.21 |
|
|
488
|
+
| ERC20CheckerFactory | - | - | 446429 | 1.5 % | 7.90 |
|
|
489
|
+
| ERC20PolicyFactory | - | - | 684892 | 2.3 % | 12.11 |
|
|
490
|
+
| ERC20VotesCheckerFactory | - | - | 464123 | 1.5 % | 8.21 |
|
|
491
|
+
| ERC20VotesInitialVoiceCreditProxyFactory | - | - | 482127 | 1.6 % | 8.53 |
|
|
492
|
+
| ERC20VotesPolicyFactory | - | - | 685960 | 2.3 % | 12.13 |
|
|
493
|
+
| FreeForAllCheckerFactory | - | - | 329927 | 1.1 % | 5.84 |
|
|
494
|
+
| FreeForAllPolicyFactory | - | - | 653501 | 2.2 % | 11.56 |
|
|
495
|
+
| GitcoinPassportCheckerFactory | - | - | 463912 | 1.5 % | 8.21 |
|
|
496
|
+
| GitcoinPassportPolicyFactory | - | - | 687052 | 2.3 % | 12.15 |
|
|
497
|
+
| Hasher | - | - | 426472 | 1.4 % | 7.54 |
|
|
498
|
+
| HatsCheckerFactory | - | - | 572538 | 1.9 % | 10.13 |
|
|
499
|
+
| HatsPolicyFactory | - | - | 684664 | 2.3 % | 12.11 |
|
|
500
|
+
| MACI | 1803354 | 1803438 | 1803408 | 6 % | 31.90 |
|
|
501
|
+
| MerkleProofCheckerFactory | - | - | 491985 | 1.6 % | 8.70 |
|
|
502
|
+
| MerkleProofPolicyFactory | - | - | 686188 | 2.3 % | 12.14 |
|
|
503
|
+
| MessageProcessorFactory | 1818377 | 1818401 | 1818398 | 6.1 % | 32.16 |
|
|
504
|
+
| PollFactory | 3725815 | 3725863 | 3725858 | 12.4 % | 65.90 |
|
|
505
|
+
| PoseidonT3 | - | - | 2157126 | 7.2 % | 38.15 |
|
|
506
|
+
| PoseidonT4 | - | - | 2745274 | 9.2 % | 48.56 |
|
|
507
|
+
| PoseidonT5 | - | - | 3569887 | 11.9 % | 63.14 |
|
|
508
|
+
| PoseidonT6 | - | - | 4261625 | 14.2 % | 75.38 |
|
|
509
|
+
| SemaphoreCheckerFactory | - | - | 557606 | 1.9 % | 9.86 |
|
|
510
|
+
| SemaphorePolicyFactory | - | - | 749517 | 2.5 % | 13.26 |
|
|
511
|
+
| TallyFactory | 2207358 | 2207382 | 2207379 | 7.4 % | 39.04 |
|
|
512
|
+
| TokenCheckerFactory | - | - | 435769 | 1.5 % | 7.71 |
|
|
513
|
+
| TokenPolicyFactory | - | - | 690920 | 2.3 % | 12.22 |
|
|
514
|
+
| Utilities | - | - | 664356 | 2.2 % | 11.75 |
|
|
515
|
+
| Verifier | - | - | 775226 | 2.6 % | 13.71 |
|
|
516
|
+
| VerifyingKeysRegistry | - | - | 1755862 | 5.9 % | 31.06 |
|
|
517
|
+
| ZupassCheckerFactory | - | - | 640425 | 2.1 % | 11.33 |
|
|
518
|
+
| ZupassGroth16Verifier | - | - | 1108706 | 3.7 % | 19.61 |
|
|
519
|
+
| ZupassPolicyFactory | - | - | 785744 | 2.6 % | 13.90 |
|
|
520
|
+
|
|
521
|
+
</details>
|
|
522
|
+
|
|
523
|
+
## Costs on Arbitrum
|
|
524
|
+
|
|
525
|
+
Below are the estimated costs for various MACI operations and deployments, assuming:
|
|
526
|
+
|
|
527
|
+
- **Gas price**: 0.012 gwei
|
|
528
|
+
- **ETH price**: $2595
|
|
529
|
+
|
|
530
|
+
<details>
|
|
531
|
+
<summary>Contract calls cost</summary>
|
|
532
|
+
|
|
533
|
+
| Contract | Method | Min | Max | Avg | USD (avg) |
|
|
534
|
+
| ---------------------------------------- | -------------------------- | ------- | ------- | ------- | --------- |
|
|
535
|
+
| AnonAadhaarCheckerFactory | deploy | - | - | 125971 | 0.00402 |
|
|
536
|
+
| AnonAadhaarPolicy | enforce | - | - | 38141 | 0.00122 |
|
|
537
|
+
| AnonAadhaarPolicy | setTarget | 50133 | 50167 | 50149 | 0.0016 |
|
|
538
|
+
| AnonAadhaarPolicyFactory | deploy | - | - | 129387 | 0.00413 |
|
|
539
|
+
| ConstantInitialVoiceCreditProxyFactory | deploy | - | - | 118665 | 0.00379 |
|
|
540
|
+
| EASCheckerFactory | deploy | - | - | 155556 | 0.00497 |
|
|
541
|
+
| EASPolicyFactory | deploy | - | - | 129387 | 0.00413 |
|
|
542
|
+
| ERC20CheckerFactory | deploy | - | - | 125959 | 0.00402 |
|
|
543
|
+
| ERC20PolicyFactory | deploy | - | - | 129365 | 0.00413 |
|
|
544
|
+
| ERC20VotesCheckerFactory | deploy | - | - | 154673 | 0.00494 |
|
|
545
|
+
| ERC20VotesInitialVoiceCreditProxyFactory | deploy | - | - | 176590 | 0.00564 |
|
|
546
|
+
| ERC20VotesPolicyFactory | deploy | - | - | 129365 | 0.00413 |
|
|
547
|
+
| FreeForAllCheckerFactory | deploy | - | - | 89376 | 0.00286 |
|
|
548
|
+
| FreeForAllPolicyFactory | deploy | 129375 | 129387 | 129386 | 0.00413 |
|
|
549
|
+
| GitcoinPassportCheckerFactory | deploy | - | - | 125937 | 0.00402 |
|
|
550
|
+
| GitcoinPassportPolicyFactory | deploy | - | - | 129365 | 0.00413 |
|
|
551
|
+
| HatsCheckerFactory | deploy | - | - | 169023 | 0.0054 |
|
|
552
|
+
| HatsPolicyFactory | deploy | - | - | 129387 | 0.00413 |
|
|
553
|
+
| MACI | deployPoll | 1580765 | 1583829 | 1581626 | 0.05052 |
|
|
554
|
+
| MACI | signUp | 197667 | 730480 | 315320 | 0.01007 |
|
|
555
|
+
| MerkleProofCheckerFactory | deploy | - | - | 119047 | 0.0038 |
|
|
556
|
+
| MerkleProofPolicyFactory | deploy | - | - | 129387 | 0.00413 |
|
|
557
|
+
| MessageProcessor | processMessages | 252019 | 252918 | 252319 | 0.00806 |
|
|
558
|
+
| Poll | joinPoll | 282314 | 503970 | 334837 | 0.0107 |
|
|
559
|
+
| Poll | mergeState | 198686 | 354005 | 255089 | 0.00815 |
|
|
560
|
+
| Poll | padLastBatch | - | - | 81884 | 0.00262 |
|
|
561
|
+
| Poll | publishMessage | - | - | 358725 | 0.01146 |
|
|
562
|
+
| Poll | publishMessageBatch | - | - | 671490 | 0.02145 |
|
|
563
|
+
| Poll | relayMessagesBatch | - | - | 155235 | 0.00496 |
|
|
564
|
+
| PollFactory | deploy | - | - | 1099100 | 0.03511 |
|
|
565
|
+
| SemaphoreCheckerFactory | deploy | - | - | 106047 | 0.00339 |
|
|
566
|
+
| SemaphorePolicyFactory | deploy | - | - | 129387 | 0.00413 |
|
|
567
|
+
| Tally | addTallyResults | 7311562 | 7844012 | 7577787 | 0.24207 |
|
|
568
|
+
| Tally | tallyVotes | 147262 | 204522 | 161585 | 0.00516 |
|
|
569
|
+
| TokenCheckerFactory | deploy | - | - | 97197 | 0.0031 |
|
|
570
|
+
| TokenPolicyFactory | deploy | - | - | 129387 | 0.00413 |
|
|
571
|
+
| VerifyingKeysRegistry | setPollJoinedVerifyingKey | - | - | 453033 | 0.01447 |
|
|
572
|
+
| VerifyingKeysRegistry | setPollJoiningVerifyingKey | - | - | 453011 | 0.01447 |
|
|
573
|
+
| VerifyingKeysRegistry | setVerifyingKeys | 885514 | 885526 | 885517 | 0.02829 |
|
|
574
|
+
| VerifyingKeysRegistry | setVerifyingKeysBatch | - | - | 1787720 | 0.05711 |
|
|
575
|
+
| ZupassCheckerFactory | deploy | - | - | 206318 | 0.00659 |
|
|
576
|
+
| ZupassPolicyFactory | deploy | - | - | 129365 | 0.00413 |
|
|
577
|
+
|
|
578
|
+
</details>
|
|
579
|
+
|
|
580
|
+
<details>
|
|
581
|
+
<summary>Deployment cost</summary>
|
|
582
|
+
|
|
583
|
+
| Deployments | Min Gas | Max Gas | Avg Gas | % of Limit | USD (avg) |
|
|
584
|
+
| ---------------------------------------- | ------- | ------- | ------- | ---------- | --------- |
|
|
585
|
+
| AnonAadhaarCheckerFactory | - | - | 567621 | 1.9% | 0.01813 |
|
|
586
|
+
| AnonAadhaarPolicyFactory | - | - | 759390 | 2.5% | 0.02426 |
|
|
587
|
+
| ConstantInitialVoiceCreditProxyFactory | - | - | 379812 | 1.3% | 0.01213 |
|
|
588
|
+
| EASCheckerFactory | - | - | 623304 | 2.1% | 0.01991 |
|
|
589
|
+
| EASPolicyFactory | - | - | 690560 | 2.3% | 0.02206 |
|
|
590
|
+
| ERC20CheckerFactory | - | - | 446429 | 1.5% | 0.01426 |
|
|
591
|
+
| ERC20PolicyFactory | - | - | 684892 | 2.3% | 0.02188 |
|
|
592
|
+
| ERC20VotesCheckerFactory | - | - | 464123 | 1.5% | 0.01483 |
|
|
593
|
+
| ERC20VotesInitialVoiceCreditProxyFactory | - | - | 482127 | 1.6% | 0.01540 |
|
|
594
|
+
| ERC20VotesPolicyFactory | - | - | 685960 | 2.3% | 0.02191 |
|
|
595
|
+
| FreeForAllCheckerFactory | - | - | 329927 | 1.1% | 0.01054 |
|
|
596
|
+
| FreeForAllPolicyFactory | - | - | 653501 | 2.2% | 0.02088 |
|
|
597
|
+
| GitcoinPassportCheckerFactory | - | - | 463912 | 1.5% | 0.01482 |
|
|
598
|
+
| GitcoinPassportPolicyFactory | - | - | 687052 | 2.3% | 0.02195 |
|
|
599
|
+
| Hasher | - | - | 426472 | 1.4% | 0.01362 |
|
|
600
|
+
| HatsCheckerFactory | - | - | 572538 | 1.9% | 0.01829 |
|
|
601
|
+
| HatsPolicyFactory | - | - | 684664 | 2.3% | 0.02187 |
|
|
602
|
+
| MACI | 1803354 | 1803438 | 1803408 | 6.0% | 0.05761 |
|
|
603
|
+
| MerkleProofCheckerFactory | - | - | 491985 | 1.6% | 0.01572 |
|
|
604
|
+
| MerkleProofPolicyFactory | - | - | 686188 | 2.3% | 0.02192 |
|
|
605
|
+
| MessageProcessorFactory | 1818377 | 1818401 | 1818398 | 6.1% | 0.05809 |
|
|
606
|
+
| PollFactory | 3720635 | 3720683 | 3720678 | 12.4% | 0.11885 |
|
|
607
|
+
| PoseidonT3 | - | - | 2157126 | 7.2% | 0.06891 |
|
|
608
|
+
| PoseidonT4 | - | - | 2745274 | 9.2% | 0.0877 |
|
|
609
|
+
| PoseidonT5 | - | - | 3569887 | 11.9% | 0.11404 |
|
|
610
|
+
| PoseidonT6 | - | - | 4261625 | 14.2% | 0.13613 |
|
|
611
|
+
| SemaphoreCheckerFactory | - | - | 557606 | 1.9% | 0.01781 |
|
|
612
|
+
| SemaphorePolicyFactory | - | - | 749517 | 2.5% | 0.02394 |
|
|
613
|
+
| TallyFactory | 2176647 | 2176671 | 2176668 | 7.3% | 0.06953 |
|
|
614
|
+
| TokenCheckerFactory | - | - | 435769 | 1.5% | 0.01392 |
|
|
615
|
+
| TokenPolicyFactory | - | - | 690920 | 2.3% | 0.02207 |
|
|
616
|
+
| Utilities | - | - | 664356 | 2.2% | 0.02122 |
|
|
617
|
+
| Verifier | - | - | 775226 | 2.6% | 0.02476 |
|
|
618
|
+
| VerifyingKeysRegistry | - | - | 1755862 | 5.9% | 0.05609 |
|
|
619
|
+
| ZupassCheckerFactory | - | - | 640425 | 2.1% | 0.02046 |
|
|
620
|
+
| ZupassGroth16Verifier | - | - | 1108706 | 3.7% | 0.03542 |
|
|
621
|
+
| ZupassPolicyFactory | - | - | 785744 | 2.6% | 0.0251 |
|
|
622
|
+
|
|
623
|
+
</details>
|
|
624
|
+
|
|
625
|
+
## Costs on Optimism
|
|
626
|
+
|
|
627
|
+
Below are the estimated costs for various MACI operations and deployments, assuming:
|
|
628
|
+
|
|
629
|
+
- **Gas price**: 0.016 gwei
|
|
630
|
+
- **ETH price**: $2493
|
|
631
|
+
|
|
632
|
+
<details>
|
|
633
|
+
<summary>Contract calls cost</summary>
|
|
634
|
+
|
|
635
|
+
| Contract | Method | Min | Max | Avg | USD (avg) |
|
|
636
|
+
| ---------------------------------------- | -------------------------- | ------- | ------- | ------- | --------- |
|
|
637
|
+
| AnonAadhaarCheckerFactory | deploy | - | - | 125971 | 0.00496 |
|
|
638
|
+
| AnonAadhaarPolicy | enforce | - | - | 38141 | 0.0016 |
|
|
639
|
+
| AnonAadhaarPolicy | setTarget | 50133 | 50167 | 50149 | 0.00208 |
|
|
640
|
+
| AnonAadhaarPolicyFactory | deploy | - | - | 129387 | 0.00512 |
|
|
641
|
+
| ConstantInitialVoiceCreditProxyFactory | deploy | - | - | 118665 | 0.0048 |
|
|
642
|
+
| EASCheckerFactory | deploy | - | - | 155556 | 0.00624 |
|
|
643
|
+
| EASPolicyFactory | deploy | - | - | 129387 | 0.00512 |
|
|
644
|
+
| ERC20CheckerFactory | deploy | - | - | 125959 | 0.00496 |
|
|
645
|
+
| ERC20PolicyFactory | deploy | - | - | 129365 | 0.00512 |
|
|
646
|
+
| ERC20VotesCheckerFactory | deploy | - | - | 154673 | 0.00624 |
|
|
647
|
+
| ERC20VotesInitialVoiceCreditProxyFactory | deploy | - | - | 176590 | 0.00704 |
|
|
648
|
+
| ERC20VotesPolicyFactory | deploy | - | - | 129365 | 0.00512 |
|
|
649
|
+
| FreeForAllCheckerFactory | deploy | - | - | 89376 | 0.00352 |
|
|
650
|
+
| FreeForAllPolicyFactory | deploy | 129375 | 129387 | 129386 | 0.00512 |
|
|
651
|
+
| GitcoinPassportCheckerFactory | deploy | - | - | 125937 | 0.00496 |
|
|
652
|
+
| GitcoinPassportPolicyFactory | deploy | - | - | 129365 | 0.00512 |
|
|
653
|
+
| HatsCheckerFactory | deploy | - | - | 169023 | 0.00672 |
|
|
654
|
+
| HatsPolicyFactory | deploy | - | - | 129387 | 0.00512 |
|
|
655
|
+
| MACI | deployPoll | 1580765 | 1583829 | 1581630 | 0.06304 |
|
|
656
|
+
| MACI | signUp | 197667 | 730492 | 315320 | 0.01264 |
|
|
657
|
+
| MerkleProofCheckerFactory | deploy | - | - | 119047 | 0.0048 |
|
|
658
|
+
| MerkleProofPolicyFactory | deploy | - | - | 129387 | 0.00512 |
|
|
659
|
+
| MessageProcessor | processMessages | 252007 | 252918 | 252317 | 0.01008 |
|
|
660
|
+
| Poll | joinPoll | 282314 | 503970 | 334835 | 0.01328 |
|
|
661
|
+
| Poll | mergeState | 198686 | 354005 | 255089 | 0.01024 |
|
|
662
|
+
| Poll | padLastBatch | - | - | 81884 | 0.0032 |
|
|
663
|
+
| Poll | publishMessage | - | - | 358725 | 0.01424 |
|
|
664
|
+
| Poll | publishMessageBatch | - | - | 671502 | 0.02672 |
|
|
665
|
+
| Poll | relayMessagesBatch | - | - | 155235 | 0.00624 |
|
|
666
|
+
| PollFactory | deploy | - | - | 1099088 | 0.04384 |
|
|
667
|
+
| SemaphoreCheckerFactory | deploy | - | - | 106047 | 0.00416 |
|
|
668
|
+
| SemaphorePolicyFactory | deploy | - | - | 129387 | 0.00512 |
|
|
669
|
+
| Tally | addTallyResults | 7311562 | 7844012 | 7577787 | 0.30224 |
|
|
670
|
+
| Tally | tallyVotes | 147262 | 204522 | 161585 | 0.0064 |
|
|
671
|
+
| TokenCheckerFactory | deploy | - | - | 97197 | 0.00384 |
|
|
672
|
+
| TokenPolicyFactory | deploy | - | - | 129387 | 0.00512 |
|
|
673
|
+
| VerifyingKeysRegistry | setPollJoinedVerifyingKey | - | - | 453033 | 0.01808 |
|
|
674
|
+
| VerifyingKeysRegistry | setPollJoiningVerifyingKey | - | - | 453011 | 0.01808 |
|
|
675
|
+
| VerifyingKeysRegistry | setVerifyingKeys | 885514 | 885526 | 885517 | 0.03536 |
|
|
676
|
+
| VerifyingKeysRegistry | setVerifyingKeysBatch | - | - | 1787720 | 0.07136 |
|
|
677
|
+
| ZupassCheckerFactory | deploy | - | - | 206318 | 0.00816 |
|
|
678
|
+
| ZupassPolicyFactory | deploy | - | - | 129365 | 0.00512 |
|
|
679
|
+
|
|
680
|
+
</details>
|
|
681
|
+
|
|
682
|
+
<details>
|
|
683
|
+
<summary>Deployment cost</summary>
|
|
684
|
+
|
|
685
|
+
| Deployments | Min Gas | Max Gas | Avg Gas | % of Block Limit | USD (avg) |
|
|
686
|
+
| ---------------------------------------- | ------- | ------- | ------- | ---------------- | --------- |
|
|
687
|
+
| AnonAadhaarCheckerFactory | - | - | 567621 | 1.9 % | 0.02272 |
|
|
688
|
+
| AnonAadhaarPolicyFactory | - | - | 759390 | 2.5 % | 0.03024 |
|
|
689
|
+
| ConstantInitialVoiceCreditProxyFactory | - | - | 379812 | 1.3 % | 0.0152 |
|
|
690
|
+
| EASCheckerFactory | - | - | 623304 | 2.1 % | 0.0248 |
|
|
691
|
+
| EASPolicyFactory | - | - | 690560 | 2.3 % | 0.02752 |
|
|
692
|
+
| ERC20CheckerFactory | - | - | 446429 | 1.5 % | 0.01776 |
|
|
693
|
+
| ERC20PolicyFactory | - | - | 684892 | 2.3 % | 0.02736 |
|
|
694
|
+
| ERC20VotesCheckerFactory | - | - | 464123 | 1.5 % | 0.01856 |
|
|
695
|
+
| ERC20VotesInitialVoiceCreditProxyFactory | - | - | 482127 | 1.6 % | 0.0192 |
|
|
696
|
+
| ERC20VotesPolicyFactory | - | - | 685960 | 2.3 % | 0.02736 |
|
|
697
|
+
| FreeForAllCheckerFactory | - | - | 329927 | 1.1 % | 0.01312 |
|
|
698
|
+
| FreeForAllPolicyFactory | - | - | 653501 | 2.2 % | 0.02608 |
|
|
699
|
+
| GitcoinPassportCheckerFactory | - | - | 463912 | 1.5 % | 0.01856 |
|
|
700
|
+
| GitcoinPassportPolicyFactory | - | - | 687052 | 2.3 % | 0.02736 |
|
|
701
|
+
| Hasher | - | - | 426472 | 1.4 % | 0.01696 |
|
|
702
|
+
| HatsCheckerFactory | - | - | 572538 | 1.9 % | 0.02288 |
|
|
703
|
+
| HatsPolicyFactory | - | - | 684664 | 2.3 % | 0.02736 |
|
|
704
|
+
| MACI | 1803354 | 1803438 | 1803408 | 6.0 % | 0.072 |
|
|
705
|
+
| MerkleProofCheckerFactory | - | - | 491985 | 1.6 % | 0.01968 |
|
|
706
|
+
| MerkleProofPolicyFactory | - | - | 686188 | 2.3 % | 0.02736 |
|
|
707
|
+
| MessageProcessorFactory | 1818377 | 1818401 | 1818398 | 6.1 % | 0.07248 |
|
|
708
|
+
| PollFactory | 3720635 | 3720683 | 3720678 | 12.4 % | 0.14848 |
|
|
709
|
+
| PoseidonT3 | - | - | 2157126 | 7.2 % | 0.08608 |
|
|
710
|
+
| PoseidonT4 | - | - | 2745274 | 9.2 % | 0.1096 |
|
|
711
|
+
| PoseidonT5 | - | - | 3569887 | 11.9 % | 0.1424 |
|
|
712
|
+
| PoseidonT6 | - | - | 4261625 | 14.2 % | 0.17008 |
|
|
713
|
+
| SemaphoreCheckerFactory | - | - | 557606 | 1.9 % | 0.02224 |
|
|
714
|
+
| SemaphorePolicyFactory | - | - | 749517 | 2.5 % | 0.02992 |
|
|
715
|
+
| TallyFactory | 2176647 | 2176671 | 2176668 | 7.3 % | 0.08688 |
|
|
716
|
+
| TokenCheckerFactory | - | - | 435769 | 1.5 % | 0.01744 |
|
|
717
|
+
| TokenPolicyFactory | - | - | 690920 | 2.3 % | 0.02752 |
|
|
718
|
+
| Utilities | - | - | 664356 | 2.2 % | 0.02656 |
|
|
719
|
+
| Verifier | - | - | 775226 | 2.6 % | 0.03088 |
|
|
720
|
+
| VerifyingKeysRegistry | - | - | 1755862 | 5.9 % | 0.07008 |
|
|
721
|
+
| ZupassCheckerFactory | - | - | 640425 | 2.1 % | 0.0256 |
|
|
722
|
+
| ZupassGroth16Verifier | - | - | 1108706 | 3.7 % | 0.04416 |
|
|
723
|
+
| ZupassPolicyFactory | - | - | 785744 | 2.6 % | 0.03136 |
|
|
724
|
+
|
|
725
|
+
</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
|
-
- [VerifyingKeysRegistry](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
11
|
-
- [PoseidonHashers](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
12
|
-
- [PollFactory](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
13
|
-
- [MessageProcessorFactory](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
14
|
-
- [TallyFactory](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
15
|
-
- [Verifier](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
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/
|
|
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
|
|
|
@@ -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/
|
|
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.
|
package/versioned_docs/version-v3.x/technical-references/smart-contracts/MessageProcessor.md
CHANGED
|
@@ -6,7 +6,7 @@ sidebar_position: 4
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
:::info
|
|
9
|
-
Code location: [MessageProcessor.sol](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
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/
|
|
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:
|
|
@@ -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.
|
|
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/
|
|
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/
|
|
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/
|
|
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.
|
|
@@ -6,7 +6,7 @@ sidebar_position: 8
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
:::info
|
|
9
|
-
Code location: [VerifyingKeysRegistry.sol](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
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:
|
package/versioned_docs/version-v3.x/technical-references/smart-contracts/VoiceCreditProxy.md
CHANGED
|
@@ -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/
|
|
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
|
|
22
|
+
Contracts are released through the [`@maci-protocol/contracts`](https://www.npmjs.com/package/@maci-protocol/contracts) NPM package.
|
|
23
23
|
|
|
24
24
|
[Learn more about MACI contracts](/docs/technical-references/smart-contracts/)
|
|
25
25
|
|
|
@@ -29,12 +29,12 @@ The TypeScript libraries manage the business logic between the smart contracts a
|
|
|
29
29
|
|
|
30
30
|
The MACI [TypeScript](https://www.typescriptlang.org/) libraries are released through the following NPM packages:
|
|
31
31
|
|
|
32
|
-
- [`@maci-cli`](https://www.npmjs.com/package
|
|
33
|
-
- [`@maci-core`](https://www.npmjs.com/package
|
|
34
|
-
- [`@maci-crypto`](https://www.npmjs.com/package
|
|
35
|
-
- [`@maci-domainobjs`](https://www.npmjs.com/package
|
|
36
|
-
- [`@maci-integrationtests`](https://www.npmjs.com/package
|
|
37
|
-
- [`@maci-sdk`](https://www.npmjs.com/package
|
|
32
|
+
- [`@maci-protocol/cli`](https://www.npmjs.com/package/@maci-protocol/cli)
|
|
33
|
+
- [`@maci-protocol/core`](https://www.npmjs.com/package/@maci-protocol/core)
|
|
34
|
+
- [`@maci-protocol/crypto`](https://www.npmjs.com/package/@maci-protocol/crypto)
|
|
35
|
+
- [`@maci-protocol/domainobjs`](https://www.npmjs.com/package/@maci-protocol/domainobjs)
|
|
36
|
+
- [`@maci-protocol/integrationtests`](https://www.npmjs.com/package/@maci-protocol/integrationtests)
|
|
37
|
+
- [`@maci-protocol/sdk`](https://www.npmjs.com/package/@maci-protocol/sdk)
|
|
38
38
|
|
|
39
39
|
## Circuits
|
|
40
40
|
|
|
@@ -43,6 +43,6 @@ MACI has multiple circuits that ensure all off-chain computation is completed co
|
|
|
43
43
|
The circuits for these zero-knowledge proofs are written
|
|
44
44
|
in [Circom](https://iden3.io/circom).
|
|
45
45
|
|
|
46
|
-
The MACI circuits are released through the [`@maci-circuits`](https://www.npmjs.com/package
|
|
46
|
+
The MACI circuits are released through the [`@maci-protocol/circuits`](https://www.npmjs.com/package/@maci-protocol/circuits) NPM package.
|
|
47
47
|
|
|
48
48
|
[Learn more about MACI circuits](/docs/technical-references/zk-snark-circuits/)
|
|
@@ -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/
|
|
8
|
+
[**Repo link**](https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/voter)
|
|
9
9
|
|
|
10
10
|
## PollJoining
|
|
11
11
|
|
package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/processMessages.md
CHANGED
|
@@ -5,11 +5,11 @@ sidebar_label: Process Messages Circuit
|
|
|
5
5
|
sidebar_position: 3
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
[**Repo link**](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
8
|
+
[**Repo link**](https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/coordinator)
|
|
9
9
|
|
|
10
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 [`MessageProcessorQv`](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
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,14 +18,74 @@ The pre-requisites for this circuit are:
|
|
|
18
18
|
|
|
19
19
|
This circuit requires the coordinator's private key, hence a proof for this circuit can only be generated by the coordinator. The private key is needed in order to generate the ECDH shared key used to decrypt the messages.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
```mermaid
|
|
22
|
+
flowchart LR
|
|
23
|
+
parameters(["MessageProcessorQv - Parameters"])
|
|
24
|
+
parameters --> stateTreeDepth["stateTreeDepth"]
|
|
25
|
+
parameters --> batchSize["batchSize"]
|
|
26
|
+
parameters --> voteOptionTreeDepth["voteOptionTreeDepth"]
|
|
27
|
+
|
|
28
|
+
stateTreeDepth & batchSize & voteOptionTreeDepth --> publicInputs["Public inputs"]
|
|
29
|
+
|
|
30
|
+
subgraph publicInputs
|
|
31
|
+
direction LR
|
|
32
|
+
totalSignups ~~~ index
|
|
33
|
+
batchEndIndex ~~~ currentSbCommitment
|
|
34
|
+
newSbCommitment ~~~ outputBatchHash
|
|
35
|
+
actualStateTreeDepth ~~~ coordinatorPublicKeyHash
|
|
36
|
+
voteOptions
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
publicInputs --> privateInputs
|
|
40
|
+
|
|
41
|
+
subgraph privateInputs
|
|
42
|
+
direction LR
|
|
43
|
+
inputBatchHash ~~~ messages
|
|
44
|
+
coordinatorPrivateKey ~~~ encryptionPublicKeys
|
|
45
|
+
currentStateRoot ~~~ currentStateLeaves
|
|
46
|
+
currentStateLeavesPathElements ~~~ currentSbSalt
|
|
47
|
+
newSbSalt ~~~ currentBallotRoot
|
|
48
|
+
currentBallots ~~~ currentBallotsPathElements
|
|
49
|
+
currentVoteWeights ~~~ currentVoteWeightsPathElements
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
privateInputs --> step1["1 - Verify currentSbCommitment"]
|
|
53
|
+
step1 --> step1B["hash(currentStateRoot, currentBallotRoot, currentSbSalt)"]
|
|
54
|
+
|
|
55
|
+
privateInputs --> step2["2 – Check voteOptions upper-bound"]
|
|
56
|
+
step2 --> step2B["voteOptions <= 5 ** voteOptionTreeDepth"]
|
|
57
|
+
|
|
58
|
+
privateInputs --> step3["3 – Ensure totalSignups within capacity"]
|
|
59
|
+
step3 --> step3B["totalSignups <= 2 ** stateTreeDepth"]
|
|
60
|
+
|
|
61
|
+
privateInputs --> step4["4 – Hash each message + pub-key"]
|
|
62
|
+
step4 --> step4B["MessageHasher template loop"]
|
|
63
|
+
|
|
64
|
+
privateInputs --> step5["5 – Build and verify chainHash"]
|
|
65
|
+
step5 --> step5B["PoseidonHasher template loop + Mux1"]
|
|
66
|
+
|
|
67
|
+
privateInputs --> step6["6 – Derive & verify coordinator pubKey"]
|
|
68
|
+
step6 --> step6B["PrivateToPublicKey -> derivedPublicKeyHash == coordinatorPublicKeyHash"]
|
|
69
|
+
|
|
70
|
+
privateInputs --> step7["7 – Decrypt each message to a command using MessageToCommand"]
|
|
71
|
+
step7 --> step7B["MessageToCommand template loop"]
|
|
72
|
+
|
|
73
|
+
privateInputs --> step8["8 – Process messages in reverse order"]
|
|
74
|
+
step8 --> step8B["SingleMessageProcessorQv template loop"]
|
|
75
|
+
|
|
76
|
+
privateInputs --> step9["9 – Compute newSbCommitment"]
|
|
77
|
+
step9 --> step9B["hash(stateRoot, ballotRoot, newSbSalt)"]
|
|
78
|
+
|
|
79
|
+
privateInputs --> step10["10 – Verify provided newSbCommitment"]
|
|
80
|
+
step10 --> step10B["equality with computed commitment"]
|
|
81
|
+
```
|
|
22
82
|
|
|
23
83
|
:::info
|
|
24
|
-
A version working with non quadratic voting (non-qv) is also [available](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
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.
|
|
25
85
|
:::
|
|
26
86
|
|
|
27
87
|
:::info
|
|
28
|
-
A version working with full credits voting (full) is also [available](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
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.
|
|
29
89
|
:::
|
|
30
90
|
|
|
31
91
|
#### Parameters
|
|
@@ -96,7 +156,7 @@ A simplified example using a tree of arity 2:
|
|
|
96
156
|
|
|
97
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.
|
|
98
158
|
|
|
99
|
-
The implementation for this is in the `QuinBatchLeavesExists` circuit in `https://github.com/privacy-scaling-explorations/maci/blob/
|
|
159
|
+
The implementation for this is in the `QuinBatchLeavesExists` circuit in `https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/trees/incrementalQuinTree.circom`.
|
|
100
160
|
|
|
101
161
|
This method requires fewer circuit constraints than if we verified a Merkle proof for each leaf.
|
|
102
162
|
|
|
@@ -5,7 +5,7 @@ sidebar_label: Tally Votes Circuit
|
|
|
5
5
|
sidebar_position: 4
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
[**Repo link**](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
8
|
+
[**Repo link**](https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/core)
|
|
9
9
|
|
|
10
10
|
#### Parameters
|
|
11
11
|
|
|
@@ -18,7 +18,7 @@ sidebar_position: 4
|
|
|
18
18
|

|
|
19
19
|
|
|
20
20
|
:::info
|
|
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/
|
|
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
|