From a0cb7bcb7a91b6f386a85bfc37916f3c6f2090fc Mon Sep 17 00:00:00 2001 From: Crisgarner <@crisgarner> Date: Fri, 7 Jun 2024 17:55:18 -0600 Subject: [PATCH 1/5] docs(quickstart-and-gatekeepers): improved quickstart and gatekeepers --- .../smart-contracts/Gatekeepers.md | 1 + .../quick-start/deployment.md | 36 ++++++++++++------- .../quick-start/poll-finalization.md | 7 ++-- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/website/versioned_docs/version-v2.0_alpha/developers-references/smart-contracts/Gatekeepers.md b/website/versioned_docs/version-v2.0_alpha/developers-references/smart-contracts/Gatekeepers.md index fa2476a25f..dc5a899e31 100644 --- a/website/versioned_docs/version-v2.0_alpha/developers-references/smart-contracts/Gatekeepers.md +++ b/website/versioned_docs/version-v2.0_alpha/developers-references/smart-contracts/Gatekeepers.md @@ -16,6 +16,7 @@ The MACI repository comes with several out-of-the-box options: - `EASGatekeeper` - This restricts signups only to users who have received an attestation of a specific schema from a trusted attester. - `HatsGatekeeper` - This allows gatekeeping signups to only users who have a specific [Hat](https://www.hatsprotocol.xyz/). - `GitcoinPassportGatekeeper` - This allows gatekeeping signups to only users who have a specific [Gitcoin Passport](https://passport.gitcoin.co/) score. +- `ZupassGatekeeper` - This allows gatekeeping signups only to users who have a valid Zupass PCD ticket. You can find all of our latest gatekeeper contracts here: https://github.com/privacy-scaling-explorations/maci/tree/dev/contracts/contracts/gatekeepers diff --git a/website/versioned_docs/version-v2.0_alpha/quick-start/deployment.md b/website/versioned_docs/version-v2.0_alpha/quick-start/deployment.md index 13197810e0..9e1f2f71ae 100644 --- a/website/versioned_docs/version-v2.0_alpha/quick-start/deployment.md +++ b/website/versioned_docs/version-v2.0_alpha/quick-start/deployment.md @@ -7,11 +7,11 @@ sidebar_position: 3 Currently, it is possible to deploy MACI contracts in two ways: -- using the cli (`maci-cli`) - using the hardhat tasks inside the `maci-contracts` package +- using the cli (`maci-cli`) :::info -We recommend to use the hardhat tasks inside the `maci-contracts` folder, due to their semplicity and customizability. +We recommend to use the hardhat tasks inside the `maci-contracts` folder, due to their simplicity and customizability. ::: ## Deployment Steps @@ -34,6 +34,12 @@ For testing purposes, you can use the test zkeys and artifacts that you can down Please do not use test artifacts in production. If you do require zKeys configured for larger param sizes, please reach out to us if you will be using them in production and we'll discuss running a new ceremony for those parameters. To build new circuits artifacts for testing purposes, please refer to the [installation page](/docs/quick-start/installation#configure-circomkit) and to the [circuits](/docs/developers-references/zk-snark-circuits/introduction) section. +### Note on Gatekeepers + +MACI uses a "gatekeeper" contract to configure and enforce the eligibility criteria of voters who can participate in MACI polls. In other words, it is a way to allowlist signups to the system. Operators of MACI can use the gatekeeper contract to configure signup eligibility and to protect against sybil attacks in their polls. + +It's necesary to define which gatekeeper are you going to use before deploying, please refer to the [gatekeepers page](/docs/developers-references/smart-contracts/Gatekeepers) section for more information on the supported Gatekeepers. + ### Deployment using `maci-contracts` hardhat tasks 1. Take the `deploy-config-example.json` file and copy it over to `deploy-config.json` @@ -51,14 +57,16 @@ Please do not use test artifacts in production. If you do require zKeys configur }, "EASGatekeeper": { "deploy": true, - "easAddress": "0xC2679fBD37d54388Ce493F1DB75320D236e1815e", + "easAddress": "0x4200000000000000000000000000000000000021", "schema": "0xe2636f31239f7948afdd9a9c477048b7fc2a089c347af60e3aa1251e5bf63e5c", - "attester": "0xa73C483623C0EA0A8AA11AD696a29622ba381555" + "attester": "0xcbc8a82e3dfc6faa2506f3033271ebc7447f096b" }, - "GitcoinPassportGatekeeper": { + "ZupassGatekeeper": { "deploy": false, - "decoderAddress": "0xe53C60F8069C2f0c3a84F9B3DB5cf56f3100ba56", - "passingScore": 5 + "signer1": "13908133709081944902758389525983124100292637002438232157513257158004852609027", + "signer2": "7654374482676219729919246464135900991450848628968334062174564799457623790084", + "eventId": "69c0caaa-c65d-5345-a20c-867774f18c67", + "zupassVerifier": "0x2272cdb3596617886d0F48524DA486044E0376d6" }, "MACI": { "stateTreeDepth": 10, @@ -73,18 +81,22 @@ Please do not use test artifacts in production. If you do require zKeys configur "zkeys": { "qv": { "processMessagesZkey": "../cli/zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test.0.zkey", - "tallyVotesZkey": "../cli/zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test.0.zkey" + "tallyVotesZkey": "../cli/zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test.0.zkey", + "processWasm": "../cli/zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test_js/ProcessMessages_10-2-1-2_test.wasm", + "tallyWasm": "../cli/zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test_js/TallyVotes_10-1-2_test.wasm" }, "nonQv": { "processMessagesZkey": "../cli/zkeys/ProcessMessagesNonQv_10-2-1-2_test/ProcessMessagesNonQv_10-2-1-2_test.0.zkey", - "tallyVotesZkey": "../cli/zkeys/TallyVotesNonQv_10-1-2_test/TallyVotesNonQv_10-1-2_test.0.zkey" + "tallyVotesZkey": "../cli/zkeys/TallyVotesNonQv_10-1-2_test/TallyVotesNonQv_10-1-2_test.0.zkey", + "processWasm": "../cli/zkeys/ProcessMessagesNonQv_10-2-1-2_test/ProcessMessagesNonQv_10-2-1-2_test_js/ProcessMessagesNonQv_10-2-1-2_test.wasm", + "tallyWasm": "../cli/zkeys/TallyVotesNonQv_10-1-2_test/TallyVotesNonQv_10-1-2_test_js/TallyVotesNonQv_10-1-2_test.wasm" } } }, "Poll": { - "pollDuration": 30000, - "coordinatorPubkey": "macipk.8c7d230547b3ccd75610b2db934ee7e1ea0a01db679e2cfcabe535234f046a18", - "useQuadraticVoting": true + "pollDuration": 60, + "coordinatorPubkey": "macipk.0a1ce79a43fa676ee3d2882c79d9164a24d4a22bb6190e3d8fa25d97bffc069a", + "useQuadraticVoting": false } } } diff --git a/website/versioned_docs/version-v2.0_alpha/quick-start/poll-finalization.md b/website/versioned_docs/version-v2.0_alpha/quick-start/poll-finalization.md index 41d1432fe2..041fcaee54 100644 --- a/website/versioned_docs/version-v2.0_alpha/quick-start/poll-finalization.md +++ b/website/versioned_docs/version-v2.0_alpha/quick-start/poll-finalization.md @@ -15,16 +15,13 @@ This could be done using `maci-cli` or by running commands in the `contracts` fo pnpm merge:[network] --poll 0 pnpm run prove:[network] --poll 0 \ --coordinator-private-key "macisk.1751146b59d32e3c0d7426de411218172428263f93b2fc4d981c036047a4d8c0" \ - --process-zkey ../cli/zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test.0.zkey \ - --tally-zkey ../cli/zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test.0.zkey \ --tally-file ../cli/tally.json \ --output-dir ../cli/proofs/ \ - --tally-wasm ../cli/zkeys/TallyVotes_10-1-2_test/TallyVotes_10-1-2_test_js/TallyVotes_10-1-2_test.wasm \ - --process-wasm ../cli/zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test_js/ProcessMessages_10-2-1-2_test.wasm + --start-block 12946802 ``` :::info -If the poll was configured to use quadratic voting, please ensure your prove command has the flag `--use-quadratic-voting`. Omitting the flag will make it work with non quadratic voting only. +If the poll was configured to use quadratic voting, please ensure your prove command has the flag `--use-quadratic-voting`. Omitting the flag will make it work with non quadratic voting only. We also suggest including the `--start-block` flag so the proving doesn't start from block 0. ::: The network options are: **_localhost, sepolia, and optimism-sepolia_**, and the tasks flags and parameters are as follows: From cb002d9e51ff44a47567a7640a486cdf801d4d6b Mon Sep 17 00:00:00 2001 From: Crisgarner <@crisgarner> Date: Fri, 7 Jun 2024 17:59:08 -0600 Subject: [PATCH 2/5] docs(quick-fixes): added gitcoin gatekeeper --- .../version-v2.0_alpha/quick-start/deployment.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/website/versioned_docs/version-v2.0_alpha/quick-start/deployment.md b/website/versioned_docs/version-v2.0_alpha/quick-start/deployment.md index 9e1f2f71ae..522b30dea9 100644 --- a/website/versioned_docs/version-v2.0_alpha/quick-start/deployment.md +++ b/website/versioned_docs/version-v2.0_alpha/quick-start/deployment.md @@ -61,6 +61,11 @@ It's necesary to define which gatekeeper are you going to use before deploying, "schema": "0xe2636f31239f7948afdd9a9c477048b7fc2a089c347af60e3aa1251e5bf63e5c", "attester": "0xcbc8a82e3dfc6faa2506f3033271ebc7447f096b" }, + "GitcoinPassportGatekeeper": { + "deploy": false, + "decoderAddress": "0xe53C60F8069C2f0c3a84F9B3DB5cf56f3100ba56", + "passingScore": 5 + }, "ZupassGatekeeper": { "deploy": false, "signer1": "13908133709081944902758389525983124100292637002438232157513257158004852609027", @@ -94,7 +99,7 @@ It's necesary to define which gatekeeper are you going to use before deploying, } }, "Poll": { - "pollDuration": 60, + "pollDuration": 3600, "coordinatorPubkey": "macipk.0a1ce79a43fa676ee3d2882c79d9164a24d4a22bb6190e3d8fa25d97bffc069a", "useQuadraticVoting": false } From 2c244ef3323b17e13dd9a923d2d29b368a34a872 Mon Sep 17 00:00:00 2001 From: Crisgarner <@crisgarner> Date: Fri, 7 Jun 2024 18:09:29 -0600 Subject: [PATCH 3/5] docs(typo-fix): typo fixc --- .../versioned_docs/version-v2.0_alpha/quick-start/deployment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/versioned_docs/version-v2.0_alpha/quick-start/deployment.md b/website/versioned_docs/version-v2.0_alpha/quick-start/deployment.md index 522b30dea9..15f9cfd103 100644 --- a/website/versioned_docs/version-v2.0_alpha/quick-start/deployment.md +++ b/website/versioned_docs/version-v2.0_alpha/quick-start/deployment.md @@ -38,7 +38,7 @@ Please do not use test artifacts in production. If you do require zKeys configur MACI uses a "gatekeeper" contract to configure and enforce the eligibility criteria of voters who can participate in MACI polls. In other words, it is a way to allowlist signups to the system. Operators of MACI can use the gatekeeper contract to configure signup eligibility and to protect against sybil attacks in their polls. -It's necesary to define which gatekeeper are you going to use before deploying, please refer to the [gatekeepers page](/docs/developers-references/smart-contracts/Gatekeepers) section for more information on the supported Gatekeepers. +It's necessary to define which gatekeeper are you going to use before deploying, please refer to the [gatekeepers page](/docs/developers-references/smart-contracts/Gatekeepers) section for more information on the supported Gatekeepers. ### Deployment using `maci-contracts` hardhat tasks From 4c6a90fdc36db41b3b361817997b19096a7dce26 Mon Sep 17 00:00:00 2001 From: Crisgarner <@crisgarner> Date: Mon, 10 Jun 2024 18:57:50 -0600 Subject: [PATCH 4/5] docs(docs): added comments --- .../developers-references/smart-contracts/Gatekeepers.md | 2 +- .../versioned_docs/version-v2.0_alpha/quick-start/deployment.md | 2 +- .../version-v2.0_alpha/quick-start/poll-finalization.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/website/versioned_docs/version-v2.0_alpha/developers-references/smart-contracts/Gatekeepers.md b/website/versioned_docs/version-v2.0_alpha/developers-references/smart-contracts/Gatekeepers.md index dc5a899e31..6bc7e21fe6 100644 --- a/website/versioned_docs/version-v2.0_alpha/developers-references/smart-contracts/Gatekeepers.md +++ b/website/versioned_docs/version-v2.0_alpha/developers-references/smart-contracts/Gatekeepers.md @@ -16,7 +16,7 @@ The MACI repository comes with several out-of-the-box options: - `EASGatekeeper` - This restricts signups only to users who have received an attestation of a specific schema from a trusted attester. - `HatsGatekeeper` - This allows gatekeeping signups to only users who have a specific [Hat](https://www.hatsprotocol.xyz/). - `GitcoinPassportGatekeeper` - This allows gatekeeping signups to only users who have a specific [Gitcoin Passport](https://passport.gitcoin.co/) score. -- `ZupassGatekeeper` - This allows gatekeeping signups only to users who have a valid Zupass PCD ticket. +- `ZupassGatekeeper` - This allows gatekeeping signups only to users who have a valid [Zupass PCD ticket](https://github.com/proofcarryingdata/zupass). You can find all of our latest gatekeeper contracts here: https://github.com/privacy-scaling-explorations/maci/tree/dev/contracts/contracts/gatekeepers diff --git a/website/versioned_docs/version-v2.0_alpha/quick-start/deployment.md b/website/versioned_docs/version-v2.0_alpha/quick-start/deployment.md index 15f9cfd103..4cfc0e0acd 100644 --- a/website/versioned_docs/version-v2.0_alpha/quick-start/deployment.md +++ b/website/versioned_docs/version-v2.0_alpha/quick-start/deployment.md @@ -38,7 +38,7 @@ Please do not use test artifacts in production. If you do require zKeys configur MACI uses a "gatekeeper" contract to configure and enforce the eligibility criteria of voters who can participate in MACI polls. In other words, it is a way to allowlist signups to the system. Operators of MACI can use the gatekeeper contract to configure signup eligibility and to protect against sybil attacks in their polls. -It's necessary to define which gatekeeper are you going to use before deploying, please refer to the [gatekeepers page](/docs/developers-references/smart-contracts/Gatekeepers) section for more information on the supported Gatekeepers. +It's necessary to define which gatekeeper you are going to use before deploying, please refer to the [gatekeepers section](/docs/developers-references/smart-contracts/Gatekeepers) for more information on the supported Gatekeepers. ### Deployment using `maci-contracts` hardhat tasks diff --git a/website/versioned_docs/version-v2.0_alpha/quick-start/poll-finalization.md b/website/versioned_docs/version-v2.0_alpha/quick-start/poll-finalization.md index 041fcaee54..13530d399a 100644 --- a/website/versioned_docs/version-v2.0_alpha/quick-start/poll-finalization.md +++ b/website/versioned_docs/version-v2.0_alpha/quick-start/poll-finalization.md @@ -21,7 +21,7 @@ pnpm run prove:[network] --poll 0 \ ``` :::info -If the poll was configured to use quadratic voting, please ensure your prove command has the flag `--use-quadratic-voting`. Omitting the flag will make it work with non quadratic voting only. We also suggest including the `--start-block` flag so the proving doesn't start from block 0. +If the poll was configured to use quadratic voting, please ensure your prove command has the flag `--use-quadratic-voting`. Omitting the flag will make it work with non quadratic voting only. We also suggest including the `--start-block` flag, proving requires fetching all events from the smartcontract and by default starts from block zero, this would take a lot of time and is error-prone due to RPC provider limitations. ::: The network options are: **_localhost, sepolia, and optimism-sepolia_**, and the tasks flags and parameters are as follows: From 0b6c9bc9721febcf4cfd287addd56141c7611586 Mon Sep 17 00:00:00 2001 From: Crisgarner <@crisgarner> Date: Tue, 11 Jun 2024 14:11:21 -0600 Subject: [PATCH 5/5] docs(docs): fixed typos --- .../version-v2.0_alpha/quick-start/poll-finalization.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/versioned_docs/version-v2.0_alpha/quick-start/poll-finalization.md b/website/versioned_docs/version-v2.0_alpha/quick-start/poll-finalization.md index 13530d399a..8e7b179743 100644 --- a/website/versioned_docs/version-v2.0_alpha/quick-start/poll-finalization.md +++ b/website/versioned_docs/version-v2.0_alpha/quick-start/poll-finalization.md @@ -21,7 +21,7 @@ pnpm run prove:[network] --poll 0 \ ``` :::info -If the poll was configured to use quadratic voting, please ensure your prove command has the flag `--use-quadratic-voting`. Omitting the flag will make it work with non quadratic voting only. We also suggest including the `--start-block` flag, proving requires fetching all events from the smartcontract and by default starts from block zero, this would take a lot of time and is error-prone due to RPC provider limitations. +If the poll was configured to use quadratic voting, please ensure your prove command has the flag `--use-quadratic-voting`. Omitting the flag will make it work with non quadratic voting only. We also suggest including the `--start-block` flag, proving requires fetching all events from the smart contracts and by default starts from block zero, this would take a lot of time and is error-prone due to RPC provider limitations. ::: The network options are: **_localhost, sepolia, and optimism-sepolia_**, and the tasks flags and parameters are as follows: