@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.
Files changed (406) 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/tallyCommitments.svg +4 -0
  110. package/static/img/voteTallyingLocal.svg +21 -0
  111. package/tsconfig.json +34 -0
  112. package/versioned_docs/version-v0.x/circuits.md +22 -0
  113. package/versioned_docs/version-v0.x/contract.md +186 -0
  114. package/versioned_docs/version-v0.x/faq.md +67 -0
  115. package/versioned_docs/version-v0.x/introduction.md +119 -0
  116. package/versioned_docs/version-v0.x/quadratic-vote-tallying-circuit.md +138 -0
  117. package/versioned_docs/version-v0.x/state-root-transition-circuit.md +230 -0
  118. package/versioned_docs/version-v1.2/audit.md +160 -0
  119. package/versioned_docs/version-v1.2/ci-pipeline.md +38 -0
  120. package/versioned_docs/version-v1.2/circuits.md +508 -0
  121. package/versioned_docs/version-v1.2/cli.md +689 -0
  122. package/versioned_docs/version-v1.2/contracts.md +445 -0
  123. package/versioned_docs/version-v1.2/contributing/code-of-conduct.md +91 -0
  124. package/versioned_docs/version-v1.2/contributing/contributing.md +129 -0
  125. package/versioned_docs/version-v1.2/coordinator-processing.md +46 -0
  126. package/versioned_docs/version-v1.2/deployment.md +122 -0
  127. package/versioned_docs/version-v1.2/installation.md +175 -0
  128. package/versioned_docs/version-v1.2/integrating.md +200 -0
  129. package/versioned_docs/version-v1.2/introduction.md +94 -0
  130. package/versioned_docs/version-v1.2/key-change.md +182 -0
  131. package/versioned_docs/version-v1.2/overview.md +47 -0
  132. package/versioned_docs/version-v1.2/poll-types.md +68 -0
  133. package/versioned_docs/version-v1.2/primitives.md +216 -0
  134. package/versioned_docs/version-v1.2/project-ideas.md +14 -0
  135. package/versioned_docs/version-v1.2/purpose.md +62 -0
  136. package/versioned_docs/version-v1.2/solidity-docs/MACI.md +345 -0
  137. package/versioned_docs/version-v1.2/solidity-docs/MessageProcessor.md +266 -0
  138. package/versioned_docs/version-v1.2/solidity-docs/MessageProcessorFactory.md +26 -0
  139. package/versioned_docs/version-v1.2/solidity-docs/Poll.md +381 -0
  140. package/versioned_docs/version-v1.2/solidity-docs/PollFactory.md +50 -0
  141. package/versioned_docs/version-v1.2/solidity-docs/SignUpToken.md +27 -0
  142. package/versioned_docs/version-v1.2/solidity-docs/Subsidy.md +218 -0
  143. package/versioned_docs/version-v1.2/solidity-docs/SubsidyFactory.md +27 -0
  144. package/versioned_docs/version-v1.2/solidity-docs/Tally.md +311 -0
  145. package/versioned_docs/version-v1.2/solidity-docs/TallyFactory.md +27 -0
  146. package/versioned_docs/version-v1.2/solidity-docs/TallyNonQv.md +296 -0
  147. package/versioned_docs/version-v1.2/solidity-docs/TallyNonQvFactory.md +27 -0
  148. package/versioned_docs/version-v1.2/solidity-docs/TopupCredit.md +61 -0
  149. package/versioned_docs/version-v1.2/solidity-docs/VkRegistry.md +457 -0
  150. package/versioned_docs/version-v1.2/solidity-docs/benchmarks/HasherBenchmarks.md +44 -0
  151. package/versioned_docs/version-v1.2/solidity-docs/crypto/Hasher.md +125 -0
  152. package/versioned_docs/version-v1.2/solidity-docs/crypto/IVerifier.md +11 -0
  153. package/versioned_docs/version-v1.2/solidity-docs/crypto/MockVerifier.md +17 -0
  154. package/versioned_docs/version-v1.2/solidity-docs/crypto/Pairing.md +85 -0
  155. package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT3.md +9 -0
  156. package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT4.md +9 -0
  157. package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT5.md +9 -0
  158. package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT6.md +9 -0
  159. package/versioned_docs/version-v1.2/solidity-docs/crypto/SnarkCommon.md +16 -0
  160. package/versioned_docs/version-v1.2/solidity-docs/crypto/SnarkConstants.md +40 -0
  161. package/versioned_docs/version-v1.2/solidity-docs/crypto/Verifier.md +61 -0
  162. package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/EASGatekeeper.md +121 -0
  163. package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/FreeForAllSignUpGatekeeper.md +40 -0
  164. package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/SignUpGatekeeper.md +26 -0
  165. package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/SignUpTokenGatekeeper.md +93 -0
  166. package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/hatsGatekeepers/HatsGatekeeperBase.md +79 -0
  167. package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/hatsGatekeepers/HatsGatekeeperMultiple.md +48 -0
  168. package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/hatsGatekeepers/HatsGatekeeperSingle.md +42 -0
  169. package/versioned_docs/version-v1.2/solidity-docs/index.md +4 -0
  170. package/versioned_docs/version-v1.2/solidity-docs/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.md +40 -0
  171. package/versioned_docs/version-v1.2/solidity-docs/initialVoiceCreditProxy/InitialVoiceCreditProxy.md +26 -0
  172. package/versioned_docs/version-v1.2/solidity-docs/interfaces/IEAS.md +40 -0
  173. package/versioned_docs/version-v1.2/solidity-docs/interfaces/IHats.md +103 -0
  174. package/versioned_docs/version-v1.2/solidity-docs/interfaces/IMPFactory.md +26 -0
  175. package/versioned_docs/version-v1.2/solidity-docs/interfaces/IMessageProcessor.md +31 -0
  176. package/versioned_docs/version-v1.2/solidity-docs/interfaces/IPoll.md +217 -0
  177. package/versioned_docs/version-v1.2/solidity-docs/interfaces/IPollFactory.md +29 -0
  178. package/versioned_docs/version-v1.2/solidity-docs/interfaces/ITallyFactory.md +28 -0
  179. package/versioned_docs/version-v1.2/solidity-docs/interfaces/ITallySubsidyFactory.md +27 -0
  180. package/versioned_docs/version-v1.2/solidity-docs/interfaces/IVerifier.md +25 -0
  181. package/versioned_docs/version-v1.2/solidity-docs/interfaces/IVkRegistry.md +70 -0
  182. package/versioned_docs/version-v1.2/solidity-docs/mocks/MockHatsProtocol.md +133 -0
  183. package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueue.md +464 -0
  184. package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueBinary.md +60 -0
  185. package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueBinary0.md +40 -0
  186. package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueBinaryMaci.md +34 -0
  187. package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinary.md +75 -0
  188. package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinary0.md +40 -0
  189. package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinaryBlankSl.md +40 -0
  190. package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinaryMaci.md +40 -0
  191. package/versioned_docs/version-v1.2/solidity-docs/trees/EmptyBallotRoots.md +13 -0
  192. package/versioned_docs/version-v1.2/solidity-docs/utilities/CommonUtilities.md +25 -0
  193. package/versioned_docs/version-v1.2/solidity-docs/utilities/DomainObjs.md +40 -0
  194. package/versioned_docs/version-v1.2/solidity-docs/utilities/Params.md +36 -0
  195. package/versioned_docs/version-v1.2/solidity-docs/utilities/Utilities.md +79 -0
  196. package/versioned_docs/version-v1.2/spec.md +944 -0
  197. package/versioned_docs/version-v1.2/testing-in-detail.md +209 -0
  198. package/versioned_docs/version-v1.2/testing.md +472 -0
  199. package/versioned_docs/version-v1.2/topup.md +43 -0
  200. package/versioned_docs/version-v1.2/troubleshooting.md +51 -0
  201. package/versioned_docs/version-v1.2/trusted-setup.md +76 -0
  202. package/versioned_docs/version-v1.2/typedoc/cli/.nojekyll +1 -0
  203. package/versioned_docs/version-v1.2/typedoc/cli/index.md +15 -0
  204. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/AirdropArgs.md +89 -0
  205. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/DeployArgs.md +154 -0
  206. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/DeployPollArgs.md +154 -0
  207. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/DeployedContracts.md +130 -0
  208. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/GenLocalStateArgs.md +168 -0
  209. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/GenProofsArgs.md +388 -0
  210. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/IGenKeypairArgs.md +37 -0
  211. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/IRegisteredUserArgs.md +63 -0
  212. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/MergeMessagesArgs.md +76 -0
  213. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/MergeSignupsArgs.md +76 -0
  214. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/PollContracts.md +53 -0
  215. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/ProveOnChainArgs.md +128 -0
  216. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/PublishArgs.md +154 -0
  217. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/SignupArgs.md +89 -0
  218. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/SubsidyData.md +73 -0
  219. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/TallyData.md +166 -0
  220. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/TopupArgs.md +89 -0
  221. package/versioned_docs/version-v1.2/typedoc/cli/interfaces/VerifyArgs.md +128 -0
  222. package/versioned_docs/version-v1.2/typedoc/cli/modules.md +556 -0
  223. package/versioned_docs/version-v1.2/typedoc/core/.nojekyll +1 -0
  224. package/versioned_docs/version-v1.2/typedoc/core/classes/MaciState.md +295 -0
  225. package/versioned_docs/version-v1.2/typedoc/core/classes/Poll.md +1098 -0
  226. package/versioned_docs/version-v1.2/typedoc/core/index.md +110 -0
  227. package/versioned_docs/version-v1.2/typedoc/core/interfaces/BatchSizes.md +50 -0
  228. package/versioned_docs/version-v1.2/typedoc/core/interfaces/IJsonMaciState.md +77 -0
  229. package/versioned_docs/version-v1.2/typedoc/core/interfaces/IProcessMessagesCircuitInputs.md +242 -0
  230. package/versioned_docs/version-v1.2/typedoc/core/interfaces/ISubsidyCircuitInputs.md +198 -0
  231. package/versioned_docs/version-v1.2/typedoc/core/interfaces/ITallyCircuitInputs.md +231 -0
  232. package/versioned_docs/version-v1.2/typedoc/core/interfaces/MaxValues.md +37 -0
  233. package/versioned_docs/version-v1.2/typedoc/core/interfaces/TreeDepths.md +63 -0
  234. package/versioned_docs/version-v1.2/typedoc/core/modules.md +289 -0
  235. package/versioned_docs/version-v1.2/typedoc/crypto/.nojekyll +1 -0
  236. package/versioned_docs/version-v1.2/typedoc/crypto/classes/AccQueue.md +770 -0
  237. package/versioned_docs/version-v1.2/typedoc/crypto/classes/G1Point.md +115 -0
  238. package/versioned_docs/version-v1.2/typedoc/crypto/classes/G2Point.md +140 -0
  239. package/versioned_docs/version-v1.2/typedoc/crypto/classes/IncrementalQuinTree.md +470 -0
  240. package/versioned_docs/version-v1.2/typedoc/crypto/index.md +44 -0
  241. package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/Keypair.md +33 -0
  242. package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/PoseidonFuncs.md +115 -0
  243. package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/Queue.md +33 -0
  244. package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/Signature.md +37 -0
  245. package/versioned_docs/version-v1.2/typedoc/crypto/modules.md +913 -0
  246. package/versioned_docs/version-v1.2/typedoc/domainobjs/.nojekyll +1 -0
  247. package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/Ballot.md +274 -0
  248. package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/Keypair.md +181 -0
  249. package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/Message.md +244 -0
  250. package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/PCommand.md +409 -0
  251. package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/PrivKey.md +206 -0
  252. package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/PubKey.md +289 -0
  253. package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/StateLeaf.md +340 -0
  254. package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/TCommand.md +200 -0
  255. package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/VerifyingKey.md +240 -0
  256. package/versioned_docs/version-v1.2/typedoc/domainobjs/index.md +81 -0
  257. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/ICommand.md +104 -0
  258. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IG1ContractParams.md +31 -0
  259. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IG2ContractParams.md +31 -0
  260. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonBallot.md +42 -0
  261. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonCommand.md +32 -0
  262. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonKeyPair.md +31 -0
  263. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonPCommand.md +111 -0
  264. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonStateLeaf.md +42 -0
  265. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonTCommand.md +67 -0
  266. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IMessageContractParams.md +31 -0
  267. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IStateLeaf.md +39 -0
  268. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IStateLeafContractParams.md +42 -0
  269. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IVkContractParams.md +64 -0
  270. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IVkObjectParams.md +108 -0
  271. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/Proof.md +46 -0
  272. package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/VoteOptionTreeLeaf.md +24 -0
  273. package/versioned_docs/version-v1.2/typedoc/domainobjs/modules.md +110 -0
  274. package/versioned_docs/version-v1.2/typedoc/index.md +4 -0
  275. package/versioned_docs/version-v1.2/versioning.md +94 -0
  276. package/versioned_docs/version-v1.2/workflow.md +142 -0
  277. package/versioned_docs/version-v2.x/case-studies.md +35 -0
  278. package/versioned_docs/version-v2.x/contributing/_category_.json +4 -0
  279. package/versioned_docs/version-v2.x/contributing/code-of-conduct.md +92 -0
  280. package/versioned_docs/version-v2.x/contributing/contributing.md +149 -0
  281. package/versioned_docs/version-v2.x/contributing/project-ideas.md +78 -0
  282. package/versioned_docs/version-v2.x/core-concepts/_category_.json +4 -0
  283. package/versioned_docs/version-v2.x/core-concepts/ballot.md +19 -0
  284. package/versioned_docs/version-v2.x/core-concepts/coordinator-processing.md +46 -0
  285. package/versioned_docs/version-v2.x/core-concepts/hashing-and-encryption.md +45 -0
  286. package/versioned_docs/version-v2.x/core-concepts/key-change.md +179 -0
  287. package/versioned_docs/version-v2.x/core-concepts/maci-keys.md +84 -0
  288. package/versioned_docs/version-v2.x/core-concepts/maci-messages.md +44 -0
  289. package/versioned_docs/version-v2.x/core-concepts/merkle-trees.md +23 -0
  290. package/versioned_docs/version-v2.x/core-concepts/poll-types.md +106 -0
  291. package/versioned_docs/version-v2.x/core-concepts/spec.md +883 -0
  292. package/versioned_docs/version-v2.x/core-concepts/state-leaf.md +42 -0
  293. package/versioned_docs/version-v2.x/core-concepts/workflow.md +142 -0
  294. package/versioned_docs/version-v2.x/getting-started.md +313 -0
  295. package/versioned_docs/version-v2.x/guides/_category_.json +4 -0
  296. package/versioned_docs/version-v2.x/guides/compile-circuits.md +163 -0
  297. package/versioned_docs/version-v2.x/guides/frontend.md +99 -0
  298. package/versioned_docs/version-v2.x/guides/integrating.md +73 -0
  299. package/versioned_docs/version-v2.x/guides/maciWrapper.md +173 -0
  300. package/versioned_docs/version-v2.x/guides/subgraph.md +79 -0
  301. package/versioned_docs/version-v2.x/guides/testing/_category_.json +4 -0
  302. package/versioned_docs/version-v2.x/guides/testing/testing-in-detail.md +203 -0
  303. package/versioned_docs/version-v2.x/guides/testing/testing.md +163 -0
  304. package/versioned_docs/version-v2.x/guides/troubleshooting.md +161 -0
  305. package/versioned_docs/version-v2.x/introduction.md +146 -0
  306. package/versioned_docs/version-v2.x/processes/_category_.json +4 -0
  307. package/versioned_docs/version-v2.x/processes/ci-pipeline.md +38 -0
  308. package/versioned_docs/version-v2.x/processes/versioning.md +94 -0
  309. package/versioned_docs/version-v2.x/resources.md +33 -0
  310. package/versioned_docs/version-v2.x/security/_category_.json +4 -0
  311. package/versioned_docs/version-v2.x/security/audit.md +167 -0
  312. package/versioned_docs/version-v2.x/security/trusted-setup.md +166 -0
  313. package/versioned_docs/version-v2.x/supported-networks/_category_.json +4 -0
  314. package/versioned_docs/version-v2.x/supported-networks/deployed-contracts.md +1108 -0
  315. package/versioned_docs/version-v2.x/supported-networks/supported-networks.md +47 -0
  316. package/versioned_docs/version-v2.x/technical-references/_category_.json +4 -0
  317. package/versioned_docs/version-v2.x/technical-references/smart-contracts/AccQueue.md +21 -0
  318. package/versioned_docs/version-v2.x/technical-references/smart-contracts/Gatekeepers.md +40 -0
  319. package/versioned_docs/version-v2.x/technical-references/smart-contracts/MACI.md +152 -0
  320. package/versioned_docs/version-v2.x/technical-references/smart-contracts/MessageProcessor.md +13 -0
  321. package/versioned_docs/version-v2.x/technical-references/smart-contracts/Params.md +32 -0
  322. package/versioned_docs/version-v2.x/technical-references/smart-contracts/Poll.md +104 -0
  323. package/versioned_docs/version-v2.x/technical-references/smart-contracts/PollFactory.md +43 -0
  324. package/versioned_docs/version-v2.x/technical-references/smart-contracts/Tally.md +45 -0
  325. package/versioned_docs/version-v2.x/technical-references/smart-contracts/VkRegistry.md +57 -0
  326. package/versioned_docs/version-v2.x/technical-references/smart-contracts/VoiceCreditProxy.md +18 -0
  327. package/versioned_docs/version-v2.x/technical-references/smart-contracts/_category_.json +8 -0
  328. package/versioned_docs/version-v2.x/technical-references/technical-references.md +47 -0
  329. package/versioned_docs/version-v2.x/technical-references/typescript-code/_category_.json +4 -0
  330. package/versioned_docs/version-v2.x/technical-references/typescript-code/cli.md +699 -0
  331. package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/_category_.json +4 -0
  332. package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/processMessages.md +107 -0
  333. package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/setup.md +101 -0
  334. package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/tallyVotes.md +79 -0
  335. package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/utilities.md +131 -0
  336. package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +37 -0
  337. package/versioned_docs/version-v2.x/use-cases/_category_.json +4 -0
  338. package/versioned_docs/version-v2.x/use-cases/governance.md +18 -0
  339. package/versioned_docs/version-v2.x/use-cases/polling.md +10 -0
  340. package/versioned_docs/version-v2.x/use-cases/public-goods.md +65 -0
  341. package/versioned_docs/version-v3.x/case-studies.md +35 -0
  342. package/versioned_docs/version-v3.x/contributing/_category_.json +4 -0
  343. package/versioned_docs/version-v3.x/contributing/code-of-conduct.md +92 -0
  344. package/versioned_docs/version-v3.x/contributing/contributing.md +149 -0
  345. package/versioned_docs/version-v3.x/contributing/project-ideas.md +78 -0
  346. package/versioned_docs/version-v3.x/core-concepts/_category_.json +4 -0
  347. package/versioned_docs/version-v3.x/core-concepts/ballot.md +19 -0
  348. package/versioned_docs/version-v3.x/core-concepts/coordinator-processing.md +46 -0
  349. package/versioned_docs/version-v3.x/core-concepts/hashing-and-encryption.md +45 -0
  350. package/versioned_docs/version-v3.x/core-concepts/key-change.md +179 -0
  351. package/versioned_docs/version-v3.x/core-concepts/maci-keys.md +84 -0
  352. package/versioned_docs/version-v3.x/core-concepts/maci-messages.md +44 -0
  353. package/versioned_docs/version-v3.x/core-concepts/merkle-trees.md +16 -0
  354. package/versioned_docs/version-v3.x/core-concepts/poll-types.md +58 -0
  355. package/versioned_docs/version-v3.x/core-concepts/polls.md +81 -0
  356. package/versioned_docs/version-v3.x/core-concepts/spec.md +883 -0
  357. package/versioned_docs/version-v3.x/core-concepts/state-leaf.md +42 -0
  358. package/versioned_docs/version-v3.x/core-concepts/workflow.md +143 -0
  359. package/versioned_docs/version-v3.x/guides/_category_.json +4 -0
  360. package/versioned_docs/version-v3.x/guides/compile-circuits.md +175 -0
  361. package/versioned_docs/version-v3.x/guides/integrating.md +137 -0
  362. package/versioned_docs/version-v3.x/guides/subgraph.md +79 -0
  363. package/versioned_docs/version-v3.x/guides/testing/_category_.json +4 -0
  364. package/versioned_docs/version-v3.x/guides/testing/testing-in-detail.md +191 -0
  365. package/versioned_docs/version-v3.x/guides/testing/testing-introduction.md +158 -0
  366. package/versioned_docs/version-v3.x/guides/troubleshooting.md +161 -0
  367. package/versioned_docs/version-v3.x/introduction.md +153 -0
  368. package/versioned_docs/version-v3.x/processes/_category_.json +4 -0
  369. package/versioned_docs/version-v3.x/processes/ci-pipeline.md +38 -0
  370. package/versioned_docs/version-v3.x/processes/versioning.md +94 -0
  371. package/versioned_docs/version-v3.x/quick-start.md +318 -0
  372. package/versioned_docs/version-v3.x/resources.md +33 -0
  373. package/versioned_docs/version-v3.x/security/_category_.json +4 -0
  374. package/versioned_docs/version-v3.x/security/audit.md +167 -0
  375. package/versioned_docs/version-v3.x/security/trusted-setup.md +172 -0
  376. package/versioned_docs/version-v3.x/supported-networks/_category_.json +4 -0
  377. package/versioned_docs/version-v3.x/supported-networks/deployed-contracts.md +112 -0
  378. package/versioned_docs/version-v3.x/supported-networks/supported-networks.md +53 -0
  379. package/versioned_docs/version-v3.x/technical-references/_category_.json +4 -0
  380. package/versioned_docs/version-v3.x/technical-references/smart-contracts/MACI.md +160 -0
  381. package/versioned_docs/version-v3.x/technical-references/smart-contracts/MessageProcessor.md +13 -0
  382. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Params.md +33 -0
  383. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Policies.md +39 -0
  384. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Poll.md +170 -0
  385. package/versioned_docs/version-v3.x/technical-references/smart-contracts/PollFactory.md +33 -0
  386. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Tally.md +43 -0
  387. package/versioned_docs/version-v3.x/technical-references/smart-contracts/VkRegistry.md +62 -0
  388. package/versioned_docs/version-v3.x/technical-references/smart-contracts/VoiceCreditProxy.md +18 -0
  389. package/versioned_docs/version-v3.x/technical-references/smart-contracts/_category_.json +8 -0
  390. package/versioned_docs/version-v3.x/technical-references/technical-references.md +48 -0
  391. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/_category_.json +4 -0
  392. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/joinPoll.md +53 -0
  393. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/processMessages.md +106 -0
  394. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/setup.md +96 -0
  395. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/tallyVotes.md +79 -0
  396. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/utilities.md +131 -0
  397. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +42 -0
  398. package/versioned_docs/version-v3.x/use-cases/_category_.json +4 -0
  399. package/versioned_docs/version-v3.x/use-cases/governance.md +18 -0
  400. package/versioned_docs/version-v3.x/use-cases/polling.md +10 -0
  401. package/versioned_docs/version-v3.x/use-cases/public-goods.md +65 -0
  402. package/versioned_sidebars/version-v0.x-sidebars.json +8 -0
  403. package/versioned_sidebars/version-v1.2-sidebars.json +8 -0
  404. package/versioned_sidebars/version-v2.x-sidebars.json +8 -0
  405. package/versioned_sidebars/version-v3.x-sidebars.json +8 -0
  406. package/versions.json +1 -0
@@ -0,0 +1,689 @@
1
+ ---
2
+ title: MACI Command-line interface (CLI)
3
+ description: Introduction to the MACI CLI interface that allows for effective deployment and testing
4
+ sidebar_label: Command-line interface
5
+ sidebar_position: 7
6
+ ---
7
+
8
+ # Command-line interface
9
+
10
+ MACI provides a command-line interface that allows for effective deployment and
11
+ testing. Applications that build on top of MACI, such as
12
+ [clr.fund](https://clr.fund/), implement their own web UIs.
13
+
14
+ Note that all the example commands default to a local Ethereum testnet at
15
+ `http://localhost:8545`, and use the Ethereum private key
16
+ `0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3`. Do not
17
+ send any real funds to the address generated by this key.
18
+
19
+ For testing purposes, you can run:
20
+
21
+ ```bash
22
+ # in maci/contracts
23
+ pnpm run hardhat
24
+ ```
25
+
26
+ > Note that you will need a hardhat.config file in your current directory to be able to run the cli.
27
+
28
+ ## Subcommands
29
+
30
+ | Command | Description | Options |
31
+ | -------------------- | ------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
32
+ | `create` | Deploy the contracts | `-i, --initialVoiceCredits <initialVoiceCredits>`: The initial voice credits <br/> `-p, --initialVoiceCreditsProxyAddress <initialVoiceCreditsProxyAddress>`: The initial voice credits proxy contract address <br/> `-g, --signupGatekeeperAddress <signupGatekeeperAddress>`: The signup gatekeeper contract address <br/> `-ph3, --poseidonT3Address <poseidonT3Address>`: The PoseidonT3 contract address <br/> `-ph4, --poseidonT4Address <poseidonT4Address>`: The PoseidonT4 contract address <br/> `-ph5, --poseidonT5Address <poseidonT5Address>`: The PoseidonT5 contract address <br/> `-ph6, --poseidonT6Address <poseidonT6Address>`: The PoseidonT6 contract address <br/> `-q, --quiet`: Whether to print values to the console <br/> `-s, --stateTreeDepth <stateTreeDepth>`: The state tree depth <br/> `-r, --rpc-provider <provider>`: The rpc provider URL |
33
+ | `checkVerifyingKeys` | Check that the verifying keys in the contract match the local ones | `-q, --quiet`: Whether to print values to the console <br/> `-vk, --vk-contract <vkContract>`: The VkRegistry contract address <br/> `-s, --state-tree-depth <stateTreeDepth>`: The state tree depth <br/> `-i, --int-state-tree-depth <intStateTreeDepth>`: The intermediate state tree depth <br/> `-m, --msg-tree-depth <messageTreeDepth>`: The message tree depth <br/> `-v, --vote-option-tree-depth <voteOptionTreeDepth>`: The vote option tree depth <br/> `-b, --msg-batch-depth <messageBatchDepth>`: The message batch depth <br/> `-p, --process-messages-zkey <processMessagesZkeyPath>`: The process messages zkey path (see different options to use specific circuits [Trusted setup](/docs/v1.2/trusted-setup) or [Testing](/docs/v1.2/testing/#pre-compiled-artifacts-for-testing)) <br/> `-t, --tally-votes-zkey <tallyVotesZkeyPath>`: The tally votes zkey path (see different options to use specific circuits [Trusted setup](/docs/v1.2/trusted-setup) or [Testing](/docs/v1.2/testing/#pre-compiled-artifacts-for-testing)) <br /> `-ss, --subsidy-zkey <subsidyZkeyPath>`: The subsidy zkey path (see different options to use specific circuits [Trusted setup](/docs/v1.2/trusted-setup) or [Testing](/docs/v1.2/testing/#pre-compiled-artifacts-for-testing)) |
34
+ | `genMaciPubKey` | Generate a new MACI public key | `-sk, --privkey <privkey>`: The private key |
35
+ | `genMaciKeyPair` | Generate a new MACI key pair | `-sp, --seed <seed> seed value for keypair` |
36
+ | `airdrop` | Airdrop topup credits to the coordinator | `-a, --amount <amount>`: The amount of topup <br/> `-x, --maci-address <maciAddress>`: The MACI contract address <br/> `-o, --poll-id <pollId>`: Poll id <br/> `-t, --token-address <tokenAddress>`: The token address <br/> `-q, --quiet`: Whether to print values to the console |
37
+ | `deployVkRegistry` | Deploy a new verification key registry contract | `-q, --quiet`: Whether to print values to the console |
38
+ | `show` | Show the deployed contract addresses | No options |
39
+ | `deployPoll` | Deploy a new poll | `-t, --duration <pollDuration>`: The poll duration <br/> `-i, --int-state-tree-depth <intStateTreeDepth>`: The int state tree depth <br/> `-b, --msg-batch-depth <messageTreeSubDepth>`: The message tree sub depth <br/> `-m, --msg-tree-depth <messageTreeDepth>`: The message tree depth <br/> `-v, --vote-option-tree-depth <voteOptionTreeDepth>`: The vote option tree depth <br/> `-pk, --pubkey <coordinatorPubkey>`: The coordinator public key <br/> `-x, --maci-address <maciAddress>`: The MACI contract address <br/> `-q, --quiet`: Whether to print values to the console <br/> "-vk, `--vkRegistryAddress <vkRegistryAddress>`: The vk registry contract address |
40
+ | `setVerifyingKeys` | Set the verifying keys | `-s, --state-tree-depth <stateTreeDepth>`: The state tree depth <br/> `-i, --int-state-tree-depth <intStateTreeDepth>`: The intermediate state tree depth <br/> `-m, --msg-tree-depth <messageTreeDepth>`: The message tree depth <br/> `-v, --vote-option-tree-depth <voteOptionTreeDepth>`: The vote option tree depth <br/> `-b, --msg-batch-depth <messageBatchDepth>`: The message batch depth <br/> `-p, --process-messages-zkey <processMessagesZkeyPath>`: The process messages zkey path (see different options to use specific circuits [Trusted setup](/docs/v1.2/trusted-setup) or [Testing](/docs/v1.2/testing/#pre-compiled-artifacts-for-testing)) <br/> `-t, --tally-votes-zkey <tallyVotesZkeyPath>`: The tally votes zkey path (see different options to use specific circuits [Trusted setup](/docs/v1.2/trusted-setup) or [Testing](/docs/v1.2/testing/#pre-compiled-artifacts-for-testing)) <br/> `-k, --vk-registry <vkRegistry>`: The vk registry contract address <br/> `-q, --quiet`: Whether to print values to the console <br/> `-ss, --subsidy-zkey <subsidyZkeyPath>`: The subsidy zkey path (see different options to use specific circuits [Trusted setup](/docs/v1.2/trusted-setup) or [Testing](/docs/v1.2/testing/#pre-compiled-artifacts-for-testing)) |
41
+ | `publish` | Publish a new message to a MACI Poll contract | `-p, --pubkey <pubkey>`: The MACI public key which should replace the user's public key in the state tree <br/> `-x, --maci-address <maciAddress>`: The MACI contract address <br/> `-sk, --privkey <privkey>`: Your serialized MACI private key <br/> `-i, --state-index <stateIndex>`: The user's state index <br/> `-v, --vote-option-index <voteOptionIndex>`: The vote option index <br/> `-n, --nonce <nonce>`: The message nonce <br/> `-s, --salt <salt>`: The message salt <br/> `-o, --poll-id <pollId>`: The poll id <br/> `-w, --new-vote-weight <newVoteWeight>`: The new vote weight <br/> `-q, --quiet`: Whether to print values to the console |
42
+ | `mergeMessages` | Merge the message accumulator queue | `-q, --quiet`: Whether to print values to the console <br/> `-x, --maci-address <maciAddress>`: The MACI contract address <br/> `-o, --poll-id <pollId>`: The poll id <br/> `-n, --num-queue-ops <numQueueOps>`: The number of queue operations |
43
+ | `mergeSignups` | Merge the signups accumulator queue | `-q, --quiet`: Whether to print values to the console <br/> `-x, --maci-address <maciAddress>`: The MACI contract address <br/> `-o, --poll-id <pollId>`: The poll id <br/> `-n, --num-queue-ops <numQueueOps>`: The number of queue operations |
44
+ | `timeTravel` | Fast-forward the time (only works for local hardhat testing) | `-s, --seconds <seconds>`: The number of seconds to fast-forward <br/> `-q, --quiet`: Whether to print values to the console |
45
+ | `signup` | Sign up to a MACI contract | `-p, --pubkey <maciPubKey>`: The MACI public key <br/> `-x, --maci-address <maciAddress>`: The MACI contract address <br/> `-s, --sg-data <sgData>`: The signup gateway data <br/> `-i, --ivcp-data <ivcpData>`: The initial voice credit proxy data <br/> `-q, --quiet`: Whether to print values to the console |
46
+ | `isRegisteredUser` | Checks if user is registered with public key | `-p, --pubkey <maciPubKey>`: The MACI public key <br/> `-x, --maci-address <maciAddress>`: The MACI contract address <br/> `-q, --quiet`: Whether to print values to the console |
47
+ | `topup` | Top up an account with voice credits | `-a, --amount <amount>`: The amount of topup <br/> `-x, --maci-address <maciAddress>`: The MACI contract address <br/> `-i, --state-index <stateIndex>`: State leaf index <br/> `-o, --poll-id <pollId>`: Poll id <br/> `-q, --quiet`: Whether to print values to the console |
48
+ | `fundWallet` | Fund a wallet with Ether | `-a, --amount <amount>`: The amount of Ether <br/> `-w, --address <address>`: The address to fund <br/> `-q, --quiet`: Whether to print values to the console |
49
+ | `verify` | Verify the results of a poll and optionally the subsidy results on-chain | `-o, --poll-id <pollId>`: The poll id <br/> `-t, --tally-file <tallyFile>`: The tally file with results, per vote option spent credits, spent voice credits total <br/> `-s, --subsidy-file <subsidyFile>`: The subsidy file <br/> `-x, --maci-address <maciAddress>`: The MACI contract address <br/> `-tc, --tally-contract <tallyContract>`: The tally contract address <br/> `-sc, --subsidy-contract <subsidyContract>`: The subsidy contract address <br/> `-q, --quiet`: Whether to print values to the console |
50
+ | `genProofs` | Generate the proofs for a poll | `-sk, --privkey <privkey>`: Your serialized MACI private key <br/> `-x, --maci-address <maciAddress>`: The MACI contract address <br/> `-o, --poll-id <pollId>`: The poll id <br/> `-t, --tally-file <tallyFile>`: The tally file <br/> `-s, --subsidy-file <subsidyFile>`: The subsidy file <br/> `-r, --rapidsnark <rapidsnark>`: The path to the rapidsnark binary <br/> `-wp, --process-witnessgen <processWitnessgen>`: The path to the process witness generation binary <br/> `-wt, --tally-witnessgen <tallyWitnessgen>`: The path to the tally witness generation binary <br/> `-ws, --subsidy-witnessgen <subsidyWitnessgen>`: The path to the subsidy witness generation binary <br/> `-zp, --process-zkey <processZkey`: The path to the process zkey <br/> `-zt, --tally-zkey <tallyZkey>`: The path to the tally zkey <br/> `-zs, --subsidy-zkey <subsidyZkey>`: The path to the subsidy zkey <br/> `-q, --quiet`: Whether to print values to the console <br/> `-f, --output <outputDir>`: The output directory for proofs <br/> `-tx, --transaction-hash <transactionHash>:` Transaction hash of MACI contract creation <br/> `-w, --wasm`: Whether to use the wasm binaries <br/> `-pw, --process-wasm <processWasm>`: The path to the process witness generation wasm binary <br/> `-tw, --tally-wasm <tallyWasm>`: The path to the tally witness generation wasm binary <br/> `-sw, --subsidy-wasm <subsidyWasm>`: The path to the subsidy witness generation wasm binary <br/> `-uq, --use-quadratic-voting`: Whether to process messages and tally votes using quadratic voting or not |
51
+ | `proveOnChain` | Prove the results of a poll on chain | `-o, --poll-id <pollId>`: The poll id <br/> `-q, --quiet`: Whether to print values to the console <br/> `-x, --maci-address <maciAddress>`: The MACI contract address <br/> `-p, --message-processor-address <messageProcessorAddress>`: The message processor contract address <br/> `-t, --tally-contract <tallyContract>`: The tally contract address <br/> `-s, --subsidy-contract <subsidyContract>`: The subsidy contract address <br/> `-f, --proof-dir <proofDir>`: The proof output directory from the genProofs subcommand |
52
+
53
+ ## Public and private key format
54
+
55
+ MACI uses private keys in the BabyJub field for operations which occur within
56
+ zk-SNARKs, such as decrypting messages or signing commands. As MACI is deployed
57
+ on Ethereum, we seek to avoid confusing BabyJub private keys with Ethereum
58
+ private keys. To that end, users should pass serialized formats of public and
59
+ private keys to this CLI. We use `maci-domainobj`'s `PrivKey.serialize` and
60
+ `PubKey.serialize` functions to do so.
61
+
62
+ Examples of serialized public and private keys:
63
+
64
+ ```
65
+ Public key: macipk.946c756cb8588f7169d37e23a98b92051359d64321cf7372a75757b5e9d5590d
66
+ Private key: macisk.08a06aef74c7f6a6f73704e30677418731bc738500f4e6c63dbfe41af8d6719c
67
+ ```
68
+
69
+ ### Generate MACI keys
70
+
71
+ You can generate MACI keys using the following cli utility.
72
+
73
+ ```bash
74
+ node build/ts/index.js genMaciKeyPair
75
+ ```
76
+
77
+ Example output:
78
+
79
+ ```bash
80
+ [✓] Public key: macipk.946c756cb8588f7169d37e23a98b92051359d64321cf7372a75757b5e9d5590d
81
+ [✓] Private key: macisk.08a06aef74c7f6a6f73704e30677418731bc738500f4e6c63dbfe41af8d6719c
82
+ ```
83
+
84
+ If you already have a MACI private key in serialized form, you can generate its corresponding public key using the following command:
85
+
86
+ ```bash
87
+ node build/ts/index.js genMaciPubKey -sk macisk.08a06aef74c7f6a6f73704e30677418731bc738500f4e6c63dbfe41af8d6719c
88
+ ```
89
+
90
+ Example output:
91
+
92
+ ```
93
+ [✓] Public key: macipk.946c756cb8588f7169d37e23a98b92051359d64321cf7372a75757b5e9d5590d
94
+ ```
95
+
96
+ ### Coordinator: Deploy VkRegistry
97
+
98
+ This command deploys an instance of a VkRegistry contract. Multiple MACI
99
+ contracts can refer to the same VkRegistry as long as they are all owned (via
100
+ `Ownable.sol`) by the same account.
101
+
102
+ Example usage:
103
+
104
+ ```bash
105
+ node build/ts/index.js deployVkRegistry
106
+ ```
107
+
108
+ Example output:
109
+
110
+ ```
111
+ [✓] VkRegistry deployed at: 0x6b5A4751307F6751E265c194244552A9995B6B3D
112
+ ```
113
+
114
+ ### Coordinator: Set verifying keys
115
+
116
+ Note that the filename of the `.zkey` files must follow this format:
117
+
118
+ ```
119
+ ProcessMessages_<STATE_TREE_DEPTH>-<MSG_TREE_DEPTH>-<MSG_SUBTREE_DEPTH>-<VOTE_OPTION_TREE_DEPTH>_test.<CONTRIBUTION_NUM>.zkey
120
+ TallyVotes_<STATE_TREE_DEPTH>-<INT_STATE_TREE_DEPTH>-<VOTE_OPTION_TREE_DEPTH>>_test.<CONTRIBUTION_NUM>>.zkey
121
+ ```
122
+
123
+ Example usage:
124
+
125
+ ```bash
126
+ node build/ts/index.js setVerifyingKeys \
127
+ -s 10 -i 1 -m 2 -v 2 -b 1 \
128
+ -p ./zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test.0.zkey \
129
+ -t ./zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test.0.zkey \
130
+ ```
131
+
132
+ Example output:
133
+
134
+ ```
135
+ [i] Setting verifying keys...
136
+ [i] Transaction hash: 0x6b5b2959ba5161497d5499a0f9d9c69f773cd5f9b82f80a79253797b066863e3
137
+ [✓] Verifying keys set successfully
138
+ ```
139
+
140
+ ### Coordinator: Create MACI instance
141
+
142
+ Example usage:
143
+
144
+ ```bash
145
+ node build/ts/index.js create -s 10
146
+ ```
147
+
148
+ Example output:
149
+
150
+ ```
151
+ [✓] MACI deployed at: 0xB08CEd0f34940a3E576Cf023b287f9Db2f306a1f
152
+ ```
153
+
154
+ ### Coordinator: Deploy poll
155
+
156
+ Example usage:
157
+
158
+ ```bash
159
+ node ./build/ts/index.js deployPoll \
160
+ -pk macipk.946c756cb8588f7169d37e23a98b92051359d64321cf7372a75757b5e9d5590d \
161
+ -t 300 -i 1 -m 2 -b 1 -v 2
162
+ ```
163
+
164
+ Example output:
165
+
166
+ ```
167
+ [i] Poll ID: 0
168
+ [i] Poll contract: 0xB6389Da0285c7B1FC0ba352F5A1D5fb1A492a786
169
+ [i] Message processor contract: 0xE0bF6021e023a197DBb3fABE64efA880E13D3f4b
170
+ [i] Tally contract: 0x3f21BC64076e7c9ed8695d053DCCBE6D8d5E6f43
171
+ [i] Subsidy contract: 0xb848ef765E289762e9BE66a38006DDc4D23AeF24
172
+ ```
173
+
174
+ ### User: sign up
175
+
176
+ Example usage:
177
+
178
+ ```bash
179
+ node ./build/ts/index.js signup \
180
+ -p macipk.182a49caec452e9966f5fef65363c3c795bf8cda482cae8289a4684c0f5bcb7b
181
+ ```
182
+
183
+ Example output:
184
+
185
+ ```
186
+ [i] Transaction hash: 0x4c7c9f65187fcf6e243804b75555bda48cbae4c317bb312f1b9f95ac4b7697b1
187
+ [✓] State index: 1
188
+ ```
189
+
190
+ ### User: publish message
191
+
192
+ Example usage:
193
+
194
+ ```bash
195
+ node build/ts/index.js publish \
196
+ -p macipk.182a49caec452e9966f5fef65363c3c795bf8cda482cae8289a4684c0f5bcb7b \
197
+ -sk macisk.569cf25e35654046ecd9f176d9e6e47115d767fabfe0e97a206dd62e7a3a8546 \
198
+ -i 1 -v 0 -w 9 -n 1 -o 0
199
+ ```
200
+
201
+ Example output:
202
+
203
+ ```
204
+ [i] Transaction hash: 0xa2ab91c821bf7fa73fedcf19a5371a0f0866ae0747d22f82f1685afca0e5db49
205
+ [i] Ephemeral private key: macisk.2631d585e46f059e4909ab35172451542ed7723a1ace120fcf49d68e27f935b0
206
+ ```
207
+
208
+ ### Coordinator: Time travel (Testing only)
209
+
210
+ Example usage:
211
+
212
+ ```bash
213
+ node build/ts/index.js timeTravel -s 300
214
+ ```
215
+
216
+ Example output:
217
+
218
+ ```
219
+ [✓] Fast-forwarded 300 seconds
220
+ ```
221
+
222
+ ### Coordinator: merge state tree
223
+
224
+ Example usage:
225
+
226
+ ```bash
227
+ node build/ts/index.js mergeSignups -o 0
228
+ ```
229
+
230
+ Example output:
231
+
232
+ ```
233
+ [i] Merging state subroots 1 / 1
234
+ [i] Transaction hash: 0xd7e7312f70831ec05bb23f23f506ef37d6ce0c2056c1b72f7bb989653d1c8a42
235
+ [✓] Executed mergeMaciStateAqSubRoots(); gas used: 720061
236
+ [✓] All state subtrees have been merged.
237
+ [i] Merging subroots to a main state root...
238
+ [i] Transaction hash: 0xb5e98d328b066d91e1b7aa35775fe624be446b540a00bcb4b27a02477636b569
239
+ [✓] Executed mergeStateAq(); gas used: 1004720
240
+ ```
241
+
242
+ ### Coordinator: merge message tree
243
+
244
+ Example usage:
245
+
246
+ ```bash
247
+ node build/ts/index.js mergeMessages -o 0
248
+ ```
249
+
250
+ Example output:
251
+
252
+ ```
253
+ [i] Merging message subroots 1 / 1
254
+ [✓] Executed mergeMessageAqSubRoots(); gas used: 602448
255
+ [i] Transaction hash: 0xdf9d11c6b35fcccff82dafa3aa15f760e3f7694a72b07007fbdb359d44df0bea
256
+ [✓] All message subtrees have been merged.
257
+ [i] Merging subroots to a main message root...
258
+ [✓] Executed mergeMessageAq(); gas used: 173346
259
+ [i] Transaction hash: 0x1f18ec08fd14db90a0d1d02d1ed27c0bfd3bc138701e812c4c3382572fc4d151
260
+ [✓] The message tree has been merged.
261
+ ```
262
+
263
+ ### Coordinator: generate Maci state offchain
264
+
265
+ Example usage to generate the state locally from the smart contracts events:
266
+
267
+ ```bash
268
+ node build/ts/index.js genLocalState \
269
+ --poll-id 0 \
270
+ --output localState.json \
271
+ --privkey macisk.08a06aef74c7f6a6f73704e30677418731bc738500f4e6c63dbfe41af8d6719c \
272
+ --blocks-per-batch 50
273
+ ```
274
+
275
+ Example output:
276
+
277
+ ```
278
+ [i] Fetching logs from 0 till 228 and generating the offline maci state
279
+ [✓] The state has been written to localState.json
280
+ ```
281
+
282
+ ### Coordinator: generate proofs
283
+
284
+ Example usage:
285
+
286
+ **C++ witness parameters**
287
+
288
+ ```bash
289
+ node build/ts/index.js genProofs -x 0x89962fa216d39fCcaaC11e1e462340d80ab6Cf4D \
290
+ -sk macisk.08a06aef74c7f6a6f73704e30677418731bc738500f4e6c63dbfe41af8d6719c \
291
+ -o 0 \
292
+ -t tally.json \
293
+ -f proofs \
294
+ -r ~/rapidsnark/build/prover \
295
+ -wp ./zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test_cpp/ProcessMessages_10-2-1-2_test \
296
+ -wt ./zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test_cpp/TallyVotes_10-1-2_test \
297
+ -zp ./zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test.0.zkey \
298
+ -zt ./zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test.0.zkey \
299
+ ```
300
+
301
+ **WASM Parameters**
302
+
303
+ ```bash
304
+ node build/ts/index.js genProofs \
305
+ -sk macisk.08a06aef74c7f6a6f73704e30677418731bc738500f4e6c63dbfe41af8d6719c \
306
+ -o 0 \
307
+ -t tally.json \
308
+ -f proofs \
309
+ -zp ./zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test.0.zkey \
310
+ -zt ./zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test.0.zkey \
311
+ -tw ./zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test_js/TallyVotes_10-1-2_test.wasm \
312
+ -pw ./zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test_js/ProcessMessages_10-2-1-2_test.wasm \
313
+ -w true \
314
+ ```
315
+
316
+ **Non Quadratic Voting**
317
+
318
+ ```bash
319
+ node build/ts/index.js genProofs \
320
+ -sk macisk.08a06aef74c7f6a6f73704e30677418731bc738500f4e6c63dbfe41af8d6719c \
321
+ -o 0 \
322
+ -t tally.json \
323
+ -f proofs \
324
+ -zp ./zkeys/ProcessMessagesNonQv_10-2-1-2_test/ProcessMessagesNonQv_10-2-1-2_test.0.zkey \
325
+ -zt ./zkeys/TallyVotesNonQv_10-1-2_test/TallyVotesNonQv_10-1-2_test.0.zkey \
326
+ -tw ./zkeys/TallyVotesNonQv_10-1-2_test/TallyVotesNonQv_10-1-2_test_js/TallyVotesNonQv_10-1-2_test.wasm \
327
+ -pw ./zkeys/ProcessMessagesNonQv_10-2-1-2_test/ProcessMessagesNonQv_10-2-1-2_test_js/ProcessMessagesNonQv_10-2-1-2_test.wasm \
328
+ -w true \
329
+ -uq false
330
+ ```
331
+
332
+ Example output:
333
+
334
+ ```
335
+ [i] starting to fetch logs from block 0
336
+ [i] Generating proofs of message processing...
337
+ [i] Progress: 1 / 1
338
+ [i] gen processMessage proof took 17.322 seconds
339
+
340
+ [i] Generating proofs of vote tallying...
341
+ [i] Progress: 1 / 1
342
+ [✓] The tally commitment is correct
343
+ [i] gen tally proof took 4.951 seconds
344
+ ```
345
+
346
+ ### Coordinator: generate proofs using a local state file
347
+
348
+ Example usage to generate the proofs locally from the local state file created with genLocalState:
349
+
350
+ **C++ witness parameters**
351
+
352
+ ```bash
353
+ node build/ts/index.js genProofs \
354
+ --privkey macisk.08a06aef74c7f6a6f73704e30677418731bc738500f4e6c63dbfe41af8d6719c \
355
+ --poll-id 0 \
356
+ --rapidsnark ~/rapidsnark/build/prover \
357
+ --process-witnessgen ./zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test_cpp/ProcessMessages_10-2-1-2_test \
358
+ --tally-witnessgen ./zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test_cpp/TallyVotes_10-1-2_test \
359
+ --process-zkey /zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test.0.zkey \
360
+ --tally-zkey ./zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test.0.zkey \
361
+ --tally-file tally.json \
362
+ --output proofs/ \
363
+ --state-file localState.json
364
+ ```
365
+
366
+ **WASM Params**
367
+
368
+ ```bash
369
+ node build/ts/index.js genProofs \
370
+ --privkey macisk.08a06aef74c7f6a6f73704e30677418731bc738500f4e6c63dbfe41af8d6719c \
371
+ --poll-id 0 \
372
+ --process-zkey ./zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test.0.zkey \
373
+ --tally-zkey ./zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test.0.zkey \
374
+ --tally-file tally.json \
375
+ --output proofs/ \
376
+ --state-file localState.json \
377
+ -tw ./zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test_js/TallyVotes_10-1-2_test.wasm \
378
+ -pw ./zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test_js/ProcessMessages_10-2-1-2_test.wasm \
379
+ -w true
380
+ ```
381
+
382
+ Example output:
383
+
384
+ ```
385
+ [i] Generating proofs of message processing...
386
+ [i] Progress: 1 / 1
387
+ [i] gen processMessage proof took 17.053 seconds
388
+
389
+ [i] Generating proofs of vote tallying...
390
+ [i] Progress: 1 / 1
391
+ [✓] The tally commitment is correct
392
+ [i] gen tally proof took 4.746 seconds
393
+ ```
394
+
395
+ ### Coordinator: prove on chain
396
+
397
+ Example usage:
398
+
399
+ ```bash
400
+ node build/ts/index.js proveOnChain \
401
+ -o 0 \
402
+ -f proofs/
403
+ ```
404
+
405
+ Example output:
406
+
407
+ ```
408
+ [i] Submitting proofs of message processing...
409
+ [i] Transaction hash: 0xa8acf67d6520ceaf5eef8acbf4cda7f5c2657122e2a72a092b9f4503282d70b9
410
+ [i] Progress: 1 / 1
411
+ [✓] All message processing proofs have been submitted.
412
+ [i] Submitting proofs of vote tallying...
413
+ [i] Progress: 1 / 1
414
+ [i] Transaction hash: 0x691687ab6fb504919859901f297cdb7d8c4d736756d2d4edf345d721bb82365b
415
+ [✓] All vote tallying proofs have been submitted.
416
+ ```
417
+
418
+ ### Anyone: verify tally
419
+
420
+ Example usage:
421
+
422
+ ```bash
423
+ node build/ts/index.js verify \
424
+ -o 0 \
425
+ -t tally.json
426
+ ```
427
+
428
+ Example output:
429
+
430
+ ```
431
+ [i] on-chain tally commitment: 83601b7979c13506317b58e859950e9e92e1e6d326810d89332cc13909833ec
432
+ [✓] The on-chain tally commitment matches.
433
+ [i] The on-chain tally matches the off-chain tally.
434
+ ```
435
+
436
+ ## Demonstration
437
+
438
+ ### Scenario:
439
+
440
+ 1. Alice votes for Party A
441
+ 2. Alice changes her key
442
+ 3. Eve tries to bribe Alice to change her vote to Party B
443
+ 4. Alice submits an invalid vote for Party B
444
+ 5. The coordinator processes the votes, computes, and verifies the final tally
445
+ 6. The expected result is: Party A has some votes and Party B has 0 votes.
446
+
447
+ Implication: Alice's invalid vote was not counted, and Eve had no way to tell.
448
+
449
+ ### Examples of serialized public and private keys:
450
+
451
+ ```
452
+ Coordinator:
453
+ Public key: macipk.281830024fb6d21a4c73a89a7139aff61fbbddad731ef2dc2db9516171fd390e
454
+ Private key: macisk.bf92af7614b07e2ba19dce65bb7fef2b93d83b84da2cf2e3af690104fbc52511
455
+
456
+ Alice:
457
+ Public key: macipk.1cac8e4e5b54d7dcce4aa06e71d8b9f324458756e7a9368383d005592719512a
458
+ Private key: macisk.63e796e4e5d18a5fcf4ccef1e74e83b807a165d6727bb89201782240458f7420
459
+ ```
460
+
461
+ ### Coordinator: Deploy VkRegistry
462
+
463
+ ```bash
464
+ node build/ts/index.js deployVkRegistry
465
+ ```
466
+
467
+ Output:
468
+
469
+ ```bash
470
+ [✓] VkRegistry deployed at: 0x7607Cfe2fA0d62F725537e55d83C693Cc3C76EF2
471
+ ```
472
+
473
+ ### Coordinator: Set verifying keys
474
+
475
+ ```bash
476
+ node build/ts/index.js setVerifyingKeys \
477
+ --state-tree-depth 10 \
478
+ --int-state-tree-depth 1 \
479
+ --msg-tree-depth 2 \
480
+ --vote-option-tree-depth 2 \
481
+ --msg-batch-depth 1 \
482
+ --process-messages-zkey ./zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test.0.zkey \
483
+ --tally-votes-zkey ./zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test.0.zkey
484
+ ```
485
+
486
+ Output:
487
+
488
+ ```bash
489
+ [i] Setting verifying keys...
490
+ [i] Transaction hash: 0xbd5d06935537fb59903c27b9bdb19a41d422f75e1dfd6eb61f028bf3a7b82c76
491
+ [✓] Verifying keys set successfully
492
+ ```
493
+
494
+ ### Coordinator: Create MACI instance
495
+
496
+ ```bash
497
+ node build/ts/index.js create -s 10
498
+ ```
499
+
500
+ Output:
501
+
502
+ ```bash
503
+ [✓] MACI deployed at: 0xC131D3eeD9D6D410A7bfc200d81b9795f1bb5ed6
504
+ ```
505
+
506
+ ### Coordinator: Deploy poll
507
+
508
+ ```bash
509
+ node ./build/ts/index.js deployPoll \
510
+ -pk macipk.281830024fb6d21a4c73a89a7139aff61fbbddad731ef2dc2db9516171fd390e \
511
+ -t 1000 -i 1 -m 2 -b 1 -v 2
512
+ ```
513
+
514
+ Output:
515
+
516
+ ```bash
517
+ [i] Poll ID: 0
518
+ [i] Poll contract: 0x2c3Adf2852788662148038511aD80962aaf631D7
519
+ [i] Message processor contract: 0xd3C3C6530fE4073292D6EAfdEAdEeAbf1A3DC19B
520
+ [i] Tally contract: 0x06c1939F6cBb68D42333F140CAE815cc36D341b0
521
+ [i] Subsidy contract: 0xCB74254716c96B07c812c73A5945e68aa1de4569
522
+ ```
523
+
524
+ ### Alice: sign up
525
+
526
+ ```bash
527
+ node ./build/ts/index.js signup \
528
+ --pubkey macipk.1cac8e4e5b54d7dcce4aa06e71d8b9f324458756e7a9368383d005592719512a
529
+ ```
530
+
531
+ Output:
532
+
533
+ ```bash
534
+ [i] Transaction hash: 0x7ab4c2d23686049432d19bb64c8ee4e8776fff134d971dcf27e1f513b4fdb97f
535
+ [✓] State index: 1
536
+ ```
537
+
538
+ ### Alice: votes for Party A (option index 0)
539
+
540
+ ```bash
541
+ node build/ts/index.js publish \
542
+ --pubkey macipk.1cac8e4e5b54d7dcce4aa06e71d8b9f324458756e7a9368383d005592719512a \
543
+ --privkey macisk.63e796e4e5d18a5fcf4ccef1e74e83b807a165d6727bb89201782240458f7420 \
544
+ --state-index 1 \
545
+ --vote-option-index 0 \
546
+ --new-vote-weight 9 \
547
+ --nonce 1 \
548
+ --poll-id 0
549
+ ```
550
+
551
+ Output:
552
+
553
+ ```bash
554
+ [i] Transaction hash: 0x60936cfb0b25c8618d3cb8d0f5497106d5f6e3776f3212932975442d874eddbd
555
+ [i] Ephemeral private key: macisk.103b8c4c98700d06f47522892032fce54bd03cd197cee495ede3802730409910
556
+ ```
557
+
558
+ ### Alice: submits an invalid vote for Party B (option index 1) with different public key
559
+
560
+ ```bash
561
+ node build/ts/index.js publish \
562
+ --pubkey macipk.1cac8e4e5b54d7dcce4aa06e71d8b9f324458756e7a9368383d005592719512a \
563
+ --privkey macisk.63e796e4e5d18a5fcf4ccef1e74e83b807a165d6727bb89201782240458f7420 \
564
+ --state-index 1 \
565
+ --vote-option-index 1 \
566
+ --new-vote-weight 9 \
567
+ --nonce 2 \
568
+ --poll-id 0
569
+ ```
570
+
571
+ Output:
572
+
573
+ ```bash
574
+ [i] Transaction hash: 0x73f74b13d276cd311ce5421a145debc71e97e48abc8be2f9a0a548b26f7920f9
575
+ [i] Ephemeral private key: macisk.1e490d67477b4c5f08806973fca2bea81e723c60deba6bdeacab56f7a4bd867b
576
+ ```
577
+
578
+ ### Coordinator: Time Travel
579
+
580
+ ```bash
581
+ node build/ts/index.js timeTravel -s 1000
582
+ ```
583
+
584
+ Output:
585
+
586
+ ```
587
+ [✓] Fast-forwarded 1000 seconds
588
+ ```
589
+
590
+ ### Coordinator: merge state tree
591
+
592
+ ```bash
593
+ node build/ts/index.js mergeSignups --poll-id 0
594
+ ```
595
+
596
+ Output:
597
+
598
+ ```bash
599
+ [i] Merging state subroots 1 / 1
600
+ [i] Transaction hash: 0xd01932e8dfad251f9b0d288290ac17f12bc449ea859a6921f63edf6b4b06f4c9
601
+ [✓] Executed mergeMaciStateAqSubRoots(); gas used: 720061
602
+ [✓] All state subtrees have been merged.
603
+ [i] Merging subroots to a main state root...
604
+ [i] Transaction hash: 0x25f60a9b5a24d11b87c41d8a4f681e3fd895b3bdf78ea86755b9800005662ce6
605
+ [✓] Executed mergeStateAq(); gas used: 1004720
606
+ ```
607
+
608
+ ### Coordinator: merge message tree
609
+
610
+ ```bash
611
+ node build/ts/index.js mergeMessages --poll-id 0
612
+ ```
613
+
614
+ Output:
615
+
616
+ ```bash
617
+ [i] Merging message subroots 1 / 1
618
+ [✓] Executed mergeMessageAqSubRoots(); gas used: 600520
619
+ [i] Transaction hash: 0xac0e8a01277db1b6282f8fb3763a8a4aeeebb3e12a41dd0dee9fc2804a4c9e81
620
+ [✓] All message subtrees have been merged.
621
+ [i] Merging subroots to a main message root...
622
+ [✓] Executed mergeMessageAq(); gas used: 173346
623
+ [i] Transaction hash: 0x472f0fd515c7cd2a02c430189e4ee92a6843bd6b19807484ce454cb7dab0e931
624
+ [✓] The message tree has been merged.
625
+ ```
626
+
627
+ ### Coordinator: generate proofs
628
+
629
+ ```bash
630
+ node build/ts/index.js genProofs \
631
+ --privkey macisk.bf92af7614b07e2ba19dce65bb7fef2b93d83b84da2cf2e3af690104fbc52511 \
632
+ --poll-id 0 \
633
+ --process-zkey ./zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test.0.zkey \
634
+ --tally-zkey ./zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test.0.zkey \
635
+ --tally-file tally.json \
636
+ --output proofs/ \
637
+ -tw ./zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test_js/TallyVotes_10-1-2_test.wasm \
638
+ -pw ./zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test_js/ProcessMessages_10-2-1-2_test.wasm \
639
+ -w true
640
+ ```
641
+
642
+ Output:
643
+
644
+ ```bash
645
+ [i] Generating proofs of message processing...
646
+ [i] Progress: 1 / 1
647
+ [i] gen processMessage proof took 16.644 seconds
648
+
649
+ [i] Generating proofs of vote tallying...
650
+ [i] Progress: 1 / 1
651
+ [✓] The tally commitment is correct
652
+ [i] gen tally proof took 4.809 seconds
653
+ ```
654
+
655
+ ### Coordinator: prove on chain
656
+
657
+ ```bash
658
+ node build/ts/index.js proveOnChain \
659
+ --poll-id 0 \
660
+ --proof-dir proofs/
661
+ ```
662
+
663
+ Output:
664
+
665
+ ```bash
666
+ [i] Submitting proofs of message processing...
667
+ [i] Transaction hash: 0x9c3280af80de2436f9a886e4cd94218e01fe35ea3d3e671aad97b5aa5d6108ed
668
+ [i] Progress: 1 / 1
669
+ [✓] All message processing proofs have been submitted.
670
+ [i] Submitting proofs of vote tallying...
671
+ [i] Progress: 1 / 1
672
+ [i] Transaction hash: 0x3e82ae3ad04215d4f357455ab5a610eba082796d2abc698aad91b046d16b9350
673
+ [✓] All vote tallying proofs have been submitted.
674
+ ```
675
+
676
+ ### Anyone: verify
677
+
678
+ ```bash
679
+ node build/ts/index.js verify \
680
+ --poll-id 0 \
681
+ --tally-file tally.json
682
+ ```
683
+
684
+ Output:
685
+
686
+ ```bash
687
+ [i] on-chain tally commitment: 1ed004ac21a5397a512cbe749e7110934a434837f4818265043fd2e2e9cbec91
688
+ [✓] The on-chain tally commitment matches.
689
+ ```