@maci-protocol/website 0.0.0-ci.044d30d → 0.0.0-ci.063ef62

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 (51) hide show
  1. package/LICENSE +1 -2
  2. package/blog/2024-02-28-maci-v1.2.0.md +1 -1
  3. package/blog/2024-08-10-maci-v2.md +1 -1
  4. package/docusaurus.config.ts +2 -2
  5. package/package.json +4 -4
  6. package/src/pages/roadmap.md +39 -80
  7. package/static/img/circuits/MACI-Circuits.excalidraw +79 -79
  8. package/static/img/circuits/ecdh.svg +1 -1
  9. package/static/img/circuits/messageToCommand.svg +1 -1
  10. package/static/img/circuits/messageValidator.svg +1 -1
  11. package/static/img/circuits/privToPubkey.svg +1 -1
  12. package/static/img/circuits/processMessages.svg +1 -1
  13. package/static/img/circuits/processMessagesInputHasher.svg +1 -1
  14. package/static/img/circuits/processMessages_2_0.svg +1 -1
  15. package/static/img/circuits/processOne.svg +1 -1
  16. package/static/img/circuits/processTopup.svg +1 -1
  17. package/static/img/circuits/quinBatchLeavesExists.svg +1 -1
  18. package/static/img/circuits/quinCheckRoot.svg +1 -1
  19. package/static/img/circuits/quinGeneratePathIndices.svg +1 -1
  20. package/static/img/circuits/quinSelector.svg +1 -1
  21. package/static/img/circuits/resultsCommitmentVerifier.svg +1 -1
  22. package/static/img/circuits/splicer.svg +1 -1
  23. package/static/img/circuits/tallyInputHasher.svg +1 -1
  24. package/static/img/circuits/tallyVotes.svg +1 -1
  25. package/static/img/circuits/verifySignature.svg +1 -1
  26. package/versioned_docs/version-v0.x/quadratic-vote-tallying-circuit.md +16 -16
  27. package/versioned_docs/version-v3.x/core-concepts/key-change.md +28 -28
  28. package/versioned_docs/version-v3.x/core-concepts/maci-keys.md +1 -1
  29. package/versioned_docs/version-v3.x/core-concepts/poll-types.md +3 -3
  30. package/versioned_docs/version-v3.x/core-concepts/polls.md +4 -4
  31. package/versioned_docs/version-v3.x/core-concepts/spec.md +39 -105
  32. package/versioned_docs/version-v3.x/guides/compile-circuits.md +7 -7
  33. package/versioned_docs/version-v3.x/guides/integrating.md +9 -9
  34. package/versioned_docs/version-v3.x/guides/testing/testing-in-detail.md +1 -1
  35. package/versioned_docs/version-v3.x/guides/troubleshooting.md +11 -11
  36. package/versioned_docs/version-v3.x/quick-start.md +29 -21
  37. package/versioned_docs/version-v3.x/security/audit.md +2 -2
  38. package/versioned_docs/version-v3.x/supported-networks/deployed-contracts.md +8 -8
  39. package/versioned_docs/version-v3.x/technical-references/smart-contracts/MACI.md +6 -6
  40. package/versioned_docs/version-v3.x/technical-references/smart-contracts/MessageProcessor.md +1 -1
  41. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Params.md +2 -2
  42. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Poll.md +8 -8
  43. package/versioned_docs/version-v3.x/technical-references/smart-contracts/PollFactory.md +1 -1
  44. package/versioned_docs/version-v3.x/technical-references/smart-contracts/Tally.md +3 -3
  45. package/versioned_docs/version-v3.x/technical-references/smart-contracts/VkRegistry.md +5 -5
  46. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/joinPoll.md +3 -3
  47. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/processMessages.md +12 -12
  48. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/setup.md +1 -1
  49. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/tallyVotes.md +3 -3
  50. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/utilities.md +7 -7
  51. package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +1 -1
@@ -18,4 +18,4 @@
18
18
  </style>
19
19
 
20
20
  </defs>
21
- <rect x="0" y="0" width="1217.3312986646956" height="496.83961586464534" fill="#ffffff"></rect><g stroke-linecap="round" transform="translate(321.0041776352655 269.2483868541449) rotate(0 114.33810379333897 33.800522136203085)"><path d="M16.9 0 C88.76 -0.11, 158 0.44, 211.78 0 M16.9 0 C71.53 0.82, 127.07 1.75, 211.78 0 M211.78 0 C223.68 -0.9, 227.92 5.41, 228.68 16.9 M211.78 0 C225.18 -0.9, 226.79 5.25, 228.68 16.9 M228.68 16.9 C227.74 23.13, 228.84 30.7, 228.68 50.7 M228.68 16.9 C227.98 29.02, 228.54 40.3, 228.68 50.7 M228.68 50.7 C228.21 60.46, 222 67.03, 211.78 67.6 M228.68 50.7 C228.75 64.04, 223.87 66.73, 211.78 67.6 M211.78 67.6 C168.98 65.25, 127.31 68.09, 16.9 67.6 M211.78 67.6 C163.66 70.17, 117.7 68.45, 16.9 67.6 M16.9 67.6 C6.89 68.79, 0.74 63.11, 0 50.7 M16.9 67.6 C6.18 66.16, 1.05 63.67, 0 50.7 M0 50.7 C1.57 41.72, -1.05 32.87, 0 16.9 M0 50.7 C-1.02 41.13, -0.71 32.91, 0 16.9 M0 16.9 C-1.23 6.5, 4.23 -0.32, 16.9 0 M0 16.9 C0.42 4.17, 5.24 -0.28, 16.9 0" stroke="#1971c2" stroke-width="1" fill="none"></path></g><g transform="translate(362.94235619667086 290.54890899034785) rotate(0 72.3999252319336 12.5)"><text x="72.3999252319336" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#e03131" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">VerifySignature</text></g><g stroke-linecap="round"><g transform="translate(421.4347549620111 183.87817598008132) rotate(0 -2.731305301702662 40.81570261330023)"><path d="M1.15 -0.19 C-0.03 13.24, -5.01 67.39, -6.26 80.99 M0.29 -1.34 C-0.58 12.2, -3.27 68.21, -3.96 82.19" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(421.4347549620111 183.87817598008132) rotate(0 -2.731305301702662 40.81570261330023)"><path d="M-12.83 53.53 C-9.79 62.65, -7.29 73.06, -3.96 82.19 M-12.83 53.53 C-10.21 60.96, -8.45 69.25, -3.96 82.19" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(421.4347549620111 183.87817598008132) rotate(0 -2.731305301702662 40.81570261330023)"><path d="M7.67 54.53 C3.17 63.48, -1.86 73.52, -3.96 82.19 M7.67 54.53 C4.61 61.83, 0.68 69.84, -3.96 82.19" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g></g><mask></mask><g transform="translate(467.98908237813475 222.12563565743494) rotate(0 31.809967041015625 12.5)"><text x="0" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="start" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">Inputs</text></g><g transform="translate(479.2753184901371 370.6925433639308) rotate(0 34.84996032714844 12.5)"><text x="0" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="start" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">Output</text></g><g stroke-linecap="round"><g transform="translate(418.5707446353731 356.0076752655941) rotate(0 0.2229014099474398 20.511057519056408)"><path d="M-0.3 0.39 C-0.13 7.21, 0.53 34.01, 0.62 40.77 M0.54 0.11 C0.69 7.01, 0.41 34.44, 0.28 41.35" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(418.5707446353731 356.0076752655941) rotate(0 0.2229014099474398 20.511057519056408)"><path d="M-6.48 21.98 C-4.26 26.72, -3.88 30.42, 0.28 41.35 M-6.48 21.98 C-4.85 27.51, -2.89 33.64, 0.28 41.35" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(418.5707446353731 356.0076752655941) rotate(0 0.2229014099474398 20.511057519056408)"><path d="M7.55 22.17 C6.58 26.82, 3.77 30.49, 0.28 41.35 M7.55 22.17 C5.13 27.61, 3.03 33.69, 0.28 41.35" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g></g><mask></mask><g stroke-linecap="round" transform="translate(321.73479892342675 421.93401753200305) rotate(0 110.05757116156974 32.17741655087593)"><path d="M16.09 0 C61.23 -1.36, 107.97 1.26, 204.03 0 M16.09 0 C64.31 1.22, 113.35 -0.31, 204.03 0 M204.03 0 C213.58 -0.15, 219.1 6.12, 220.12 16.09 M204.03 0 C212.78 -0.82, 219.17 6.98, 220.12 16.09 M220.12 16.09 C218.79 25.21, 219.73 36.48, 220.12 48.27 M220.12 16.09 C219.36 28.22, 219.51 40.52, 220.12 48.27 M220.12 48.27 C219.18 57.48, 216.66 63.23, 204.03 64.35 M220.12 48.27 C221.16 60.86, 213.23 66.63, 204.03 64.35 M204.03 64.35 C133.07 66.27, 60.87 66.01, 16.09 64.35 M204.03 64.35 C159.24 65.69, 114.06 66.52, 16.09 64.35 M16.09 64.35 C5.93 63.28, 1.28 58.4, 0 48.27 M16.09 64.35 C7.06 65.69, -1.77 58, 0 48.27 M0 48.27 C0.71 38.68, -0.47 32.27, 0 16.09 M0 48.27 C0.5 40.12, -0.75 32.37, 0 16.09 M0 16.09 C-0.54 6.98, 6.78 -1.23, 16.09 0 M0 16.09 C-1.55 4.33, 5.09 1.94, 16.09 0" stroke="#1971c2" stroke-width="1" fill="none"></path></g><g transform="translate(409.3823893110707 441.611434082879) rotate(0 22.40998077392578 12.5)"><text x="22.40998077392578" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#2f9e44" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">valid</text></g><g transform="translate(604.3045623273312 260.52445102419415) rotate(0 49.669944763183594 12.5)"><text x="0" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="start" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">Processing</text></g><g stroke-linecap="round"><g transform="translate(610.393068410685 311.06455075794474) rotate(0 93.97450351338216 1.8903043869634075)"><path d="M-0.98 -0.2 C29.99 0.69, 155.65 4.33, 186.98 4.87 M0.7 -1.35 C31.95 -0.73, 157.73 2.44, 189.18 3.32" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(610.393068410685 311.06455075794474) rotate(0 93.97450351338216 1.8903043869634075)"><path d="M160.73 12.84 C171.61 7.71, 184.95 4, 189.18 3.32 M160.73 12.84 C167.04 10.98, 173.45 7.98, 189.18 3.32" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(610.393068410685 311.06455075794474) rotate(0 93.97450351338216 1.8903043869634075)"><path d="M161.27 -7.68 C171.86 -4.74, 184.99 -0.39, 189.18 3.32 M161.27 -7.68 C167.33 -4.66, 173.62 -2.78, 189.18 3.32" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g></g><mask></mask><g transform="translate(10 269.0311999256169) rotate(0 126.28990173339844 12.5)"><text x="0" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="start" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">Verify a EdDSA signature</text></g><g stroke-linecap="round" transform="translate(312.12392397068345 107.21675958591004) rotate(0 110.05757116156974 32.17741655087593)"><path d="M16.09 0 C56.02 0.32, 98.3 0.48, 204.03 0 M16.09 0 C79.15 1.37, 143.18 1.24, 204.03 0 M204.03 0 C214.29 -1.51, 219.08 4.79, 220.12 16.09 M204.03 0 C214.83 2.07, 220.94 4.49, 220.12 16.09 M220.12 16.09 C218.66 22, 218.47 31.69, 220.12 48.27 M220.12 16.09 C219.6 24.91, 221.1 31.02, 220.12 48.27 M220.12 48.27 C221.37 60.18, 215.49 65.5, 204.03 64.35 M220.12 48.27 C220.66 57.55, 215.8 66.06, 204.03 64.35 M204.03 64.35 C152.45 63.52, 96.71 64.23, 16.09 64.35 M204.03 64.35 C152.46 65.02, 101.97 65.93, 16.09 64.35 M16.09 64.35 C4.13 65.22, -1.4 58.67, 0 48.27 M16.09 64.35 C5.78 62.89, -0.39 58.71, 0 48.27 M0 48.27 C-1.2 36.64, 1.79 27.5, 0 16.09 M0 48.27 C0.1 41.44, -0.53 33.73, 0 16.09 M0 16.09 C-1.02 7.29, 3.92 -0.5, 16.09 0 M0 16.09 C1.22 6.57, 5.1 1.21, 16.09 0" stroke="#1971c2" stroke-width="1" fill="none"></path></g><g transform="translate(390.20152992229225 126.89417613678597) rotate(0 31.979965209960938 12.5)"><text x="31.979965209960938" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">pubKey</text></g><g stroke-linecap="round" transform="translate(821.4290949205064 156.92763297834836) rotate(0 110.05757116156974 42.5)"><path d="M21.25 0 C64.85 -0.82, 106.22 0.08, 198.87 0 M21.25 0 C86.8 -1.76, 152.3 -1.29, 198.87 0 M198.87 0 C213.1 1.8, 220.83 6.33, 220.12 21.25 M198.87 0 C211.03 -0.95, 218.45 5.57, 220.12 21.25 M220.12 21.25 C218.66 32.92, 221.42 41.45, 220.12 63.75 M220.12 21.25 C221.1 38.8, 220.84 55.72, 220.12 63.75 M220.12 63.75 C220.59 76.66, 213.95 86.48, 198.87 85 M220.12 63.75 C219.72 77.8, 211.31 86.78, 198.87 85 M198.87 85 C139.94 87.61, 83.36 84.6, 21.25 85 M198.87 85 C152.62 86.28, 106.9 85.69, 21.25 85 M21.25 85 C7.45 83.73, -0.34 77.67, 0 63.75 M21.25 85 C8.11 83.74, -1.84 76.34, 0 63.75 M0 63.75 C-1.57 50.79, -1.24 40.29, 0 21.25 M0 63.75 C-0.19 48.37, -0.4 30.81, 0 21.25 M0 21.25 C1.06 8.14, 6.86 1.06, 21.25 0 M0 21.25 C-1.74 9, 5.48 -1.54, 21.25 0" stroke="#1971c2" stroke-width="1" fill="none"></path></g><g transform="translate(829.3667472588339 174.42763297834836) rotate(0 102.11991882324219 25)"><text x="102.11991882324219" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">1. hash the preImage</text><text x="102.11991882324219" y="25" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">using Poseidon</text></g><g stroke-linecap="round" transform="translate(819.2869353481848 267.96382233672193) rotate(0 194.02218165825548 55)"><path d="M27.5 0 C99.75 1.14, 170.87 0.61, 360.54 0 M27.5 0 C102.25 1.25, 177.2 0.39, 360.54 0 M360.54 0 C377.13 -0.82, 386.6 7.85, 388.04 27.5 M360.54 0 C377.8 -1.74, 390.23 7.87, 388.04 27.5 M388.04 27.5 C390.47 48.17, 387.02 66.74, 388.04 82.5 M388.04 27.5 C388.49 46.65, 388.7 67.8, 388.04 82.5 M388.04 82.5 C387.7 100.73, 377.38 111.55, 360.54 110 M388.04 82.5 C388.7 99.6, 380.35 109.32, 360.54 110 M360.54 110 C235.51 107.65, 112.3 107.43, 27.5 110 M360.54 110 C246.4 109.21, 131.89 109.56, 27.5 110 M27.5 110 C10.06 108.91, -1.6 99.46, 0 82.5 M27.5 110 C8.55 111.86, 1.62 99.42, 0 82.5 M0 82.5 C1.94 68.21, 1.87 55.87, 0 27.5 M0 82.5 C0.93 61.22, 0.28 39.42, 0 27.5 M0 27.5 C-1.51 10.83, 7.77 -1.34, 27.5 0 M0 27.5 C0.21 10.77, 10.3 -1.48, 27.5 0" stroke="#1971c2" stroke-width="1" fill="none"></path></g><g transform="translate(831.4892470113231 272.96382233672193) rotate(0 181.8198699951172 50)"><text x="181.8198699951172" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">2. Verify using </text><text x="181.8198699951172" y="25" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">EdDSAPoseidonVerifier_patched</text><text x="181.8198699951172" y="50" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">which takes all inputs and the hash </text><text x="181.8198699951172" y="75" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">of the preImage of the signature</text></g><g stroke-linecap="round" transform="translate(818.1681233501882 401.83961586464534) rotate(0 110.05757116156974 42.5)"><path d="M21.25 0 C75.84 -0.63, 132.88 0.48, 198.87 0 M21.25 0 C89.63 0.26, 159.03 0.01, 198.87 0 M198.87 0 C212.09 -1.52, 222.02 5.95, 220.12 21.25 M198.87 0 C214.07 1.87, 218.6 9.36, 220.12 21.25 M220.12 21.25 C220.99 38.3, 220.95 54.36, 220.12 63.75 M220.12 21.25 C220.14 31.29, 219.56 42.2, 220.12 63.75 M220.12 63.75 C220.68 76.85, 214.31 84.41, 198.87 85 M220.12 63.75 C221.81 79.26, 211.27 84.01, 198.87 85 M198.87 85 C154.56 82.5, 108.21 84.27, 21.25 85 M198.87 85 C157.35 84.24, 114.13 84.1, 21.25 85 M21.25 85 C6.55 86.62, 1.41 76.69, 0 63.75 M21.25 85 C5.54 83.96, -0.27 79.86, 0 63.75 M0 63.75 C1.58 52.71, -0.85 45.62, 0 21.25 M0 63.75 C-0.71 49.6, -0.65 33.11, 0 21.25 M0 21.25 C0.19 8.48, 8.07 -1.28, 21.25 0 M0 21.25 C1.8 5.83, 7.43 -0.4, 21.25 0" stroke="#1971c2" stroke-width="1" fill="none"></path></g><g transform="translate(826.6457766040431 419.33961586464534) rotate(0 101.57991790771484 25)"><text x="101.57991790771484" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">3. Return whether is</text><text x="101.57991790771484" y="25" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">valid or not</text></g><g stroke-linecap="round" transform="translate(61.99469259540717 105.26086868321454) rotate(0 110.05757116156974 32.17741655087593)"><path d="M16.09 0 C55.1 -0.82, 97.29 -0.92, 204.03 0 M16.09 0 C60.06 -0.54, 104.77 -0.21, 204.03 0 M204.03 0 C215.56 0.02, 221.19 3.66, 220.12 16.09 M204.03 0 C212.7 -0.46, 219.69 7.48, 220.12 16.09 M220.12 16.09 C218.9 24.79, 222.29 30.57, 220.12 48.27 M220.12 16.09 C219.82 25.65, 220.33 36.12, 220.12 48.27 M220.12 48.27 C220.67 59.81, 214.06 64.01, 204.03 64.35 M220.12 48.27 C218.84 57.11, 215.53 65.49, 204.03 64.35 M204.03 64.35 C134.44 65.69, 64.81 63.6, 16.09 64.35 M204.03 64.35 C143.77 63.08, 84.22 63.05, 16.09 64.35 M16.09 64.35 C3.45 63.62, -0.75 60.78, 0 48.27 M16.09 64.35 C6.47 65.87, -1.2 57.38, 0 48.27 M0 48.27 C-2.21 38.1, 1.4 31.59, 0 16.09 M0 48.27 C0.64 35.13, -1.24 22.69, 0 16.09 M0 16.09 C-1.63 6.15, 6.4 0.31, 16.09 0 M0 16.09 C-1.72 5.89, 4.62 -0.88, 16.09 0" stroke="#1971c2" stroke-width="1" fill="none"></path></g><g transform="translate(120.202311059223 124.93828523409047) rotate(0 51.849952697753906 12.5)"><text x="51.849952697753906" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">signatureR</text></g><g stroke-linecap="round" transform="translate(552.8217271194076 104.8566288276329) rotate(0 110.05757116156974 32.17741655087593)"><path d="M16.09 0 C92.23 0.62, 166.8 -1.05, 204.03 0 M16.09 0 C64.87 1.81, 113.62 1.49, 204.03 0 M204.03 0 C214.38 -0.92, 220.6 5.98, 220.12 16.09 M204.03 0 C216.62 0.01, 221 5.33, 220.12 16.09 M220.12 16.09 C218.65 23.6, 220.85 34.37, 220.12 48.27 M220.12 16.09 C220.16 26.13, 220.33 37.13, 220.12 48.27 M220.12 48.27 C219.07 59.89, 216.63 66.01, 204.03 64.35 M220.12 48.27 C222.26 60.44, 215.63 64, 204.03 64.35 M204.03 64.35 C146.66 63.06, 85.76 65.02, 16.09 64.35 M204.03 64.35 C148.04 63.62, 91.25 62.28, 16.09 64.35 M16.09 64.35 C4.39 63.79, 0.45 57.77, 0 48.27 M16.09 64.35 C3.07 64.5, 0.29 58.04, 0 48.27 M0 48.27 C-1.58 36.6, -0.76 24, 0 16.09 M0 48.27 C-0.94 36.5, -0.41 25.6, 0 16.09 M0 16.09 C1.69 6.74, 3.6 -1.36, 16.09 0 M0 16.09 C-1.76 5.43, 3.32 1.68, 16.09 0" stroke="#1971c2" stroke-width="1" fill="none"></path></g><g transform="translate(611.7293501608601 124.53404537850884) rotate(0 51.14994812011719 12.5)"><text x="51.14994812011719" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">signatureS</text></g><g stroke-linecap="round" transform="translate(319.9645984579398 10) rotate(0 110.05757116156974 32.17741655087593)"><path d="M16.09 0 C56.1 -3.17, 96.71 -3.37, 204.03 0 M16.09 0 C67.11 -0.94, 117.53 -0.81, 204.03 0 M204.03 0 C216.63 -1.52, 218.55 5.29, 220.12 16.09 M204.03 0 C213.59 0.13, 219.04 5.35, 220.12 16.09 M220.12 16.09 C220.84 26.31, 218.45 37.31, 220.12 48.27 M220.12 16.09 C221.15 28.91, 219.9 40.65, 220.12 48.27 M220.12 48.27 C218.34 58.62, 215.88 65.94, 204.03 64.35 M220.12 48.27 C221.98 60.4, 216.18 62.69, 204.03 64.35 M204.03 64.35 C154.41 64.6, 108.46 63.64, 16.09 64.35 M204.03 64.35 C142.34 64.99, 81.51 64.34, 16.09 64.35 M16.09 64.35 C3.84 64.21, -1.05 57.06, 0 48.27 M16.09 64.35 C6.55 66.09, -1.49 61.09, 0 48.27 M0 48.27 C0.34 36.09, -0.03 24.79, 0 16.09 M0 48.27 C-1.02 39.7, -0.21 30.88, 0 16.09 M0 16.09 C1.6 3.93, 6.96 0.4, 16.09 0 M0 16.09 C-1.78 5.13, 4.26 -1.6, 16.09 0" stroke="#1971c2" stroke-width="1" fill="none"></path></g><g transform="translate(365.8422227200955 17.177416550875932) rotate(0 64.17994689941406 25)"><text x="64.17994689941406" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">preImage (4 </text><text x="64.17994689941406" y="25" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">elements)</text></g></svg>
21
+ <rect x="0" y="0" width="1217.3312986646956" height="496.83961586464534" fill="#ffffff"></rect><g stroke-linecap="round" transform="translate(321.0041776352655 269.2483868541449) rotate(0 114.33810379333897 33.800522136203085)"><path d="M16.9 0 C88.76 -0.11, 158 0.44, 211.78 0 M16.9 0 C71.53 0.82, 127.07 1.75, 211.78 0 M211.78 0 C223.68 -0.9, 227.92 5.41, 228.68 16.9 M211.78 0 C225.18 -0.9, 226.79 5.25, 228.68 16.9 M228.68 16.9 C227.74 23.13, 228.84 30.7, 228.68 50.7 M228.68 16.9 C227.98 29.02, 228.54 40.3, 228.68 50.7 M228.68 50.7 C228.21 60.46, 222 67.03, 211.78 67.6 M228.68 50.7 C228.75 64.04, 223.87 66.73, 211.78 67.6 M211.78 67.6 C168.98 65.25, 127.31 68.09, 16.9 67.6 M211.78 67.6 C163.66 70.17, 117.7 68.45, 16.9 67.6 M16.9 67.6 C6.89 68.79, 0.74 63.11, 0 50.7 M16.9 67.6 C6.18 66.16, 1.05 63.67, 0 50.7 M0 50.7 C1.57 41.72, -1.05 32.87, 0 16.9 M0 50.7 C-1.02 41.13, -0.71 32.91, 0 16.9 M0 16.9 C-1.23 6.5, 4.23 -0.32, 16.9 0 M0 16.9 C0.42 4.17, 5.24 -0.28, 16.9 0" stroke="#1971c2" stroke-width="1" fill="none"></path></g><g transform="translate(362.94235619667086 290.54890899034785) rotate(0 72.3999252319336 12.5)"><text x="72.3999252319336" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#e03131" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">VerifySignature</text></g><g stroke-linecap="round"><g transform="translate(421.4347549620111 183.87817598008132) rotate(0 -2.731305301702662 40.81570261330023)"><path d="M1.15 -0.19 C-0.03 13.24, -5.01 67.39, -6.26 80.99 M0.29 -1.34 C-0.58 12.2, -3.27 68.21, -3.96 82.19" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(421.4347549620111 183.87817598008132) rotate(0 -2.731305301702662 40.81570261330023)"><path d="M-12.83 53.53 C-9.79 62.65, -7.29 73.06, -3.96 82.19 M-12.83 53.53 C-10.21 60.96, -8.45 69.25, -3.96 82.19" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(421.4347549620111 183.87817598008132) rotate(0 -2.731305301702662 40.81570261330023)"><path d="M7.67 54.53 C3.17 63.48, -1.86 73.52, -3.96 82.19 M7.67 54.53 C4.61 61.83, 0.68 69.84, -3.96 82.19" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g></g><mask></mask><g transform="translate(467.98908237813475 222.12563565743494) rotate(0 31.809967041015625 12.5)"><text x="0" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="start" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">Inputs</text></g><g transform="translate(479.2753184901371 370.6925433639308) rotate(0 34.84996032714844 12.5)"><text x="0" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="start" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">Output</text></g><g stroke-linecap="round"><g transform="translate(418.5707446353731 356.0076752655941) rotate(0 0.2229014099474398 20.511057519056408)"><path d="M-0.3 0.39 C-0.13 7.21, 0.53 34.01, 0.62 40.77 M0.54 0.11 C0.69 7.01, 0.41 34.44, 0.28 41.35" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(418.5707446353731 356.0076752655941) rotate(0 0.2229014099474398 20.511057519056408)"><path d="M-6.48 21.98 C-4.26 26.72, -3.88 30.42, 0.28 41.35 M-6.48 21.98 C-4.85 27.51, -2.89 33.64, 0.28 41.35" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(418.5707446353731 356.0076752655941) rotate(0 0.2229014099474398 20.511057519056408)"><path d="M7.55 22.17 C6.58 26.82, 3.77 30.49, 0.28 41.35 M7.55 22.17 C5.13 27.61, 3.03 33.69, 0.28 41.35" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g></g><mask></mask><g stroke-linecap="round" transform="translate(321.73479892342675 421.93401753200305) rotate(0 110.05757116156974 32.17741655087593)"><path d="M16.09 0 C61.23 -1.36, 107.97 1.26, 204.03 0 M16.09 0 C64.31 1.22, 113.35 -0.31, 204.03 0 M204.03 0 C213.58 -0.15, 219.1 6.12, 220.12 16.09 M204.03 0 C212.78 -0.82, 219.17 6.98, 220.12 16.09 M220.12 16.09 C218.79 25.21, 219.73 36.48, 220.12 48.27 M220.12 16.09 C219.36 28.22, 219.51 40.52, 220.12 48.27 M220.12 48.27 C219.18 57.48, 216.66 63.23, 204.03 64.35 M220.12 48.27 C221.16 60.86, 213.23 66.63, 204.03 64.35 M204.03 64.35 C133.07 66.27, 60.87 66.01, 16.09 64.35 M204.03 64.35 C159.24 65.69, 114.06 66.52, 16.09 64.35 M16.09 64.35 C5.93 63.28, 1.28 58.4, 0 48.27 M16.09 64.35 C7.06 65.69, -1.77 58, 0 48.27 M0 48.27 C0.71 38.68, -0.47 32.27, 0 16.09 M0 48.27 C0.5 40.12, -0.75 32.37, 0 16.09 M0 16.09 C-0.54 6.98, 6.78 -1.23, 16.09 0 M0 16.09 C-1.55 4.33, 5.09 1.94, 16.09 0" stroke="#1971c2" stroke-width="1" fill="none"></path></g><g transform="translate(409.3823893110707 441.611434082879) rotate(0 22.40998077392578 12.5)"><text x="22.40998077392578" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#2f9e44" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">valid</text></g><g transform="translate(604.3045623273312 260.52445102419415) rotate(0 49.669944763183594 12.5)"><text x="0" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="start" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">Processing</text></g><g stroke-linecap="round"><g transform="translate(610.393068410685 311.06455075794474) rotate(0 93.97450351338216 1.8903043869634075)"><path d="M-0.98 -0.2 C29.99 0.69, 155.65 4.33, 186.98 4.87 M0.7 -1.35 C31.95 -0.73, 157.73 2.44, 189.18 3.32" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(610.393068410685 311.06455075794474) rotate(0 93.97450351338216 1.8903043869634075)"><path d="M160.73 12.84 C171.61 7.71, 184.95 4, 189.18 3.32 M160.73 12.84 C167.04 10.98, 173.45 7.98, 189.18 3.32" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(610.393068410685 311.06455075794474) rotate(0 93.97450351338216 1.8903043869634075)"><path d="M161.27 -7.68 C171.86 -4.74, 184.99 -0.39, 189.18 3.32 M161.27 -7.68 C167.33 -4.66, 173.62 -2.78, 189.18 3.32" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g></g><mask></mask><g transform="translate(10 269.0311999256169) rotate(0 126.28990173339844 12.5)"><text x="0" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="start" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">Verify a EdDSA signature</text></g><g stroke-linecap="round" transform="translate(312.12392397068345 107.21675958591004) rotate(0 110.05757116156974 32.17741655087593)"><path d="M16.09 0 C56.02 0.32, 98.3 0.48, 204.03 0 M16.09 0 C79.15 1.37, 143.18 1.24, 204.03 0 M204.03 0 C214.29 -1.51, 219.08 4.79, 220.12 16.09 M204.03 0 C214.83 2.07, 220.94 4.49, 220.12 16.09 M220.12 16.09 C218.66 22, 218.47 31.69, 220.12 48.27 M220.12 16.09 C219.6 24.91, 221.1 31.02, 220.12 48.27 M220.12 48.27 C221.37 60.18, 215.49 65.5, 204.03 64.35 M220.12 48.27 C220.66 57.55, 215.8 66.06, 204.03 64.35 M204.03 64.35 C152.45 63.52, 96.71 64.23, 16.09 64.35 M204.03 64.35 C152.46 65.02, 101.97 65.93, 16.09 64.35 M16.09 64.35 C4.13 65.22, -1.4 58.67, 0 48.27 M16.09 64.35 C5.78 62.89, -0.39 58.71, 0 48.27 M0 48.27 C-1.2 36.64, 1.79 27.5, 0 16.09 M0 48.27 C0.1 41.44, -0.53 33.73, 0 16.09 M0 16.09 C-1.02 7.29, 3.92 -0.5, 16.09 0 M0 16.09 C1.22 6.57, 5.1 1.21, 16.09 0" stroke="#1971c2" stroke-width="1" fill="none"></path></g><g transform="translate(390.20152992229225 126.89417613678597) rotate(0 31.979965209960938 12.5)"><text x="31.979965209960938" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">publicKey</text></g><g stroke-linecap="round" transform="translate(821.4290949205064 156.92763297834836) rotate(0 110.05757116156974 42.5)"><path d="M21.25 0 C64.85 -0.82, 106.22 0.08, 198.87 0 M21.25 0 C86.8 -1.76, 152.3 -1.29, 198.87 0 M198.87 0 C213.1 1.8, 220.83 6.33, 220.12 21.25 M198.87 0 C211.03 -0.95, 218.45 5.57, 220.12 21.25 M220.12 21.25 C218.66 32.92, 221.42 41.45, 220.12 63.75 M220.12 21.25 C221.1 38.8, 220.84 55.72, 220.12 63.75 M220.12 63.75 C220.59 76.66, 213.95 86.48, 198.87 85 M220.12 63.75 C219.72 77.8, 211.31 86.78, 198.87 85 M198.87 85 C139.94 87.61, 83.36 84.6, 21.25 85 M198.87 85 C152.62 86.28, 106.9 85.69, 21.25 85 M21.25 85 C7.45 83.73, -0.34 77.67, 0 63.75 M21.25 85 C8.11 83.74, -1.84 76.34, 0 63.75 M0 63.75 C-1.57 50.79, -1.24 40.29, 0 21.25 M0 63.75 C-0.19 48.37, -0.4 30.81, 0 21.25 M0 21.25 C1.06 8.14, 6.86 1.06, 21.25 0 M0 21.25 C-1.74 9, 5.48 -1.54, 21.25 0" stroke="#1971c2" stroke-width="1" fill="none"></path></g><g transform="translate(829.3667472588339 174.42763297834836) rotate(0 102.11991882324219 25)"><text x="102.11991882324219" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">1. hash the preImage</text><text x="102.11991882324219" y="25" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">using Poseidon</text></g><g stroke-linecap="round" transform="translate(819.2869353481848 267.96382233672193) rotate(0 194.02218165825548 55)"><path d="M27.5 0 C99.75 1.14, 170.87 0.61, 360.54 0 M27.5 0 C102.25 1.25, 177.2 0.39, 360.54 0 M360.54 0 C377.13 -0.82, 386.6 7.85, 388.04 27.5 M360.54 0 C377.8 -1.74, 390.23 7.87, 388.04 27.5 M388.04 27.5 C390.47 48.17, 387.02 66.74, 388.04 82.5 M388.04 27.5 C388.49 46.65, 388.7 67.8, 388.04 82.5 M388.04 82.5 C387.7 100.73, 377.38 111.55, 360.54 110 M388.04 82.5 C388.7 99.6, 380.35 109.32, 360.54 110 M360.54 110 C235.51 107.65, 112.3 107.43, 27.5 110 M360.54 110 C246.4 109.21, 131.89 109.56, 27.5 110 M27.5 110 C10.06 108.91, -1.6 99.46, 0 82.5 M27.5 110 C8.55 111.86, 1.62 99.42, 0 82.5 M0 82.5 C1.94 68.21, 1.87 55.87, 0 27.5 M0 82.5 C0.93 61.22, 0.28 39.42, 0 27.5 M0 27.5 C-1.51 10.83, 7.77 -1.34, 27.5 0 M0 27.5 C0.21 10.77, 10.3 -1.48, 27.5 0" stroke="#1971c2" stroke-width="1" fill="none"></path></g><g transform="translate(831.4892470113231 272.96382233672193) rotate(0 181.8198699951172 50)"><text x="181.8198699951172" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">2. Verify using </text><text x="181.8198699951172" y="25" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">EdDSAPoseidonVerifier_patched</text><text x="181.8198699951172" y="50" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">which takes all inputs and the hash </text><text x="181.8198699951172" y="75" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">of the preImage of the signature</text></g><g stroke-linecap="round" transform="translate(818.1681233501882 401.83961586464534) rotate(0 110.05757116156974 42.5)"><path d="M21.25 0 C75.84 -0.63, 132.88 0.48, 198.87 0 M21.25 0 C89.63 0.26, 159.03 0.01, 198.87 0 M198.87 0 C212.09 -1.52, 222.02 5.95, 220.12 21.25 M198.87 0 C214.07 1.87, 218.6 9.36, 220.12 21.25 M220.12 21.25 C220.99 38.3, 220.95 54.36, 220.12 63.75 M220.12 21.25 C220.14 31.29, 219.56 42.2, 220.12 63.75 M220.12 63.75 C220.68 76.85, 214.31 84.41, 198.87 85 M220.12 63.75 C221.81 79.26, 211.27 84.01, 198.87 85 M198.87 85 C154.56 82.5, 108.21 84.27, 21.25 85 M198.87 85 C157.35 84.24, 114.13 84.1, 21.25 85 M21.25 85 C6.55 86.62, 1.41 76.69, 0 63.75 M21.25 85 C5.54 83.96, -0.27 79.86, 0 63.75 M0 63.75 C1.58 52.71, -0.85 45.62, 0 21.25 M0 63.75 C-0.71 49.6, -0.65 33.11, 0 21.25 M0 21.25 C0.19 8.48, 8.07 -1.28, 21.25 0 M0 21.25 C1.8 5.83, 7.43 -0.4, 21.25 0" stroke="#1971c2" stroke-width="1" fill="none"></path></g><g transform="translate(826.6457766040431 419.33961586464534) rotate(0 101.57991790771484 25)"><text x="101.57991790771484" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">3. Return whether is</text><text x="101.57991790771484" y="25" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">valid or not</text></g><g stroke-linecap="round" transform="translate(61.99469259540717 105.26086868321454) rotate(0 110.05757116156974 32.17741655087593)"><path d="M16.09 0 C55.1 -0.82, 97.29 -0.92, 204.03 0 M16.09 0 C60.06 -0.54, 104.77 -0.21, 204.03 0 M204.03 0 C215.56 0.02, 221.19 3.66, 220.12 16.09 M204.03 0 C212.7 -0.46, 219.69 7.48, 220.12 16.09 M220.12 16.09 C218.9 24.79, 222.29 30.57, 220.12 48.27 M220.12 16.09 C219.82 25.65, 220.33 36.12, 220.12 48.27 M220.12 48.27 C220.67 59.81, 214.06 64.01, 204.03 64.35 M220.12 48.27 C218.84 57.11, 215.53 65.49, 204.03 64.35 M204.03 64.35 C134.44 65.69, 64.81 63.6, 16.09 64.35 M204.03 64.35 C143.77 63.08, 84.22 63.05, 16.09 64.35 M16.09 64.35 C3.45 63.62, -0.75 60.78, 0 48.27 M16.09 64.35 C6.47 65.87, -1.2 57.38, 0 48.27 M0 48.27 C-2.21 38.1, 1.4 31.59, 0 16.09 M0 48.27 C0.64 35.13, -1.24 22.69, 0 16.09 M0 16.09 C-1.63 6.15, 6.4 0.31, 16.09 0 M0 16.09 C-1.72 5.89, 4.62 -0.88, 16.09 0" stroke="#1971c2" stroke-width="1" fill="none"></path></g><g transform="translate(120.202311059223 124.93828523409047) rotate(0 51.849952697753906 12.5)"><text x="51.849952697753906" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">signatureR</text></g><g stroke-linecap="round" transform="translate(552.8217271194076 104.8566288276329) rotate(0 110.05757116156974 32.17741655087593)"><path d="M16.09 0 C92.23 0.62, 166.8 -1.05, 204.03 0 M16.09 0 C64.87 1.81, 113.62 1.49, 204.03 0 M204.03 0 C214.38 -0.92, 220.6 5.98, 220.12 16.09 M204.03 0 C216.62 0.01, 221 5.33, 220.12 16.09 M220.12 16.09 C218.65 23.6, 220.85 34.37, 220.12 48.27 M220.12 16.09 C220.16 26.13, 220.33 37.13, 220.12 48.27 M220.12 48.27 C219.07 59.89, 216.63 66.01, 204.03 64.35 M220.12 48.27 C222.26 60.44, 215.63 64, 204.03 64.35 M204.03 64.35 C146.66 63.06, 85.76 65.02, 16.09 64.35 M204.03 64.35 C148.04 63.62, 91.25 62.28, 16.09 64.35 M16.09 64.35 C4.39 63.79, 0.45 57.77, 0 48.27 M16.09 64.35 C3.07 64.5, 0.29 58.04, 0 48.27 M0 48.27 C-1.58 36.6, -0.76 24, 0 16.09 M0 48.27 C-0.94 36.5, -0.41 25.6, 0 16.09 M0 16.09 C1.69 6.74, 3.6 -1.36, 16.09 0 M0 16.09 C-1.76 5.43, 3.32 1.68, 16.09 0" stroke="#1971c2" stroke-width="1" fill="none"></path></g><g transform="translate(611.7293501608601 124.53404537850884) rotate(0 51.14994812011719 12.5)"><text x="51.14994812011719" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">signatureS</text></g><g stroke-linecap="round" transform="translate(319.9645984579398 10) rotate(0 110.05757116156974 32.17741655087593)"><path d="M16.09 0 C56.1 -3.17, 96.71 -3.37, 204.03 0 M16.09 0 C67.11 -0.94, 117.53 -0.81, 204.03 0 M204.03 0 C216.63 -1.52, 218.55 5.29, 220.12 16.09 M204.03 0 C213.59 0.13, 219.04 5.35, 220.12 16.09 M220.12 16.09 C220.84 26.31, 218.45 37.31, 220.12 48.27 M220.12 16.09 C221.15 28.91, 219.9 40.65, 220.12 48.27 M220.12 48.27 C218.34 58.62, 215.88 65.94, 204.03 64.35 M220.12 48.27 C221.98 60.4, 216.18 62.69, 204.03 64.35 M204.03 64.35 C154.41 64.6, 108.46 63.64, 16.09 64.35 M204.03 64.35 C142.34 64.99, 81.51 64.34, 16.09 64.35 M16.09 64.35 C3.84 64.21, -1.05 57.06, 0 48.27 M16.09 64.35 C6.55 66.09, -1.49 61.09, 0 48.27 M0 48.27 C0.34 36.09, -0.03 24.79, 0 16.09 M0 48.27 C-1.02 39.7, -0.21 30.88, 0 16.09 M0 16.09 C1.6 3.93, 6.96 0.4, 16.09 0 M0 16.09 C-1.78 5.13, 4.26 -1.6, 16.09 0" stroke="#1971c2" stroke-width="1" fill="none"></path></g><g transform="translate(365.8422227200955 17.177416550875932) rotate(0 64.17994689941406 25)"><text x="64.17994689941406" y="0" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">preImage (4 </text><text x="64.17994689941406" y="25" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#1971c2" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="text-before-edge">elements)</text></g></svg>
@@ -35,25 +35,25 @@ The MACI contract's `quadraticVoteTally()` function should verify a proof create
35
35
 
36
36
  ## Inputs
37
37
 
38
- | Pseudocode name | zk-SNARK input type | Description | Set by |
39
- | ----------------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------- | ----------- |
40
- | `fullStateRoot` | Public | The final Merkle root of the state tree | Contract |
41
- | `fullStateTreeDepth` | Hardcoded | The depth of the state tree | Contract |
42
- | `intermediateStateTreeDepth` | Hardcoded | The depth of the intermediate state tree | Contract |
43
- | `intermediateStateRoot` | Public | The intermediate Merkle root generated by the given state leaves | Contract |
44
- | `intermediatePathElements[k]` | Private | The Merkle path elements from `intermediateStateRoot` to `stateRoot`. | Coordinator |
45
- | `intermediatePathIndex` | Public | The Merkle path index from `intermediateStateRoot` to `stateRoot`. | Contract |
46
- | `currentResults[n]` | Private | The vote tally of all prior batches of state leaves | Coordinator |
47
- | `currentResultsSalt` | Private | A random value to hash with the vote tally for state leaves up to the current batch | Coordinator |
48
- | `currentResultsCommitment` | Public | The salted commitment of the values in `currentResults` | Contract |
49
- | `newResultsCommitment` | Public | The salted commitment of the vote tally for this batch of leaves plus the vote tally from `currentResults` | Contract |
50
- | `salt` | Private | A random value to hash with the culmulate vote tally for this batch of state leaves | Coordinator |
51
- | `stateLeaves[m][p]` | Private | The batch of leaves of the state tree to tally. | Coordinator |
52
- | `voteLeaves[m][n]` | Private | The vote leaves for each user in this batch of state leaves. | Coordinator |
38
+ | Pseudocode name | zk-SNARK input type | Description | Set by |
39
+ | ------------------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------- | ----------- |
40
+ | `fullStateRoot` | Public | The final Merkle root of the state tree | Contract |
41
+ | `fullStateTreeDepth` | Hardcoded | The depth of the state tree | Contract |
42
+ | `tallyProcessingStateTreeDepth` | Hardcoded | The depth of the intermediate state tree | Contract |
43
+ | `intermediateStateRoot` | Public | The intermediate Merkle root generated by the given state leaves | Contract |
44
+ | `intermediatePathElements[k]` | Private | The Merkle path elements from `intermediateStateRoot` to `stateRoot`. | Coordinator |
45
+ | `intermediatePathIndex` | Public | The Merkle path index from `intermediateStateRoot` to `stateRoot`. | Contract |
46
+ | `currentResults[n]` | Private | The vote tally of all prior batches of state leaves | Coordinator |
47
+ | `currentResultsSalt` | Private | A random value to hash with the vote tally for state leaves up to the current batch | Coordinator |
48
+ | `currentResultsCommitment` | Public | The salted commitment of the values in `currentResults` | Contract |
49
+ | `newResultsCommitment` | Public | The salted commitment of the vote tally for this batch of leaves plus the vote tally from `currentResults` | Contract |
50
+ | `salt` | Private | A random value to hash with the culmulate vote tally for this batch of state leaves | Coordinator |
51
+ | `stateLeaves[m][p]` | Private | The batch of leaves of the state tree to tally. | Coordinator |
52
+ | `voteLeaves[m][n]` | Private | The vote leaves for each user in this batch of state leaves. | Coordinator |
53
53
 
54
54
  `n` is the number of options in `voteOptionTree`.
55
55
  `m` is the number of state leaves in this batch.
56
- `k` is `fullStateTreeDepth - intermediateStateTreeDepth`
56
+ `k` is `fullStateTreeDepth - tallyProcessingStateTreeDepth`
57
57
  `p` is the message length
58
58
 
59
59
  A result commitment is the hash of a Merkle root of all the vote leaves, and a salt. For instance:
@@ -23,14 +23,14 @@ Reverse processing was introduced to prevent a type of attack where a briber wou
23
23
 
24
24
  Let's take as an example the following:
25
25
 
26
- 1. Alice signs up with pub key $pub1$
27
- 2. Bob (Briber) bribes Alice and asks her to submit a key change message to $pub2$ (owned by Bob)
28
- 3. Bob submits a vote with $pub2$
29
- 4. Alice submits a vote with $pub1$
26
+ 1. Alice signs up with public key $public1$
27
+ 2. Bob (Briber) bribes Alice and asks her to submit a key change message to $public2$ (owned by Bob)
28
+ 3. Bob submits a vote with $public2$
29
+ 4. Alice submits a vote with $public1$
30
30
 
31
31
  If messages were processed in the same order as they were submitted, Alice's vote would not be valid, due to it being signed with a private key $priv1$ - which now would not be valid.
32
32
 
33
- On the other hand, due to messages being processed in reverse order, Alice's last message would be counted as valid as the key change would have not been processed yet. Then, Bob's vote would not be counted as valid as the current key for Alice would be $pub1$.
33
+ On the other hand, due to messages being processed in reverse order, Alice's last message would be counted as valid as the key change would have not been processed yet. Then, Bob's vote would not be counted as valid as the current key for Alice would be $public1$.
34
34
 
35
35
  > Note that a key change message should have the nonce set to 1 in order for it to be valid. We'll see a code example in the next sections.
36
36
 
@@ -47,7 +47,7 @@ Let's take a look into a code example:
47
47
  ```ts
48
48
  const user1Keypair = new Keypair();
49
49
  const user2Keypair = new Keypair();
50
- const secondKeyPair = new Keypair();
50
+ const secondKeypair = new Keypair();
51
51
  ```
52
52
 
53
53
  - Votes will be
@@ -77,10 +77,10 @@ As seen above, we expect the first vote weight 9 to not be counted, but instead
77
77
  - Deploy a MaciState locally and sign up
78
78
 
79
79
  ```ts
80
- const maciState: MaciState = new MaciState(STATE_TREE_DEPTH);
80
+ const maciState = new MaciState(STATE_TREE_DEPTH);
81
81
  // Sign up
82
- user1StateIndex = maciState.signUp(user1Keypair.pubKey, voiceCreditBalance, BigInt(Math.floor(Date.now() / 1000)));
83
- user2StateIndex = maciState.signUp(user2Keypair.pubKey, voiceCreditBalance, BigInt(Math.floor(Date.now() / 1000)));
82
+ user1StateIndex = maciState.signUp(user1Keypair.publicKey, voiceCreditBalance, BigInt(Math.floor(Date.now() / 1000)));
83
+ user2StateIndex = maciState.signUp(user2Keypair.publicKey, voiceCreditBalance, BigInt(Math.floor(Date.now() / 1000)));
84
84
  // deploy a poll
85
85
  pollId = maciState.deployPoll(
86
86
  duration,
@@ -95,61 +95,61 @@ pollId = maciState.deployPoll(
95
95
 
96
96
  ```ts
97
97
  const poll = maciState.polls[pollId];
98
- const command1 = new PCommand(
98
+ const command1 = new VoteCommand(
99
99
  BigInt(user1StateIndex),
100
- user1Keypair.pubKey,
100
+ user1Keypair.publicKey,
101
101
  user1VoteOptionIndex,
102
102
  user1VoteWeight,
103
103
  BigInt(1),
104
104
  BigInt(pollId),
105
105
  );
106
106
 
107
- const signature1 = command1.sign(user1Keypair.privKey);
107
+ const signature1 = command1.sign(user1Keypair.privateKey);
108
108
 
109
109
  const ecdhKeypair1 = new Keypair();
110
- const sharedKey1 = Keypair.genEcdhSharedKey(ecdhKeypair1.privKey, coordinatorKeypair.pubKey);
110
+ const sharedKey1 = Keypair.genEcdhSharedKey(ecdhKeypair1.privateKey, coordinatorKeypair.publicKey);
111
111
 
112
112
  const message1 = command1.encrypt(signature1, sharedKey1);
113
- poll.publishMessage(message1, ecdhKeypair1.pubKey);
113
+ poll.publishMessage(message1, ecdhKeypair1.publicKey);
114
114
 
115
- const command2 = new PCommand(
115
+ const command2 = new VoteCommand(
116
116
  BigInt(user2StateIndex),
117
- user2Keypair.pubKey,
117
+ user2Keypair.publicKey,
118
118
  user2VoteOptionIndex,
119
119
  user2VoteWeight,
120
120
  BigInt(1),
121
121
  BigInt(pollId),
122
122
  );
123
123
 
124
- const signature2 = command2.sign(user2Keypair.privKey);
124
+ const signature2 = command2.sign(user2Keypair.privateKey);
125
125
 
126
126
  const ecdhKeypair2 = new Keypair();
127
- const sharedKey2 = Keypair.genEcdhSharedKey(ecdhKeypair2.privKey, coordinatorKeypair.pubKey);
127
+ const sharedKey2 = Keypair.genEcdhSharedKey(ecdhKeypair2.privateKey, coordinatorKeypair.publicKey);
128
128
 
129
129
  const message2 = command2.encrypt(signature2, sharedKey2);
130
- poll.publishMessage(message2, ecdhKeypair2.pubKey);
130
+ poll.publishMessage(message2, ecdhKeypair2.publicKey);
131
131
  ```
132
132
 
133
133
  - User1 submits a key change message with the new vote
134
134
 
135
135
  ```ts
136
136
  const poll = maciState.polls[pollId];
137
- const command = new PCommand(
137
+ const command = new VoteCommand(
138
138
  BigInt(user1StateIndex),
139
- secondKeyPair.pubKey,
139
+ secondKeypair.publicKey,
140
140
  user1VoteOptionIndex,
141
141
  user1NewVoteWeight,
142
142
  BigInt(1),
143
143
  BigInt(pollId),
144
144
  );
145
145
 
146
- const signature = command.sign(user1Keypair.privKey);
146
+ const signature = command.sign(user1Keypair.privateKey);
147
147
 
148
148
  const ecdhKeypair = new Keypair();
149
- const sharedKey = Keypair.genEcdhSharedKey(ecdhKeypair.privKey, coordinatorKeypair.pubKey);
149
+ const sharedKey = Keypair.genEcdhSharedKey(ecdhKeypair.privateKey, coordinatorKeypair.publicKey);
150
150
 
151
151
  const message = command.encrypt(signature, sharedKey);
152
- poll.publishMessage(message, ecdhKeypair.pubKey);
152
+ poll.publishMessage(message, ecdhKeypair.publicKey);
153
153
  ```
154
154
 
155
155
  - We process the votes and check that the result is as expected (`user1NewVoteWeight` was 5 and `user2VoteWeight` 3)
@@ -158,8 +158,8 @@ poll.publishMessage(message, ecdhKeypair.pubKey);
158
158
  const poll = maciState.polls[pollId];
159
159
  poll.processMessages(pollId);
160
160
  poll.tallyVotes();
161
- expect(poll.perVOSpentVoiceCredits[0].toString()).to.eq((user1NewVoteWeight * user1NewVoteWeight).toString());
162
- expect(poll.perVOSpentVoiceCredits[1].toString()).to.eq((user2VoteWeight * user2VoteWeight).toString());
161
+ expect(poll.perVoteOptionSpentVoiceCredits[0].toString()).to.eq((user1NewVoteWeight * user1NewVoteWeight).toString());
162
+ expect(poll.perVoteOptionSpentVoiceCredits[1].toString()).to.eq((user2VoteWeight * user2VoteWeight).toString());
163
163
  ```
164
164
 
165
165
  - Finally confirm that the keypair was changed for the user1
@@ -168,8 +168,8 @@ expect(poll.perVOSpentVoiceCredits[1].toString()).to.eq((user2VoteWeight * user2
168
168
  const poll = maciState.polls[pollId];
169
169
  const stateLeaf1 = poll.stateLeaves[user1StateIndex];
170
170
  const stateLeaf2 = poll.stateLeaves[user2StateIndex];
171
- expect(stateLeaf1.pubKey.equals(user1SecondKeypair.pubKey)).to.eq(true);
172
- expect(stateLeaf2.pubKey.equals(user2Keypair.pubKey)).to.eq(true);
171
+ expect(stateLeaf1.publicKey.equals(user1SecondKeypair.publicKey)).to.eq(true);
172
+ expect(stateLeaf2.publicKey.equals(user2Keypair.publicKey)).to.eq(true);
173
173
  ```
174
174
 
175
175
  We see that is important that we set the final message (the one with the new vote) with nonce 1, as this vote would be counted as the first vote.
@@ -78,7 +78,7 @@ Serialized, these will look like **macipk.0e5194a54562ea4d440ac6a0049a41d4b600e3
78
78
  After successfully [installing](/docs/quick-start#installation) MACI, you can easily generate your MACI key pair by running:
79
79
 
80
80
  ```bash
81
- pnpm run genMaciKeyPair
81
+ pnpm run generateMaciKeyPair
82
82
  ```
83
83
 
84
84
  This command will create the necessary public and private keys required for running various MACI operations.
@@ -11,7 +11,7 @@ This document will explain how to use each of these options. Hardhat tasks are t
11
11
 
12
12
  ## Quadratic Voting
13
13
 
14
- MACI has always worked with quadratic voting. Users signing up to MACI are assigned a number of voice credits based on certain conditions (enforced by the [initial voice credit proxy contract](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/initialVoiceCreditProxy/InitialVoiceCreditProxy.sol)), and after each vote, the number of voice credits is reduced by the square of the weight of the vote casted. For instance, if the vote weight is 5, a user must have at least 25 voice credits to cast the vote.
14
+ MACI has always worked with quadratic voting. Users signing up to MACI are assigned a number of voice credits based on certain conditions (enforced by the [initial voice credit proxy contract](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.sol)), and after each vote, the number of voice credits is reduced by the square of the weight of the vote casted. For instance, if the vote weight is 5, a user must have at least 25 voice credits to cast the vote.
15
15
 
16
16
  To run a poll with quadratic voting, the coordinator must deploy the Poll with the mode set to quadratic voting.
17
17
 
@@ -22,7 +22,7 @@ In the deploy-config.json file set the `useQuadraticVoting` value to **true**.
22
22
  ```json
23
23
  "Poll": {
24
24
  "pollDuration": 604800,
25
- "coordinatorPubkey": "macipk",
25
+ "coordinatorPublicKey": "macipk",
26
26
  "useQuadraticVoting": true
27
27
  }
28
28
  ```
@@ -46,7 +46,7 @@ In the deploy-config.json file set the `useQuadraticVoting` value to **false**.
46
46
  ```json
47
47
  "Poll": {
48
48
  "pollDuration": 604800,
49
- "coordinatorPubkey": "macipk",
49
+ "coordinatorPublicKey": "macipk",
50
50
  "useQuadraticVoting": false
51
51
  }
52
52
  ```
@@ -23,7 +23,7 @@ The full configuration for a poll looks like this:
23
23
  "Poll": {
24
24
  "pollStartDate": 3600,
25
25
  "pollEndDate": 3600,
26
- "coordinatorPubkey": "macipk.9a59264310d95cfd8eb7083aebeba221b5c26e77427f12b7c0f50bc1cc35e621",
26
+ "coordinatorPublicKey": "macipk.9a59264310d95cfd8eb7083aebeba221b5c26e77427f12b7c0f50bc1cc35e621",
27
27
  "useQuadraticVoting": false,
28
28
  "policy": "FreeForAllPolicy",
29
29
  "relayers": "0x0000000000000000000000000000000000000000",
@@ -34,7 +34,7 @@ The full configuration for a poll looks like this:
34
34
 
35
35
  ## Quadratic Voting
36
36
 
37
- MACI has always worked with quadratic voting. Users joining a Poll are assigned a number of voice credits based on certain conditions (enforced by the [initial voice credit proxy contract](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/initialVoiceCreditProxy/InitialVoiceCreditProxy.sol)), and after each vote, the number of voice credits is reduced by the square of the weight of the vote casted. For instance, if the vote weight is 5, a user must have at least 25 voice credits to cast the vote.
37
+ MACI has always worked with quadratic voting. Users joining a Poll are assigned a number of voice credits based on certain conditions (enforced by the [initial voice credit proxy contract](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.sol)), and after each vote, the number of voice credits is reduced by the square of the weight of the vote casted. For instance, if the vote weight is 5, a user must have at least 25 voice credits to cast the vote.
38
38
 
39
39
  To run a poll with quadratic voting, the coordinator must deploy the Poll with the mode set to quadratic voting.
40
40
 
@@ -45,7 +45,7 @@ In the deploy-config.json file set the `useQuadraticVoting` value to **true**.
45
45
  ```json
46
46
  "Poll": {
47
47
  [...]
48
- "coordinatorPubkey": "macipk",
48
+ "coordinatorPublicKey": "macipk",
49
49
  "useQuadraticVoting": true
50
50
  }
51
51
  ```
@@ -69,7 +69,7 @@ In the deploy-config.json file set the `useQuadraticVoting` value to **false**.
69
69
  ```json
70
70
  "Poll": {
71
71
  [...]
72
- "coordinatorPubkey": "macipk",
72
+ "coordinatorPublicKey": "macipk",
73
73
  "useQuadraticVoting": false
74
74
  }
75
75
  ```
@@ -86,7 +86,7 @@ while true:
86
86
  if rand >= min:
87
87
  break
88
88
 
89
- privKey = rand % p
89
+ privateKey = rand % p
90
90
  ```
91
91
 
92
92
  #### 1.3. Private key formatting
@@ -550,88 +550,22 @@ To make these processes easy to use, we provide command-line interface tools.
550
550
 
551
551
  The integration tests and shell scripts in the `cli` directory provide examples of the order in which to execute them.
552
552
 
553
- | Command | Description | Notes |
554
- | ------------------ | -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
555
- | `genMaciPubkey` | Generate a MACI public key from a private key | Only the coordinator needs to run this, as users should generate their keys in the browser and should be automated by the client application |
556
- | `genMaciKeypair` | Generates a MACI private key and public key | Only the coordinator needs to run this, as users should generate their keys in the browser and should be automated by the client application |
557
- | `deployVkRegistry` | Deploy the `VkRegistry` contract | Executed only the coordinator |
558
- | `setVerifyingKeys` | Set verifying keys to the `VkRegistry` | Executed only the coordinator |
559
- | `create` | Deploy a new instance of MACI | Executed only the coordinator |
560
- | `deployPoll` | Deploy a new poll on a MACI instance | Executed only the coordinator |
561
- | `signup` | Sign up a user | Mainly for testing; as users are more likely to use the client application instead of the CLI |
562
- | `publish` | Submit a message to a poll | Mainly for testing; as users are more likely to use the client application instead of the CLI |
563
- | `mergeMessages` | Must be executed before generating proofs | Executed only the coordinator |
564
- | `mergeSignups` | Must be executed before generating proofs | Executed only the coordinator |
565
- | `genProofs` | Generate all message processing and vote tallying proofs | Executed only the coordinator |
566
- | `proveOnChain` | Submit proofs to the `PollProcessorAndTallyer` contract | Executed only the coordinator |
567
-
568
- ## 5. Ethereum contracts
569
-
570
- ### 5.1. MACI
571
-
572
- | Function | Permissions | Notes |
573
- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
574
- | `init(VkRegistry _vkRegistry, MessageAqFactory _messageAqFactory)` | Coordinator only | Initialise factory, helper and registry contracts that share equal ownership |
575
- | `signUp(PubKey memory _pubKey, bytes memory _signUpPolicyData, bytes memory _initialVoiceCreditProxyData)` | Executable only during the sign-up period and after initialisation | Participant registration and voice credit assignment |
576
- | `mergeStateAqSubRoots(uint256 _numSrQueueOps, uint256 _pollId)` | Executable only by poll contract `_pollId` and after initialisation | Merge queued state leaves to form the state tree subroots |
577
- | `mergeStateAq(uint256 _pollId)` | Executable only by poll contract `_pollId` and after initialisation | Merge the state subroots to form the state root |
578
- | `getStateTreeRoot()` | Non-applicable | Query the state root |
579
- | `deployPoll(uint256 _duration, TreeDepths memory _treeDepths, PubKey memory _coordinatorPubKey)` | Executable only after initialisation | Create a new poll |
580
- | `getPoll(uint256 _pollId)` | Non-applicable | Query a poll address |
581
-
582
- ### 5.2. Poll
583
-
584
- | Function | Permissions | Notes |
585
- | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
586
- | `getDeployTimeAndDuration()` | Non-applicable | Query the deployment timestamp and duration |
587
- | `numSignUpsAndMessages()` | Non-applicable | Query the number of participants and messages cast |
588
- | `currentSbAndTallyCommitments()` | Non-applicable | Query the current state-ballot and tally commitments hashes |
589
- | `publishMessage(Message memory _message, PubKey memory _encPubKey)` | Executable only during the voting period and if the message limit has not been not met | Submit a message (whether valid or not) to the message queue |
590
- | `hashMessageAndEncPubKey(Message memory _message, PubKey memory _encPubKey)` | Non-applicable | Query a hash of a message and public key coordinates |
591
- | `mergeMaciStateAqSubRoots( uint256 _numSrQueueOps, uint256 _pollId)` | Executable only by the coordinator and after the voting period | Merge queued state leaves to form the state subroots |
592
- | `mergeMaciStateAq(uint256 _pollId)` | Executable only by the coordinator and after the voting period | Merge the state subroots to form the state root and initialise the state-ballot commitment hash |
593
- | `mergeMessageAqSubRoots(uint256 _numSrQueueOps)` | Executable only by the coordinator and after the voting period | Merge the queued message leaves to form the message tree subroots |
594
- | `mergeMessageAq()` | Executable only by the coordinator and after the voting period | Merge the message tree subroots to form the message tree root |
595
- | `batchEnqueueMessage(uint256 _messageSubRoot)` | Executable only by the coordinator and after the voting period | Submit a batch of messages to the queue |
596
-
597
- ### 5.3. PollFactory
598
-
599
- | Function | Permissions | Notes |
600
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------- | --------------------------------------- |
601
- | `setMessageAqFactory(MessageAqFactory _messageAqFactory)` | Coordinator only | Initialise the message factory contract |
602
- | `deploy(uint256 _duration, TreeDepths memory _treeDepths, BatchSizes memory _batchSizes, PubKey memory _coordinatorPubKey, VkRegistry _vkRegistry, IMACI _maci, address _pollOwner)` | Coordinator only | Create a new poll |
603
-
604
- ### 5.4. VkRegistry
605
-
606
- | Function | Permissions | Notes |
607
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
608
- | `isProcessVkSet(uint256 _sig)` | Non-applicable | Query whether a signature is valid for message processing |
609
- | `isTallyVkSet(uint256 _sig)` | Non-applicable | Query whether a signature valid for tallying votes |
610
- | `genProcessVkSig(uint256 _stateTreeDepth, uint256 _messageTreeDepth, uint256 _voteOptionTreeDepth, uint256 _messageBatchSize)` | Non-applicable | Generate a signature (used for verifying key mapping lookups) for message processing by compressing parameters into a singular value |
611
- | `genTallyVkSig(uint256 _stateTreeDepth, uint256 _intStateTreeDepth, uint256 _voteOptionTreeDepth)` | Non-applicable | Generate a signature (used for verifying key mapping lookups) for vote tallying by compressing parameters into a singular value |
612
- | `setVerifyingKeys( uint256 _stateTreeDepth, uint256 _intStateTreeDepth, uint256 _messageTreeDepth, uint256 _voteOptionTreeDepth, uint256 _messageBatchSize, VerifyingKey memory _processVk, VerifyingKey memory _tallyVk)` | Coordinator only | Initialise verifying keys for processing and tallying to the contract alongside specifying each tree depth |
613
- | `hasProcessVk(uint256 _stateTreeDepth, uint256 _messageTreeDepth, uint256 _voteOptionTreeDepth, uint256 _messageBatchSize)` | Non-applicable | Query whether the signature of the parameters is valid for message processing |
614
- | `getProcessVkBySig(uint256 _sig)` | Non-applicable | Query a processing verifying key by providing a valid signature |
615
- | `getProcessVk(uint256 _stateTreeDepth, uint256 _messageTreeDepth, uint256 _voteOptionTreeDepth, uint256 _messageBatchSize)` | Non-applicable | Query a processing verifying key by providing parameters to generate a valid signature |
616
- | `hasTallyVk(uint256 _stateTreeDepth, uint256 _intStateTreeDepth, uint256 _voteOptionTreeDepth)` | Non-applicable | Query whether the signature of the parameters is valid for vote tallying |
617
- | `getTallyVkBySig(uint256 _sig)` | Non-applicable | Query a tallying verifying key by providing a valid signature |
618
- | `getTallyVk(uint256 _stateTreeDepth, uint256 _intStateTreeDepth, uint256 _voteOptionTreeDepth)` | Non-applicable | Query a tallying verifying key by providing parameters to generate a valid signature |
619
-
620
- ### 5.5. PollProcessorAndTallyer
621
-
622
- | Function | Permissions | Notes |
623
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
624
- | `sha256Hash(uint256[] memory array)` | Non-applicable | Hash an array of values (using SHA256) moduluo the snark field size |
625
- | `processMessages(Poll _poll, uint256 _newSbCommitment, uint256[8] memory _proof)` | Executable only by the coordinator and after the voting period | Process state messages relative to a new state-ballot commitment given that the proof is valid |
626
- | `verifyProcessProof(Poll _poll, uint256 _currentMessageBatchIndex, uint256 _messageRoot, uint256 _currentSbCommitment, uint256 _newSbCommitment, uint256[8] memory _proof)` | Non-applicable | Query whether a message processing proof is valid |
627
- | `genProcessMessagesPublicInputHash(Poll _poll, uint256 _currentMessageBatchIndex, uint256 _messageRoot, uint256 _numSignUps, uint256 _currentSbCommitment, uint256 _newSbCommitment)` | Non-applicable | Hash of the coordinators public key, `packedVals`, current state-ballot commitment and message root |
628
- | `genProcessMessagesPackedVals( Poll _poll, uint256 _currentMessageBatchIndex, uint256 _numSignUps)` | Non-applicable | Generate a packed 250-bit value `packedVals` for message processing |
629
- | `genTallyVotesPackedVals( uint256 _numSignUps, uint256 _batchStartIndex, uint256 _tallyBatchSize)` | Non-applicable | Generate a packed 100-bit value `packedVals` for vote tallying |
630
- | `genTallyVotesPublicInputHash( uint256 _numSignUps, uint256 _batchStartIndex, uint256 _tallyBatchSize, uint256 _newTallyCommitment )` | Non-applicable | Hash of the current tally commitment, the new tally commitment, `packedVals` and the state-ballot commitment |
631
- | `tallyVotes(Poll _poll, uint256 _newTallyCommitment, uint256[8] memory _proof)` | Executable only by the coordinator and after the voting period | Tally votes relative to a new tally commitment given that the proof is valid |
632
- | `verifyTallyProof(Poll _poll, uint256[8] memory _proof, uint256 _numSignUps, uint256 _batchStartIndex, uint256 _tallyBatchSize, uint256 _newTallyCommitment)` | Non-applicable | Query whether a vote tallying proof is valid |
633
-
634
- ## 6. zk-SNARKs
553
+ | Command | Description | Notes |
554
+ | ----------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
555
+ | `generateMaciPublicKey` | Generate a MACI public key from a private key | Only the coordinator needs to run this, as users should generate their keys in the browser and should be automated by the client application |
556
+ | `generateMaciKeypair` | Generates a MACI private key and public key | Only the coordinator needs to run this, as users should generate their keys in the browser and should be automated by the client application |
557
+ | `deployVerifyingKeysRegistry` | Deploy the `deployVerifyingKeysRegistry` contract | Executed only the coordinator |
558
+ | `setVerifyingKeys` | Set verifying keys to the `deployVerifyingKeysRegistry` | Executed only the coordinator |
559
+ | `create` | Deploy a new instance of MACI | Executed only the coordinator |
560
+ | `deployPoll` | Deploy a new poll on a MACI instance | Executed only the coordinator |
561
+ | `signup` | Sign up a user | Mainly for testing; as users are more likely to use the client application instead of the CLI |
562
+ | `publish` | Submit a message to a poll | Mainly for testing; as users are more likely to use the client application instead of the CLI |
563
+ | `mergeMessages` | Must be executed before generating proofs | Executed only the coordinator |
564
+ | `mergeSignups` | Must be executed before generating proofs | Executed only the coordinator |
565
+ | `generateProofs` | Generate all message processing and vote tallying proofs | Executed only the coordinator |
566
+ | `proveOnChain` | Submit proofs to the `MessageProcessor` and `Tally` contracts | Executed only the coordinator |
567
+
568
+ ## 5. zk-SNARKs
635
569
 
636
570
  The zk-SNARK circuits in MACI are written in the [circom](https://github.com/iden3/circom) language. Proofs are [Groth16](https://eprint.iacr.org/2016/260.pdf) and are generated using the [`rapidsnark`](https://github.com/iden3/rapidsnark) prover.
637
571
 
@@ -646,15 +580,15 @@ Please note that MACI requires the coordinator to generate proofs on an x86 mach
646
580
 
647
581
  ### 6.1. Message processing circuit
648
582
 
649
- The message processing circuit, defined in `circuits/circom/processMessages.circom`, allows the coordinator to prove that they have correctly applied each message in reverse order, in a consecutive batch of `5 ^ msgBatchDepth` messages to the respective state leaf within the state tree.
583
+ The message processing circuit, defined in `circuits/circom/processMessages.circom`, allows the coordinator to prove that they have correctly applied each message in reverse order, in a consecutive batch of `5 ^ messageBatchDepth` messages to the respective state leaf within the state tree.
650
584
 
651
585
  #### Parameters
652
586
 
653
587
  | Parameter | Description |
654
588
  | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
655
589
  | `stateTreeDepth` | Depth of the state tree, this value must be equal to `10` |
656
- | `msgTreeDepth` | Depth of the message tree, this must be the same value passed to the `deployPoll()` contract function of `MACI.sol` |
657
- | `msgBatchDepth` | Depth of a tree that exactly fits the number of messages in a batch, this must be the same value passed to the `deployPoll()` contract function of `MACI.sol` |
590
+ | `messageTreeDepth` | Depth of the message tree, this must be the same value passed to the `deployPoll()` contract function of `MACI.sol` |
591
+ | `messageBatchDepth` | Depth of a tree that exactly fits the number of messages in a batch, this must be the same value passed to the `deployPoll()` contract function of `MACI.sol` |
658
592
  | `voteOptionTreeDepth` | Depth of the vote option tree, this must be the same value passed to the `deployPoll()` contract function of `MACI.sol` |
659
593
 
660
594
  The state tree, message tree, and vote option trees all have an arity of 5. As such, it is possible to calculate the maximum number of signups, messages per poll, and vote options per poll.
@@ -663,17 +597,17 @@ The state tree, message tree, and vote option trees all have an arity of 5. As s
663
597
 
664
598
  | Input signal | Description |
665
599
  | -------------------------------- | --------------------------------------------------------------------------------------- |
666
- | `numSignUps` | Number of users that have completed the sign up |
600
+ | `totalSignups` | Number of users that have completed the sign up |
667
601
  | `index` | The batch index of current message batch |
668
602
  | `pollEndTimestamp` | The Unix timestamp at which the poll ends |
669
- | `msgRoot` | The root of the message tree |
670
- | `msgs` | The batch of messages as an array of arrays |
671
- | `msgSubrootPathElements` | As described below |
603
+ | `messageRoot` | The root of the message tree |
604
+ | `messages` | The batch of messages as an array of arrays |
605
+ | `messageSubrootPathElements` | As described below |
672
606
  | `coordinatorPublicKeyHash` | $\mathsf{poseidon_2}([cPk_x, cPk_y])$ |
673
607
  | `newSbCommitment` | As described below |
674
- | `coordPrivKey` | The coordinator's private key |
608
+ | `coordinatorPrivateKey` | The coordinator's private key |
675
609
  | `batchEndIndex` | The last batch index |
676
- | `encPubKeys` | The public keys used to generate shared ECDH encryption keys to encrypt the messages |
610
+ | `encryptionPublicKeys` | The public keys used to generate shared ECDH encryption keys to encrypt the messages |
677
611
  | `currentStateRoot` | The state root before the commands are applied |
678
612
  | `currentStateLeaves` | The state leaves upon which messages are applied |
679
613
  | `currentStateLeavesPathElements` | The Merkle path to each incremental state root |
@@ -701,9 +635,9 @@ The salt used to produce `currentSbCommitment` (see above).
701
635
 
702
636
  The salt used to produce `newSbCommitment` (see above).
703
637
 
704
- ##### `msgSubrootPathElements`
638
+ ##### `messageSubrootPathElements`
705
639
 
706
- The index of each message in `msgs` is consecutive. As such, in order to prove that each message in `msgs` is indeed a leaf of the message tree, we compute the subtree root of `msgs`, and then verify that the subtree root is indeed a subroot of `msgRoot`.
640
+ The index of each message in `messages` is consecutive. As such, in order to prove that each message in `messages` is indeed a leaf of the message tree, we compute the subtree root of `messages`, and then verify that the subtree root is indeed a subroot of `messageRoot`.
707
641
 
708
642
  A simplified example using a tree of arity 2:
709
643
 
@@ -727,9 +661,9 @@ This method requires fewer circuit constraints than if we verified a Merkle proo
727
661
 
728
662
  1. That the prover knows the preimage to `currentSbCommitment` (that is, the state root, ballot root, and `currentSbSalt`)
729
663
  2. That `maxVoteOptions <= (5 ^ voteOptionTreeDepth)`
730
- 3. That `numSignUps <== (5 ^ stateTreeDepth)`
731
- 4. That `coordinatorPublicKeyHash` is a hash of public key that is correctly derived from `coordPrivKey`
732
- 5. That each message in `msgs` exists in the message tree
664
+ 3. That `totalSignups <== (5 ^ stateTreeDepth)`
665
+ 4. That `coordinatorPublicKeyHash` is a hash of public key that is correctly derived from `coordinatorPrivateKey`
666
+ 5. That each message in `messages` exists in the message tree
733
667
  6. That after decrypting and applying each message, in reverse order, to the corresponding state and ballot leaves, the new state root, new ballot root, and `newSbSalt` are the preimage to `newSbCommitment`
734
668
 
735
669
  #### How messages are decrypted and applied
@@ -817,17 +751,17 @@ The coordinator uses the ballot tallying circuit (`tallyVotes.circom`) to genera
817
751
 
818
752
  #### Parameters
819
753
 
820
- | Parameter | Description |
821
- | --------------------- | ----------------------------------------------------------------------------------------------------------------------- |
822
- | `stateTreeDepth` | Depth of the state tree, this value must be equal to `10` |
823
- | `intStateTreeDepth` | Depth of the intermediate state tree, `5 ** intStateTreeDepth` is the batch size |
824
- | `voteOptionTreeDepth` | Depth of the vote option tree, this must be the same value passed to the `deployPoll()` contract function of `MACI.sol` |
754
+ | Parameter | Description |
755
+ | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
756
+ | `stateTreeDepth` | Depth of the state tree, this value must be equal to `10` |
757
+ | `tallyProcessingStateTreeDepth` | Depth of the intermediate state tree, `5 ** tallyProcessingStateTreeDepth` is the batch size |
758
+ | `voteOptionTreeDepth` | Depth of the vote option tree, this must be the same value passed to the `deployPoll()` contract function of `MACI.sol` |
825
759
 
826
760
  #### Input signals
827
761
 
828
762
  | Input signal | Description |
829
763
  | --------------------------------------- | ---------------------------------------------------------------- |
830
- | `numSignUps` | The number of users that signup |
764
+ | `totalSignups` | The number of users that signup |
831
765
  | `index` | Start index of given batch |
832
766
  | `sbCommitment` | As described below |
833
767
  | `currentTallyCommitment` | As described below |
@@ -874,8 +808,8 @@ $\mathsf{poseidon_3}([tc_r, tc_t, tc_p])$
874
808
  #### Statements that the circuit proves
875
809
 
876
810
  1. That the coordinator knows the preimage of `sbCommitment` (see above)
877
- 2. That `index` is less than or equal to `numSignUps`
878
- 3. That each ballot in `ballots` is in a member of the ballot tree with the Merkle root `ballotRoot` at indices `batchStartIndex` to `batchStartIndex + (5 ** intStateTreeDepth)`
811
+ 2. That `index` is less than or equal to `totalSignups`
812
+ 3. That each ballot in `ballots` is in a member of the ballot tree with the Merkle root `ballotRoot` at indices `batchStartIndex` to `batchStartIndex + (5 ** tallyProcessingStateTreeDepth)`
879
813
  4. That each set of votes (`votes[i]`) has the Merkle root $blt_r$ whose value equals `ballots[i][1]`
880
814
  5. That the tally is valid, which is:
881
815
  - That the sum of votes per vote option is correct