@maci-protocol/website 0.0.0-ci.ab3b4c1 → 0.0.0-ci.ae1d978

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.
@@ -46,7 +46,7 @@ async function getConfig(): Promise<Config> {
46
46
  routeBasePath: "docs/",
47
47
  sidebarPath: "./sidebars.ts",
48
48
  editUrl: ({ versionDocsDirPath, docPath }) =>
49
- `${GITHUB_URL}/edit/dev/apps/website/${versionDocsDirPath}/${docPath}`,
49
+ `${GITHUB_URL}/edit/dev/website/${versionDocsDirPath}/${docPath}`,
50
50
  remarkPlugins: [remarkMath],
51
51
  rehypePlugins: [rehypeKatex],
52
52
  includeCurrentVersion: false,
@@ -59,7 +59,7 @@ async function getConfig(): Promise<Config> {
59
59
  blog: {
60
60
  showReadingTime: true,
61
61
 
62
- editUrl: ({ blogDirPath, blogPath }) => `${GITHUB_URL}/edit/dev/apps/website/${blogDirPath}/${blogPath}`,
62
+ editUrl: ({ blogDirPath, blogPath }) => `${GITHUB_URL}/edit/dev/website/${blogDirPath}/${blogPath}`,
63
63
  remarkPlugins: [remarkMath],
64
64
  rehypePlugins: [rehypeKatex],
65
65
  onUntruncatedBlogPosts: "ignore",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maci-protocol/website",
3
- "version": "0.0.0-ci.ab3b4c1",
3
+ "version": "0.0.0-ci.ae1d978",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -61,5 +61,5 @@
61
61
  "engines": {
62
62
  "node": ">=18.0"
63
63
  },
64
- "gitHead": "3f62ca8b8ba47cb72f3e562eb473487595f27cab"
64
+ "gitHead": "4d0c9dff7fe8e4ff4c5d9b02a81272672e0e597a"
65
65
  }
@@ -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/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.
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.
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/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.
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.
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
 
@@ -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/dev/packages/contracts/contracts/interfaces/IInitialVoiceCreditProxy.sol). You can see our [basic example](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.sol) how it's implemented for constant distribution.
46
+ If you'd like to extend the functionality of how votes are distributed among users, you need to extend [InitialVoiceCreditProxy](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/initialVoiceCreditProxy/InitialVoiceCreditProxy.sol) contract. You can see our [basic example](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.sol) how it's implemented for constant distribution.
47
47
 
48
48
  ```ts
49
49
  contract ConstantInitialVoiceCreditProxy is InitialVoiceCreditProxy {
@@ -203,10 +203,6 @@ As a coordinator, first you need to merge signups and messages (votes). This opt
203
203
  pnpm merge:[network] --poll [poll-id]
204
204
  ```
205
205
 
206
- :::info
207
- `poll-id` starts at 0 and increments for each deployed poll
208
- :::
209
-
210
206
  Then you need to generate the proofs for the message processing, and tally calculations. This allows to publish the poll results on-chain and then everyone can verify the results:
211
207
 
212
208
  ```bash
@@ -214,16 +210,12 @@ pnpm run prove:[network] --poll [poll-id] \
214
210
  --coordinator-private-key [coordinator-maci-private-key] \
215
211
  --tally-file ../results/tally.json \
216
212
  --output-dir ../results/proofs/ \
217
- --start-block [block-number] \
213
+ --start-block [block-number]
218
214
  --blocks-per-batch [number-of-blocks]
219
215
  ```
220
216
 
221
- :::info
222
- The `--coordinator-private-key` is the one you generated earlier with `pnpm run generateMaciKeyPair`.
223
-
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
-
226
- You can reduce the time of the proving by including more blocks per batch with `--blocks-per-batch`, you can try with 500.
217
+ :::important
218
+ You can reduce the time of the proving by including more blocks per batch, you can try with 500.
227
219
  :::
228
220
 
229
221
  #### Submit On-chain
@@ -232,8 +224,8 @@ Now it's time to submit the poll results on-chain so that everyone can verify th
232
224
 
233
225
  ```bash
234
226
  pnpm submitOnChain:[network] --poll [poll-id] \
235
- --output-dir ../results/proofs/ \
236
- --tally-file ../results/tally.json
227
+ --output-dir proofs/ \
228
+ --tally-file proofs/tally.json
237
229
  ```
238
230
 
239
231
  ### Tally
@@ -7,14 +7,14 @@ sidebar_position: 2
7
7
 
8
8
  There are a number of MACI's smart contracts which can be re-used by different deployments. These are the following:
9
9
 
10
- - [VerifyingKeysRegistry](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/VerifyingKeysRegistry.sol)
11
- - [PoseidonHashers](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/crypto/Hasher.sol)
12
- - [PollFactory](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/PollFactory.sol)
13
- - [MessageProcessorFactory](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/MessageProcessorFactory.sol)
14
- - [TallyFactory](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/TallyFactory.sol)
15
- - [Verifier](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/crypto/Verifier.sol)
10
+ - [VerifyingKeysRegistry](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/VerifyingKeysRegistry.sol)
11
+ - [PoseidonHashers](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/crypto/Hasher.sol)
12
+ - [PollFactory](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/PollFactory.sol)
13
+ - [MessageProcessorFactory](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/MessageProcessorFactory.sol)
14
+ - [TallyFactory](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/TallyFactory.sol)
15
+ - [Verifier](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/crypto/Verifier.sol)
16
16
  - [FreeForAllPolicy](https://github.com/privacy-scaling-explorations/excubiae/tree/main/packages/contracts/contracts/extensions/freeForAll)
17
- - [ConstantInitialVoiceCreditProxy](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.sol) - if you are happy to work with a fixed amount of credits
17
+ - [ConstantInitialVoiceCreditProxy](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.sol) - if you are happy to work with a fixed amount of credits
18
18
 
19
19
  VkRegistries can be re-used by different protocols to share the same set of verifying keys. Please be advised that you should be verifying that those verifying keys are the ones that have undergone a trusted setup ceremony.
20
20
 
@@ -6,7 +6,7 @@ sidebar_position: 1
6
6
  ---
7
7
 
8
8
  :::info
9
- Code location: [MACI.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/MACI.sol)
9
+ Code location: [MACI.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/MACI.sol)
10
10
  :::
11
11
 
12
12
  `MACI.sol` is the core contract of the project, as it provides the base layer for user signups and Polls to be created.
@@ -6,7 +6,7 @@ sidebar_position: 4
6
6
  ---
7
7
 
8
8
  :::info
9
- Code location: [MessageProcessor.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/MessageProcessor.sol)
9
+ Code location: [MessageProcessor.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/MessageProcessor.sol)
10
10
  :::
11
11
 
12
12
  This contract is used to prepare parameters for the zk-SNARK circuits as well as for verifying proofs. It should be deployed alongside a `Poll`.
@@ -6,7 +6,7 @@ sidebar_position: 9
6
6
  ---
7
7
 
8
8
  :::info
9
- Code location: [Params.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/utilities/Params.sol)
9
+ Code location: [Params.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/utils/Params.sol)
10
10
  :::
11
11
 
12
12
  A contract holding three structs:
@@ -6,7 +6,7 @@ sidebar_position: 2
6
6
  ---
7
7
 
8
8
  :::info
9
- Code location: [Poll.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/Poll.sol)
9
+ Code location: [Poll.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/Poll.sol)
10
10
  :::
11
11
 
12
12
  This contract allows users to submit their votes.
@@ -6,7 +6,7 @@ sidebar_position: 3
6
6
  ---
7
7
 
8
8
  :::info
9
- Code location: [PollFactory.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/PollFactory.sol)
9
+ Code location: [PollFactory.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/PollFactory.sol)
10
10
  :::
11
11
 
12
12
  `PollFactory` is a smart contract that is used to deploy new Polls. This is used by MACI inside the `deployPoll` function.
@@ -6,7 +6,7 @@ sidebar_position: 5
6
6
  ---
7
7
 
8
8
  :::info
9
- Code location: [Tally.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/Tally.sol)
9
+ Code location: [Tally.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/Tally.sol)
10
10
  :::
11
11
 
12
12
  The `Tally` contract is used by the coordinator to submit commitments to the tally results via the `tallyVotes` function. This is done in batches and the final commitment can be used by the users to verify the validity of the results.
@@ -6,7 +6,7 @@ sidebar_position: 8
6
6
  ---
7
7
 
8
8
  :::info
9
- Code location: [VerifyingKeysRegistry.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/VerifyingKeysRegistry.sol)
9
+ Code location: [VerifyingKeysRegistry.sol](https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/VerifyingKeysRegistry.sol)
10
10
  :::
11
11
 
12
12
  The VerifyingKeysRegistry is a contract that holds the verifying keys for the zk-SNARK circuits. It holds four different sets of keys:
@@ -5,7 +5,7 @@ sidebar_label: zk-SNARK Circuits
5
5
  sidebar_position: 1
6
6
  ---
7
7
 
8
- MACI has three main zk-SNARK [circuits](https://github.com/privacy-scaling-explorations/maci/tree/dev/packages/circuits):
8
+ MACI has three main zk-SNARK [circuits](https://github.com/privacy-scaling-explorations/maci/tree/dev/circuits):
9
9
 
10
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/dev/circuits/circom/core/qv/processMessages.circom) and [non-QV](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/core/non-qv/processMessages.circom) versions are available.
11
11
  2. TallyVotes.circom, which counts votes from users' ballots, batch by batch. [QV](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/core/qv/tallyVotes.circom) and [non-QV](https://github.com/privacy-scaling-explorations/maci/blob/dev/circuits/circom/core/non-qv/tallyVotes.circom) versions are available.