@maci-protocol/website 0.0.0-ci.752ce71 → 0.0.0-ci.75ef321
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blog/2024-02-28-maci-v1.2.0.md +1 -1
- package/blog/2025-03-21-roadmap-2025.md +1 -1
- package/docusaurus.config.ts +7 -1
- package/package.json +13 -12
- package/versioned_docs/version-v0.x/introduction.md +0 -4
- package/versioned_docs/version-v1.2/circuits.md +8 -8
- package/versioned_docs/version-v1.2/contributing/contributing.md +4 -4
- package/versioned_docs/version-v1.2/deployment.md +1 -1
- package/versioned_docs/version-v1.2/integrating.md +1 -1
- package/versioned_docs/version-v1.2/key-change.md +1 -1
- package/versioned_docs/version-v1.2/poll-types.md +1 -1
- package/versioned_docs/version-v1.2/testing-in-detail.md +3 -3
- package/versioned_docs/version-v1.2/testing.md +1 -1
- package/versioned_docs/version-v1.2/topup.md +1 -1
- package/versioned_docs/version-v1.2/typedoc/core/index.md +2 -2
- package/versioned_docs/version-v1.2/versioning.md +3 -3
- package/versioned_docs/version-v1.2/workflow.md +1 -1
- package/versioned_docs/version-v2.x/contributing/contributing.md +4 -4
- package/versioned_docs/version-v2.x/core-concepts/key-change.md +1 -1
- package/versioned_docs/version-v2.x/core-concepts/merkle-trees.md +1 -1
- package/versioned_docs/version-v2.x/core-concepts/poll-types.md +1 -1
- package/versioned_docs/version-v2.x/core-concepts/workflow.md +1 -1
- package/versioned_docs/version-v2.x/guides/integrating.md +1 -1
- package/versioned_docs/version-v2.x/guides/testing/testing-in-detail.md +3 -3
- package/versioned_docs/version-v2.x/guides/testing/testing.md +1 -1
- package/versioned_docs/version-v2.x/processes/versioning.md +3 -3
- package/versioned_docs/version-v2.x/supported-networks/deployed-contracts.md +7 -7
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/AccQueue.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/MACI.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/MessageProcessor.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Params.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Poll.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/PollFactory.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Tally.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/VkRegistry.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/VoiceCreditProxy.md +1 -1
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/processMessages.md +4 -4
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/tallyVotes.md +2 -2
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +3 -3
- package/versioned_docs/version-v3.x/contributing/contributing.md +4 -4
- package/versioned_docs/version-v3.x/core-concepts/key-change.md +1 -1
- package/versioned_docs/version-v3.x/core-concepts/maci-keys.md +1 -1
- package/versioned_docs/version-v3.x/core-concepts/poll-types.md +1 -1
- package/versioned_docs/version-v3.x/core-concepts/polls.md +1 -1
- package/versioned_docs/version-v3.x/core-concepts/spec.md +2 -2
- package/versioned_docs/version-v3.x/core-concepts/workflow.md +2 -2
- package/versioned_docs/version-v3.x/guides/compile-circuits.md +12 -12
- package/versioned_docs/version-v3.x/guides/integrating.md +2 -2
- package/versioned_docs/version-v3.x/guides/sdk.md +121 -0
- package/versioned_docs/version-v3.x/guides/testing/testing-in-detail.md +3 -3
- package/versioned_docs/version-v3.x/guides/testing/testing-introduction.md +29 -3
- package/versioned_docs/version-v3.x/guides/troubleshooting.md +53 -8
- package/versioned_docs/version-v3.x/processes/versioning.md +3 -3
- package/versioned_docs/version-v3.x/quick-start.md +2 -2
- package/versioned_docs/version-v3.x/resources.md +1 -0
- package/versioned_docs/version-v3.x/security/trusted-setup.md +36 -36
- package/versioned_docs/version-v3.x/supported-networks/costs.md +725 -0
- package/versioned_docs/version-v3.x/supported-networks/deployed-contracts.md +8 -8
- package/versioned_docs/version-v3.x/supported-networks/supported-networks.md +16 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/MACI.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/MessageProcessor.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Params.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Policies.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Poll.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/PollFactory.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Tally.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/VkRegistry.md +3 -3
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/VoiceCreditProxy.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/technical-references.md +8 -8
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/joinPoll.md +1 -1
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/processMessages.md +66 -6
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/setup.md +3 -3
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/tallyVotes.md +3 -3
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/utilities.md +2 -2
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +3 -3
package/versioned_docs/version-v2.x/technical-references/smart-contracts/VoiceCreditProxy.md
CHANGED
|
@@ -6,7 +6,7 @@ sidebar_position: 7
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
:::info
|
|
9
|
-
Code location: [InitialVoiceCreditProxy](https://github.com/privacy-scaling-explorations/maci/tree/
|
|
9
|
+
Code location: [InitialVoiceCreditProxy](https://github.com/privacy-scaling-explorations/maci/tree/main/contracts/contracts/initialVoiceCreditProxy)
|
|
10
10
|
:::
|
|
11
11
|
|
|
12
12
|
The VoiceCreditProxy contract is used to assign voice credits to users. Whichever implementation should the MACI deployers use, this must implement a view function that returns the balance for a user, such as the one below:
|
package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/processMessages.md
CHANGED
|
@@ -5,11 +5,11 @@ sidebar_label: Process Messages Circuit
|
|
|
5
5
|
sidebar_position: 3
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
[**Repo link**](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
8
|
+
[**Repo link**](https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/core)
|
|
9
9
|
|
|
10
10
|
This circuit allows the coordinator to prove that they have correctly processed each message in reverse order, in a consecutive batch of 5 ^ msgBatchDepth messages to the respective state leaf within the state tree. Coordinators would use this circuit to prove correct execution at the end of each Poll.
|
|
11
11
|
|
|
12
|
-
The [`processMessages`](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
12
|
+
The [`processMessages`](https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/core/qv/processMessages.circom) circuit will try to decrypt the messages, and based on the content of the message, update within itself the trees, to generate a proof that the coordinator's off-chain processing was done correctly. In other words, the circuit takes a final state, an initial state, and the leaves (messages and user signups) - it processes these messages via the different state transitions to finally check that the expected state is correct.
|
|
13
13
|
The pre-requisites for this circuit are:
|
|
14
14
|
|
|
15
15
|
- the related Poll has ended
|
|
@@ -21,7 +21,7 @@ This circuit requires the coordinator's private key, hence a proof for this circ
|
|
|
21
21
|

|
|
22
22
|
|
|
23
23
|
:::info
|
|
24
|
-
A version working with non quadratic voting (non-qv) is also [available](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
24
|
+
A version working with non quadratic voting (non-qv) is also [available](https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/core/non-qv/processMessages.circom). This version is called `processMessagesNonQV` and is to be used when the Poll is not using the quadratic voting feature. Note that by default MACI works with quadratic voting.
|
|
25
25
|
:::
|
|
26
26
|
|
|
27
27
|
#### Parameters
|
|
@@ -93,7 +93,7 @@ A simplified example using a tree of arity 2:
|
|
|
93
93
|
|
|
94
94
|
To prove that `a...d` are leaves of the tree with root `r`, we prove that the leaves have the subroot `s` with depth 2, and _then_ prove that `s` is a member of `r` at depth 1.
|
|
95
95
|
|
|
96
|
-
The implementation for this is in the `QuinBatchLeavesExists` circuit in `https://github.com/privacy-scaling-explorations/maci/blob/
|
|
96
|
+
The implementation for this is in the `QuinBatchLeavesExists` circuit in `https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/trees/incrementalQuinTree.circom`.
|
|
97
97
|
|
|
98
98
|
This method requires fewer circuit constraints than if we verified a Merkle proof for each leaf.
|
|
99
99
|
|
|
@@ -5,7 +5,7 @@ sidebar_label: Tally Votes Circuit
|
|
|
5
5
|
sidebar_position: 4
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
[**Repo link**](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
8
|
+
[**Repo link**](https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/core)
|
|
9
9
|
|
|
10
10
|
#### Parameters
|
|
11
11
|
|
|
@@ -18,7 +18,7 @@ sidebar_position: 4
|
|
|
18
18
|

|
|
19
19
|
|
|
20
20
|
:::info
|
|
21
|
-
A version working with non quadratic voting (non-qv) is also [available](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
21
|
+
A version working with non quadratic voting (non-qv) is also [available](https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/core/non-qv/tallyVotes.circom). This version is called `tallyVotesNonQv` and is to be used when the Poll is not using the quadratic voting feature. Note that by default MACI works with quadratic voting.
|
|
22
22
|
:::
|
|
23
23
|
|
|
24
24
|
#### Input signals
|
package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/zk-snark-circuits.md
CHANGED
|
@@ -5,10 +5,10 @@ sidebar_label: zk-SNARK Circuits
|
|
|
5
5
|
sidebar_position: 1
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
MACI has two main zk-SNARK [circuits](https://github.com/privacy-scaling-explorations/maci/tree/
|
|
8
|
+
MACI has two main zk-SNARK [circuits](https://github.com/privacy-scaling-explorations/maci/tree/main/circuits):
|
|
9
9
|
|
|
10
|
-
1. ProcessMessages.circom, which takes a batch of encrypted messages, decrypts them, and generates a proof that the coordinator's local processing was performed correctly. [QV](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
11
|
-
2. TallyVotes.circom, which counts votes from users' ballots, batch by batch. [QV](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
10
|
+
1. ProcessMessages.circom, which takes a batch of encrypted messages, decrypts them, and generates a proof that the coordinator's local processing was performed correctly. [QV](https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/core/qv/processMessages.circom) and [non-QV](https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/core/non-qv/processMessages.circom) versions are available.
|
|
11
|
+
2. TallyVotes.circom, which counts votes from users' ballots, batch by batch. [QV](https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/core/qv/tallyVotes.circom) and [non-QV](https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/circom/core/non-qv/tallyVotes.circom) versions are available.
|
|
12
12
|
|
|
13
13
|
The rest of the circuits are utilities templates that are required for the main circuits to work correctly. These include utilities such as float math, conversion of private keys, and Poseidon hashing/encryption.
|
|
14
14
|
|
|
@@ -57,13 +57,13 @@ Pull requests are great if you want to add a feature or fix a bug. Here's a quic
|
|
|
57
57
|
|
|
58
58
|
7. Make the test pass.
|
|
59
59
|
|
|
60
|
-
8. Commit your changes. Please make sure your forked `
|
|
60
|
+
8. Commit your changes. Please make sure your forked `main` branch is synced as well feature/fix branch and there are no "temp" commits (like wip, fix typo/lint/types and etc). We recommend to squash the feature/fix branch commits before creating PR. You can use this command for it:
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
|
-
git reset $(git merge-base
|
|
63
|
+
git reset $(git merge-base main $(git rev-parse --abbrev-ref HEAD))
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
9. Push to your fork and submit a pull request on our `
|
|
66
|
+
9. Push to your fork and submit a pull request on our `main` branch. Please provide us with some explanation of why you made the changes you made. For new features make sure to explain a standard use case to us.
|
|
67
67
|
|
|
68
68
|
10. Link any issues that the PR is addressing as described in our processes documentation.
|
|
69
69
|
|
|
@@ -131,7 +131,7 @@ Just as in the subject, use the imperative, present tense: "change" not "changed
|
|
|
131
131
|
|
|
132
132
|
### Branch rules
|
|
133
133
|
|
|
134
|
-
- Branches should generally be created off of the base branch (`
|
|
134
|
+
- Branches should generally be created off of the base branch (`main` )
|
|
135
135
|
- Avoid long descriptive names for long-lived branches
|
|
136
136
|
- Use kebab-case (no CamelCase)
|
|
137
137
|
- Use grouping tokens (words) at the beginning of your branch names (in a similar way to the `type` of commit)
|
|
@@ -175,5 +175,5 @@ expect(stateLeaf2.publicKey.equals(user2Keypair.publicKey)).to.eq(true);
|
|
|
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.
|
|
176
176
|
|
|
177
177
|
:::info
|
|
178
|
-
Tests related to key changes have been added to the [core package](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
178
|
+
Tests related to key changes have been added to the [core package](https://github.com/privacy-scaling-explorations/maci/blob/main/core/ts/__tests__/) and to the [cli package](https://github.com/privacy-scaling-explorations/maci/blob/main/cli/tests/).
|
|
179
179
|
:::
|
|
@@ -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
|
|
81
|
+
pnpm run generate-maci-keypair
|
|
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/
|
|
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/main/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
|
|
|
@@ -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/
|
|
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/main/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
|
|
|
@@ -580,7 +580,7 @@ Please note that MACI requires the coordinator to generate proofs on an x86 mach
|
|
|
580
580
|
|
|
581
581
|
### 6.1. Message processing circuit
|
|
582
582
|
|
|
583
|
-
The message processing circuit, defined in `circuits/circom/
|
|
583
|
+
The message processing circuit, defined in `circuits/circom/coordinator/qv/MessageProcessor.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.
|
|
584
584
|
|
|
585
585
|
#### Parameters
|
|
586
586
|
|
|
@@ -747,7 +747,7 @@ The final tally should be:
|
|
|
747
747
|
2. Total voice credits per vote option: `[3, 9, 19, 33, 26]`
|
|
748
748
|
3. Total spent voice credits: `66`
|
|
749
749
|
|
|
750
|
-
The coordinator uses the ballot tallying circuit (`
|
|
750
|
+
The coordinator uses the ballot tallying circuit (`VoteTally.circom`) to generate proofs that they have correctly computed the tally. As there are many ballots to tally, each proof only computes the tally for a batch of ballots. Each proof is chained to the previous one such that each proof is also a proof of knowledge of the preimage of the previous tally commitment.
|
|
751
751
|
|
|
752
752
|
#### Parameters
|
|
753
753
|
|
|
@@ -66,7 +66,7 @@ Therefore, even if a coordinator is corrupt, they are unable to change a user’
|
|
|
66
66
|
|
|
67
67
|
To explain the MACI workflow, let's give a quick overview of the key smart contracts.
|
|
68
68
|
|
|
69
|
-
See our [smart contract docs](/docs/category/smart-contracts) or our [contract source code](https://github.com/privacy-scaling-explorations/maci/tree/
|
|
69
|
+
See our [smart contract docs](/docs/category/smart-contracts) or our [contract source code](https://github.com/privacy-scaling-explorations/maci/tree/main/contracts/contracts) for a more in-depth explanation of all smart contracts.
|
|
70
70
|
|
|
71
71
|
### MACI.sol
|
|
72
72
|
|
|
@@ -133,7 +133,7 @@ The `MessageProcessor` contract will send the proof to a separate verifier contr
|
|
|
133
133
|
|
|
134
134
|
#### Tally Results
|
|
135
135
|
|
|
136
|
-
Finally, once all messages have been processed, the coordinator tallies the votes of the valid messages (off-chain). The coordinator creates a zk-SNARK proving that the valid messages in the state tree (proved in Process Messages step) contain votes that sum to the given tally result. Then, they call [`Tally.tallyVotes()`](/docs/technical-references/smart-contracts/solidity-docs/Tally#tallyvotes) with a hash of the correct tally results and the zk-SNARK proof. Similarly to the processMessages function, the `tallyVotes` function will send the proof to a verifier contract to ensure that it is valid.
|
|
136
|
+
Finally, once all messages have been processed, the coordinator tallies the votes of the valid messages (off-chain). The coordinator creates a zk-SNARK proving that the valid messages in the state tree (proved in Process Messages step) contain votes that sum to the given tally result. Then, they call [`Tally.tallyVotes()`](/docs/technical-references/smart-contracts/solidity-docs/Tally#tallyvotes) with a hash of the correct tally results and the zk-SNARK proof. Similarly to the `processMessages` function, the `tallyVotes` function will send the proof to a verifier contract to ensure that it is valid.
|
|
137
137
|
|
|
138
138
|
<!-- "hash of the correct tally results" - so are the final results actually put on chain? or just a hash?? -->
|
|
139
139
|
|
|
@@ -93,9 +93,9 @@ Edit `circuits/circom/circuits` to include the circuits you would like to compil
|
|
|
93
93
|
"params": [10],
|
|
94
94
|
"pubs": ["stateRoot"]
|
|
95
95
|
},
|
|
96
|
-
"
|
|
97
|
-
"file": "./coordinator/qv/
|
|
98
|
-
"template": "
|
|
96
|
+
"MessageProcessorQv_10-20-2_test": {
|
|
97
|
+
"file": "./coordinator/qv/MessageProcessor",
|
|
98
|
+
"template": "MessageProcessorQv",
|
|
99
99
|
"params": [10, 20, 2],
|
|
100
100
|
"pubs": [
|
|
101
101
|
"totalSignups",
|
|
@@ -109,9 +109,9 @@ Edit `circuits/circom/circuits` to include the circuits you would like to compil
|
|
|
109
109
|
"voteOptions"
|
|
110
110
|
]
|
|
111
111
|
},
|
|
112
|
-
"
|
|
113
|
-
"file": "./coordinator/non-qv/
|
|
114
|
-
"template": "
|
|
112
|
+
"MessageProcessorNonQv_10-20-2_test": {
|
|
113
|
+
"file": "./coordinator/non-qv/MessageProcessor",
|
|
114
|
+
"template": "MessageProcessorNonQv",
|
|
115
115
|
"params": [10, 20, 2],
|
|
116
116
|
"pubs": [
|
|
117
117
|
"totalSignups",
|
|
@@ -141,15 +141,15 @@ Edit `circuits/circom/circuits` to include the circuits you would like to compil
|
|
|
141
141
|
"voteOptions"
|
|
142
142
|
]
|
|
143
143
|
},
|
|
144
|
-
"
|
|
145
|
-
"file": "./coordinator/qv/
|
|
146
|
-
"template": "
|
|
144
|
+
"VoteTallyQv_10-1-2_test": {
|
|
145
|
+
"file": "./coordinator/qv/VoteTally",
|
|
146
|
+
"template": "VoteTallyQv",
|
|
147
147
|
"params": [10, 1, 2],
|
|
148
148
|
"pubs": ["index", "totalSignups", "sbCommitment", "currentTallyCommitment", "newTallyCommitment"]
|
|
149
149
|
},
|
|
150
|
-
"
|
|
151
|
-
"file": "./coordinator/non-qv/
|
|
152
|
-
"template": "
|
|
150
|
+
"VoteTallyNonQv_10-1-2_test": {
|
|
151
|
+
"file": "./coordinator/non-qv/VoteTally",
|
|
152
|
+
"template": "VoteTallyNonQv",
|
|
153
153
|
"params": [10, 1, 2],
|
|
154
154
|
"pubs": ["index", "totalSignups", "sbCommitment", "currentTallyCommitment", "newTallyCommitment"]
|
|
155
155
|
}
|
|
@@ -43,7 +43,7 @@ function signUp(PublicKey memory _publicKey, bytes memory _signUpPolicyData) pub
|
|
|
43
43
|
|
|
44
44
|
## InitialVoiceCreditProxy
|
|
45
45
|
|
|
46
|
-
If you'd like to extend the functionality of how votes are distributed among users, you'll need to build you own initial voice credit proxy contract by following the [IInitialVoiceCreditProxy interface](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
46
|
+
If you'd like to extend the functionality of how votes are distributed among users, you'll need to build you own initial voice credit proxy contract by following the [IInitialVoiceCreditProxy interface](https://github.com/privacy-scaling-explorations/maci/blob/main/packages/contracts/contracts/interfaces/IInitialVoiceCreditProxy.sol). You can see our [basic example](https://github.com/privacy-scaling-explorations/maci/blob/main/packages/contracts/contracts/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.sol) how it's implemented for constant distribution.
|
|
47
47
|
|
|
48
48
|
```ts
|
|
49
49
|
contract ConstantInitialVoiceCreditProxy is InitialVoiceCreditProxy {
|
|
@@ -118,7 +118,7 @@ Given the verification functions being exposed by the Tally contract, quadratic
|
|
|
118
118
|
|
|
119
119
|
## SDK
|
|
120
120
|
|
|
121
|
-
Another important component of MACI is the [SDK](https://github.com/privacy-scaling-explorations/maci/tree/
|
|
121
|
+
Another important component of MACI is the [SDK](https://github.com/privacy-scaling-explorations/maci/tree/main/packages/sdk). This is a TypeScript library that allows you to interact with MACI.
|
|
122
122
|
|
|
123
123
|
You can find the following subdirectories, where functions are organised as follows:
|
|
124
124
|
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: MACI SDK
|
|
3
|
+
description: How to use the MACI SDK
|
|
4
|
+
sidebar_label: MACI SDK
|
|
5
|
+
sidebar_position: 6
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
In this guide we will be looking at how to use the MACI SDK to interact with the MACI protocol.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @maci-protocol/sdk
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Browser compatibility
|
|
17
|
+
|
|
18
|
+
As the SDK imports functions from the `@maci-protocol/contracts` package which uses hardhat, certain functionality is not browser compatible.
|
|
19
|
+
However, all it takes to use browser compatible functions is to import from `@maci-protocol/sdk/browser`.
|
|
20
|
+
|
|
21
|
+
As an example, we can import the `signUp` function from the `@maci-protocol/sdk/browser` package.
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { signUp } from "@maci-protocol/sdk/browser";
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Let's take a look at an example of how to use the `joinPoll` function to register a user to a poll.
|
|
28
|
+
|
|
29
|
+
### JoinPoll
|
|
30
|
+
|
|
31
|
+
This step is required to register a user to a specific poll for which they want to vote. In short, it requires the user to generate a zk-SNARK proof that they know the private key to a public key registered to the MACI contract (proving they passed the initial gatekeeping requirements). This forces them to join with the same MACI key to each poll, greatly increasing the value of the key. Should they have been allowed to join with a throwaway key, they could simply sell their key for polls they do not care about.
|
|
32
|
+
|
|
33
|
+
**How does the flow look like?**
|
|
34
|
+
|
|
35
|
+
1. Reconstruct the MACI state tree by pulling all public keys from the MACI contract (events from RPC or from Subgraph)
|
|
36
|
+
2. Generate a merkle tree inclusion proof for the user's public key
|
|
37
|
+
3. Generate a zk-SNARK proof that the user knows the private key to the public key in the merkle tree inclusion proof
|
|
38
|
+
4. Call the `joinPoll` function on the Poll smart contract
|
|
39
|
+
|
|
40
|
+
**How to use the SDK for this?**
|
|
41
|
+
|
|
42
|
+
> This example is browser specific, as it uses the `@maci-protocol/sdk/browser` package and WASM for witness generation
|
|
43
|
+
|
|
44
|
+
Option 1: Use the `joinPoll` function from the `@maci-protocol/sdk/browser` package.
|
|
45
|
+
|
|
46
|
+
1. Download the `pollJoining` zk artifacts using [downloadPollJoiningArtifactsBrowser](https://github.com/privacy-scaling-explorations/maci/blob/main/packages/sdk/ts/proof/download.ts#L46)
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import { downloadPollJoiningArtifactsBrowser } from "@maci-protocol/sdk/browser";
|
|
50
|
+
|
|
51
|
+
const artifacts = await downloadPollJoiningArtifactsBrowser({
|
|
52
|
+
testing: true,
|
|
53
|
+
stateTreeDepth: 10,
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
2. Use the `joinPoll` function to join the poll
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
import { joinPoll } from "@maci-protocol/sdk/browser";
|
|
61
|
+
|
|
62
|
+
const joinedPollData = await joinPoll({
|
|
63
|
+
maciAddress: PUBLIC_MACI_ADDRESS,
|
|
64
|
+
privateKey: maciKeypair.privateKey.serialize(),
|
|
65
|
+
signer,
|
|
66
|
+
pollId,
|
|
67
|
+
inclusionProof,
|
|
68
|
+
pollJoiningZkey: artifacts.zKey as unknown as string,
|
|
69
|
+
pollWasm: artifacts.wasm as unknown as string,
|
|
70
|
+
sgDataArg: DEFAULT_SG_DATA,
|
|
71
|
+
ivcpDataArg: DEFAULT_IVCP_DATA,
|
|
72
|
+
blocksPerBatch: 1000,
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
This is not really efficient, as we are using the user RPC to fetch events, which can be quite slow and prone to errors. A better approach is to use a Subgraph to fetch the events.
|
|
77
|
+
|
|
78
|
+
Option 2: Fetch the MACI keys using a subgraph and reconstruct the state tree locally.
|
|
79
|
+
|
|
80
|
+
1. Deploy the subgraph - instructions [here](/guides/subgraph)
|
|
81
|
+
2. Fetch the MACI keys
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import { MaciSubgraph } from "@maci-protocol/sdk/browser";
|
|
85
|
+
|
|
86
|
+
const subgraph = new MaciSubgraph("https://api.studio.thegraph.com/query/x/maci/version/latest");
|
|
87
|
+
|
|
88
|
+
const keys = await subgraph.getKeys();
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
3. Generate the merkle tree
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
import { generateSignUpTreeFromKeys } from "@maci-protocol/sdk/browser";
|
|
95
|
+
|
|
96
|
+
const signUpTree = generateSignUpTreeFromKeys(keys);
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
4. Generate the inclusion proof - you will need to know the index of the user's public key in the merkle tree
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
const inclusionProof = signUpTree.generateProof(publicKeyIndex);
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
5. Generate the zk-SNARK proof and join the poll
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
import { joinPoll } from "@maci-protocol/sdk/browser";
|
|
109
|
+
|
|
110
|
+
const joinedPollData = await joinPoll({
|
|
111
|
+
maciAddress: PUBLIC_MACI_ADDRESS,
|
|
112
|
+
privateKey: maciKeypair.privateKey.serialize(),
|
|
113
|
+
signer,
|
|
114
|
+
pollId,
|
|
115
|
+
inclusionProof,
|
|
116
|
+
pollJoiningZkey: artifacts.zKey as unknown as string,
|
|
117
|
+
pollWasm: artifacts.wasm as unknown as string,
|
|
118
|
+
sgDataArg: DEFAULT_SG_DATA,
|
|
119
|
+
ivcpDataArg: DEFAULT_IVCP_DATA,
|
|
120
|
+
});
|
|
121
|
+
```
|
|
@@ -154,7 +154,7 @@ Within the circuits folder, there are a number of tests that are used to verify
|
|
|
154
154
|
|
|
155
155
|
These tests often use mock data from the `core` package. For instance, when testing the `processMessages` circuit, we are required to generate the parameters from the `core` packing, using the `Poll:processMessages` function. The same applies to vote tallying, where we need the `Poll:tally` function to be run first with mock users and vote messages.
|
|
156
156
|
|
|
157
|
-
All of the tests run using test parameters, usually `10, 20, 2`, aside from the tests inside: [`ceremonyParam`](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
157
|
+
All of the tests run using test parameters, usually `10, 20, 2`, aside from the tests inside: [`ceremonyParam`](https://github.com/privacy-scaling-explorations/maci/blob/main/circuits/ts/__tests__/CeremonyParams.test.ts) which use the parameters of the latest MACI ceremony. More details on the trusted setup can be found [here](/docs/security/trusted-setup).
|
|
158
158
|
|
|
159
159
|
### Core
|
|
160
160
|
|
|
@@ -162,7 +162,7 @@ The core package contains a number of tests that are used to verify that the cor
|
|
|
162
162
|
|
|
163
163
|
These tests interact with the crypto and dombinobjs packages, where mock data comes from. Their main goal is to ensure that the core functions work as expected, and that the state is as expected after a series of operations.
|
|
164
164
|
|
|
165
|
-
Currently, there is a blend of e2e and unit tests, where e2e tests are used to verify that the entire MACI local processing works as expected (users signup, publish votes, messages are processed and finally these votes are tallied). Unit tests on the other hand are used to verify that the core functions work as expected, such as `
|
|
165
|
+
Currently, there is a blend of e2e and unit tests, where e2e tests are used to verify that the entire MACI local processing works as expected (users signup, publish votes, messages are processed and finally these votes are tallied). Unit tests on the other hand are used to verify that the core functions work as expected, such as `MessageProcessor` and `VoteTally`. You will find them in separate files, with e2e being [here](https://github.com/privacy-scaling-explorations/maci/blob/main/core/ts/__tests__/e2e.test.ts) and unit tests in the other files.
|
|
166
166
|
|
|
167
167
|
### Domainobjs/Crypto tests
|
|
168
168
|
|
|
@@ -170,7 +170,7 @@ These tests are used to verify that MACI's primitives such as private keys work
|
|
|
170
170
|
|
|
171
171
|
## "Manual" Testing
|
|
172
172
|
|
|
173
|
-
To ensure that the MACI stack works as expected, without having to run the entire test suite (or even just the e2e tests), there is a [bash script](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
173
|
+
To ensure that the MACI stack works as expected, without having to run the entire test suite (or even just the e2e tests), there is a [bash script](https://github.com/privacy-scaling-explorations/maci/blob/main/packages/contracts/testScriptLocalhost.sh) inside the contracts folder which can be used.
|
|
174
174
|
|
|
175
175
|
This script contains a number of actions which touch all of the parts of MACI, and resemble exactly what other e2e tests do.
|
|
176
176
|
|
|
@@ -53,6 +53,32 @@ To run Contracts only tests, run:
|
|
|
53
53
|
pnpm run test
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
+
To run e2e tests for hardhat tasks for `contracts` using the in-memory hardhat network:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pnpm run test:hardhat
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
You can update the `deploy-config.json` file to change policies or other deployment settings used by the test.
|
|
63
|
+
|
|
64
|
+
You can enhance test reporting and gas cost estimation by adding the following variables to your `.env` file:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# CoinMarkerCap api key for prices (gas reporter)
|
|
68
|
+
COINMARKETCAP_API_KEY=
|
|
69
|
+
# Gas price for gas reporter
|
|
70
|
+
# Allows you to manually specify the gas price (e.g. 3 gwei)
|
|
71
|
+
GAS_REPORTER_PRICE=
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
These variables are used by `hardhat-gas-reporter` to show cost estimates for gas usage in the test reports.
|
|
75
|
+
|
|
76
|
+
If you would like to run these E2E tests against a different [supported networks](/docs/supported-networks/), you can override the network like this:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pnpm exec hardhat test --network {NETWORK} ./tests/e2e/hardhatTasks.test.ts
|
|
80
|
+
```
|
|
81
|
+
|
|
56
82
|
### Circuits
|
|
57
83
|
|
|
58
84
|
To test the circuits, from the main `maci/` directory, run:
|
|
@@ -71,10 +97,10 @@ or download them. Please remember to not use these testing `.zkey` files in prod
|
|
|
71
97
|
|
|
72
98
|
### Download `.zkey` files or the witness generation binaries
|
|
73
99
|
|
|
74
|
-
MACI has two main zk-SNARK circuits, `
|
|
100
|
+
MACI has two main zk-SNARK circuits, `MessageProcessor` and `VoteTally`.
|
|
75
101
|
|
|
76
102
|
:::info
|
|
77
|
-
The `
|
|
103
|
+
The `MessageProcessor` and `VoteTally` circuits are also provided in a non-quadratic voting (non-QV) and in a full credits voting (full) versions. Currently these new versions have not undergone a trusted setup ceremony.
|
|
78
104
|
:::
|
|
79
105
|
|
|
80
106
|
Each circuit is parameterised and there should be one
|
|
@@ -86,7 +112,7 @@ circuits.
|
|
|
86
112
|
|
|
87
113
|
Note the locations of the `.zkey` files as the smart contract tasks require them as part of the JSON configuration file.
|
|
88
114
|
|
|
89
|
-
For testing purposes you can download the required artifacts using the [`download-zkeys:test`](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
115
|
+
For testing purposes you can download the required artifacts using the [`download-zkeys:test`](https://github.com/privacy-scaling-explorations/maci/blob/main/package.json#L15). The script will place all required artifacts inside the `cli/zkeys` folder.
|
|
90
116
|
|
|
91
117
|
You can run the script directly with bash or use pnpm: `pnpm run download:test-zkeys` from the monorepo root.
|
|
92
118
|
|
|
@@ -11,17 +11,17 @@ sidebar_position: 5
|
|
|
11
11
|
|
|
12
12
|
### Case: missing `.dat` files
|
|
13
13
|
|
|
14
|
-
If your logs look like the following, then make sure you have `
|
|
14
|
+
If your logs look like the following, then make sure you have `MessageProcessorQv_10-2-1-2_test.dat` and `VoteTallyQv_10-1-2_test.dat` files in the same directory as your zkeys:
|
|
15
15
|
|
|
16
16
|
```
|
|
17
17
|
node build/ts/index.js generateProofs -x 0xf204a4Ef082f5c04bB89F7D5E6568B796096735a \
|
|
18
18
|
> -sk macisk.49953af3585856f539d194b46c82f4ed54ec508fb9b882940cbe68bbc57e59e \
|
|
19
19
|
> -o 0 \
|
|
20
20
|
> -r ~/rapidsnark/build/prover \
|
|
21
|
-
> -wp ./zkeys/
|
|
22
|
-
> -wt ./zkeys/
|
|
23
|
-
> -zp ./zkeys/
|
|
24
|
-
> -zt ./zkeys/
|
|
21
|
+
> -wp ./zkeys/MessageProcessorQv_10-2-1-2_test \
|
|
22
|
+
> -wt ./zkeys/VoteTallyQv_10-1-2_test \
|
|
23
|
+
> -zp ./zkeys/MessageProcessorQv_10-2-1-2_test.0.zkey \
|
|
24
|
+
> -zt ./zkeys/VoteTallyQv_10-1-2_test.0.zkey \
|
|
25
25
|
> -t tally.json \
|
|
26
26
|
> -f proofs
|
|
27
27
|
|
|
@@ -36,7 +36,7 @@ terminate called after throwing an instance of 'std::system_error'
|
|
|
36
36
|
Aborted (core dumped)
|
|
37
37
|
|
|
38
38
|
Error: could not generate proof.
|
|
39
|
-
Error: Error executing ./zkeys/
|
|
39
|
+
Error: Error executing ./zkeys/MessageProcessorQv_10-2-1-2_test /tmp/tmp-9904-zG0k8YPTATWB/input.json /tmp/tmp-9904-zG0k8YPTATWB/output.wtns
|
|
40
40
|
at genProof (/home/ubuntu/maci/circuits/ts/index.ts:44:15)
|
|
41
41
|
at /home/ubuntu/maci/cli/ts/generateProofs.ts:339:25
|
|
42
42
|
at step (/home/ubuntu/maci/cli/build/generateProofs.js:33:23)
|
|
@@ -71,7 +71,7 @@ Error: commitment mismatch
|
|
|
71
71
|
|
|
72
72
|
This is because commitments are generated using random salts, thus will differ at each `generateProofs` run.
|
|
73
73
|
|
|
74
|
-
In [core/Poll.ts](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
74
|
+
In [core/Poll.ts](https://github.com/privacy-scaling-explorations/maci/blob/main/packages/core/ts/Poll.ts):
|
|
75
75
|
|
|
76
76
|
```
|
|
77
77
|
let newSbSalt = genRandomSalt();
|
|
@@ -140,7 +140,7 @@ event MergeMessageAqSubRoots(uint256 indexed _numSrQueueOps);
|
|
|
140
140
|
event MergeMessageAq(uint256 indexed _messageRoot);
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
Please remember to pull the latest MACI repo updates(`git fetch origin && git pull origin
|
|
143
|
+
Please remember to pull the latest MACI repo updates(`git fetch origin && git pull origin main`) and run `pnpm build` in the root of this monorepo.
|
|
144
144
|
|
|
145
145
|
### Verifier contract found the proof invalid
|
|
146
146
|
|
|
@@ -159,3 +159,48 @@ Error: The verifier contract found the proof invalid.
|
|
|
159
159
|
### The on-chain verification of total spent voice credits failed
|
|
160
160
|
|
|
161
161
|
If you ran the `verify` command and got this error, please ensure consistency in your use of quadratic voting throughout interactions with MACI, including poll deployment, proof generation, and verification.
|
|
162
|
+
|
|
163
|
+
### Proof generation process is killed
|
|
164
|
+
|
|
165
|
+
If your terminal output ends like this:
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
[i] Starting to fetch logs from block 8386826
|
|
169
|
+
[i] Generating proofs of message processing...
|
|
170
|
+
[i] Progress: 1 / 1
|
|
171
|
+
[i] Wait until proof generation is finished
|
|
172
|
+
Killed
|
|
173
|
+
ELIFECYCLE Command failed with exit code 137.
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
This typically indicates the proof generation process was terminated due to exceeding the system's available memory limit (exit code `137` = SIGKILL by the OS, often due to OOM).
|
|
177
|
+
|
|
178
|
+
Increase Node.js' memory allocation by setting the `NODE_OPTIONS` environment variable before running the command:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
export NODE_OPTIONS="--max-old-space-size=4096"
|
|
182
|
+
# You can increase the value further (e.g., 8192 for 8GB) if your system has enough RAM:
|
|
183
|
+
export NODE_OPTIONS="--max-old-space-size=8192"
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Error: Not enough or too many values for input signals
|
|
187
|
+
|
|
188
|
+
If you see errors like:
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
Error: Not enough values for input signal currentVoteWeightsPathElements
|
|
192
|
+
at /home/maci/node_modules/.pnpm/circom_runtime@0.1.28/node_modules/circom_runtime/build/main.cjs:513:27
|
|
193
|
+
...
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
Error: Too many values for input signal ballots
|
|
198
|
+
at /home/maci/node_modules/.pnpm/circom_runtime@0.1.28/node_modules/circom_runtime/build/main.cjs:513:27
|
|
199
|
+
...
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
This usually happens when the Merkle tree depth configured in your MACI deployment does not match the depth expected by the zkey files used during proof generation.
|
|
203
|
+
To solve this:
|
|
204
|
+
|
|
205
|
+
- Download the correct zkey files from a trusted source.
|
|
206
|
+
- Verify that the `stateTreeDepth`, `messageTreeDepth`, and `voteOptionTreeDepth` used in your CLI or config match the values used to generate those zkey files.
|
|
@@ -19,7 +19,7 @@ MACI follows the [Semantic Versioning Specification (SemVer)](https://semver.org
|
|
|
19
19
|
|
|
20
20
|
All MACI packages are organized in our monorepo and follow a global release approach, meaning that all packages have the same version.
|
|
21
21
|
|
|
22
|
-
Currently, MACI core team manually decides when to release and what the version should be. Packages are released [automatically via CI](https://github.com/privacy-scaling-explorations/maci/blob/
|
|
22
|
+
Currently, MACI core team manually decides when to release and what the version should be. Packages are released [automatically via CI](https://github.com/privacy-scaling-explorations/maci/blob/main/.github/workflows/release.yml) when a new tag is created in GitHub. [You can view our releases and tags in GitHub](https://github.com/privacy-scaling-explorations/maci/releases).
|
|
23
23
|
|
|
24
24
|
## MACI Release Process
|
|
25
25
|
|
|
@@ -37,10 +37,10 @@ Version number '1.2.3' is used here as an example. You should replace the versio
|
|
|
37
37
|
git clone https://github.com/privacy-scaling-explorations/maci
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
3. Switch to the `
|
|
40
|
+
3. Switch to the `main` branch:
|
|
41
41
|
|
|
42
42
|
```
|
|
43
|
-
git checkout
|
|
43
|
+
git checkout main
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
4. Install required dependencies:
|
|
@@ -73,7 +73,7 @@ Currently, the ceremony artifacts work with MACI version up to 2.x
|
|
|
73
73
|
In order to run MACI polls, a coordinator is required to publish their MACI public key. You will need to generate a MACI keypair, and treat the private key just as your ethereum private keys. Please store them in a safe place as you won't be able to finish a round if you lose access, or if compromised a bad actor could decrypt the vote and publish them online. You can generate a new key pair using maci-cli by running the following command in the root of the project:
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
|
-
pnpm run
|
|
76
|
+
pnpm run generate-maci-keypair
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
### Set the .env
|
|
@@ -219,7 +219,7 @@ pnpm run prove:[network] --poll [poll-id] \
|
|
|
219
219
|
```
|
|
220
220
|
|
|
221
221
|
:::info
|
|
222
|
-
The `--coordinator-private-key` is the one you generated earlier with `pnpm run
|
|
222
|
+
The `--coordinator-private-key` is the one you generated earlier with `pnpm run generate-maci-keypair`.
|
|
223
223
|
|
|
224
224
|
`--start-block` is the block number from which to start looking for events from. You can use the block that you deployed the contracts in.
|
|
225
225
|
|
|
@@ -28,6 +28,7 @@ sidebar_position: 13
|
|
|
28
28
|
- [MACI - Starting From Scratch](https://www.youtube.com/watch?v=qVuhWlHnQF0) - Doris Chan 03/2024
|
|
29
29
|
- [MACI Workshop](https://www.youtube.com/watch?v=AimgqnMjG0o) - ctrlc03 04/2024
|
|
30
30
|
- [MACI Starter Kit Demo](https://www.youtube.com/watch?v=pYoBLLtVEoI&t=1s) - Yash 05/2024
|
|
31
|
+
- [The Promise of Blockchain Voting](https://www.youtube.com/watch?v=TQxR7U52ne0) - Sam Richards 06/2024
|
|
31
32
|
- [MACI Tutorial Deploying Contracts and Subgraph](https://www.youtube.com/watch?v=-QA0VB9EUMk) - Crisgarner 09/2024
|
|
32
33
|
- [MACI Tutorial Frontend Deployment 🚀](https://www.youtube.com/watch?v=q0yS8RfwDcw) - Crisgarner 09/2024
|
|
33
34
|
- [Finalizing a MACI Round](https://www.youtube.com/watch?v=nlS3hOC0ljw) - Crisgarner 09/2024
|