@maci-protocol/website 0.0.0-ci.2653bc0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (415) hide show
  1. package/.eslintrc.js +157 -0
  2. package/CHANGELOG.md +566 -0
  3. package/LICENSE +22 -0
  4. package/README.md +58 -0
  5. package/babel.config.js +3 -0
  6. package/blog/2021-10-12-maci-v1.md +100 -0
  7. package/blog/2022-09-22-maci-v1-technical-introduction.md +180 -0
  8. package/blog/2023-01-18-maci-v1.1.1.md +121 -0
  9. package/blog/2024-01-18-roadmap.md +106 -0
  10. package/blog/2024-02-28-maci-v1.2.0.md +121 -0
  11. package/blog/2024-04-10-roadmap-q2.md +96 -0
  12. package/blog/2024-05-08-ethdam.md +169 -0
  13. package/blog/2024-05-22-the-origins-of-maci.md +38 -0
  14. package/blog/2024-05-28-upcoming-grants.md +85 -0
  15. package/blog/2024-06-17-understanding-maci.md +63 -0
  16. package/blog/2024-06-21-deciphering-maci.md +48 -0
  17. package/blog/2024-06-28-revolusioning-public-goods-funding.md +32 -0
  18. package/blog/2024-07-23-q2-review.md +72 -0
  19. package/blog/2024-07-30-roadmap-q3.md +61 -0
  20. package/blog/2024-08-10-maci-v2.md +102 -0
  21. package/blog/2024-08-29-anonymous-poll-joining.md +47 -0
  22. package/blog/2024-10-29-q3-review.md +63 -0
  23. package/blog/2024-11-20-maci-platform.md +93 -0
  24. package/blog/2024-12-01-maci-getting-started.md +294 -0
  25. package/blog/2025-03-21-roadmap-2025.md +112 -0
  26. package/blog/assets/MACI_Bob_SignUp_1.png +0 -0
  27. package/blog/assets/MACI_Bob_SignUp_2.png +0 -0
  28. package/blog/assets/MACI_Complex_Message.png +0 -0
  29. package/blog/assets/MACI_Contracts.png +0 -0
  30. package/blog/assets/MACI_Sign_Up.png +0 -0
  31. package/blog/assets/MACI_Simple_Message.png +0 -0
  32. package/blog/assets/MACI_Verifier_1.png +0 -0
  33. package/blog/authors.yml +5 -0
  34. package/docusaurus.config.ts +213 -0
  35. package/package.json +65 -0
  36. package/src/components/ActionCard/index.tsx +30 -0
  37. package/src/components/ActionCard/styles.module.css +96 -0
  38. package/src/components/HomepageFeatures/index.tsx +91 -0
  39. package/src/components/HomepageFeatures/styles.module.css +17 -0
  40. package/src/components/ProjectCard/index.tsx +74 -0
  41. package/src/components/ProjectCard/styles.module.css +77 -0
  42. package/src/components/ProjectList/index.tsx +218 -0
  43. package/src/components/ProjectList/styles.module.css +180 -0
  44. package/src/content/projects.json +294 -0
  45. package/src/css/card.module.css +130 -0
  46. package/src/css/custom.css +91 -0
  47. package/src/icons/IconDiscord.tsx +16 -0
  48. package/src/icons/IconGithub.tsx +16 -0
  49. package/src/icons/IconWebsite.tsx +16 -0
  50. package/src/pages/blogs.tsx +58 -0
  51. package/src/pages/index.module.css +152 -0
  52. package/src/pages/index.tsx +66 -0
  53. package/src/pages/projects.tsx +44 -0
  54. package/src/pages/roadmap.md +150 -0
  55. package/src/pages/typedoc.tsx +11 -0
  56. package/src/plugins/blog-plugin/index.ts +86 -0
  57. package/src/react-app-env.d.ts +1 -0
  58. package/src/scripts/setupSolidityDocs.ts +67 -0
  59. package/src/scripts/setupTypedoc.ts +112 -0
  60. package/src/scripts/utils.ts +115 -0
  61. package/src/utils/getProjectsByFilter.ts +40 -0
  62. package/static/.nojekyll +0 -0
  63. package/static/audit_reports/20210922_Hashcloak_audit_report.pdf +0 -0
  64. package/static/audit_reports/202220930_Hashcloak_audit_report.pdf +0 -0
  65. package/static/audit_reports/20240223_PSE_Audit_audit_report.pdf +0 -0
  66. package/static/audit_reports/20240731_PSE_Audit_audit_report.pdf +0 -0
  67. package/static/fonts/DM_Sans.woff2 +0 -0
  68. package/static/fonts/Share_Tech_Mono.woff2 +0 -0
  69. package/static/img/box.png +0 -0
  70. package/static/img/box_dark.png +0 -0
  71. package/static/img/chain.png +0 -0
  72. package/static/img/chain_dark.png +0 -0
  73. package/static/img/chart.png +0 -0
  74. package/static/img/chart_dark.png +0 -0
  75. package/static/img/circuits/MACI-Circuits.excalidraw +39652 -0
  76. package/static/img/circuits/calculateTotal.svg +21 -0
  77. package/static/img/circuits/ecdh.svg +21 -0
  78. package/static/img/circuits/messageToCommand.svg +21 -0
  79. package/static/img/circuits/messageValidator.svg +21 -0
  80. package/static/img/circuits/poseidonHasher13.svg +21 -0
  81. package/static/img/circuits/privToPubkey.svg +21 -0
  82. package/static/img/circuits/processMessages.svg +21 -0
  83. package/static/img/circuits/processMessagesInputHasher.svg +21 -0
  84. package/static/img/circuits/processMessages_2_0.svg +21 -0
  85. package/static/img/circuits/processOne.svg +21 -0
  86. package/static/img/circuits/processTopup.svg +21 -0
  87. package/static/img/circuits/processingAfterPollEnds.svg +21 -0
  88. package/static/img/circuits/quinBatchLeavesExists.svg +21 -0
  89. package/static/img/circuits/quinCheckRoot.svg +21 -0
  90. package/static/img/circuits/quinGeneratePathIndices.svg +21 -0
  91. package/static/img/circuits/quinSelector.svg +21 -0
  92. package/static/img/circuits/resultsCommitmentVerifier.svg +21 -0
  93. package/static/img/circuits/splicer.svg +21 -0
  94. package/static/img/circuits/tallyInputHasher.svg +21 -0
  95. package/static/img/circuits/tallyVotes.svg +21 -0
  96. package/static/img/circuits/unpackElement.svg +21 -0
  97. package/static/img/circuits/verifySignature.svg +21 -0
  98. package/static/img/completingAPoll.svg +4 -0
  99. package/static/img/contracts.svg +16 -0
  100. package/static/img/coordinatorComponents.svg +21 -0
  101. package/static/img/favicon.ico +0 -0
  102. package/static/img/generateProofs.svg +4 -0
  103. package/static/img/hero.svg +9 -0
  104. package/static/img/maci-card.png +0 -0
  105. package/static/img/maci-rpgf-design.jpg +0 -0
  106. package/static/img/messageProcessingLocal.svg +21 -0
  107. package/static/img/offlineProcessing.svg +21 -0
  108. package/static/img/pse-logo-round.png +0 -0
  109. package/static/img/relayer-diagram.png +0 -0
  110. package/static/img/tallyCommitments.svg +4 -0
  111. package/static/img/voteTallyingLocal.svg +21 -0
  112. package/tsconfig.json +34 -0
  113. package/versioned_docs/version-v0.x/circuits.md +22 -0
  114. package/versioned_docs/version-v0.x/contract.md +186 -0
  115. package/versioned_docs/version-v0.x/faq.md +67 -0
  116. package/versioned_docs/version-v0.x/introduction.md +119 -0
  117. package/versioned_docs/version-v0.x/quadratic-vote-tallying-circuit.md +138 -0
  118. package/versioned_docs/version-v0.x/state-root-transition-circuit.md +230 -0
  119. package/versioned_docs/version-v1.2/audit.md +160 -0
  120. package/versioned_docs/version-v1.2/ci-pipeline.md +38 -0
  121. package/versioned_docs/version-v1.2/circuits.md +508 -0
  122. package/versioned_docs/version-v1.2/cli.md +689 -0
  123. package/versioned_docs/version-v1.2/contracts.md +445 -0
  124. package/versioned_docs/version-v1.2/contributing/code-of-conduct.md +91 -0
  125. package/versioned_docs/version-v1.2/contributing/contributing.md +129 -0
  126. package/versioned_docs/version-v1.2/coordinator-processing.md +46 -0
  127. package/versioned_docs/version-v1.2/deployment.md +122 -0
  128. package/versioned_docs/version-v1.2/installation.md +175 -0
  129. package/versioned_docs/version-v1.2/integrating.md +200 -0
  130. package/versioned_docs/version-v1.2/introduction.md +94 -0
  131. package/versioned_docs/version-v1.2/key-change.md +182 -0
  132. package/versioned_docs/version-v1.2/overview.md +47 -0
  133. package/versioned_docs/version-v1.2/poll-types.md +68 -0
  134. package/versioned_docs/version-v1.2/primitives.md +216 -0
  135. package/versioned_docs/version-v1.2/project-ideas.md +14 -0
  136. package/versioned_docs/version-v1.2/purpose.md +62 -0
  137. package/versioned_docs/version-v1.2/solidity-docs/MACI.md +345 -0
  138. package/versioned_docs/version-v1.2/solidity-docs/MessageProcessor.md +266 -0
  139. package/versioned_docs/version-v1.2/solidity-docs/MessageProcessorFactory.md +26 -0
  140. package/versioned_docs/version-v1.2/solidity-docs/Poll.md +381 -0
  141. package/versioned_docs/version-v1.2/solidity-docs/PollFactory.md +50 -0
  142. package/versioned_docs/version-v1.2/solidity-docs/SignUpToken.md +27 -0
  143. package/versioned_docs/version-v1.2/solidity-docs/Subsidy.md +218 -0
  144. package/versioned_docs/version-v1.2/solidity-docs/SubsidyFactory.md +27 -0
  145. package/versioned_docs/version-v1.2/solidity-docs/Tally.md +311 -0
  146. package/versioned_docs/version-v1.2/solidity-docs/TallyFactory.md +27 -0
  147. package/versioned_docs/version-v1.2/solidity-docs/TallyNonQv.md +296 -0
  148. package/versioned_docs/version-v1.2/solidity-docs/TallyNonQvFactory.md +27 -0
  149. package/versioned_docs/version-v1.2/solidity-docs/TopupCredit.md +61 -0
  150. package/versioned_docs/version-v1.2/solidity-docs/VkRegistry.md +457 -0
  151. package/versioned_docs/version-v1.2/solidity-docs/benchmarks/HasherBenchmarks.md +44 -0
  152. package/versioned_docs/version-v1.2/solidity-docs/crypto/Hasher.md +125 -0
  153. package/versioned_docs/version-v1.2/solidity-docs/crypto/IVerifier.md +11 -0
  154. package/versioned_docs/version-v1.2/solidity-docs/crypto/MockVerifier.md +17 -0
  155. package/versioned_docs/version-v1.2/solidity-docs/crypto/Pairing.md +85 -0
  156. package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT3.md +9 -0
  157. package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT4.md +9 -0
  158. package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT5.md +9 -0
  159. package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT6.md +9 -0
  160. package/versioned_docs/version-v1.2/solidity-docs/crypto/SnarkCommon.md +16 -0
  161. package/versioned_docs/version-v1.2/solidity-docs/crypto/SnarkConstants.md +40 -0
  162. package/versioned_docs/version-v1.2/solidity-docs/crypto/Verifier.md +61 -0
  163. package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/EASGatekeeper.md +121 -0
  164. package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/FreeForAllSignUpGatekeeper.md +40 -0
  165. package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/SignUpGatekeeper.md +26 -0
  166. package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/SignUpTokenGatekeeper.md +93 -0
  167. package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/hatsGatekeepers/HatsGatekeeperBase.md +79 -0
  168. package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/hatsGatekeepers/HatsGatekeeperMultiple.md +48 -0
  169. package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/hatsGatekeepers/HatsGatekeeperSingle.md +42 -0
  170. package/versioned_docs/version-v1.2/solidity-docs/index.md +4 -0
  171. package/versioned_docs/version-v1.2/solidity-docs/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.md +40 -0
  172. package/versioned_docs/version-v1.2/solidity-docs/initialVoiceCreditProxy/InitialVoiceCreditProxy.md +26 -0
  173. package/versioned_docs/version-v1.2/solidity-docs/interfaces/IEAS.md +40 -0
  174. package/versioned_docs/version-v1.2/solidity-docs/interfaces/IHats.md +103 -0
  175. package/versioned_docs/version-v1.2/solidity-docs/interfaces/IMPFactory.md +26 -0
  176. package/versioned_docs/version-v1.2/solidity-docs/interfaces/IMessageProcessor.md +31 -0
  177. package/versioned_docs/version-v1.2/solidity-docs/interfaces/IPoll.md +217 -0
  178. package/versioned_docs/version-v1.2/solidity-docs/interfaces/IPollFactory.md +29 -0
  179. package/versioned_docs/version-v1.2/solidity-docs/interfaces/ITallyFactory.md +28 -0
  180. package/versioned_docs/version-v1.2/solidity-docs/interfaces/ITallySubsidyFactory.md +27 -0
  181. package/versioned_docs/version-v1.2/solidity-docs/interfaces/IVerifier.md +25 -0
  182. package/versioned_docs/version-v1.2/solidity-docs/interfaces/IVkRegistry.md +70 -0
  183. package/versioned_docs/version-v1.2/solidity-docs/mocks/MockHatsProtocol.md +133 -0
  184. package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueue.md +464 -0
  185. package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueBinary.md +60 -0
  186. package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueBinary0.md +40 -0
  187. package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueBinaryMaci.md +34 -0
  188. package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinary.md +75 -0
  189. package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinary0.md +40 -0
  190. package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinaryBlankSl.md +40 -0
  191. package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinaryMaci.md +40 -0
  192. package/versioned_docs/version-v1.2/solidity-docs/trees/EmptyBallotRoots.md +13 -0
  193. package/versioned_docs/version-v1.2/solidity-docs/utilities/CommonUtilities.md +25 -0
  194. package/versioned_docs/version-v1.2/solidity-docs/utilities/DomainObjs.md +40 -0
  195. package/versioned_docs/version-v1.2/solidity-docs/utilities/Params.md +36 -0
  196. package/versioned_docs/version-v1.2/solidity-docs/utilities/Utilities.md +79 -0
  197. package/versioned_docs/version-v1.2/spec.md +944 -0
  198. package/versioned_docs/version-v1.2/testing-in-detail.md +209 -0
  199. package/versioned_docs/version-v1.2/testing.md +472 -0
  200. package/versioned_docs/version-v1.2/topup.md +43 -0
  201. package/versioned_docs/version-v1.2/troubleshooting.md +51 -0
  202. package/versioned_docs/version-v1.2/trusted-setup.md +76 -0
  203. package/versioned_docs/version-v1.2/typedoc/cli/.nojekyll +1 -0
  204. package/versioned_docs/version-v1.2/typedoc/cli/index.md +15 -0
  205. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/AirdropArgs.md +89 -0
  206. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/DeployArgs.md +154 -0
  207. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/DeployPollArgs.md +154 -0
  208. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/DeployedContracts.md +130 -0
  209. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/GenLocalStateArgs.md +168 -0
  210. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/GenProofsArgs.md +388 -0
  211. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/IGenKeypairArgs.md +37 -0
  212. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/IRegisteredUserArgs.md +63 -0
  213. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/MergeMessagesArgs.md +76 -0
  214. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/MergeSignupsArgs.md +76 -0
  215. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/PollContracts.md +53 -0
  216. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/ProveOnChainArgs.md +128 -0
  217. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/PublishArgs.md +154 -0
  218. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/SignupArgs.md +89 -0
  219. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/SubsidyData.md +73 -0
  220. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/TallyData.md +166 -0
  221. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/TopupArgs.md +89 -0
  222. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/VerifyArgs.md +128 -0
  223. package/versioned_docs/version-v1.2/typedoc/cli/modules.md +556 -0
  224. package/versioned_docs/version-v1.2/typedoc/core/.nojekyll +1 -0
  225. package/versioned_docs/version-v1.2/typedoc/core/classes/MaciState.md +295 -0
  226. package/versioned_docs/version-v1.2/typedoc/core/classes/Poll.md +1098 -0
  227. package/versioned_docs/version-v1.2/typedoc/core/index.md +110 -0
  228. package/versioned_docs/version-v1.2/typedoc/core/interfaces/BatchSizes.md +50 -0
  229. package/versioned_docs/version-v1.2/typedoc/core/interfaces/IJsonMaciState.md +77 -0
  230. package/versioned_docs/version-v1.2/typedoc/core/interfaces/IProcessMessagesCircuitInputs.md +242 -0
  231. package/versioned_docs/version-v1.2/typedoc/core/interfaces/ISubsidyCircuitInputs.md +198 -0
  232. package/versioned_docs/version-v1.2/typedoc/core/interfaces/ITallyCircuitInputs.md +231 -0
  233. package/versioned_docs/version-v1.2/typedoc/core/interfaces/MaxValues.md +37 -0
  234. package/versioned_docs/version-v1.2/typedoc/core/interfaces/TreeDepths.md +63 -0
  235. package/versioned_docs/version-v1.2/typedoc/core/modules.md +289 -0
  236. package/versioned_docs/version-v1.2/typedoc/crypto/.nojekyll +1 -0
  237. package/versioned_docs/version-v1.2/typedoc/crypto/classes/AccQueue.md +770 -0
  238. package/versioned_docs/version-v1.2/typedoc/crypto/classes/G1Point.md +115 -0
  239. package/versioned_docs/version-v1.2/typedoc/crypto/classes/G2Point.md +140 -0
  240. package/versioned_docs/version-v1.2/typedoc/crypto/classes/IncrementalQuinTree.md +470 -0
  241. package/versioned_docs/version-v1.2/typedoc/crypto/index.md +44 -0
  242. package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/Keypair.md +33 -0
  243. package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/PoseidonFuncs.md +115 -0
  244. package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/Queue.md +33 -0
  245. package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/Signature.md +37 -0
  246. package/versioned_docs/version-v1.2/typedoc/crypto/modules.md +913 -0
  247. package/versioned_docs/version-v1.2/typedoc/domainobjs/.nojekyll +1 -0
  248. package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/Ballot.md +274 -0
  249. package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/Keypair.md +181 -0
  250. package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/Message.md +244 -0
  251. package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/PCommand.md +409 -0
  252. package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/PrivKey.md +206 -0
  253. package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/PubKey.md +289 -0
  254. package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/StateLeaf.md +340 -0
  255. package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/TCommand.md +200 -0
  256. package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/VerifyingKey.md +240 -0
  257. package/versioned_docs/version-v1.2/typedoc/domainobjs/index.md +81 -0
  258. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/ICommand.md +104 -0
  259. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IG1ContractParams.md +31 -0
  260. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IG2ContractParams.md +31 -0
  261. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonBallot.md +42 -0
  262. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonCommand.md +32 -0
  263. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonKeyPair.md +31 -0
  264. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonPCommand.md +111 -0
  265. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonStateLeaf.md +42 -0
  266. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonTCommand.md +67 -0
  267. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IMessageContractParams.md +31 -0
  268. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IStateLeaf.md +39 -0
  269. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IStateLeafContractParams.md +42 -0
  270. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IVkContractParams.md +64 -0
  271. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IVkObjectParams.md +108 -0
  272. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/Proof.md +46 -0
  273. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/VoteOptionTreeLeaf.md +24 -0
  274. package/versioned_docs/version-v1.2/typedoc/domainobjs/modules.md +110 -0
  275. package/versioned_docs/version-v1.2/typedoc/index.md +4 -0
  276. package/versioned_docs/version-v1.2/versioning.md +94 -0
  277. package/versioned_docs/version-v1.2/workflow.md +142 -0
  278. package/versioned_docs/version-v2.x/case-studies.md +35 -0
  279. package/versioned_docs/version-v2.x/contributing/_category_.json +4 -0
  280. package/versioned_docs/version-v2.x/contributing/code-of-conduct.md +92 -0
  281. package/versioned_docs/version-v2.x/contributing/contributing.md +149 -0
  282. package/versioned_docs/version-v2.x/contributing/project-ideas.md +78 -0
  283. package/versioned_docs/version-v2.x/core-concepts/_category_.json +4 -0
  284. package/versioned_docs/version-v2.x/core-concepts/ballot.md +19 -0
  285. package/versioned_docs/version-v2.x/core-concepts/coordinator-processing.md +46 -0
  286. package/versioned_docs/version-v2.x/core-concepts/hashing-and-encryption.md +45 -0
  287. package/versioned_docs/version-v2.x/core-concepts/key-change.md +179 -0
  288. package/versioned_docs/version-v2.x/core-concepts/maci-keys.md +84 -0
  289. package/versioned_docs/version-v2.x/core-concepts/maci-messages.md +44 -0
  290. package/versioned_docs/version-v2.x/core-concepts/merkle-trees.md +23 -0
  291. package/versioned_docs/version-v2.x/core-concepts/poll-types.md +106 -0
  292. package/versioned_docs/version-v2.x/core-concepts/spec.md +883 -0
  293. package/versioned_docs/version-v2.x/core-concepts/state-leaf.md +42 -0
  294. package/versioned_docs/version-v2.x/core-concepts/workflow.md +142 -0
  295. package/versioned_docs/version-v2.x/getting-started.md +313 -0
  296. package/versioned_docs/version-v2.x/guides/_category_.json +4 -0
  297. package/versioned_docs/version-v2.x/guides/compile-circuits.md +163 -0
  298. package/versioned_docs/version-v2.x/guides/frontend.md +99 -0
  299. package/versioned_docs/version-v2.x/guides/integrating.md +73 -0
  300. package/versioned_docs/version-v2.x/guides/maciWrapper.md +173 -0
  301. package/versioned_docs/version-v2.x/guides/subgraph.md +79 -0
  302. package/versioned_docs/version-v2.x/guides/testing/_category_.json +4 -0
  303. package/versioned_docs/version-v2.x/guides/testing/testing-in-detail.md +203 -0
  304. package/versioned_docs/version-v2.x/guides/testing/testing.md +163 -0
  305. package/versioned_docs/version-v2.x/guides/troubleshooting.md +161 -0
  306. package/versioned_docs/version-v2.x/introduction.md +146 -0
  307. package/versioned_docs/version-v2.x/processes/_category_.json +4 -0
  308. package/versioned_docs/version-v2.x/processes/ci-pipeline.md +38 -0
  309. package/versioned_docs/version-v2.x/processes/versioning.md +94 -0
  310. package/versioned_docs/version-v2.x/resources.md +33 -0
  311. package/versioned_docs/version-v2.x/security/_category_.json +4 -0
  312. package/versioned_docs/version-v2.x/security/audit.md +167 -0
  313. package/versioned_docs/version-v2.x/security/trusted-setup.md +166 -0
  314. package/versioned_docs/version-v2.x/supported-networks/_category_.json +4 -0
  315. package/versioned_docs/version-v2.x/supported-networks/deployed-contracts.md +1108 -0
  316. package/versioned_docs/version-v2.x/supported-networks/supported-networks.md +47 -0
  317. package/versioned_docs/version-v2.x/technical-references/_category_.json +4 -0
  318. package/versioned_docs/version-v2.x/technical-references/smart-contracts/AccQueue.md +21 -0
  319. package/versioned_docs/version-v2.x/technical-references/smart-contracts/Gatekeepers.md +40 -0
  320. package/versioned_docs/version-v2.x/technical-references/smart-contracts/MACI.md +152 -0
  321. package/versioned_docs/version-v2.x/technical-references/smart-contracts/MessageProcessor.md +13 -0
  322. package/versioned_docs/version-v2.x/technical-references/smart-contracts/Params.md +32 -0
  323. package/versioned_docs/version-v2.x/technical-references/smart-contracts/Poll.md +104 -0
  324. package/versioned_docs/version-v2.x/technical-references/smart-contracts/PollFactory.md +43 -0
  325. package/versioned_docs/version-v2.x/technical-references/smart-contracts/Tally.md +45 -0
  326. package/versioned_docs/version-v2.x/technical-references/smart-contracts/VkRegistry.md +57 -0
  327. package/versioned_docs/version-v2.x/technical-references/smart-contracts/VoiceCreditProxy.md +18 -0
  328. package/versioned_docs/version-v2.x/technical-references/smart-contracts/_category_.json +8 -0
  329. package/versioned_docs/version-v2.x/technical-references/technical-references.md +47 -0
  330. package/versioned_docs/version-v2.x/technical-references/typescript-code/_category_.json +4 -0
  331. package/versioned_docs/version-v2.x/technical-references/typescript-code/cli.md +699 -0
  332. package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/_category_.json +4 -0
  333. package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/processMessages.md +107 -0
  334. package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/setup.md +101 -0
  335. package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/tallyVotes.md +79 -0
  336. package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/utilities.md +131 -0
  337. package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +37 -0
  338. package/versioned_docs/version-v2.x/use-cases/_category_.json +4 -0
  339. package/versioned_docs/version-v2.x/use-cases/governance.md +18 -0
  340. package/versioned_docs/version-v2.x/use-cases/polling.md +10 -0
  341. package/versioned_docs/version-v2.x/use-cases/public-goods.md +65 -0
  342. package/versioned_docs/version-v3.x/case-studies.md +35 -0
  343. package/versioned_docs/version-v3.x/contributing/_category_.json +4 -0
  344. package/versioned_docs/version-v3.x/contributing/code-of-conduct.md +92 -0
  345. package/versioned_docs/version-v3.x/contributing/contributing.md +149 -0
  346. package/versioned_docs/version-v3.x/contributing/project-ideas.md +78 -0
  347. package/versioned_docs/version-v3.x/core-concepts/_category_.json +4 -0
  348. package/versioned_docs/version-v3.x/core-concepts/ballot.md +19 -0
  349. package/versioned_docs/version-v3.x/core-concepts/coordinator-processing.md +46 -0
  350. package/versioned_docs/version-v3.x/core-concepts/coordinator-service.md +16 -0
  351. package/versioned_docs/version-v3.x/core-concepts/hashing-and-encryption.md +45 -0
  352. package/versioned_docs/version-v3.x/core-concepts/key-change.md +179 -0
  353. package/versioned_docs/version-v3.x/core-concepts/maci-keys.md +84 -0
  354. package/versioned_docs/version-v3.x/core-concepts/maci-messages.md +44 -0
  355. package/versioned_docs/version-v3.x/core-concepts/merkle-trees.md +16 -0
  356. package/versioned_docs/version-v3.x/core-concepts/offchain-voting.md +14 -0
  357. package/versioned_docs/version-v3.x/core-concepts/poll-types.md +58 -0
  358. package/versioned_docs/version-v3.x/core-concepts/polls.md +81 -0
  359. package/versioned_docs/version-v3.x/core-concepts/spec.md +883 -0
  360. package/versioned_docs/version-v3.x/core-concepts/state-leaf.md +42 -0
  361. package/versioned_docs/version-v3.x/core-concepts/workflow.md +149 -0
  362. package/versioned_docs/version-v3.x/guides/_category_.json +4 -0
  363. package/versioned_docs/version-v3.x/guides/compile-circuits.md +175 -0
  364. package/versioned_docs/version-v3.x/guides/integrating.md +137 -0
  365. package/versioned_docs/version-v3.x/guides/subgraph.md +79 -0
  366. package/versioned_docs/version-v3.x/guides/testing/_category_.json +4 -0
  367. package/versioned_docs/version-v3.x/guides/testing/testing-in-detail.md +191 -0
  368. package/versioned_docs/version-v3.x/guides/testing/testing-introduction.md +158 -0
  369. package/versioned_docs/version-v3.x/guides/troubleshooting.md +161 -0
  370. package/versioned_docs/version-v3.x/introduction.md +153 -0
  371. package/versioned_docs/version-v3.x/processes/_category_.json +4 -0
  372. package/versioned_docs/version-v3.x/processes/ci-pipeline.md +38 -0
  373. package/versioned_docs/version-v3.x/processes/versioning.md +94 -0
  374. package/versioned_docs/version-v3.x/quick-start.md +318 -0
  375. package/versioned_docs/version-v3.x/resources.md +33 -0
  376. package/versioned_docs/version-v3.x/security/_category_.json +4 -0
  377. package/versioned_docs/version-v3.x/security/audit.md +167 -0
  378. package/versioned_docs/version-v3.x/security/trusted-setup.md +172 -0
  379. package/versioned_docs/version-v3.x/supported-networks/_category_.json +4 -0
  380. package/versioned_docs/version-v3.x/supported-networks/deployed-contracts.md +112 -0
  381. package/versioned_docs/version-v3.x/supported-networks/supported-networks.md +53 -0
  382. package/versioned_docs/version-v3.x/technical-references/_category_.json +4 -0
  383. package/versioned_docs/version-v3.x/technical-references/coordinator-service/_category_.json +8 -0
  384. package/versioned_docs/version-v3.x/technical-references/coordinator-service/index.md +10 -0
  385. package/versioned_docs/version-v3.x/technical-references/coordinator-service/installation.md +43 -0
  386. package/versioned_docs/version-v3.x/technical-references/offchain-relayer/_category_.json +8 -0
  387. package/versioned_docs/version-v3.x/technical-references/offchain-relayer/index.md +51 -0
  388. package/versioned_docs/version-v3.x/technical-references/offchain-relayer/installation.md +109 -0
  389. package/versioned_docs/version-v3.x/technical-references/smart-contracts/MACI.md +160 -0
  390. package/versioned_docs/version-v3.x/technical-references/smart-contracts/MessageProcessor.md +13 -0
  391. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Params.md +33 -0
  392. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Policies.md +39 -0
  393. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Poll.md +170 -0
  394. package/versioned_docs/version-v3.x/technical-references/smart-contracts/PollFactory.md +33 -0
  395. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Tally.md +43 -0
  396. package/versioned_docs/version-v3.x/technical-references/smart-contracts/VkRegistry.md +62 -0
  397. package/versioned_docs/version-v3.x/technical-references/smart-contracts/VoiceCreditProxy.md +18 -0
  398. package/versioned_docs/version-v3.x/technical-references/smart-contracts/_category_.json +8 -0
  399. package/versioned_docs/version-v3.x/technical-references/technical-references.md +48 -0
  400. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/_category_.json +4 -0
  401. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/joinPoll.md +53 -0
  402. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/processMessages.md +106 -0
  403. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/setup.md +96 -0
  404. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/tallyVotes.md +79 -0
  405. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/utilities.md +131 -0
  406. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +42 -0
  407. package/versioned_docs/version-v3.x/use-cases/_category_.json +4 -0
  408. package/versioned_docs/version-v3.x/use-cases/governance.md +18 -0
  409. package/versioned_docs/version-v3.x/use-cases/polling.md +10 -0
  410. package/versioned_docs/version-v3.x/use-cases/public-goods.md +65 -0
  411. package/versioned_sidebars/version-v0.x-sidebars.json +8 -0
  412. package/versioned_sidebars/version-v1.2-sidebars.json +8 -0
  413. package/versioned_sidebars/version-v2.x-sidebars.json +8 -0
  414. package/versioned_sidebars/version-v3.x-sidebars.json +8 -0
  415. package/versions.json +1 -0
@@ -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: 16
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
+ ![components involved](/img/coordinatorComponents.svg)
19
+
20
+ ## What does the process look like?
21
+
22
+ ![processing](/img/offlineProcessing.svg)
23
+
24
+ Zooming in..
25
+
26
+ **Message processing**
27
+
28
+ ![message processing](/img/messageProcessingLocal.svg)
29
+
30
+ **Vote tallying**
31
+
32
+ ![vote tallying](/img/voteTallyingLocal.svg)
33
+
34
+ ## What does the process look like when including the zk-SNARK proofs
35
+
36
+ **Process of completing a Poll**
37
+
38
+ ![processing with proofs](/img/completingAPoll.svg)
39
+
40
+ **Process of generating proofs**
41
+
42
+ ![generating proofs](/img/generateProofs.svg)
43
+
44
+ **Tally commitments**
45
+
46
+ ![tally commitments](/img/tallyCommitments.svg)
@@ -0,0 +1,122 @@
1
+ ---
2
+ title: MACI Deployment
3
+ description: MACI Smart Contracts deployment
4
+ sidebar_label: MACI deployment
5
+ sidebar_position: 24
6
+ ---
7
+
8
+ # MACI Deployment
9
+
10
+ Currently, it is possible to deploy MACI contracts in two ways:
11
+
12
+ - using the cli (`maci-cli`)
13
+ - using the hardhat tasks inside the `maci-contracts` package
14
+
15
+ ## MACI Deployment Steps
16
+
17
+ In order, these are the steps for contract deployment:
18
+
19
+ 1. Deploy crypto (Hasher, Poseidon)
20
+ 2. Deploy VK Registry
21
+ 3. Set verification keys
22
+ 4. Deploy VoiceCreditProxy
23
+ 5. Deploy Gatekeeper
24
+ 6. Deploy Verifier
25
+ 7. Deploy Topup credit
26
+ 8. Deploy MessageProcessorFactory, PollFactory, SubsidyFactory, TallyFactory
27
+ 9. Deploy MACI, AccQueueQuinaryMaci
28
+ 10. Deploy Poll, AccQueueQuinaryMaci, MessageProcessor, Tally and Subsidy (optional)
29
+
30
+ ### Note on ZKey artifacts
31
+
32
+ For testing purposes, you can use the test zkeys and artifacts that you can download using `pnpm download:test-zkeys`. For production use, you can download the most recent artifacts that have undergone a trusted setup. Please refer to the [Trusted Setup](/docs/v1.2/trusted-setup) section for more information. To download those, please use `pnpm download:ceremony-zkeys`.
33
+
34
+ Please do not use test artifacts in production. If you do require zKeys configured for larger param sizes, please reach out to us if you will be using them in production and we'll discuss running a new ceremony for those parameters. To build new circuits artifacts for testing purposes, please refer to the [installation page](/docs/v1.2/installation/#configure-circomkit) and to the [circuits](/docs/v1.2/circuits) section.
35
+
36
+ ### Deployment using `maci-cli`
37
+
38
+ ```bash
39
+ maci-cli deployVkRegistry
40
+ maci-cli setVerifyingKeys \
41
+ --state-tree-depth 10 \
42
+ --int-state-tree-depth 1 \
43
+ --msg-tree-depth 2 \
44
+ --vote-option-tree-depth 2 \
45
+ --msg-batch-depth 1 \
46
+ --process-messages-zkey ./zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test.0.zkey \
47
+ --tally-votes-zkey ./zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test.0.zkey
48
+ maci-cli create --stateTreeDepth 10 --use-quadratic-voting true
49
+ maci-cli deployPoll \
50
+ --pubkey coordinator-public-key \
51
+ --duration 300 \
52
+ --int-state-tree-depth 1 \
53
+ --msg-tree-depth 2 \
54
+ --msg-batch-depth 1 \
55
+ --vote-option-tree-depth 2 \
56
+ --subsidy-enabled false
57
+ ```
58
+
59
+ :::info
60
+ For quadratic voting polls, you can use the `--use-quadratic-voting true` flag when creating the MACI instance.
61
+ For non-quadratic voting polls, you can use the `--use-quadratic-voting false` flag when creating the MACI instance.
62
+ :::
63
+
64
+ ### Deployment using `maci-contracts` hardhat tasks
65
+
66
+ 1. Take the `deploy-config-example.json` file and copy it over to `deploy-config.json`
67
+ 2. Update the fields as necessary:
68
+
69
+ ```json
70
+ {
71
+ "sepolia": {
72
+ "ConstantInitialVoiceCreditProxy": {
73
+ "deploy": true,
74
+ "amount": 99
75
+ },
76
+ "FreeForAllGatekeeper": {
77
+ "deploy": false
78
+ },
79
+ "EASGatekeeper": {
80
+ "deploy": true,
81
+ "easAddress": "0xC2679fBD37d54388Ce493F1DB75320D236e1815e",
82
+ "schema": "0xe2636f31239f7948afdd9a9c477048b7fc2a089c347af60e3aa1251e5bf63e5c",
83
+ "attester": "attester-address"
84
+ },
85
+ "MACI": {
86
+ "stateTreeDepth": 10,
87
+ "gatekeeper": "EASGatekeeper"
88
+ },
89
+ "VkRegistry": {
90
+ "stateTreeDepth": 10,
91
+ "intStateTreeDepth": 1,
92
+ "messageTreeDepth": 2,
93
+ "voteOptionTreeDepth": 2,
94
+ "messageBatchDepth": 1,
95
+ "processMessagesZkey": "../cli/zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test.0.zkey",
96
+ "tallyVotesZkey": "../cli/zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test.0.zkey"
97
+ },
98
+ "Poll": {
99
+ "pollDuration": 30,
100
+ "coordinatorPubkey": "macipk.ea638a3366ed91f2e955110888573861f7c0fc0bb5fb8b8dca9cd7a08d7d6b93",
101
+ "subsidyEnabled": false,
102
+ "useQuadraticVoting": true
103
+ }
104
+ }
105
+ }
106
+ ```
107
+
108
+ 3. Fill the `.env` file with the appropriate data (you will find an example in the `.env.example` file:
109
+ - your mnemonic
110
+ - an RPC key
111
+ 4. Run `pnpm deploy` to deploy the contracts (you can specify the network by appending `:network` to the command, e.g. `pnpm deploy:sepolia` - please refer to the available networks on the `package.json` scripts section)
112
+ 5. Run `pnpm deploy-poll` to deploy your first Poll (you can specify the network by appending `:network` to the command, e.g. `pnpm deploy-poll:sepolia` - please refer to the available networks on the `package.json` scripts section)
113
+
114
+ :::info
115
+ Should you wish to deploy on a different network, you will need to update the [contracts/tasks/helpers/constants.ts](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/tasks/helpers/constants.ts) file.
116
+ :::
117
+
118
+ 6. You will find all of the deployed contracts addresses and configs in the `deployed-contracts.json` file inside the contracts folder.
119
+
120
+ :::info
121
+ You can find more information on integration and usage in the [Integrating MACI](/docs/v1.2/integrating) section.
122
+ :::
@@ -0,0 +1,175 @@
1
+ ---
2
+ title: Installing MACI
3
+ description: How to install MACI
4
+ sidebar_label: Installation
5
+ sidebar_position: 5
6
+ ---
7
+
8
+ # Installation
9
+
10
+ ## Requirements
11
+
12
+ You need the following to use MACI:
13
+
14
+ - Node.js: use [`nvm`](https://github.com/nvm-sh/nvm) to install it. MACI has
15
+ been tested with Node 14, 16, 18 and 20. We do however recommend to use Node 18 or Node 20 as Node 14 is deprecated and Node 16 will soon be deprecated too.
16
+ - The [`rapidsnark`](https://github.com/iden3/rapidsnark) tool if running on an intel chip (this allows for faster proof generation vs snarkjs).
17
+
18
+ > Note that MACI works on Linux and MacOS. It has not been tested on Windows, however it should work on Windows Subsystem for Linux (WSL). Keep in mind that when using MACI e2e on a non intel chip, tests will run using snarkjs with WASM. This will result in slower proof generation.
19
+
20
+ ## Installation
21
+
22
+ ### Install `rapidsnark` (if on an intel chip)
23
+
24
+ First, install dependencies:
25
+
26
+ ```bash
27
+ sudo apt-get install build-essential cmake libgmp-dev libsodium-dev nasm curl m4
28
+ ```
29
+
30
+ If you're running on **MacOS with an intel chip**, install dependencies by running the following command:
31
+
32
+ ```bash
33
+ brew install cmake gmp libsodium nasm
34
+ ```
35
+
36
+ Next, clone `rapidsnark` and build it:
37
+
38
+ ```bash
39
+ git clone https://github.com/iden3/rapidsnark.git && \
40
+ cd rapidsnark
41
+
42
+ pnpm install && \
43
+ git submodule init && \
44
+ git submodule update && \
45
+ ./build_gmp.sh host && \
46
+ mkdir build_prover && cd build_prover && \
47
+ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../package && \
48
+ make -j4 && make install
49
+ ```
50
+
51
+ Note the location of the `rapidsnark` binary (e.g.
52
+ `/home/user/rapidsnark/build/prover`).
53
+
54
+ For more information, please check rapidsnark [github repo](https://github.com/iden3/rapidsnark)
55
+
56
+ ### Install circom v2:
57
+
58
+ https://docs.circom.io/
59
+
60
+ Note the location of the `circom` binary (e.g. `$HOME/.cargo/bin/circom`), as you will need it later.
61
+
62
+ ### Install MACI
63
+
64
+ ```bash
65
+ git clone https://github.com/privacy-scaling-explorations/maci.git && \
66
+ cd maci && \
67
+ pnpm i && \
68
+ pnpm run build
69
+ ```
70
+
71
+ #### On Intel chips (no ARM64)
72
+
73
+ Install dependencies:
74
+
75
+ ```bash
76
+ sudo apt-get install libgmp-dev nlohmann-json3-dev nasm g++
77
+ ```
78
+
79
+ :::info
80
+ Remember that if on a ARM64 chip, you will not be able to compile the c++ witness generator and thus use rapidsnark. Please follow instructions for WASM artifacts, in case you decide to recompile artifacts.
81
+ :::
82
+
83
+ ### Decide whether you need to compile new circuits or use the test ones
84
+
85
+ If you are going to be making any changes to the circom circuits, then the following will apply to you. Otherwise, you can skip to the [Download `.zkey` files](#download-zkey-files-if-you-would-like-to-use-the-default-parameters-or-the-trusted-setup-artifacts) section.
86
+
87
+ #### Configure circomkit
88
+
89
+ Edit `circuits/circom/circuits` to include the circuits you would like to compile. This comes already configured with the three main circuits and with testing parameters:
90
+
91
+ ```json
92
+ {
93
+ "ProcessMessages_10-2-1-2_test": {
94
+ "file": "processMessages",
95
+ "template": "ProcessMessages",
96
+ "params": [10, 2, 1, 2],
97
+ "pubs": ["inputHash"]
98
+ },
99
+ "ProcessMessagesNonQv_10-2-1-2_test": {
100
+ "file": "processMessagesNonQv",
101
+ "template": "ProcessMessagesNonQv",
102
+ "params": [10, 2, 1, 2],
103
+ "pubs": ["inputHash"]
104
+ },
105
+ "TallyVotes_10-1-2_test": {
106
+ "file": "tallyVotes",
107
+ "template": "TallyVotes",
108
+ "params": [10, 1, 2],
109
+ "pubs": ["inputHash"]
110
+ },
111
+ "TallyVotesNonQv_10-1-2_test": {
112
+ "file": "tallyVotesNonQv",
113
+ "template": "TallyVotesNonQv",
114
+ "params": [10, 1, 2],
115
+ "pubs": ["inputHash"]
116
+ }
117
+ }
118
+ ```
119
+
120
+ ### Generate `.zkey` files
121
+
122
+ If you wish to generate `.zkey` files from scratch, first navigate to `circuits/circom`
123
+ and edit `circuits.json`. Set the parameters you need.
124
+
125
+ Next, run the following to compile the circuits with parameters you specified:
126
+
127
+ **for the c++ witness generator**
128
+
129
+ ```bash
130
+ pnpm test:circuits-c
131
+ ```
132
+
133
+ **for the wasm witness generator**
134
+
135
+ ```bash
136
+ pnpm build:circuits-wasm
137
+ ```
138
+
139
+ Finally, generate the `.zkey` files. This may require a lot of memory and time.
140
+
141
+ ```bash
142
+ pnpm setup:zkeys
143
+ ```
144
+
145
+ > If on a ARM64 chip, the above will work with the wasm witness only. The errors you will get for the c++ witness are:
146
+ >
147
+ > ```bash
148
+ > main.cpp:9:10: fatal error: 'nlohmann/json.hpp' file not found
149
+ > #include <nlohmann/json.hpp>
150
+ > ^~~~~~~~~~~~~~~~~~~
151
+ > 1 error generated.
152
+ > ```
153
+
154
+ ### Download `.zkey` files (if you would like to use the default parameters or the trusted setup artifacts)
155
+
156
+ MACI has two main zk-SNARK circuits (plus an optional Subsidy circuit). Each circuit is parameterised. There should be one
157
+ `.zkey` file for each circuit and set of parameters.
158
+
159
+ Unless you wish to generate a fresh set of `.zkey` files, you should obtain
160
+ them from someone who has performed a multi-party trusted setup for said
161
+ circuits. For more details on which artifacts have undergone a trusted setup, please refer to the [Trusted Setup](/docs/v1.2/trusted-setup) page.
162
+
163
+ Note the locations of the `.zkey` files as the CLI requires them as command-line flags.
164
+
165
+ **Download test artifacts**
166
+
167
+ ```bash
168
+ pnpm download:test-zkeys
169
+ ```
170
+
171
+ **Download ceremony artifacts**
172
+
173
+ ```bash
174
+ pnpm download:ceremony-zkeys
175
+ ```
@@ -0,0 +1,200 @@
1
+ ---
2
+ title: Integrating MACI
3
+ description: How to integrate MACI into your application
4
+ sidebar_label: Integrating
5
+ sidebar_position: 13
6
+ ---
7
+
8
+ # Integrating MACI
9
+
10
+ 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).
11
+
12
+ Here we will be looking at QFI and how it was used. 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.
13
+
14
+ ## Deployment
15
+
16
+ First, you need to deploy contracts to start using MACI. This can be easily done via `maci-cli`.
17
+ Deployment order is:
18
+
19
+ 1. Deploy crypto (Hasher, Poseidon)
20
+ 2. Deploy VK Registry
21
+ 3. Set verification keys
22
+ 4. Deploy VoiceCreditProxy
23
+ 5. Deploy Gatekeeper
24
+ 6. Deploy Verifier
25
+ 7. Deploy Topup credit
26
+ 8. Deploy MessageProcessorFactory, PollFactory, SubsidyFactory, TallyFactory
27
+ 9. Deploy MACI, AccQueueQuinaryMaci
28
+ 10. Deploy Poll, AccQueueQuinaryMaci, MessageProcessor, Tally and Subsidy (optional)
29
+
30
+ Before running the deploy command make sure you have [zkey files](/docs/v1.2/trusted-setup) from trusted setup and env variables `ETH_PROVIDER` (RPC endpoint) and `ETH_SK` (wallet private key) are set. For production environment make sure you don't use zkey files from our examples.
31
+
32
+ :::note Non Quadratic Voting
33
+
34
+ Make sure that if you intend to run a non quadratic voting Poll, you set the **NonQv** zKey files on the VkRegistry contract, as well as deploy the Poll with the option `--use-quadratic-voting false`. Finally, remember to use the correct zk-SNARK artifacts (zKeys, and witnesses) in the genProof/prove commands.
35
+
36
+ :::
37
+
38
+ ```bash
39
+ maci-cli deployVkRegistry
40
+ maci-cli setVerifyingKeys \
41
+ --state-tree-depth 10 \
42
+ --int-state-tree-depth 1 \
43
+ --msg-tree-depth 2 \
44
+ --vote-option-tree-depth 2 \
45
+ --msg-batch-depth 1 \
46
+ --process-messages-zkey ./zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test.0.zkey \
47
+ --tally-votes-zkey ./zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test.0.zkey
48
+ maci-cli create --stateTreeDepth 10 --use-quadratic-voting true
49
+ maci-cli deployPoll \
50
+ --pubkey coordinator-public-key \
51
+ --duration 30 \
52
+ --int-state-tree-depth 1 \
53
+ --msg-tree-depth 2 \
54
+ --msg-batch-depth 1 \
55
+ --vote-option-tree-depth 2 \
56
+ --subsidy-enabled false
57
+ ```
58
+
59
+ ## Signups and votes
60
+
61
+ Next, you can start accept user signup and votes. This can be done via `maci-cli` as well:
62
+
63
+ ```bash
64
+ maci-cli signup \
65
+ --pubkey user-public-key
66
+ maci-cli publish \
67
+ --pubkey user-public-key \
68
+ --privkey user-private-key \
69
+ --state-index 1 \
70
+ --vote-option-index 0 \
71
+ --new-vote-weight 9 \
72
+ --nonce 1 \
73
+ --poll-id 0
74
+ ```
75
+
76
+ ## Poll finalization
77
+
78
+ As a coordinator, first you need to merge signups and messages (votes). Signups and messages are stored in a queue so when the poll in over, the coordinator needs to create the tree from the queue. This optimization is needed to reduce gas cost for voters. Then coordinator generates proofs for the message processing, tally and subsidy calculations. This allows to publish the poll results on-chain and then everyone can verify the results when the poll is over.
79
+
80
+ ```bash
81
+ maci-cli mergeSignups --poll-id 0
82
+ maci-cli mergeMessages --poll-id 0
83
+ maci-cli genProofs \
84
+ --privkey coordinator-private-key \
85
+ --poll-id 0 \
86
+ --process-zkey ./zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test.0.zkey \
87
+ --tally-zkey ./zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test.0.zkey \
88
+ --tally-file tally.json \
89
+ --output proofs/ \
90
+ --tally-wasm ./zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test_js/TallyVotes_10-1-2_test.wasm \
91
+ --process-wasm ./zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test_js/ProcessMessages_10-2-1-2_test.wasm \
92
+ --wasm
93
+ maci-cli proveOnChain \
94
+ --poll-id 0 \
95
+ --proof-dir proofs/ \
96
+ --subsidy-enabled false
97
+ maci-cli verify \
98
+ --poll-id 0 \
99
+ --subsidy-enabled false \
100
+ --tally-file tally.json # this file is generated in genProofs
101
+ ```
102
+
103
+ ## MACI Contract
104
+
105
+ The MACI contract is the core of the protocol. Contracts can inherit from MACI and thus expose the signup and topup functions. As with standalone MACI, one would need to deploy a [sign up gatekeeper](/docs/v1.2/contracts#signupgatekeeper) as well as the [voice credit proxy](/docs/v1.2/contracts#voicecreditproxy).
106
+
107
+ As an example, within the quadratic funding infrastructure project, the QFI contract inherits from MACI and allows sign up via the contribute function.
108
+
109
+ ```javascript
110
+ function contribute(
111
+ PubKey calldata pubKey,
112
+ uint256 amount
113
+ ) external {
114
+
115
+ [..snip]
116
+
117
+ uint256 voiceCredits = amount / voiceCreditFactor;
118
+ // The user is marked as registered here upon contribution
119
+ grantRoundToContributors[nextGrantRoundId][msg.sender] = ContributorStatus(voiceCredits, true);
120
+
121
+ // Increase the number of contributors for this round
122
+ grantRoundToContributorsCount[nextGrantRoundId]++;
123
+
124
+ bytes memory signUpGatekeeperAndInitialVoiceCreditProxyData = abi.encode(
125
+ msg.sender,
126
+ voiceCredits
127
+ );
128
+
129
+ signUp(
130
+ pubKey,
131
+ signUpGatekeeperAndInitialVoiceCreditProxyData,
132
+ signUpGatekeeperAndInitialVoiceCreditProxyData
133
+ );
134
+
135
+ [..snip]
136
+
137
+ emit ContributionSent(msg.sender, amount);
138
+ }
139
+ ```
140
+
141
+ ## InitialVoiceCreditProxy
142
+
143
+ 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.
144
+
145
+ ```javascript
146
+ // SPDX-License-Identifier: MIT
147
+ pragma solidity ^0.8.10;
148
+
149
+ import { InitialVoiceCreditProxy } from "./InitialVoiceCreditProxy.sol";
150
+
151
+ /// @title ConstantInitialVoiceCreditProxy
152
+ /// @notice This contract allows to set a constant initial voice credit balance
153
+ /// for MACI's voters.
154
+ contract ConstantInitialVoiceCreditProxy is InitialVoiceCreditProxy {
155
+ /// @notice the balance to be returned by getVoiceCredits
156
+ uint256 internal balance;
157
+
158
+ /// @notice creates a new ConstantInitialVoiceCreditProxy
159
+ /// @param _balance the balance to be returned by getVoiceCredits
160
+ constructor(uint256 _balance) payable {
161
+ balance = _balance;
162
+ }
163
+
164
+ /// @notice Returns the constant balance for any new MACI's voter
165
+ /// @return balance
166
+ function getVoiceCredits(address, bytes memory) public view override returns (uint256) {
167
+ return balance;
168
+ }
169
+ }
170
+ ```
171
+
172
+ ## Subsidy
173
+
174
+ It's also possible to use subsidy feature when coordinator deploys polls, proves poll results on-chain and when poll results are verified. This contract is used to verify that the subsidy calculations are correct. It is also used to update the subsidy commitment if the proof is valid. To enable this feature just provide `--subsidy-enabled` or `-se` for `maci-cli` commands (`deployPoll`, `proveOnChain`, `verify`).
175
+
176
+ ## Poll Contract
177
+
178
+ On the other hand, the Poll contract can be inherited to expose functionality such as top ups and publishing of messages/commands.
179
+
180
+ For instance, within QFI, the `publishMessageBatch` function call the `publishMessage` function of Poll, as shown below:
181
+
182
+ ```javascript
183
+ function publishMessageBatch(
184
+ Message[] calldata _messages,
185
+ PubKey[] calldata _encPubKeys
186
+ ) external {
187
+ // Check that the two arrays have the same length
188
+ require(
189
+ _messages.length == _encPubKeys.length,
190
+ "GrantRound: _messages and _encPubKeys should be the same length"
191
+ );
192
+
193
+ uint256 batchSize = _messages.length;
194
+ for (uint8 i = 0; i < batchSize; ++i) {
195
+ publishMessage(_messages[i], _encPubKeys[i]);
196
+ }
197
+
198
+ emit Voted(msg.sender);
199
+ }
200
+ ```
@@ -0,0 +1,94 @@
1
+ ---
2
+ title: Introduction to MACI
3
+ description: High-level introduction to Minimum Anti-Collusion Infrastructure (MACI)
4
+ sidebar_label: Introduction
5
+ sidebar_position: 1
6
+ ---
7
+
8
+ :::info
9
+ For a more secure and stable protocol, please refer to MACI v3.x
10
+ :::
11
+
12
+ # Welcome to MACI
13
+
14
+ ![MACI card](/img/maci-card.png)
15
+
16
+ ## Introduction
17
+
18
+ **Minimal Anti-Collusion Infrastructure (MACI)** is an open-source public good that serves as infrastructure for private on-chain voting.
19
+
20
+ MACI is an Ethereum application that provides privacy and collusion resistance for on-chain voting, both in a [quadratic](https://vitalik.eth.limo/general/2019/12/07/quadratic.html) and non-quadratic fashion. A common problem among today’s on-chain voting (or public good funding) processes is how easy it is to bribe voters into voting for a particular option. Since all transactions on the blockchain are public by default, without MACI, voters can easily prove to the briber which option they voted for and therefore receive the bribe rewards.
21
+
22
+ MACI counters this problem by using encryption and zero-knowledge proofs (zk-SNARKs) to hide how each person voted while still publicly revealing the final result. User’s cannot prove which option they voted for, and therefore bribers cannot reliably trust that a user voted for their preferred option. For example, a voter can tell a briber that they are voting for option A, but in reality they voted for option B. There is no reliable way to prove which option the voter actually voted for, so the briber has less incentive to pay voters to vote their way.
23
+
24
+ Applications like [clr.fund](https://clr.fund/) build atop MACI to increase
25
+ user privacy and discourage collusion or bribery for public goods funding.
26
+
27
+ ## Features
28
+
29
+ MACI offers the following guarantees:
30
+
31
+ | Property | Description |
32
+ | ------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
33
+ | **Collusion Resistance** | No one except a trusted coordinator should be certain of the validity of a vote, reducing the effectiveness of bribery. |
34
+ | **Receipt-freeness** | No one can prove (besides to the coordinator) which way they voted. |
35
+ | **Privacy** | No one except a trusted coordinator should be able to decrypt a vote. |
36
+ | **Uncensorability** | No one — not even the trusted coordinator, should be able to censor a vote. |
37
+ | **Unforgeability** | Only the owner of a user's private key may cast a vote tied to its corresponding public key. |
38
+ | **Non-repudiation** | No one may modify or delete a vote after it is cast, although a user may cast another vote to nullify it. |
39
+ | **Correct execution** | No one, not even the trusted coordinator, should be able to produce a false tally of votes. |
40
+
41
+ Under the hood, MACI uses Ethereum smart contracts, ECDH encryption, and zero-knowledge proofs.
42
+ It inherits security and uncensorability from the underlying Ethereum
43
+ blockchain, ensures unforgeability via asymmetric encryption, and achieves
44
+ collusion resistance, privacy, and correct execution via zk-SNARK proofs.
45
+
46
+ The participants of a MACI voting process are: 1) the voters and 2) a trusted coordinator. The coordinator is in charge of setting up the system, deploying polls, and computing the tally of the votes. Through smart contracts and ZK-proofs, MACI ensures that everything is done in a fair manner. Although MACI can provide collusion resistance only if the coordinator is honest, a dishonest coordinator can neither censor nor tamper with its execution.
47
+
48
+ Note that MACI presumes an identity system where each legitimate member
49
+ controls a unique Ethereum private key.
50
+
51
+ For information on MACI's latest features, please check out our [MACI v1.2.0 release post](/blog/maci-v1-2-0-release).
52
+
53
+ ## Background
54
+
55
+ MACI was originally proposed by Vitalik Buterin in [this ethresear.ch
56
+ post](https://ethresear.ch/t/minimal-anti-collusion-infrastructure/5413) and has been maintained and improved since thanks to support from the Ethereum Foundation. For a general overview, the history and the importance of MACI, see [Release Announcement: MACI 1.0](/blog/maci-1-0-release) by Wei Jie, one of the creators. He also created a helpful [overview of MACI video](https://www.youtube.com/watch?v=sKuNj_IQVYI). Kyle Charbonnet wrote a great [Technical Introduction to MACI 1.0](/blog/maci-1-0-technical-introduction) that provides a walkthrough on how MACI operates.
57
+
58
+ ## Credits
59
+
60
+ MACI is a public good infrastructure that is supported by the [Ethereum Foundation](https://ethereum.foundation/) within [Privacy &amp; Scaling Explorations (PSE)](https://pse.dev/). It's also continuously improved by our open source community! Many people have contributed to MACI, but below are some notable contributors.
61
+
62
+ **[MACI v1.0](/blog/maci-1-0-release) was originally developed by:**
63
+
64
+ - [Barry WhiteHat](https://github.com/barryWhiteHat)
65
+ - [Cory Dickson](https://github.com/corydickson)
66
+ - [Chih-Cheng Liang](https://twitter.com/ChihChengLiang)
67
+ - [Han Jian](https://han0110.github.io/)
68
+ - [Kendrick Tan](https://kndrck.co/)
69
+ - [Kirill Goncharov](https://github.com/xuhcc)
70
+ - [Kobi Gurkan](http://kobi.one/)
71
+ - [Koh Wei Jie](https://kohweijie.com)
72
+ - [Samuel Gosling](https://twitter.com/xGozzy)
73
+
74
+ **[MACI v1.1.1](/blog/maci-v1-1-1-release) was primarily developed by:**
75
+
76
+ - [ctrlc03](https://github.com/ctrlc03)
77
+ - [chaosma](https://github.com/chaosma)
78
+ - [baumstern](https://github.com/baumstern)
79
+ - [daodesigner](https://github.com/daodesigner)
80
+ - [0xjei](https://github.com/0xjei)
81
+
82
+ **Currently, MACI (v1.2.0 and beyond) is maintained and continuously improved by a core development team:**
83
+
84
+ - [ctrlc03](https://github.com/ctrlc03)
85
+ - [samajammin](https://github.com/samajammin)
86
+ - [0xmad](https://github.com/0xmad)
87
+ - [kittybest](https://github.com/kittybest)
88
+ - [crisgarner](https://github.com/crisgarner)
89
+
90
+ Our core team continues to work on improving the protocol and its documentation with help from our open source community.
91
+
92
+ :::info
93
+ If you are using one of the previous versions of MACI, see the [MACI v0.x](/docs/v0.x/introduction) documentation.
94
+ :::