@maci-protocol/website 0.0.0-ci.26f28d6
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/.eslintrc.js +157 -0
- package/CHANGELOG.md +566 -0
- package/LICENSE +22 -0
- package/README.md +58 -0
- package/babel.config.js +3 -0
- package/blog/2021-10-12-maci-v1.md +100 -0
- package/blog/2022-09-22-maci-v1-technical-introduction.md +180 -0
- package/blog/2023-01-18-maci-v1.1.1.md +121 -0
- package/blog/2024-01-18-roadmap.md +106 -0
- package/blog/2024-02-28-maci-v1.2.0.md +121 -0
- package/blog/2024-04-10-roadmap-q2.md +96 -0
- package/blog/2024-05-08-ethdam.md +169 -0
- package/blog/2024-05-22-the-origins-of-maci.md +38 -0
- package/blog/2024-05-28-upcoming-grants.md +85 -0
- package/blog/2024-06-17-understanding-maci.md +63 -0
- package/blog/2024-06-21-deciphering-maci.md +48 -0
- package/blog/2024-06-28-revolusioning-public-goods-funding.md +32 -0
- package/blog/2024-07-23-q2-review.md +72 -0
- package/blog/2024-07-30-roadmap-q3.md +61 -0
- package/blog/2024-08-10-maci-v2.md +102 -0
- package/blog/2024-08-29-anonymous-poll-joining.md +47 -0
- package/blog/2024-10-29-q3-review.md +63 -0
- package/blog/2024-11-20-maci-platform.md +93 -0
- package/blog/2024-12-01-maci-getting-started.md +294 -0
- package/blog/2025-03-21-roadmap-2025.md +112 -0
- package/blog/assets/MACI_Bob_SignUp_1.png +0 -0
- package/blog/assets/MACI_Bob_SignUp_2.png +0 -0
- package/blog/assets/MACI_Complex_Message.png +0 -0
- package/blog/assets/MACI_Contracts.png +0 -0
- package/blog/assets/MACI_Sign_Up.png +0 -0
- package/blog/assets/MACI_Simple_Message.png +0 -0
- package/blog/assets/MACI_Verifier_1.png +0 -0
- package/blog/authors.yml +5 -0
- package/docusaurus.config.ts +213 -0
- package/package.json +65 -0
- package/src/components/ActionCard/index.tsx +30 -0
- package/src/components/ActionCard/styles.module.css +96 -0
- package/src/components/HomepageFeatures/index.tsx +91 -0
- package/src/components/HomepageFeatures/styles.module.css +17 -0
- package/src/components/ProjectCard/index.tsx +74 -0
- package/src/components/ProjectCard/styles.module.css +77 -0
- package/src/components/ProjectList/index.tsx +218 -0
- package/src/components/ProjectList/styles.module.css +180 -0
- package/src/content/projects.json +294 -0
- package/src/css/card.module.css +130 -0
- package/src/css/custom.css +91 -0
- package/src/icons/IconDiscord.tsx +16 -0
- package/src/icons/IconGithub.tsx +16 -0
- package/src/icons/IconWebsite.tsx +16 -0
- package/src/pages/blogs.tsx +58 -0
- package/src/pages/index.module.css +152 -0
- package/src/pages/index.tsx +66 -0
- package/src/pages/projects.tsx +44 -0
- package/src/pages/roadmap.md +150 -0
- package/src/pages/typedoc.tsx +11 -0
- package/src/plugins/blog-plugin/index.ts +86 -0
- package/src/react-app-env.d.ts +1 -0
- package/src/scripts/setupSolidityDocs.ts +67 -0
- package/src/scripts/setupTypedoc.ts +112 -0
- package/src/scripts/utils.ts +115 -0
- package/src/utils/getProjectsByFilter.ts +40 -0
- package/static/.nojekyll +0 -0
- package/static/audit_reports/20210922_Hashcloak_audit_report.pdf +0 -0
- package/static/audit_reports/202220930_Hashcloak_audit_report.pdf +0 -0
- package/static/audit_reports/20240223_PSE_Audit_audit_report.pdf +0 -0
- package/static/audit_reports/20240731_PSE_Audit_audit_report.pdf +0 -0
- package/static/fonts/DM_Sans.woff2 +0 -0
- package/static/fonts/Share_Tech_Mono.woff2 +0 -0
- package/static/img/box.png +0 -0
- package/static/img/box_dark.png +0 -0
- package/static/img/chain.png +0 -0
- package/static/img/chain_dark.png +0 -0
- package/static/img/chart.png +0 -0
- package/static/img/chart_dark.png +0 -0
- package/static/img/circuits/MACI-Circuits.excalidraw +39652 -0
- package/static/img/circuits/calculateTotal.svg +21 -0
- package/static/img/circuits/ecdh.svg +21 -0
- package/static/img/circuits/messageToCommand.svg +21 -0
- package/static/img/circuits/messageValidator.svg +21 -0
- package/static/img/circuits/poseidonHasher13.svg +21 -0
- package/static/img/circuits/privToPubkey.svg +21 -0
- package/static/img/circuits/processMessages.svg +21 -0
- package/static/img/circuits/processMessagesInputHasher.svg +21 -0
- package/static/img/circuits/processMessages_2_0.svg +21 -0
- package/static/img/circuits/processOne.svg +21 -0
- package/static/img/circuits/processTopup.svg +21 -0
- package/static/img/circuits/processingAfterPollEnds.svg +21 -0
- package/static/img/circuits/quinBatchLeavesExists.svg +21 -0
- package/static/img/circuits/quinCheckRoot.svg +21 -0
- package/static/img/circuits/quinGeneratePathIndices.svg +21 -0
- package/static/img/circuits/quinSelector.svg +21 -0
- package/static/img/circuits/resultsCommitmentVerifier.svg +21 -0
- package/static/img/circuits/splicer.svg +21 -0
- package/static/img/circuits/tallyInputHasher.svg +21 -0
- package/static/img/circuits/tallyVotes.svg +21 -0
- package/static/img/circuits/unpackElement.svg +21 -0
- package/static/img/circuits/verifySignature.svg +21 -0
- package/static/img/completingAPoll.svg +4 -0
- package/static/img/contracts.svg +16 -0
- package/static/img/coordinatorComponents.svg +21 -0
- package/static/img/favicon.ico +0 -0
- package/static/img/generateProofs.svg +4 -0
- package/static/img/hero.svg +9 -0
- package/static/img/maci-card.png +0 -0
- package/static/img/maci-rpgf-design.jpg +0 -0
- package/static/img/messageProcessingLocal.svg +21 -0
- package/static/img/offlineProcessing.svg +21 -0
- package/static/img/pse-logo-round.png +0 -0
- package/static/img/tallyCommitments.svg +4 -0
- package/static/img/voteTallyingLocal.svg +21 -0
- package/tsconfig.json +34 -0
- package/versioned_docs/version-v0.x/circuits.md +22 -0
- package/versioned_docs/version-v0.x/contract.md +186 -0
- package/versioned_docs/version-v0.x/faq.md +67 -0
- package/versioned_docs/version-v0.x/introduction.md +119 -0
- package/versioned_docs/version-v0.x/quadratic-vote-tallying-circuit.md +138 -0
- package/versioned_docs/version-v0.x/state-root-transition-circuit.md +230 -0
- package/versioned_docs/version-v1.2/audit.md +160 -0
- package/versioned_docs/version-v1.2/ci-pipeline.md +38 -0
- package/versioned_docs/version-v1.2/circuits.md +508 -0
- package/versioned_docs/version-v1.2/cli.md +689 -0
- package/versioned_docs/version-v1.2/contracts.md +445 -0
- package/versioned_docs/version-v1.2/contributing/code-of-conduct.md +91 -0
- package/versioned_docs/version-v1.2/contributing/contributing.md +129 -0
- package/versioned_docs/version-v1.2/coordinator-processing.md +46 -0
- package/versioned_docs/version-v1.2/deployment.md +122 -0
- package/versioned_docs/version-v1.2/installation.md +175 -0
- package/versioned_docs/version-v1.2/integrating.md +200 -0
- package/versioned_docs/version-v1.2/introduction.md +94 -0
- package/versioned_docs/version-v1.2/key-change.md +182 -0
- package/versioned_docs/version-v1.2/overview.md +47 -0
- package/versioned_docs/version-v1.2/poll-types.md +68 -0
- package/versioned_docs/version-v1.2/primitives.md +216 -0
- package/versioned_docs/version-v1.2/project-ideas.md +14 -0
- package/versioned_docs/version-v1.2/purpose.md +62 -0
- package/versioned_docs/version-v1.2/solidity-docs/MACI.md +345 -0
- package/versioned_docs/version-v1.2/solidity-docs/MessageProcessor.md +266 -0
- package/versioned_docs/version-v1.2/solidity-docs/MessageProcessorFactory.md +26 -0
- package/versioned_docs/version-v1.2/solidity-docs/Poll.md +381 -0
- package/versioned_docs/version-v1.2/solidity-docs/PollFactory.md +50 -0
- package/versioned_docs/version-v1.2/solidity-docs/SignUpToken.md +27 -0
- package/versioned_docs/version-v1.2/solidity-docs/Subsidy.md +218 -0
- package/versioned_docs/version-v1.2/solidity-docs/SubsidyFactory.md +27 -0
- package/versioned_docs/version-v1.2/solidity-docs/Tally.md +311 -0
- package/versioned_docs/version-v1.2/solidity-docs/TallyFactory.md +27 -0
- package/versioned_docs/version-v1.2/solidity-docs/TallyNonQv.md +296 -0
- package/versioned_docs/version-v1.2/solidity-docs/TallyNonQvFactory.md +27 -0
- package/versioned_docs/version-v1.2/solidity-docs/TopupCredit.md +61 -0
- package/versioned_docs/version-v1.2/solidity-docs/VkRegistry.md +457 -0
- package/versioned_docs/version-v1.2/solidity-docs/benchmarks/HasherBenchmarks.md +44 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/Hasher.md +125 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/IVerifier.md +11 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/MockVerifier.md +17 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/Pairing.md +85 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT3.md +9 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT4.md +9 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT5.md +9 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT6.md +9 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/SnarkCommon.md +16 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/SnarkConstants.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/Verifier.md +61 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/EASGatekeeper.md +121 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/FreeForAllSignUpGatekeeper.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/SignUpGatekeeper.md +26 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/SignUpTokenGatekeeper.md +93 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/hatsGatekeepers/HatsGatekeeperBase.md +79 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/hatsGatekeepers/HatsGatekeeperMultiple.md +48 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/hatsGatekeepers/HatsGatekeeperSingle.md +42 -0
- package/versioned_docs/version-v1.2/solidity-docs/index.md +4 -0
- package/versioned_docs/version-v1.2/solidity-docs/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/initialVoiceCreditProxy/InitialVoiceCreditProxy.md +26 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IEAS.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IHats.md +103 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IMPFactory.md +26 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IMessageProcessor.md +31 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IPoll.md +217 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IPollFactory.md +29 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/ITallyFactory.md +28 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/ITallySubsidyFactory.md +27 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IVerifier.md +25 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IVkRegistry.md +70 -0
- package/versioned_docs/version-v1.2/solidity-docs/mocks/MockHatsProtocol.md +133 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueue.md +464 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueBinary.md +60 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueBinary0.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueBinaryMaci.md +34 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinary.md +75 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinary0.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinaryBlankSl.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinaryMaci.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/EmptyBallotRoots.md +13 -0
- package/versioned_docs/version-v1.2/solidity-docs/utilities/CommonUtilities.md +25 -0
- package/versioned_docs/version-v1.2/solidity-docs/utilities/DomainObjs.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/utilities/Params.md +36 -0
- package/versioned_docs/version-v1.2/solidity-docs/utilities/Utilities.md +79 -0
- package/versioned_docs/version-v1.2/spec.md +944 -0
- package/versioned_docs/version-v1.2/testing-in-detail.md +209 -0
- package/versioned_docs/version-v1.2/testing.md +472 -0
- package/versioned_docs/version-v1.2/topup.md +43 -0
- package/versioned_docs/version-v1.2/troubleshooting.md +51 -0
- package/versioned_docs/version-v1.2/trusted-setup.md +76 -0
- package/versioned_docs/version-v1.2/typedoc/cli/.nojekyll +1 -0
- package/versioned_docs/version-v1.2/typedoc/cli/index.md +15 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/AirdropArgs.md +89 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/DeployArgs.md +154 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/DeployPollArgs.md +154 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/DeployedContracts.md +130 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/GenLocalStateArgs.md +168 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/GenProofsArgs.md +388 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/IGenKeypairArgs.md +37 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/IRegisteredUserArgs.md +63 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/MergeMessagesArgs.md +76 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/MergeSignupsArgs.md +76 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/PollContracts.md +53 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/ProveOnChainArgs.md +128 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/PublishArgs.md +154 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/SignupArgs.md +89 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/SubsidyData.md +73 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/TallyData.md +166 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/TopupArgs.md +89 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/VerifyArgs.md +128 -0
- package/versioned_docs/version-v1.2/typedoc/cli/modules.md +556 -0
- package/versioned_docs/version-v1.2/typedoc/core/.nojekyll +1 -0
- package/versioned_docs/version-v1.2/typedoc/core/classes/MaciState.md +295 -0
- package/versioned_docs/version-v1.2/typedoc/core/classes/Poll.md +1098 -0
- package/versioned_docs/version-v1.2/typedoc/core/index.md +110 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/BatchSizes.md +50 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/IJsonMaciState.md +77 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/IProcessMessagesCircuitInputs.md +242 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/ISubsidyCircuitInputs.md +198 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/ITallyCircuitInputs.md +231 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/MaxValues.md +37 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/TreeDepths.md +63 -0
- package/versioned_docs/version-v1.2/typedoc/core/modules.md +289 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/.nojekyll +1 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/classes/AccQueue.md +770 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/classes/G1Point.md +115 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/classes/G2Point.md +140 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/classes/IncrementalQuinTree.md +470 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/index.md +44 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/Keypair.md +33 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/PoseidonFuncs.md +115 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/Queue.md +33 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/Signature.md +37 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/modules.md +913 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/.nojekyll +1 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/Ballot.md +274 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/Keypair.md +181 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/Message.md +244 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/PCommand.md +409 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/PrivKey.md +206 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/PubKey.md +289 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/StateLeaf.md +340 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/TCommand.md +200 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/VerifyingKey.md +240 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/index.md +81 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/ICommand.md +104 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IG1ContractParams.md +31 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IG2ContractParams.md +31 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonBallot.md +42 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonCommand.md +32 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonKeyPair.md +31 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonPCommand.md +111 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonStateLeaf.md +42 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonTCommand.md +67 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IMessageContractParams.md +31 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IStateLeaf.md +39 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IStateLeafContractParams.md +42 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IVkContractParams.md +64 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IVkObjectParams.md +108 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/Proof.md +46 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/VoteOptionTreeLeaf.md +24 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/modules.md +110 -0
- package/versioned_docs/version-v1.2/typedoc/index.md +4 -0
- package/versioned_docs/version-v1.2/versioning.md +94 -0
- package/versioned_docs/version-v1.2/workflow.md +142 -0
- package/versioned_docs/version-v2.x/case-studies.md +35 -0
- package/versioned_docs/version-v2.x/contributing/_category_.json +4 -0
- package/versioned_docs/version-v2.x/contributing/code-of-conduct.md +92 -0
- package/versioned_docs/version-v2.x/contributing/contributing.md +149 -0
- package/versioned_docs/version-v2.x/contributing/project-ideas.md +78 -0
- package/versioned_docs/version-v2.x/core-concepts/_category_.json +4 -0
- package/versioned_docs/version-v2.x/core-concepts/ballot.md +19 -0
- package/versioned_docs/version-v2.x/core-concepts/coordinator-processing.md +46 -0
- package/versioned_docs/version-v2.x/core-concepts/hashing-and-encryption.md +45 -0
- package/versioned_docs/version-v2.x/core-concepts/key-change.md +179 -0
- package/versioned_docs/version-v2.x/core-concepts/maci-keys.md +84 -0
- package/versioned_docs/version-v2.x/core-concepts/maci-messages.md +44 -0
- package/versioned_docs/version-v2.x/core-concepts/merkle-trees.md +23 -0
- package/versioned_docs/version-v2.x/core-concepts/poll-types.md +106 -0
- package/versioned_docs/version-v2.x/core-concepts/spec.md +883 -0
- package/versioned_docs/version-v2.x/core-concepts/state-leaf.md +42 -0
- package/versioned_docs/version-v2.x/core-concepts/workflow.md +142 -0
- package/versioned_docs/version-v2.x/getting-started.md +313 -0
- package/versioned_docs/version-v2.x/guides/_category_.json +4 -0
- package/versioned_docs/version-v2.x/guides/compile-circuits.md +163 -0
- package/versioned_docs/version-v2.x/guides/frontend.md +99 -0
- package/versioned_docs/version-v2.x/guides/integrating.md +73 -0
- package/versioned_docs/version-v2.x/guides/maciWrapper.md +173 -0
- package/versioned_docs/version-v2.x/guides/subgraph.md +79 -0
- package/versioned_docs/version-v2.x/guides/testing/_category_.json +4 -0
- package/versioned_docs/version-v2.x/guides/testing/testing-in-detail.md +203 -0
- package/versioned_docs/version-v2.x/guides/testing/testing.md +163 -0
- package/versioned_docs/version-v2.x/guides/troubleshooting.md +161 -0
- package/versioned_docs/version-v2.x/introduction.md +146 -0
- package/versioned_docs/version-v2.x/processes/_category_.json +4 -0
- package/versioned_docs/version-v2.x/processes/ci-pipeline.md +38 -0
- package/versioned_docs/version-v2.x/processes/versioning.md +94 -0
- package/versioned_docs/version-v2.x/resources.md +33 -0
- package/versioned_docs/version-v2.x/security/_category_.json +4 -0
- package/versioned_docs/version-v2.x/security/audit.md +167 -0
- package/versioned_docs/version-v2.x/security/trusted-setup.md +166 -0
- package/versioned_docs/version-v2.x/supported-networks/_category_.json +4 -0
- package/versioned_docs/version-v2.x/supported-networks/deployed-contracts.md +1108 -0
- package/versioned_docs/version-v2.x/supported-networks/supported-networks.md +47 -0
- package/versioned_docs/version-v2.x/technical-references/_category_.json +4 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/AccQueue.md +21 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Gatekeepers.md +40 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/MACI.md +152 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/MessageProcessor.md +13 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Params.md +32 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Poll.md +104 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/PollFactory.md +43 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Tally.md +45 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/VkRegistry.md +57 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/VoiceCreditProxy.md +18 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/_category_.json +8 -0
- package/versioned_docs/version-v2.x/technical-references/technical-references.md +47 -0
- package/versioned_docs/version-v2.x/technical-references/typescript-code/_category_.json +4 -0
- package/versioned_docs/version-v2.x/technical-references/typescript-code/cli.md +699 -0
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/_category_.json +4 -0
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/processMessages.md +107 -0
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/setup.md +101 -0
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/tallyVotes.md +79 -0
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/utilities.md +131 -0
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +37 -0
- package/versioned_docs/version-v2.x/use-cases/_category_.json +4 -0
- package/versioned_docs/version-v2.x/use-cases/governance.md +18 -0
- package/versioned_docs/version-v2.x/use-cases/polling.md +10 -0
- package/versioned_docs/version-v2.x/use-cases/public-goods.md +65 -0
- package/versioned_docs/version-v3.x/case-studies.md +35 -0
- package/versioned_docs/version-v3.x/contributing/_category_.json +4 -0
- package/versioned_docs/version-v3.x/contributing/code-of-conduct.md +92 -0
- package/versioned_docs/version-v3.x/contributing/contributing.md +149 -0
- package/versioned_docs/version-v3.x/contributing/project-ideas.md +78 -0
- package/versioned_docs/version-v3.x/core-concepts/_category_.json +4 -0
- package/versioned_docs/version-v3.x/core-concepts/ballot.md +19 -0
- package/versioned_docs/version-v3.x/core-concepts/coordinator-processing.md +46 -0
- package/versioned_docs/version-v3.x/core-concepts/hashing-and-encryption.md +45 -0
- package/versioned_docs/version-v3.x/core-concepts/key-change.md +179 -0
- package/versioned_docs/version-v3.x/core-concepts/maci-keys.md +84 -0
- package/versioned_docs/version-v3.x/core-concepts/maci-messages.md +44 -0
- package/versioned_docs/version-v3.x/core-concepts/merkle-trees.md +16 -0
- package/versioned_docs/version-v3.x/core-concepts/poll-types.md +58 -0
- package/versioned_docs/version-v3.x/core-concepts/polls.md +81 -0
- package/versioned_docs/version-v3.x/core-concepts/spec.md +883 -0
- package/versioned_docs/version-v3.x/core-concepts/state-leaf.md +42 -0
- package/versioned_docs/version-v3.x/core-concepts/workflow.md +143 -0
- package/versioned_docs/version-v3.x/guides/_category_.json +4 -0
- package/versioned_docs/version-v3.x/guides/compile-circuits.md +175 -0
- package/versioned_docs/version-v3.x/guides/integrating.md +137 -0
- package/versioned_docs/version-v3.x/guides/subgraph.md +79 -0
- package/versioned_docs/version-v3.x/guides/testing/_category_.json +4 -0
- package/versioned_docs/version-v3.x/guides/testing/testing-in-detail.md +191 -0
- package/versioned_docs/version-v3.x/guides/testing/testing-introduction.md +158 -0
- package/versioned_docs/version-v3.x/guides/troubleshooting.md +161 -0
- package/versioned_docs/version-v3.x/introduction.md +153 -0
- package/versioned_docs/version-v3.x/processes/_category_.json +4 -0
- package/versioned_docs/version-v3.x/processes/ci-pipeline.md +38 -0
- package/versioned_docs/version-v3.x/processes/versioning.md +94 -0
- package/versioned_docs/version-v3.x/quick-start.md +318 -0
- package/versioned_docs/version-v3.x/resources.md +33 -0
- package/versioned_docs/version-v3.x/security/_category_.json +4 -0
- package/versioned_docs/version-v3.x/security/audit.md +167 -0
- package/versioned_docs/version-v3.x/security/trusted-setup.md +172 -0
- package/versioned_docs/version-v3.x/supported-networks/_category_.json +4 -0
- package/versioned_docs/version-v3.x/supported-networks/deployed-contracts.md +112 -0
- package/versioned_docs/version-v3.x/supported-networks/supported-networks.md +53 -0
- package/versioned_docs/version-v3.x/technical-references/_category_.json +4 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/MACI.md +160 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/MessageProcessor.md +13 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Params.md +33 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Policies.md +39 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Poll.md +170 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/PollFactory.md +33 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Tally.md +43 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/VkRegistry.md +62 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/VoiceCreditProxy.md +18 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/_category_.json +8 -0
- package/versioned_docs/version-v3.x/technical-references/technical-references.md +48 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/_category_.json +4 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/joinPoll.md +53 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/processMessages.md +106 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/setup.md +96 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/tallyVotes.md +79 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/utilities.md +131 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +42 -0
- package/versioned_docs/version-v3.x/use-cases/_category_.json +4 -0
- package/versioned_docs/version-v3.x/use-cases/governance.md +18 -0
- package/versioned_docs/version-v3.x/use-cases/polling.md +10 -0
- package/versioned_docs/version-v3.x/use-cases/public-goods.md +65 -0
- package/versioned_sidebars/version-v0.x-sidebars.json +8 -0
- package/versioned_sidebars/version-v1.2-sidebars.json +8 -0
- package/versioned_sidebars/version-v2.x-sidebars.json +8 -0
- package/versioned_sidebars/version-v3.x-sidebars.json +8 -0
- package/versions.json +1 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Frontend Deployment
|
|
3
|
+
description: How to troubleshoot MACI's failures
|
|
4
|
+
sidebar_label: Frontend Deployment
|
|
5
|
+
sidebar_position: 2
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Deploy a Frontend
|
|
9
|
+
|
|
10
|
+
[MACI Platform](https://github.com/privacy-scaling-explorations/maci-platform) is a complete frontend solution for running voting or funding rounds using MACI. This guide explains how to deploy MACI Platform.
|
|
11
|
+
|
|
12
|
+
## Setup
|
|
13
|
+
|
|
14
|
+
Start by cloning the MACI Platform repo:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
git clone https://github.com/privacy-scaling-explorations/maci-platform
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Head to the folder, checkout to the v1 release and install the dependencies:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
cd maci-platform && \
|
|
24
|
+
git checkout v1 && \
|
|
25
|
+
pnpm install
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
:::note
|
|
29
|
+
This guide uses the v1 version of MACI Platform, for documentation related to each version head to the repository docs [here](https://github.com/privacy-scaling-explorations/maci-platform/blob/main/docs/01_setup.md).
|
|
30
|
+
:::
|
|
31
|
+
|
|
32
|
+
## Configuration
|
|
33
|
+
|
|
34
|
+
Copy the example variables and update them accord to your needs:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
cp packages/interface/.env.example packages/interface/.env
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
At the very minimum make sure to configure:
|
|
41
|
+
|
|
42
|
+
- **BLOB_READ_WRITE_TOKEN.** Storage for applications metadata.
|
|
43
|
+
- **NEXT_PUBLIC_ALCHEMY_ID.** Optional but highly recommended for RPC calls.
|
|
44
|
+
- **NEXT_PUBLIC_REGISTRATION_END_DATE.** Determine when users can register application.
|
|
45
|
+
- **NEXT_PUBLIC_ADMIN_ADDRESS.** Address that will approve applications and voters
|
|
46
|
+
- **NEXT_PUBLIC_APPROVAL_SCHEMA.** Schema for applications and voters.
|
|
47
|
+
- **NEXT_PUBLIC_METADATA_SCHEMA.** Schema for storing metadata refs.
|
|
48
|
+
- **NEXT_PUBLIC_MACI_ADDRESS.** The MACI contract address deployed on the [Getting Started Guide](/docs/getting-started).
|
|
49
|
+
- **NEXT_PUBLIC_MACI_START_BLOCK.** Block when was deployed the MACI contract.
|
|
50
|
+
- **NEXT_PUBLIC_MACI_SUBGRAPH_URL.** URL of the Subgraph deployed on the [Subgraph Deployment Guide](/docs/guides/subgraph).
|
|
51
|
+
|
|
52
|
+
:::important
|
|
53
|
+
Make sure that the EAS schemas exist in the network that you are using.
|
|
54
|
+
:::
|
|
55
|
+
|
|
56
|
+
Build the repo with the following command.
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pnpm build
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
In order to run the interface locally can run:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pnpm dev:interface
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Deploy Poll
|
|
69
|
+
|
|
70
|
+
Once you have configured the repo with the subgraph and MACI contract you only need to [deploy a poll](/docs/getting-started#deploy-poll) on MACI.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pnpm deploy-poll:NETWORK
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Deploy Frontend
|
|
77
|
+
|
|
78
|
+
The easiest way to deploy MACI Platform is using [vercel](https://vercel.com/new).
|
|
79
|
+
|
|
80
|
+
1. Import the repo you created/forked
|
|
81
|
+
2. Open the Environment Variables panel
|
|
82
|
+
3. Select the first field and paste your variables from your text editor.
|
|
83
|
+
4. Deploy!
|
|
84
|
+
|
|
85
|
+
## Results
|
|
86
|
+
|
|
87
|
+
Once the voting time has ended, as a coordinator, you need to [merge the signups and generate the proofs](/docs/getting-started#poll-finalization). This is done on the MACI repo.
|
|
88
|
+
|
|
89
|
+
This is going to generate a `tally.json` file, then you need to rename it as `tally-{pollId}.json` or `tally-{roundId}.json`, upload it and add it as an environment variable `NEXT_PUBLIC_TALLY_URL`. The frontend will read this variable and will display the results.
|
|
90
|
+
|
|
91
|
+
:::important
|
|
92
|
+
We recommend you use vercel storage to upload the `tally-{pollid}.json` file.
|
|
93
|
+
:::
|
|
94
|
+
|
|
95
|
+
## Credits
|
|
96
|
+
|
|
97
|
+
The interface originally started as a fork of [easy-rpgf](https://github.com/gitcoinco/easy-retro-pgf), but has since taken a completely different direction. As a result, we decided to detach the fork to clarify the project's new focus, which now extends beyond RPGF to include other types of voting and funding.
|
|
98
|
+
|
|
99
|
+
We are very thankful to the developers and all contributors of the [easy-rpgf](https://github.com/gitcoinco/easy-retro-pgf) project, and we hope to continue collaborating and wish to see their project succeed and help more communities/projects get funded.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Integrating MACI
|
|
3
|
+
description: How to integrate MACI into your application
|
|
4
|
+
sidebar_label: Integrating
|
|
5
|
+
sidebar_position: 5
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
MACI can be used in any protocol that requires collusion resistance, for instance it has been proven to be quite efficient when integrated in quadratic funding applications such as [clr.fund](https://github.com/clrfund/monorepo) and [qfi](https://github.com/quadratic-funding/qfi/tree/feat/code-freeze).
|
|
9
|
+
|
|
10
|
+
Here we will be looking at how the smart contracts can be integrated. Please note that this will be expanded as QFI is updated to use the newest version of MACI. Should you decide to integrate MACI in the meantime, feel free to open an issue on the GitHub repo.
|
|
11
|
+
|
|
12
|
+
## MACI Contract
|
|
13
|
+
|
|
14
|
+
The MACI contract is the core of the protocol. Contracts can inherit from MACI and thus expose the `signUp` and `deployPoll` functions. As with standalone MACI, one would need to deploy a [sign up gatekeeper](/docs/technical-references/smart-contracts/Gatekeepers) as well as the [voice credit proxy](/docs/technical-references/smart-contracts/VoiceCreditProxy).
|
|
15
|
+
|
|
16
|
+
As an example, a [contract](https://github.com/ctrlc03/minimalQF/blob/main/contracts/MinimalQf.sol#L113) could inherit from MACI and allows sign up via a custom signup function.
|
|
17
|
+
|
|
18
|
+
```javascript
|
|
19
|
+
function signUp(
|
|
20
|
+
PubKey memory _pubKey,
|
|
21
|
+
bytes memory _signUpGatekeeperData,
|
|
22
|
+
bytes memory _initialVoiceCreditProxyData
|
|
23
|
+
) public override {
|
|
24
|
+
// the amount must be set in the initial voice credit proxy data
|
|
25
|
+
uint256 amount = abi.decode(_initialVoiceCreditProxyData, (uint256));
|
|
26
|
+
|
|
27
|
+
// transfer tokens to this contract
|
|
28
|
+
nativeToken.safeTransferFrom(msg.sender, address(this), amount);
|
|
29
|
+
|
|
30
|
+
// the voice credits will be the amount divided by the factor
|
|
31
|
+
// the factor should be decimals of the token
|
|
32
|
+
// normal signup
|
|
33
|
+
super.signUp(_pubKey, _signUpGatekeeperData, _initialVoiceCreditProxyData);
|
|
34
|
+
|
|
35
|
+
// store the address of the user signing up and amount so they can be refunded just in case
|
|
36
|
+
// the round is cancelled
|
|
37
|
+
// they will be able to vote from different addresses though
|
|
38
|
+
contributors[msg.sender] = amount;
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## InitialVoiceCreditProxy
|
|
43
|
+
|
|
44
|
+
If you'd like to extend the functionality of how votes are distributed among users, you need to extend [InitialVoiceCreditProxy](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/initialVoiceCreditProxy/InitialVoiceCreditProxy.sol) contract. You can see our [basic example](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.sol) how it's implemented for constant distribution.
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
contract ConstantInitialVoiceCreditProxy is InitialVoiceCreditProxy {
|
|
48
|
+
/// @notice the balance to be returned by getVoiceCredits
|
|
49
|
+
uint256 internal balance;
|
|
50
|
+
|
|
51
|
+
/// @notice creates a new ConstantInitialVoiceCreditProxy
|
|
52
|
+
/// @param _balance the balance to be returned by getVoiceCredits
|
|
53
|
+
constructor(uint256 _balance) payable {
|
|
54
|
+
balance = _balance;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/// @notice Returns the constant balance for any new MACI's voter
|
|
58
|
+
/// @return balance
|
|
59
|
+
function getVoiceCredits(address, bytes memory) public view override returns (uint256) {
|
|
60
|
+
return balance;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Poll Contract
|
|
66
|
+
|
|
67
|
+
On the other hand, the Poll contract can be inherited to expose functionality such as publishing of messages/commands.
|
|
68
|
+
|
|
69
|
+
For instance, should it be required to gatekeep who can send a message, overriding the `publishMessage` function could be the best way to go.
|
|
70
|
+
|
|
71
|
+
## Tally Contract
|
|
72
|
+
|
|
73
|
+
Given the verification functions being exposed by the Tally contract, quadratic funding protocols might require to extend the Tally contract to add distribution logic. Looking at this [example](https://github.com/ctrlc03/minimalQF/blob/main/contracts/MinimalQFTally.sol#L114) the `claimFunds` function is added to a contract inheriting from `Tally`, and uses functions such as `verifyPerVOSpentVoiceCredits` to distribute funds to projects part of a quadratic funding round.
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: MACI Wrapper Guide Scaffold ETH 2 & MACI Voting Template
|
|
3
|
+
description: Introduction to the MACI Wrapper and Setup
|
|
4
|
+
sidebar_label: MACI Wrapper Guide
|
|
5
|
+
sidebar_position: 3
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# MACI Wrapper Guide: [Scaffold ETH 2 & MACI Voting Template](https://github.com/yashgo0018/maci-wrapper) by [Yash](https://github.com/yashgo0018)
|
|
9
|
+
|
|
10
|
+
Welcome to the hacker guide for the Scaffold ETH 2 + MACI Voting Template! This guide will help you get started with the template, providing step-by-step instructions to set up and customize your decentralized voting application, understand MACI, and explore project ideas.
|
|
11
|
+
|
|
12
|
+
## Understanding MACI
|
|
13
|
+
|
|
14
|
+
### What is MACI?
|
|
15
|
+
|
|
16
|
+
Minimal Anti-Collusion Infrastructure (MACI) is a cryptographic protocol designed to enhance the privacy and security of voting systems on blockchain platforms. MACI ensures that votes are cast anonymously, preventing voters from being coerced or bribed. It combines several cryptographic techniques, including zk-SNARKs (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) and Merkle trees, to achieve its anti-collusion goals.
|
|
17
|
+
|
|
18
|
+
### Key Features of MACI
|
|
19
|
+
|
|
20
|
+
- **Anonymity:** Ensures that the identity of the voter is concealed, making it impossible to link votes to individuals.
|
|
21
|
+
- **Collusion Resistance:** Prevents voters from proving how they voted, thereby deterring bribery and coercion.
|
|
22
|
+
- **Privacy:** Maintains the confidentiality of individual votes while allowing the aggregate result to be verified.
|
|
23
|
+
|
|
24
|
+
### How MACI Works
|
|
25
|
+
|
|
26
|
+
1. **Voter Registration:** Voters register their identities using a public-private key pair.
|
|
27
|
+
2. **Vote Casting:** Votes are encrypted and submitted to the MACI contract. When votes are processed, only votes of eligible users are counted.
|
|
28
|
+
3. **Tallying Votes:** After the voting period, the votes are decrypted and tallied in a way that ensures the privacy and integrity of the results.
|
|
29
|
+
|
|
30
|
+
## Quickstart Guide
|
|
31
|
+
|
|
32
|
+
### 1. Clone and Set Up the Project
|
|
33
|
+
|
|
34
|
+
Clone the project repository and install the dependencies:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
git clone https://github.com/yashgo0018/maci-wrapper.git
|
|
38
|
+
cd maci-wrapper
|
|
39
|
+
yarn install
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 2. Download the zkeys for the MACI Circuits
|
|
43
|
+
|
|
44
|
+
In your first terminal window, run:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
yarn download-zkeys
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 3. Update Environment Variables
|
|
51
|
+
|
|
52
|
+
Copy the example environment files to the required `.env` files:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
cp packages/hardhat/.env.example packages/hardhat/.env
|
|
56
|
+
cp packages/nextjs/.env.example packages/nextjs/.env.local
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Update the values of the environment variables in these new `.env` files.
|
|
60
|
+
|
|
61
|
+
### 4. Start a Local Ethereum Network
|
|
62
|
+
|
|
63
|
+
In your first terminal window, run:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
yarn chain
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
This will start a local Ethereum network using Hardhat.
|
|
70
|
+
|
|
71
|
+
### 5. Deploy Contracts
|
|
72
|
+
|
|
73
|
+
In a second terminal window, deploy your contracts:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
yarn deploy
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 6. Launch the NextJS Application
|
|
80
|
+
|
|
81
|
+
In a third terminal window, start the NextJS frontend:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
yarn start
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 7. Compute Results
|
|
88
|
+
|
|
89
|
+
In a fourth terminal window, clone the MACI repository:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
git clone git@github.com:privacy-scaling-explorations/maci.git
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Copy the zkeys generated from the maci-wrapper repo to the CLI directory of the MACI repo:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
cp -r ../maci-wrapper/packages/hardhat/zkeys ./cli
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Install dependencies and build the MACI project:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
pnpm i
|
|
105
|
+
pnpm run build
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Copy the new contract addresses:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
cp -r ../maci-wrapper/packages/contractAddresses.json ./cli/build/contractAddresses.json
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Follow the MACI documentation to merge signups, merge messages, generate proof, and then you can upload the `tally.json` file to the admin panel after the poll is over.
|
|
115
|
+
|
|
116
|
+
### 8. Interact with Your DApp
|
|
117
|
+
|
|
118
|
+
Navigate to `http://localhost:3000` to interact with your decentralized application (dApp).
|
|
119
|
+
|
|
120
|
+
### 9. Modifications
|
|
121
|
+
|
|
122
|
+
You can modify the app configuration in `packages/nextjs/scaffold.config.ts` to change the target network and `packages/hardhat/constants.ts` is you want to update the zkeys or use your own custom contracts for `voice credit proxy`, `gate keeper`, `verifier` or `topup credits`.
|
|
123
|
+
|
|
124
|
+
#### Example Configuration Changes
|
|
125
|
+
|
|
126
|
+
To host your dApp on a separate network (e.g., Sepolia testnet), you need to update the following file:
|
|
127
|
+
|
|
128
|
+
1. **`packages/nextjs/scaffold.config.ts`**
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
...
|
|
132
|
+
const scaffoldConfig = {
|
|
133
|
+
...
|
|
134
|
+
targetNetworks: [chains.sepolia],
|
|
135
|
+
...
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
2. **Deploying Contracts to Sepolia**
|
|
139
|
+
|
|
140
|
+
Ensure your `packages/hardhat/.env` file contains your private key and Alchemy project ID:
|
|
141
|
+
|
|
142
|
+
```env
|
|
143
|
+
DEPLOYER_PRIVATE_KEY=your_private_key
|
|
144
|
+
ALCHEMY_API_KEY=your_alchemy_project_id
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Then, deploy your contracts to Sepolia:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
yarn deploy --network sepolia
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Usage
|
|
154
|
+
|
|
155
|
+
### Register
|
|
156
|
+
|
|
157
|
+
Use the app's interface to register with the MACI contract and gain voting rights.
|
|
158
|
+
|
|
159
|
+
### Create Polls
|
|
160
|
+
|
|
161
|
+
As an admin, you can create polls with custom questions and options.
|
|
162
|
+
|
|
163
|
+
### Vote
|
|
164
|
+
|
|
165
|
+
Registered voters can participate in polls, utilizing MACI's secure voting mechanism.
|
|
166
|
+
|
|
167
|
+
### View Results
|
|
168
|
+
|
|
169
|
+
Access poll outcomes after the voting phase ends.
|
|
170
|
+
|
|
171
|
+
### Admin Dashboard
|
|
172
|
+
|
|
173
|
+
Monitor and manage ongoing polls, including viewing detailed poll status.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Subgraph Deployment
|
|
3
|
+
description: How to deploy a MACI Subgraph
|
|
4
|
+
sidebar_label: Subgraph Deployment
|
|
5
|
+
sidebar_position: 1
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Subgraph Deployment
|
|
9
|
+
|
|
10
|
+
In some instances like a frontend you might need to deploy a subgraph, in the MACI repository you can find the configuration to deploy a subgraph on The Graph Network or Alchemy Subgraphs.
|
|
11
|
+
|
|
12
|
+
:::important
|
|
13
|
+
While the free plan of The Graph and Alchemy can work well, it's recommended to use a paid plan for production.
|
|
14
|
+
:::
|
|
15
|
+
|
|
16
|
+
## Configuration
|
|
17
|
+
|
|
18
|
+
Head to the subgraph folder in the app folder.
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
cd apps/subgraph
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Edit the `network.json` file in the `config` folder. Adding the network it was deployed, the MACI contract and the block where it was deployed.
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"network": "optimism-sepolia",
|
|
29
|
+
"maciContractAddress": "0xD18Ca45b6cC1f409380731C40551BD66932046c3",
|
|
30
|
+
"maciContractStartBlock": 11052407
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
:::note
|
|
35
|
+
See the supported networks of The Graph **[here](https://thegraph.com/docs/en/developing/supported-networks/)**.
|
|
36
|
+
:::
|
|
37
|
+
|
|
38
|
+
Create a subgraph in [the graph studio](https://thegraph.com/studio/) and name it `maci-subgraph`.
|
|
39
|
+
|
|
40
|
+
## The Graph Deployment
|
|
41
|
+
|
|
42
|
+
The first thing you need to do is to copy the `key` in subgraph studio dashboard and run the following command to authenticate:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
graph auth --studio {key}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Then run the following commands to build and deploy the subgraph:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pnpm run build && \
|
|
52
|
+
pnpm run deploy
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
:::important
|
|
56
|
+
The `pnpm run deploy` command uses `maci-subgraph` as the subgraph name by default, but if you named your subgraph differently (e.g. maci-graph, my-graph, etc.), please change the command to `graph deploy --node https://api.studio.thegraph.com/deploy/ your_subgraph_name`
|
|
57
|
+
:::
|
|
58
|
+
|
|
59
|
+
## Alchemy Deployment
|
|
60
|
+
|
|
61
|
+
Deploying to the Alchemy subgraph service requires some changes to the `subgraph.template.yaml` file located in the `templates` folder. You need to remove the following keys:
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
indexerHints:
|
|
65
|
+
prune: auto
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Now you can run the deploy command with some minor changes:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
graph deploy SUBGRAPH_NAME \
|
|
72
|
+
--version-label VERSION \
|
|
73
|
+
--node https://subgraphs.alchemy.com/api/subgraphs/deploy \
|
|
74
|
+
--deploy-key API_KEY
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
:::note
|
|
78
|
+
In order to get a subgraph deploy key for alchemy, head to the subgraph dashboard section and select `add subgraph` and pick `Deploy a New Subgraph` here you will see the deploy key.
|
|
79
|
+
:::
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: MACI Testing in Detail
|
|
3
|
+
description: How MACI tests work in detail
|
|
4
|
+
sidebar_label: Testing in detail
|
|
5
|
+
sidebar_position: 2
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Testing in detail
|
|
9
|
+
|
|
10
|
+
This doc expands on our [introduction to testing](/docs/testing) doc and explains how MACI tests work in greater detail. This information should be used by MACI's maintainers as well as contributors.
|
|
11
|
+
|
|
12
|
+
## Automated Tests
|
|
13
|
+
|
|
14
|
+
### CLI Tests
|
|
15
|
+
|
|
16
|
+
MACI's CLI provides a series of commands that can be used by both the coordinator and voters, to interact with MACI, from deploying smart contracts to submitting a vote.
|
|
17
|
+
|
|
18
|
+
Currently, there are a number of test cases that are available inside the cli tests folder. The tests are split into two categories:
|
|
19
|
+
|
|
20
|
+
- e2e tests that include the entire MACI stack, from deploying the contracts to submitting a vote and tallying all results.
|
|
21
|
+
- unit tests for cli commands
|
|
22
|
+
|
|
23
|
+
The goal of these tests is to ensure that the MACI stack works as expected, and that the coordinator and voters can interact with the system as expected. They currently do not attempt to verify whether the tally results are expected, or that all votes were accounted for. On the other hand, they test different scenarios, mixing different numbers of voters and messages.
|
|
24
|
+
|
|
25
|
+
### Integration Tests
|
|
26
|
+
|
|
27
|
+
Integration tests follow a similar fashion of the CLI tests, though they also ensure that the tally results are as expected.
|
|
28
|
+
|
|
29
|
+
Currently, tests are defined using a JSON file, here is one example:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"name": "Happy path",
|
|
34
|
+
"description": "Full tree, 4 batches, no bribers",
|
|
35
|
+
"numVotesPerUser": 1,
|
|
36
|
+
"numUsers": 15,
|
|
37
|
+
"expectedTally": [15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
|
38
|
+
"expectedSpentVoiceCredits": [15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
|
39
|
+
"expectedTotalSpentVoiceCredits": 15
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
This test will generate 15 signups (as expressed in `numUsers`), and submit one vote (`numVotesPerUser`) for each of the users. As we did not provide any vote detail, it will use the default: `weight = 1`, `option = 0` for all voters. This will result of course in a tally result of 15 for option 0, and 0 for all other options.
|
|
44
|
+
|
|
45
|
+
Finally, the whole process of merging the state and message trees is performed, proofs are generated and the tally result is verified against the expected result.
|
|
46
|
+
|
|
47
|
+
#### How to implement a new test case
|
|
48
|
+
|
|
49
|
+
To add a new test case, it is quite simple. You can amend the `integrationTests/ts/__tests__/data/suites.json` file and add your test declaration in there.
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"name": "4 voters 1 vote per user",
|
|
54
|
+
"description": "has correct results",
|
|
55
|
+
"numUsers": 4,
|
|
56
|
+
"numVotesPerUser": 1,
|
|
57
|
+
"votes": {
|
|
58
|
+
"0": {
|
|
59
|
+
"0": { "voteOptionIndex": 0, "voteWeight": 1, "valid": true }
|
|
60
|
+
},
|
|
61
|
+
"1": {
|
|
62
|
+
"0": { "voteOptionIndex": 0, "voteWeight": 1, "valid": true }
|
|
63
|
+
},
|
|
64
|
+
"2": {
|
|
65
|
+
"0": { "voteOptionIndex": 0, "voteWeight": 1, "valid": true }
|
|
66
|
+
},
|
|
67
|
+
"3": {
|
|
68
|
+
"0": { "voteOptionIndex": 0, "voteWeight": 1, "valid": true }
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"expectedTally": [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
|
72
|
+
"expectedSpentVoiceCredits": [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
|
73
|
+
"expectedTotalSpentVoiceCredits": 4
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Let's look at the fields in detail:
|
|
78
|
+
|
|
79
|
+
- `name`: the name of the test case
|
|
80
|
+
- `description`: a description of the test case
|
|
81
|
+
- `numUsers`: the number of users to generate
|
|
82
|
+
- `numVotesPerUser`: the number of votes to generate for each user
|
|
83
|
+
- `votes`: the votes to generate. This is an object where the key is the user index, and the value is another object where the key is the message index, and the value is the vote details. If you do not provide any vote details, the default will be used: `weight = 1`, `option = 0` for all voters.
|
|
84
|
+
- `expectedTally`: the expected tally result for each vote option (in order)
|
|
85
|
+
- `expectedSpentVoiceCredits`: the expected spent voice credits for each vote option (in order)
|
|
86
|
+
- `expectedTotalSpentVoiceCredits`: the expected total spent voice credits
|
|
87
|
+
|
|
88
|
+
As an example, let's try to implement a test given the following criteria:
|
|
89
|
+
|
|
90
|
+
1. We want 10 users to signup
|
|
91
|
+
2. We want each user to publish a different vote
|
|
92
|
+
3. We want to verify that the tally result is as expected
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"name": "10 Users test",
|
|
97
|
+
"description": "Should signup 10 users, submit 10 votes and tally the results",
|
|
98
|
+
"numUsers": 10,
|
|
99
|
+
"numVotesPerUser": 1,
|
|
100
|
+
"votes": {
|
|
101
|
+
"0": {
|
|
102
|
+
"0": { "voteOptionIndex": 0, "voteWeight": 5 }
|
|
103
|
+
},
|
|
104
|
+
"1": {
|
|
105
|
+
"0": { "voteOptionIndex": 0, "voteWeight": 9 }
|
|
106
|
+
},
|
|
107
|
+
"2": {
|
|
108
|
+
"0": { "voteOptionIndex": 5, "voteWeight": 3 }
|
|
109
|
+
},
|
|
110
|
+
"3": {
|
|
111
|
+
"0": { "voteOptionIndex": 3, "voteWeight": 2 }
|
|
112
|
+
},
|
|
113
|
+
"4": {
|
|
114
|
+
"0": { "voteOptionIndex": 0, "voteWeight": 1 }
|
|
115
|
+
},
|
|
116
|
+
"5": {
|
|
117
|
+
"0": { "voteOptionIndex": 9, "voteWeight": 1 }
|
|
118
|
+
},
|
|
119
|
+
"6": {
|
|
120
|
+
"0": { "voteOptionIndex": 4, "voteWeight": 7 }
|
|
121
|
+
},
|
|
122
|
+
"7": {
|
|
123
|
+
"0": { "voteOptionIndex": 7, "voteWeight": 5 }
|
|
124
|
+
},
|
|
125
|
+
"8": {
|
|
126
|
+
"0": { "voteOptionIndex": 3, "voteWeight": 10 }
|
|
127
|
+
},
|
|
128
|
+
"9": {
|
|
129
|
+
"0": { "voteOptionIndex": 8, "voteWeight": 2 }
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"expectedTally": [15, 0, 0, 12, 7, 3, 0, 5, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0],
|
|
133
|
+
"expectedSpentVoiceCredits": [107, 0, 0, 104, 49, 9, 0, 25, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
|
134
|
+
"expectedTotalSpentVoiceCredits": 299
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Why expectedTally as above**
|
|
139
|
+
|
|
140
|
+
[(5 + 9 + 1), 0, 0, (2 + 10), 7, 3, 0, 5, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0] -> [15, 0, 0, 12, 7, 3, 0, 5, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
141
|
+
|
|
142
|
+
**Why 299 voice credits spent**
|
|
143
|
+
|
|
144
|
+
- 5 ** 2 + 9 ** 2 + 3 ** 2 + 2 ** 2 + 1 ** 2 + 1 ** 1 + 7 ** 2 + 5 ** 2 + 10 ** 2 + 2 ** 2 = 25 + 81 + 9 + 4 + 1 + 1 + 49 + 25 + 100 + 4 = 299
|
|
145
|
+
|
|
146
|
+
**Why expectedSpentVoiceCredits as above**
|
|
147
|
+
|
|
148
|
+
[(25 + 81 + 1), 0, 0, (4 + 100), 49, 0, 25, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0] -> [107, 0, 0, 104, 49, 0, 25, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
149
|
+
|
|
150
|
+
#### MACI keys integration tests
|
|
151
|
+
|
|
152
|
+
Another test file which is found inside the integration tests folder is the `maciKeys.test.ts` file. This file contains a number of tests that are used to verify that the MACI keys work as expected. These tests are written in TypeScript and use the `mocha` and `chai` frameworks.
|
|
153
|
+
|
|
154
|
+
They are testing that between the `contracts`, `domainobjs` and `crypto` packages, the MACI keys are working correctly, and are serialized/deserialized as expected. This is particularly important to test due to different data formats for keys, especially when parsed from the smart contract events.
|
|
155
|
+
|
|
156
|
+
### Contract tests
|
|
157
|
+
|
|
158
|
+
Within the contracts folder, there are a number of tests that are used to verify that the contracts work as expected. These tests are written in TypeScript and use the `hardhat` framework.
|
|
159
|
+
|
|
160
|
+
These tests interact with all other packages, such as crypto, domainobjs and core, where mock data comes from. Their main goal is to ensure that the smart contracts have the correct parameters when deployed, privileged functions cannot be called by non-privileged users, and that the contract state is as expected after a series of operations.
|
|
161
|
+
|
|
162
|
+
### Circuits tests
|
|
163
|
+
|
|
164
|
+
Within the circuits folder, there are a number of tests that are used to verify that the circuits work as expected. These tests are written in TypeScript and use the `circom_tester` (which runs on top of `mocha` and `chai`).
|
|
165
|
+
|
|
166
|
+
These tests often use mock data from the `core` package. For instance, when testing the `processMessages` circuit, we are required to generate the parameters from the `core` packing, using the `Poll:processMessages` function. The same applies to vote tallying, where we need the `Poll:tally` function to be run first with mock users and vote messages.
|
|
167
|
+
|
|
168
|
+
All of the tests run using test parameters, usually `10, 2, 1, 2`, aside from the tests inside: [`ceremonyParam`](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/ts/__tests__/CeremonyParams.test.ts) which use the parameters of the latest MACI ceremony. More details on the trusted setup can be found [here](/docs/security/trusted-setup).
|
|
169
|
+
|
|
170
|
+
### Core
|
|
171
|
+
|
|
172
|
+
The core package contains a number of tests that are used to verify that the core functions work as expected. These tests are written in TypeScript and use the `mocha` and `chai` frameworks.
|
|
173
|
+
|
|
174
|
+
These tests interact with the crypto and dombinobjs packages, where mock data comes from. Their main goal is to ensure that the core functions work as expected, and that the state is as expected after a series of operations.
|
|
175
|
+
|
|
176
|
+
Currently, there is a blend of e2e and unit tests, where e2e tests are used to verify that the entire MACI local processing works as expected (users signup, publish votes, messages are processed and finally these votes are tallied). Unit tests on the other hand are used to verify that the core functions work as expected, such as `processMessage` and `tallyVotes`. You will find them in separate files, with e2e being [here](https://github.com/privacy-scaling-explorations/maci/blob/dev/core/ts/__tests__/e2e.test.ts) and unit tests in the other files.
|
|
177
|
+
|
|
178
|
+
### Domainobjs/Crypto tests
|
|
179
|
+
|
|
180
|
+
These tests are used to verify that MACI's primitives such as private keys work as expected. They are written in TypeScript and use the `mocha` and `chai` frameworks.
|
|
181
|
+
|
|
182
|
+
## "Manual" Testing
|
|
183
|
+
|
|
184
|
+
To ensure that the MACI stack works as expected, without having to run the entire test suite (or even just the e2e tests), there is a [bash script](https://github.com/privacy-scaling-explorations/maci/blob/dev/cli/testScript.sh) inside the cli folder which can be used.
|
|
185
|
+
|
|
186
|
+
This script contains a number of actions which touch all of the parts of MACI, and resemble exactly what other e2e tests do.
|
|
187
|
+
|
|
188
|
+
Looking at this in more details we do the following:
|
|
189
|
+
|
|
190
|
+
1. Deploy a `VkRegistry` contract
|
|
191
|
+
2. Set the verification keys on this smart contract
|
|
192
|
+
3. Deploy a `MACI` contract (and associated utility contracts)
|
|
193
|
+
4. Deploy a Poll from the MACI contract.
|
|
194
|
+
5. Signup 1 user
|
|
195
|
+
6. Publish 2 messages
|
|
196
|
+
7. Travel in time (local blockchain node) to arrive at the end of the poll
|
|
197
|
+
8. Merge the signups tree
|
|
198
|
+
9. Merge the messages tree
|
|
199
|
+
10. Generate proofs for the message processing and vote tallying
|
|
200
|
+
11. Update the on chain state
|
|
201
|
+
12. Verify that proofs and tally are correct
|
|
202
|
+
|
|
203
|
+
The above is the minimum required to ensure that the stack works as expected, as it encompasses actions from both voters and the coordinator.
|