@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,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: MACI Project Ideas
|
|
3
|
+
description: Community-sourced ideas of projects you could build with MACI
|
|
4
|
+
sidebar_label: MACI Project ideas
|
|
5
|
+
sidebar_position: 3
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Project Ideas
|
|
9
|
+
|
|
10
|
+
### 1. Decentralized Governance Platform
|
|
11
|
+
|
|
12
|
+
**Idea:** Create a decentralized governance platform for DAOs (Decentralized Autonomous Organizations) using the Scaffold ETH 2 + MACI Voting Template. Enable DAO members to propose and vote on governance decisions securely and anonymously.
|
|
13
|
+
|
|
14
|
+
**Features:**
|
|
15
|
+
|
|
16
|
+
- Proposal creation and submission
|
|
17
|
+
- Secure, anonymous voting using MACI
|
|
18
|
+
- Transparent results display
|
|
19
|
+
- Integration with existing DAO frameworks
|
|
20
|
+
|
|
21
|
+
### 2. Secure Polling System for Communities
|
|
22
|
+
|
|
23
|
+
**Idea:** Develop a secure and private polling system for online communities, such as social media groups, forums, or local organizations. This system can be used for decision-making, surveys, or feedback collection.
|
|
24
|
+
|
|
25
|
+
**Features:**
|
|
26
|
+
|
|
27
|
+
- User-friendly poll creation and management interface
|
|
28
|
+
- Anonymized vote submission
|
|
29
|
+
- Real-time poll results visualization
|
|
30
|
+
- Admin dashboard for poll oversight
|
|
31
|
+
|
|
32
|
+
### 3. Private Election System for Institutions
|
|
33
|
+
|
|
34
|
+
**Idea:** Build a private and secure election system for educational institutions, corporate boards, or non-profits. Ensure that election processes are transparent, fair, and resistant to manipulation.
|
|
35
|
+
|
|
36
|
+
**Features:**
|
|
37
|
+
|
|
38
|
+
- Secure voter registration process
|
|
39
|
+
- Anonymous and tamper-proof voting
|
|
40
|
+
- Detailed results analytics
|
|
41
|
+
- Audit logs and election certification
|
|
42
|
+
|
|
43
|
+
### 4. Anonymous Feedback System
|
|
44
|
+
|
|
45
|
+
**Idea:** Implement an anonymous feedback system for companies or organizations to collect honest feedback from employees or customers. Guarantee the privacy of the respondents to encourage open and honest communication.
|
|
46
|
+
|
|
47
|
+
**Features:**
|
|
48
|
+
|
|
49
|
+
- Anonymous feedback submission
|
|
50
|
+
- Secure handling of sensitive information
|
|
51
|
+
- Aggregated feedback reports
|
|
52
|
+
- Admin tools for feedback analysis
|
|
53
|
+
|
|
54
|
+
### 5. Decentralized Survey Platform
|
|
55
|
+
|
|
56
|
+
**Idea:** Create a decentralized survey platform for academic research or market analysis. Utilize MACI's privacy features to ensure respondent confidentiality and data integrity.
|
|
57
|
+
|
|
58
|
+
**Features:**
|
|
59
|
+
|
|
60
|
+
- Customizable survey creation
|
|
61
|
+
- Anonymized responses
|
|
62
|
+
- Secure data storage and processing
|
|
63
|
+
- Results aggregation and visualization
|
|
64
|
+
|
|
65
|
+
### 6. Blockchain-based Voting for Public Elections
|
|
66
|
+
|
|
67
|
+
**Idea:** Develop a blockchain-based voting system for municipal or state-level public elections. Focus on enhancing transparency, security, and voter anonymity.
|
|
68
|
+
|
|
69
|
+
**Features:**
|
|
70
|
+
|
|
71
|
+
- Robust voter registration and verification
|
|
72
|
+
- Anonymous vote casting and tallying
|
|
73
|
+
- Transparent and verifiable election results
|
|
74
|
+
- Compliance with electoral regulations
|
|
75
|
+
|
|
76
|
+
## Join the conversation
|
|
77
|
+
|
|
78
|
+
The MACI core team maintains a wishlist of community-sourced ideas to build with/for/on MACI. Check out our ["Project ideas to build with MACI" GitHub Discussion](https://github.com/privacy-scaling-explorations/maci/discussions/1136) for the up-to-date list! We encourage you to find inspiration here and comment in the discussion to suggest ideas of your own.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Ballot
|
|
3
|
+
description: A short introduction of the main primitives used by MACI
|
|
4
|
+
sidebar_label: Ballot
|
|
5
|
+
sidebar_position: 4
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
A Ballot represents a particular user's votes in a poll, as well as their next valid nonce. It is akin to a voting slip, which belongs to only one voter and contains a list of their choices.
|
|
9
|
+
|
|
10
|
+
| Symbol | Name | Comments |
|
|
11
|
+
| --------- | -------------------------- | -------------------------------------------------------------------------- |
|
|
12
|
+
| $blt_{v}$ | An array of vote weights | $blt_{v[i]}$ refers to the vote weights assigned to vote option $i$ |
|
|
13
|
+
| $blt_n$ | The current nonce | Starts from 0 and increments, so the first valid command must have nonce 1 |
|
|
14
|
+
| $blt_d$ | The vote option tree depth | The depth of the vote option tree |
|
|
15
|
+
|
|
16
|
+
The hash $blt$ is computed as such:
|
|
17
|
+
|
|
18
|
+
1. Compute the Merkle root of $blt_v$, arity 5, of a tree of depth $blt_d$; let this value be $blt_r$
|
|
19
|
+
2. Compute $poseidon_2([blt_n, blt_r])$
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Coordinator local processing
|
|
3
|
+
description: How does the coordinator process and tally messages locally
|
|
4
|
+
sidebar_label: Coordinator local processing
|
|
5
|
+
sidebar_position: 7
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Coordinator local processing
|
|
9
|
+
|
|
10
|
+
The coordinator is responsible for processing and tallying messages locally, before generating proofs that this was done correctly using the zk-SNARK circuits.
|
|
11
|
+
|
|
12
|
+
To summarize, the coordinator's goal here is to process all of the messages that were submitted by MACI's voters, then tally the votes based on the valid vote messages. Furthermore, each batch processed should be able to be verified by a zk-SNARK proof.
|
|
13
|
+
|
|
14
|
+
## Which MACI's components are involved
|
|
15
|
+
|
|
16
|
+
The following diagram, shows which components are involved and at which step of the way
|
|
17
|
+
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
## What does the process look like?
|
|
21
|
+
|
|
22
|
+

|
|
23
|
+
|
|
24
|
+
Zooming in..
|
|
25
|
+
|
|
26
|
+
**Message processing**
|
|
27
|
+
|
|
28
|
+

|
|
29
|
+
|
|
30
|
+
**Vote tallying**
|
|
31
|
+
|
|
32
|
+

|
|
33
|
+
|
|
34
|
+
## What does the process look like when including the zk-SNARK proofs
|
|
35
|
+
|
|
36
|
+
**Process of completing a Poll**
|
|
37
|
+
|
|
38
|
+

|
|
39
|
+
|
|
40
|
+
**Process of generating proofs**
|
|
41
|
+
|
|
42
|
+

|
|
43
|
+
|
|
44
|
+
**Tally commitments**
|
|
45
|
+
|
|
46
|
+

|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Hashing and Encryption
|
|
3
|
+
description: A short introduction of the main primitives used by MACI
|
|
4
|
+
sidebar_label: Hashing and Encryption
|
|
5
|
+
sidebar_position: 3
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
### Hash Functions
|
|
9
|
+
|
|
10
|
+
MACI uses the Poseidon hash function, which is proven to be very efficient in ZK applications. Poseidon accepts $n$ inputs and produces 1 output:
|
|
11
|
+
|
|
12
|
+
$y = poseidon_n([x_1, x_2, ..., x_n])$
|
|
13
|
+
|
|
14
|
+
Also, SHA256 is used to compress public inputs to a circuit into a single field element in the finite field $F$ mod $p$.
|
|
15
|
+
|
|
16
|
+
### Message Encryption
|
|
17
|
+
|
|
18
|
+
In order to encrypt messages, MACI uses Poseidon in DuplexSponge [mode](https://dusk.network/uploads/Encryption-with-Poseidon.pdf). This provides an encryption function and a decryption function:
|
|
19
|
+
|
|
20
|
+
- $C$ as $poseidonEncrypt(k_s[0], k_s[1], N, l, t[])$
|
|
21
|
+
- $poseidonDecrypt(k_s[0], k_s[1], N, l, C)$
|
|
22
|
+
|
|
23
|
+
In more details,
|
|
24
|
+
|
|
25
|
+
- $k_s$ is the shared key, a point on the Baby Jubjub curve
|
|
26
|
+
- $N$ is the nonce, which we hardcode to 0
|
|
27
|
+
- $l$ is the length of the plaintext $t[]$
|
|
28
|
+
|
|
29
|
+
The implementation can be found [here](https://github.com/privacy-scaling-explorations/zk-kit/tree/main/packages/poseidon-cipher).
|
|
30
|
+
|
|
31
|
+
### Shared Key Generation
|
|
32
|
+
|
|
33
|
+
The ECDH algorithm is used to generate a shared key, which is then used to encrypt each message. This allows to create messages which are only decryptable by the coordinator and the person sending the message.
|
|
34
|
+
|
|
35
|
+
In more details:
|
|
36
|
+
|
|
37
|
+
- The coordinator's public key $cPk$ is known to all. Their private key $cSk$ is secret.
|
|
38
|
+
|
|
39
|
+
- When the user publishes a message (i.e. casts a vote), they generate an ephemeral keypair with private key $eSk$ and public key $ePk$.
|
|
40
|
+
|
|
41
|
+
- The user generates the shared key $k$ using the coordinator's public key $cPk$ and the user's ephemeral private key $eSk$.
|
|
42
|
+
|
|
43
|
+
- The user encrypts the command and signature with $k$ to form a message.
|
|
44
|
+
|
|
45
|
+
- The user sends their ephemeral public key $ePk$ along with the ciphertext. The coordinator can recover the same shared key using their private key $cSk$ and the given ephemeral public key $ePk$.
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Key change
|
|
3
|
+
description: How key change messages work
|
|
4
|
+
sidebar_label: Key change
|
|
5
|
+
sidebar_position: 8
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
MACI's voters are identified by their MACI public key. Together with their private key, they can sign and submit messages to live Polls.
|
|
9
|
+
|
|
10
|
+
As MACI's main property is to provide collusion resistance in digital voting applications, it is important to have a mechanism for a user to change their voting key, should this become compromised, or they wish to revoke past actions.
|
|
11
|
+
|
|
12
|
+
## How MACI messages are processed
|
|
13
|
+
|
|
14
|
+
In order to understand how key changing currently works in MACI, we need to understand how messages are processed.
|
|
15
|
+
|
|
16
|
+
After a poll ends, the coordinator processes messages off chain in reverse order. To improve efficiency, messages are processed in batches, and correctness is proved for each batch using a zk-SNARK circuit.
|
|
17
|
+
|
|
18
|
+
Due to messages being processed in reverse order, key change messages would work a bit differently than if they were processed in the same order as they were submitted.
|
|
19
|
+
|
|
20
|
+
## Why are messages processed in reverse order?
|
|
21
|
+
|
|
22
|
+
Reverse processing was introduced to prevent a type of attack where a briber would collude with a voter to sign up, and then submit a message to change their key to a key that the briber controls. This way the briber would have assurance that they could submit the vote they want.
|
|
23
|
+
|
|
24
|
+
Let's take as an example the following:
|
|
25
|
+
|
|
26
|
+
1. Alice signs up with pub key $pub1$
|
|
27
|
+
2. Bob (Briber) bribes Alice and asks her to submit a key change message to $pub2$ (owned by Bob)
|
|
28
|
+
3. Bob submits a vote with $pub2$
|
|
29
|
+
4. Alice submits a vote with $pub1$
|
|
30
|
+
|
|
31
|
+
If messages were processed in the same order as they were submitted, Alice's vote would not be valid, due to it being signed with a private key $priv1$ - which now would not be valid.
|
|
32
|
+
|
|
33
|
+
On the other hand, due to messages being processed in reverse order, Alice's last message would be counted as valid as the key change would have not been processed yet. Then, Bob's vote would not be counted as valid as the current key for Alice would be $pub1$.
|
|
34
|
+
|
|
35
|
+
> Note that a key change message should have the nonce set to 1 in order for it to be valid. We'll see a code example in the next sections.
|
|
36
|
+
|
|
37
|
+
## Then how can a voter change their key and submit a new vote?
|
|
38
|
+
|
|
39
|
+
A user, can submit a key change message, by simply sending a new message signed with their signup key, and setting the nonce to 1. This is because the code checks that the first message to be processed has the nonce set to 1.
|
|
40
|
+
|
|
41
|
+
Let's take a look into a code example:
|
|
42
|
+
|
|
43
|
+
> We have two users, and three keypairs
|
|
44
|
+
|
|
45
|
+
- Create three keypairs
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
const user1Keypair = new Keypair();
|
|
49
|
+
const user2Keypair = new Keypair();
|
|
50
|
+
const secondKeyPair = new Keypair();
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
- Votes will be
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
// user1 votes for project 0
|
|
57
|
+
const user1VoteOptionIndex = BigInt(0);
|
|
58
|
+
// user2 votes for project 1
|
|
59
|
+
const user2VoteOptionIndex = BigInt(1);
|
|
60
|
+
// user1 votes 9 for the first vote
|
|
61
|
+
const user1VoteWeight = BigInt(9);
|
|
62
|
+
// user2 votes 3
|
|
63
|
+
const user2VoteWeight = BigInt(3);
|
|
64
|
+
// user1 will change their vote to 5
|
|
65
|
+
const user1NewVoteWeight = BigInt(5);
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
- What do we expect as result
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
project 0 = 5 * 5 -> 25
|
|
72
|
+
project 1 = 3 * 3 -> 9
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
As seen above, we expect the first vote weight 9 to not be counted, but instead the second vote weight 5 to be counted.
|
|
76
|
+
|
|
77
|
+
- Deploy a MaciState locally and sign up
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
const maciState: MaciState = new MaciState(STATE_TREE_DEPTH);
|
|
81
|
+
// Sign up
|
|
82
|
+
user1StateIndex = maciState.signUp(user1Keypair.pubKey, voiceCreditBalance, BigInt(Math.floor(Date.now() / 1000)));
|
|
83
|
+
user2StateIndex = maciState.signUp(user2Keypair.pubKey, voiceCreditBalance, BigInt(Math.floor(Date.now() / 1000)));
|
|
84
|
+
// deploy a poll
|
|
85
|
+
pollId = maciState.deployPoll(
|
|
86
|
+
duration,
|
|
87
|
+
BigInt(Math.floor(Date.now() / 1000) + duration),
|
|
88
|
+
treeDepths,
|
|
89
|
+
messageBatchSize,
|
|
90
|
+
coordinatorKeypair,
|
|
91
|
+
);
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
- User1 and user2 submit their first votes
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
const poll = maciState.polls[pollId];
|
|
98
|
+
const command1 = new PCommand(
|
|
99
|
+
BigInt(user1StateIndex),
|
|
100
|
+
user1Keypair.pubKey,
|
|
101
|
+
user1VoteOptionIndex,
|
|
102
|
+
user1VoteWeight,
|
|
103
|
+
BigInt(1),
|
|
104
|
+
BigInt(pollId),
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
const signature1 = command1.sign(user1Keypair.privKey);
|
|
108
|
+
|
|
109
|
+
const ecdhKeypair1 = new Keypair();
|
|
110
|
+
const sharedKey1 = Keypair.genEcdhSharedKey(ecdhKeypair1.privKey, coordinatorKeypair.pubKey);
|
|
111
|
+
|
|
112
|
+
const message1 = command1.encrypt(signature1, sharedKey1);
|
|
113
|
+
poll.publishMessage(message1, ecdhKeypair1.pubKey);
|
|
114
|
+
|
|
115
|
+
const command2 = new PCommand(
|
|
116
|
+
BigInt(user2StateIndex),
|
|
117
|
+
user2Keypair.pubKey,
|
|
118
|
+
user2VoteOptionIndex,
|
|
119
|
+
user2VoteWeight,
|
|
120
|
+
BigInt(1),
|
|
121
|
+
BigInt(pollId),
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
const signature2 = command2.sign(user2Keypair.privKey);
|
|
125
|
+
|
|
126
|
+
const ecdhKeypair2 = new Keypair();
|
|
127
|
+
const sharedKey2 = Keypair.genEcdhSharedKey(ecdhKeypair2.privKey, coordinatorKeypair.pubKey);
|
|
128
|
+
|
|
129
|
+
const message2 = command2.encrypt(signature2, sharedKey2);
|
|
130
|
+
poll.publishMessage(message2, ecdhKeypair2.pubKey);
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
- User1 submits a key change message with the new vote
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
const poll = maciState.polls[pollId];
|
|
137
|
+
const command = new PCommand(
|
|
138
|
+
BigInt(user1StateIndex),
|
|
139
|
+
secondKeyPair.pubKey,
|
|
140
|
+
user1VoteOptionIndex,
|
|
141
|
+
user1NewVoteWeight,
|
|
142
|
+
BigInt(1),
|
|
143
|
+
BigInt(pollId),
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
const signature = command.sign(user1Keypair.privKey);
|
|
147
|
+
|
|
148
|
+
const ecdhKeypair = new Keypair();
|
|
149
|
+
const sharedKey = Keypair.genEcdhSharedKey(ecdhKeypair.privKey, coordinatorKeypair.pubKey);
|
|
150
|
+
|
|
151
|
+
const message = command.encrypt(signature, sharedKey);
|
|
152
|
+
poll.publishMessage(message, ecdhKeypair.pubKey);
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
- We process the votes and check that the result is as expected (`user1NewVoteWeight` was 5 and `user2VoteWeight` 3)
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
const poll = maciState.polls[pollId];
|
|
159
|
+
poll.processMessages(pollId);
|
|
160
|
+
poll.tallyVotes();
|
|
161
|
+
expect(poll.perVOSpentVoiceCredits[0].toString()).to.eq((user1NewVoteWeight * user1NewVoteWeight).toString());
|
|
162
|
+
expect(poll.perVOSpentVoiceCredits[1].toString()).to.eq((user2VoteWeight * user2VoteWeight).toString());
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
- Finally confirm that the keypair was changed for the user1
|
|
166
|
+
|
|
167
|
+
```ts
|
|
168
|
+
const poll = maciState.polls[pollId];
|
|
169
|
+
const stateLeaf1 = poll.stateLeaves[user1StateIndex];
|
|
170
|
+
const stateLeaf2 = poll.stateLeaves[user2StateIndex];
|
|
171
|
+
expect(stateLeaf1.pubKey.equals(user1SecondKeypair.pubKey)).to.eq(true);
|
|
172
|
+
expect(stateLeaf2.pubKey.equals(user2Keypair.pubKey)).to.eq(true);
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
We see that is important that we set the final message (the one with the new vote) with nonce 1, as this vote would be counted as the first vote.
|
|
176
|
+
|
|
177
|
+
:::info
|
|
178
|
+
Tests related to key changes have been added to the [core package](https://github.com/privacy-scaling-explorations/maci/blob/dev/core/ts/__tests__/) and to the [cli package](https://github.com/privacy-scaling-explorations/maci/blob/dev/cli/tests/).
|
|
179
|
+
:::
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: MACI Keys
|
|
3
|
+
description: A short introduction of MACI's keys
|
|
4
|
+
sidebar_label: Maci Keys
|
|
5
|
+
sidebar_position: 2
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Elliptic Curves
|
|
9
|
+
|
|
10
|
+
MACI uses the Baby Jubjub Elliptic [Curve](https://iden3-docs.readthedocs.io/en/latest/_downloads/33717d75ab84e11313cc0d8a090b636f/Baby-Jubjub.pdf). The `p` scalar field of choosing is:
|
|
11
|
+
|
|
12
|
+
$p=21888242871839275222246405745257275088548364400416034343698204186575808495617$
|
|
13
|
+
|
|
14
|
+
with generator:
|
|
15
|
+
|
|
16
|
+
$995203441582195749578291179787384436505546430278305826713579947235728471134$
|
|
17
|
+
$5472060717959818805561601436314318772137091100104008585924551046643952123905$
|
|
18
|
+
|
|
19
|
+
and within the finite field with modulo $p$.
|
|
20
|
+
|
|
21
|
+
## Key Pairs
|
|
22
|
+
|
|
23
|
+
MACI uses Node.js's `crypto.randomBytes(32)` function to generate a cryptographically strong pseudorandom 32-byte value. This value is the seed used to generate a maci public key. A public key is a point on the Baby Jubjub [curve](https://iden3-docs.readthedocs.io/en/latest/_downloads/33717d75ab84e11313cc0d8a090b636f/Baby-Jubjub.pdf), which is deterministically derived from a private key `s`.
|
|
24
|
+
|
|
25
|
+
A public key is generated with the following function from [zk-kit](https://github.com/privacy-scaling-explorations/zk-kit/blob/main/packages/eddsa-poseidon/src/eddsa-poseidon.ts#L75):
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
export function derivePublicKey(privateKey: Buffer | Uint8Array | string): Point<bigint> {
|
|
29
|
+
const s = deriveSecretScalar(privateKey);
|
|
30
|
+
|
|
31
|
+
return mulPointEscalar(Base8, s);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
In more details, the function does the following:
|
|
36
|
+
|
|
37
|
+
1. Derive a scalar value from the seed (private key).
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
export function deriveSecretScalar(privateKey: Buffer | Uint8Array | string): bigint {
|
|
41
|
+
// Convert the private key to buffer.
|
|
42
|
+
privateKey = checkPrivateKey(privateKey);
|
|
43
|
+
|
|
44
|
+
let hash = blake(privateKey);
|
|
45
|
+
|
|
46
|
+
hash = hash.slice(0, 32);
|
|
47
|
+
hash = pruneBuffer(hash);
|
|
48
|
+
|
|
49
|
+
return scalar.shiftRight(leBufferToBigInt(hash), BigInt(3)) % subOrder;
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
2. Perform a scalar multiplication of the base point `Base8` with the scalar value `s`.
|
|
54
|
+
|
|
55
|
+
Now we have a public key, which is a point on the Baby Jubjub curve. In TypeScript, this is an array of two bigint values, representing the x and y coordinates of the point.
|
|
56
|
+
|
|
57
|
+
## Serialization
|
|
58
|
+
|
|
59
|
+
In order to easily store and transmit maci keys, these are serialized to a string.
|
|
60
|
+
|
|
61
|
+
A public key if first packed, then converted to a hex string. This string is then prefixed with `macipk.`.
|
|
62
|
+
|
|
63
|
+
For private keys (well the seed really), the value is converted to a hex string, padded to be of 64 characters, and prefixed with `macisk.`.
|
|
64
|
+
|
|
65
|
+
For instance, given a seed of `27514007781052885036162808648019893362811628316940391612960868886926452498447`, we have a public key of:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"x": 7849177681360672621257726786949079749092629607596162839195961972852243798387,
|
|
70
|
+
"y": 6476520406570543146511284735472598280851241629796745672331248892171436291770
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Serialized, these will look like **macipk.0e5194a54562ea4d440ac6a0049a41d4b600e3eb0bf54486e7a5f7e27521f6ba** and **macisk.3cd46064ea59936f82efb384059dd4f5b6b8e5c7546614caf7c1c3be0daea00f**.
|
|
75
|
+
|
|
76
|
+
## Generate MACI Keys
|
|
77
|
+
|
|
78
|
+
After successfully [installing](../getting-started.md#installation) MACI, you can easily generate your MACI key pair by running:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
pnpm run genMaciKeyPair
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
This command will create the necessary public and private keys required for running various MACI operations.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Commands and Messages
|
|
3
|
+
description: A short introduction of MACI's commands and messages
|
|
4
|
+
sidebar_label: Commands and Messages
|
|
5
|
+
sidebar_position: 3
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Command
|
|
9
|
+
|
|
10
|
+
A command represents an action that a user may take, such as casting a vote in a poll or changing their public key if bribed. It is made up of the following parameters:
|
|
11
|
+
|
|
12
|
+
| Symbol | Name | Size | Description |
|
|
13
|
+
| ------------ | ----------------------- | ---- | --------------------------------------------------------------------------------------------------- |
|
|
14
|
+
| $cm_i$ | State index | 50 | State leaf index where the signing key is located |
|
|
15
|
+
| $cm_{p_{x}}$ | Public key x-coordinate | 253 | If no change is necessary this parameter should reflect the current public key's x-coordinate |
|
|
16
|
+
| $cm_{p_{y}}$ | Public key y-coordinate | 253 | If no change is necessary this parameter should reflect the current public key's y-coordinate |
|
|
17
|
+
| $cm_{i_{v}}$ | Vote option index | 50 | Option state leaf index of preference to assign the vote for |
|
|
18
|
+
| $cm_w$ | Voting weight | 50 | Voice credit balance allocation, this is an arbitrary value dependent on a user's available credits |
|
|
19
|
+
| $cm_n$ | Nonce | 50 | State leaf's index of actions committed plus one |
|
|
20
|
+
| $cm_{id}$ | Poll id | 50 | The poll's identifier to cast in regard to |
|
|
21
|
+
| $cm_s$ | Salt | 253 | An entropy value to inhibit brute force attacks |
|
|
22
|
+
|
|
23
|
+
## Message
|
|
24
|
+
|
|
25
|
+
A message is an encrypted command using the shared key $k_s$ between the voter and the coordinator. The plaintext $t$ is computed as such:
|
|
26
|
+
|
|
27
|
+
$t = [p, cm_{p_{x}}, cm_{p_{y}}, cm_s, R8[0], R8[1], S]$
|
|
28
|
+
|
|
29
|
+
While the message can be computed with the formula below:
|
|
30
|
+
|
|
31
|
+
$M$ = ${poseidonEncrypt}(k_s[0], k_s[1], cm_n, 7, t)$
|
|
32
|
+
|
|
33
|
+
### Decrypting a message
|
|
34
|
+
|
|
35
|
+
To decrypt a message using $k_s$ we have the following:
|
|
36
|
+
|
|
37
|
+
$[p, R8[0], R8[1], cm_s]$ = ${poseidonDecrypt}(M, k_s[0], k_s[1], cm_n, 7)$
|
|
38
|
+
|
|
39
|
+
To unpack $p$ to its original five parameters, it must be separated into 50 bit values from the parent 250 bit value. To extract 50 bits at byte $n$, we:
|
|
40
|
+
|
|
41
|
+
1. initialise 50 bits
|
|
42
|
+
2. shift left by $n$ bits
|
|
43
|
+
3. bitwise AND with $p$
|
|
44
|
+
4. shift right by $n$ bits
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Merkle Trees
|
|
3
|
+
description: A short introduction of the main primitives used by MACI
|
|
4
|
+
sidebar_label: Merkle Trees
|
|
5
|
+
sidebar_position: 5
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
MACI uses different types of merkle trees to store and manage data. On chain, a [LazyIMT](https://github.com/privacy-scaling-explorations/zk-kit.solidity/tree/main/packages/lazy-imt) is used to store user's state leaves, and an [AccQueue](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/trees/AccQueue.sol) to store user's messages.
|
|
9
|
+
|
|
10
|
+
## Accumulator queue
|
|
11
|
+
|
|
12
|
+
This contract holds [messages](/docs/technical-references/smart-contracts/Poll#publishmessage) sent by users. When a leaf is inserted into the `AccQueue`, the merkle root is not updated yet, instead the leaf is updated or the root of a subtree is re-computed. The smart contract exposes three functions:
|
|
13
|
+
|
|
14
|
+
- `enqueue(leaf)`: Enqueues a leaf into a subtree
|
|
15
|
+
four out of five times it is invoked, an enqueue operation may or may not require the contract to perform a hash function. When it does, only up to $t_d$ required number of hashes need to be computed
|
|
16
|
+
- `mergeSubRoots()`: Merge all subtree roots into the shortest possible Merkle tree to fit
|
|
17
|
+
Before computing the main Merkle root, it is necessary to compute the smallSRTroot (the smallest subroot tree root). This is the Merkle root of a tree which is small enough to fit all the subroots
|
|
18
|
+
function which allows the coordinator to specify the number of queue operations to execute. The entire tree may be merged in a single transaction, or it may not.
|
|
19
|
+
- `merge()`: Calculate the Merkle root of all the leaves at height $d_t$
|
|
20
|
+
|
|
21
|
+
## LazyIMT
|
|
22
|
+
|
|
23
|
+
A LazyIMT is a Merkle tree that is updated lazily. It is used to [store the state leaves](/docs/technical-references/smart-contracts/MACI#signup) of the users. The "lazy" tree performs the minimum number of hashes necessary to insert elements in a tree. This means if there is only a left element the parent hash is not calculated until a corresponding right element exists, to avoid having an intermediate hash that will change in the future. This tree is designed for roots that are infrequently accessed onchain.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Poll Types
|
|
3
|
+
description: Which type of polls you can run on MACI
|
|
4
|
+
sidebar_label: Poll types
|
|
5
|
+
sidebar_position: 9
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
MACI allows to conduct polls in both a quadratic voting and non quadratic voting fashion. One should be aware that the only distinction between the two happens when messages are processed and votes tallied. On top of that, the Tally smart contract has been split into two different ones, with the non quadratic voting version one being slightly smaller, due to the need of one less function.
|
|
9
|
+
|
|
10
|
+
This document will explain how to use each of these options. Hardhat tasks are the currently recommended way to deploy contracts and run polls but you can also use the MACI cli.
|
|
11
|
+
|
|
12
|
+
## Quadratic Voting
|
|
13
|
+
|
|
14
|
+
MACI has always worked with quadratic voting. Users signing up to MACI are assigned a number of voice credits based on certain conditions (enforced by the [initial voice credit proxy contract](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/initialVoiceCreditProxy/InitialVoiceCreditProxy.sol)), and after each vote, the number of voice credits is reduced by the square of the weight of the vote casted. For instance, if the vote weight is 5, a user must have at least 25 voice credits to cast the vote.
|
|
15
|
+
|
|
16
|
+
To run a poll with quadratic voting, the coordinator must deploy the Poll with the mode set to quadratic voting.
|
|
17
|
+
|
|
18
|
+
### Using Hardhat tasks
|
|
19
|
+
|
|
20
|
+
In the deploy-config.json file set the `useQuadraticVoting` value to **true**.
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
"Poll": {
|
|
24
|
+
"pollDuration": 604800,
|
|
25
|
+
"coordinatorPubkey": "macipk",
|
|
26
|
+
"useQuadraticVoting": true
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Then run the task to create a poll:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pnpm deploy-poll:NETWORK
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Using MACI's cli
|
|
37
|
+
|
|
38
|
+
One can create a MACI instance with quadratic voting by running the following command:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
maci-cli create -uq true $OTHER_PARAMETERS
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Then, when generating the zkSNARK proofs, the coordinator should pass the following to the `genProofs` command:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
maci-cli genProofs -uq true $OTHER_PARAMETERS
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
For users, when verifying the tally results, please ensure that the tally file contains the entry:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"isQuadratic": true
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
If verifying without a tally file, but by passing a tally data object, please ensure that the object has the same entry set to true.
|
|
59
|
+
|
|
60
|
+
## Non Quadratic Voting
|
|
61
|
+
|
|
62
|
+
The non quadratic voting option is a new feature that has been added to MACI with the v1.2 release. It allows to conduct polls without the quadratic voting mechanism. This means that the number of voice credits is not reduced by the square of the weight of the vote casted. This option is useful for polls where the quadratic voting mechanism is not necessary, and it is also slightly cheaper for coordinators to tally votes, as there are less checks required in the Tally smart contract.
|
|
63
|
+
|
|
64
|
+
To run a poll with non quadratic voting, the coordinator must set the `useQuadraticVoting` parameter to `false` when creating the MACI instance. This will make the MACI instance use the `TallyNonQv` smart contract, which is a smaller version of the `Tally` smart contract, as it does not require the checks for the quadratic voting mechanism.
|
|
65
|
+
|
|
66
|
+
### Using Hardhat tasks
|
|
67
|
+
|
|
68
|
+
In the deploy-config.json file set the `useQuadraticVoting` value to **false**.
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
"Poll": {
|
|
72
|
+
"pollDuration": 604800,
|
|
73
|
+
"coordinatorPubkey": "macipk",
|
|
74
|
+
"useQuadraticVoting": false
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Then run the task to create a poll:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
pnpm deploy-poll:NETWORK
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Using MACI's cli
|
|
85
|
+
|
|
86
|
+
One can create a MACI instance with non quadratic voting by running the following command:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
maci-cli create -uq false $OTHER_PARAMETERS
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Then, when generating the zkSNARK proofs, the coordinator should pass the following to the `genProofs` command:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
maci-cli genProofs -uq false $OTHER_PARAMETERS
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
For users, when verifying the tally results, please ensure that the tally file contains the entry:
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"isQuadratic": false
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
If verifying without a tally file, but by passing a tally data object, please ensure that the object has the same entry set to false.
|