Skip to content

Commit

Permalink
chore: update sidebar_position of docs
Browse files Browse the repository at this point in the history
  • Loading branch information
samajammin committed Dec 1, 2023
1 parent d27b229 commit 93a6faf
Show file tree
Hide file tree
Showing 12 changed files with 132 additions and 146 deletions.
21 changes: 10 additions & 11 deletions website/versioned_docs/version-v1.x/audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
title: MACI Security Audits
description: In the summer of 2022, MACI v1 was audited by HashCloak. The audit covered both the zk-SNARK circuits and the Solidity smart contracts.
sidebar_label: Security Assessments
sidebar_position: 10
sidebar_position: 11
---

# Security Audits

## Links

* Audit by HashCloak 2022/09 [report](/audit_reports/202220930_Hashcloak_audit_report.pdf)
* Audit by HashCloak 2021/09 [report](/audit_reports/20210922_Hashcloak_audit_report.pdf)
- Audit by HashCloak 2022/09 [report](/audit_reports/202220930_Hashcloak_audit_report.pdf)
- Audit by HashCloak 2021/09 [report](/audit_reports/20210922_Hashcloak_audit_report.pdf)

## HashCloak audit 2022

Expand All @@ -20,7 +20,7 @@ This audit revealed a number of high severity issues which have been remediated

## Data is not fully verified during a state update

This issue could have allowed a malicious coordinator to change the MACI state arbitrarily, for instance by tampering with the voice credits and the voting public key of any user.
This issue could have allowed a malicious coordinator to change the MACI state arbitrarily, for instance by tampering with the voice credits and the voting public key of any user.

In more details, the `processMessages.circom` circuit, did not fully verify that after a state update, the new state was the result of executing an arbitrary number of user messages on the previous state. `topupStateLeaves` and `topupStateLeavesPathElements` were never verified against the current state, and `topupStateIndexes` and `topupAmounts` were not verified against the message root.

Expand All @@ -44,7 +44,7 @@ function airdrop(uint256 amount) public onlyOwner {

## Integer overflow problem and improper bit length restriction

This issue within the `float.circom` circuit could have resulted in an overflow on the `IntegerDivision` template. This stemmed from the lack of validation of input size, as well as not preventing a division by zero. Furthemore, it was pointed out that using assert in circuits did not contribute to constraints verification, and could have been bypassed by a malicious coordinator.
This issue within the `float.circom` circuit could have resulted in an overflow on the `IntegerDivision` template. This stemmed from the lack of validation of input size, as well as not preventing a division by zero. Furthemore, it was pointed out that using assert in circuits did not contribute to constraints verification, and could have been bypassed by a malicious coordinator.

The issue was rectified with commit [efd4617724e956d2566062c6fe882e1d45cba7c4](https://github.com/privacy-scaling-explorations/maci/pull/523/commits/efd4617724e956d2566062c6fe882e1d45cba7c4)

Expand Down Expand Up @@ -112,7 +112,7 @@ The rest of the issues were successfully fixed and reflected in the v1.1.1. For

In March 2023, Veridise responsibly disclosed a number of issues to the MACI team, which were identified using their new [tool](https://twitter.com/VeridiseInc/status/1630806464695791616?s=20) for catching ZK circuit bugs.

Out of five issues disclosed, only three were relevant and have been since fixed by the MACI team. The other two issues were disregarded as they were present in older version of code which is not in use anymore.
Out of five issues disclosed, only three were relevant and have been since fixed by the MACI team. The other two issues were disregarded as they were present in older version of code which is not in use anymore.

We would like to thank you the Veridise team for their effort in keeping open source projects safe.

Expand All @@ -122,7 +122,7 @@ We would like to thank you the Veridise team for their effort in keeping open so

**Description**

In the template `QuinSelector`, if you want to confirm the input signal index is a valid integer less than 2**3, you should add Num2bits(3) to check it.
In the template `QuinSelector`, if you want to confirm the input signal index is a valid integer less than 2\*\*3, you should add Num2bits(3) to check it.

**Code Location**

Expand All @@ -139,7 +139,7 @@ component lessThan = SafeLessThan(3);

This was fixed by adding a new Template, `SafeLesThan` which uses `Num2Bits` as further check on the signals:

```javascript
```javascript
// the implicit assumption of LessThan is both inputs are at most n bits
// so we need add range check for both inputs
template SafeLessThan(n) {
Expand All @@ -160,7 +160,6 @@ template SafeLessThan(n) {
}
```


### Issue 2

**Description**
Expand Down Expand Up @@ -194,7 +193,7 @@ template SafeGreaterThan(n) {

And then used it to constrain the [`index` input signal](https://github.com/chaosma/maci/blob/2d7a3a0efd33dfc3a5f4d3f95bec3adda7abb963/circuits/circom/trees/incrementalQuinTree.circom#L115-L117):

```javascript
```javascript
greaterThan[i] = SafeGreaterThan(3);
greaterThan[i].in[0] <== i;
greaterThan[i].in[1] <== index;
Expand All @@ -214,7 +213,7 @@ In the template `QuinGeneratePathIndices`, the constrains of the `signal n[level

The [updated code](https://github.com/chaosma/maci/blob/2d7a3a0efd33dfc3a5f4d3f95bec3adda7abb963/circuits/circom/trees/incrementalQuinTree.circom#L285-L290) uses the `SafeLessThen` template, as shown below:

```javascript
```javascript
for (var i = 0; i < levels; i ++) {
// Check that each output element is less than the base
leq[i] = SafeLessThan(3);
Expand Down
8 changes: 2 additions & 6 deletions website/versioned_docs/version-v1.x/ci-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: CI Pipeline
description: Introduction to how MACI's CI works
sidebar_label: CI
sidebar_position: 11
sidebar_position: 12
---

# Continuous Integration (CI) Pipeline
Expand All @@ -11,12 +11,11 @@ CI (Continuous Integration) pipeline is an automated workflow to ensure that sof

![cicd-maci drawio-7](https://user-images.githubusercontent.com/1610146/185962260-091cd952-5444-44f3-89e3-be64e81d4c21.png)


## Pipeline Triggers

### Commit to Main Branch

Each commit (i.e. a merged PR) to the main branch triggers the pipeline. The pipeline creates packages that can be deployed to any environment. Packages are uploaded to an artifact repository (e.g. npm).
Each commit (i.e. a merged PR) to the main branch triggers the pipeline. The pipeline creates packages that can be deployed to any environment. Packages are uploaded to an artifact repository (e.g. npm).

![cicd-maci drawio-12](https://user-images.githubusercontent.com/1610146/183404579-8bcb76fe-34b6-4748-a5ae-e2e4b010bd86.png)

Expand All @@ -26,7 +25,6 @@ When a pull request has been created (or updated), it triggers the PR pipeline.

![cicd-maci drawio-9](https://user-images.githubusercontent.com/1610146/183391880-d3a20f29-2708-4d72-988d-4781c0396e48.png)


### Nightly

Nightly build runs every midnight. It is to ensure that all required dependencies are present and to show no bugs have been introduced.
Expand All @@ -38,5 +36,3 @@ Nightly build runs every midnight. It is to ensure that all required dependencie
When a tag has been pushed, it triggers a release pipeline. It will draft a release note with an auto-generated changelog and publish npm package(s).

![cicd-maci drawio-5](https://user-images.githubusercontent.com/1610146/185958513-51dadaf1-7f72-404b-b482-149b91edcaab.png)


2 changes: 1 addition & 1 deletion website/versioned_docs/version-v1.x/circuits.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: MACI Circuits
description: Introduction to the core zk-SNARK circuits of MACI
sidebar_label: Circuits
sidebar_position: 6
sidebar_position: 7
---

# Circuits
Expand Down
4 changes: 2 additions & 2 deletions website/versioned_docs/version-v1.x/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: MACI Command-line interface (CLI)
description: Introduction to the MACI CLI interface that allows for effective deployment and testing
sidebar_label: Command-line interface
sidebar_position: 4
sidebar_position: 5
---

# Command-line interface
Expand Down Expand Up @@ -253,7 +253,7 @@ node/build.js genProofs \
--tally-zkey "$ZKEYS_DIR"/TallyVotes_"$TALLY_VOTES_PARAMS".0.zkey \
--tally-file tally.json \
--output proofs/ \
--state-file localState.json
--state-file localState.json
```

### Coordinator: prove on chain
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-v1.x/contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: MACI Smart Contracts
description: MACI is composed of multiple smart contracts, which together with the zk-SNARK circuits, can be used to carry out on-chain voting
sidebar_label: Smart Contracts
sidebar_position: 5
sidebar_position: 6
---

# Smart Contracts
Expand Down
7 changes: 3 additions & 4 deletions website/versioned_docs/version-v1.x/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@
title: Installing MACI
description: How to install MACI
sidebar_label: Installation
sidebar_position: 2
sidebar_position: 3
---


# Installation

## Requirements

You need the following to use MACI:

- Node.js: use [`nvm`](https://github.com/nvm-sh/nvm) to install it. MACI has
been tested with Node 14, 16 and 18. We do however recommend to use Node 18 as Node 14 is deprecated and Node 16 will soon be deprecated too.
been tested with Node 14, 16 and 18. We do however recommend to use Node 18 as Node 14 is deprecated and Node 16 will soon be deprecated too.
- The [`rapidsnark`](https://github.com/iden3/rapidsnark) tool if running on an intel chip (this allows for faster proof generation vs snarkjs).

> Note that MACI works on Linux and MacOS. It has not been tested on Windows, however it should work on Windows Subsystem for Linux (WSL). Keep in mind that when using MACI e2e on a non intel chip, you will not be able to use rapidsnark and will have to use snarkjs instead. This will result in slower proof generation.
Expand Down Expand Up @@ -62,6 +61,7 @@ npm run build
```

<!-- check if these are needed on a fresh ubuntu VM -->

Install dependencies for and `zkey-manager`:

```bash
Expand All @@ -74,7 +74,6 @@ Edit `cli/zkeys.config.yml` to include the relative path to the
circom binary.

```yml

---
circomPath: "RELATIVE_PATH_TO_CIRCOM"
```
Expand Down
4 changes: 2 additions & 2 deletions website/versioned_docs/version-v1.x/integrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
title: Integrating MACI
description: How to integrate MACI into your application
sidebar_label: Integrating
sidebar_position: 9
sidebar_position: 10
---

# Integrating MACI
# Integrating MACI

MACI can be used in any protocol that requires collusion resistance, for instance it has been proven to be quite efficient when integrated in quadratic funding applications such as [clr.fund](https://github.com/clrfund/monorepo) and [qfi](https://github.com/quadratic-funding/qfi/tree/feat/code-freeze).

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-v1.x/primitives.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: MACI Primitives
description: A short introduction of the main primitives used by MACI
sidebar_label: Primitives
sidebar_position: 3
sidebar_position: 4
---

## MACI primitives
Expand Down
21 changes: 10 additions & 11 deletions website/versioned_docs/version-v1.x/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Release process
description: How MACI's release process works
sidebar_label: MACI Release process
sidebar_position: 12
sidebar_position: 13
---

# Maci Release Process
Expand Down Expand Up @@ -47,7 +47,6 @@ git commit --message "chore(release): publish 1.2.3"

After the pull request has been merged:


8. Retrieve merged commit

9. Add a tag:
Expand All @@ -68,12 +67,12 @@ Once the tag is pushed, GitHub Actions will automatically publish the packages t

The following packages will be published on npm.js:

* maci-circuits
* maci-cli
* maci-common
* maci-contracts
* maci-core
* maci-crypto
* maci-domainobjs
* maci-integrationtests
* maci-server
- maci-circuits
- maci-cli
- maci-common
- maci-contracts
- maci-core
- maci-crypto
- maci-domainobjs
- maci-integrationtests
- maci-server
Loading

0 comments on commit 93a6faf

Please sign in to comment.