feat: trusted setup ceremony prep

This commit is contained in:
0xSage
2022-07-08 21:41:48 -04:00
parent 5b1ff2af21
commit c60660dc37
8 changed files with 69 additions and 5 deletions

BIN
circuits/pot12_final.ptau Normal file

Binary file not shown.

View File

@@ -0,0 +1,48 @@
# Nightmarket Trusted Setup Ceremony
## Overview
We have 2 circuits:
1. list: 23850 constraints (2^15)
2. sale: 3421 constraints (2^12)
We use a Groth16 proving system, so we need a 2 phase trusted setup process:
1. Universal (done)
2. Circuit specific setup (todo)
This gives us a final **zkey** file, which:
1. which generates solidity verifier contracts, used to verify proofs
2. used to create the proofs
[see process](https://fvictorio.notion.site/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F5f267294-acb7-4a7b-b68d-a9ffe3fa1c71%2Fdiagram.png?table=block&id=2e2fd7a5-4c9e-429e-8d6b-57caa4b06b68&spaceId=999fcf0b-d32c-46d7-922b-b4a5f30b1f90&width=2000&userId=&cache=v2)
## Setup
1. Tips for getting up and running:
- `git clone https://github.com/factorgroup/nightmarket.git`
- ```git config --global url."https://".insteadOf git://```
- disable `postinstall`
- `yarn install`
2. (optional) Verify phase 1 (from Hermez) was valid
`snarkjs powersoftau verify pot15_final.ptau`
supports up to 2^15 constraints
## Ceremony
We repeat steps 16/17 [mentioned here](https://github.com/factorgroup/nightmarket.git) for BOTH circuits separately.
0. Decide ceremony sequence. 0xSage already generated `list_0001.zkey` and `sale_0001.zkey`
1. cd into `/trustedsetup`, run the commands:
`snarkjs zkey contribute list_????.zkey list_????.zkey --name="your Contributor Name" -v`
and then:
`snarkjs zkey contribute sale_????.zkey sale_????.zkey --name="your Contributor Name" -v`
2. Verify this was done correctly
`snarkjs zkey verify ../client/list/list.r1cs ../circuits/pot15_final.ptau ????.zkey`
2. Upload your zkey files to `/trustedsetup`
3. Update the README with your `contribution hashes`
4. Discard your toxic waste!

21
trustedsetup/README.md Normal file
View File

@@ -0,0 +1,21 @@
# Trusted Setup Ceremony
This is a chronology of the trusted setup ceremony conducted for circuits `list.circom` and `sale.circom` before productionalizing Nightmarket.
### List Circuit
| Contribution | Contributor | Hash |
| -------- | -------- | -------- |
| list_0000.zkey | N/A | N/A|
| list_0001.zkey | [0xSage](https://github.com/0xSage) |1244f6bb a7f2351f 959db669 dbe3e56f 099e54a9 73b9708b fdf1b9fb 39ab0641 da61c9cd f93d2eca 31b87f21 8b13c7c0 2505b6d1 f7847e90 4fd8c3dc 98d2a623|
||||
||||
||||
### Sale Circuit
| Contribution | Contributor | Hash |
| -------- | -------- | -------- |
| sale_0000.zkey | N/A | N/A|
| sale_0001.zkey | [0xSage](https://github.com/0xSage) |501ed545 0e1fd1e7 7783aa50 99f95766 d48609cb 6c23c24e ed174e1a b07382dd bd757248 61480fe8 1a548f74 a35543af 956559a3 317b1ce4 31685a16 c6701944|
||||
||||
||||

BIN
trustedsetup/list_0000.zkey Normal file

Binary file not shown.

BIN
trustedsetup/list_0001.zkey Normal file

Binary file not shown.

BIN
trustedsetup/sale_0000.zkey Normal file

Binary file not shown.

BIN
trustedsetup/sale_0001.zkey Normal file

Binary file not shown.

View File

@@ -3880,11 +3880,6 @@ crypto-browserify@3.12.0:
randombytes "^2.0.0"
randomfill "^1.0.3"
crypto-js@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.1.1.tgz#9e485bcf03521041bd85844786b83fb7619736cf"
integrity sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==
cssom@^0.4.4:
version "0.4.4"
resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10"