This tool allows users to run an MPC ceremony for generating the proving and verifying keys for the Groth16/PLONK circuits used by Succinct SP1.
This repo is adapted from Worldcoin's Semaphore Merkle Tree Batcher.
Each groth16 proof of a circuit requires a trusted setup that has 2 parts: a phase 1 which is also known as a "Powers of Tau ceremony" which is universal (the same one can be used for any circuit) and a phase2 which is circuit-specific, meaning that you need to a separate phase2 for every single circuit. In order to create an SRS to generate verifying keys for SMTB we would like many different members from different organizations to participate in the phase 2 of the trusted setup.
For the phase 1 we will be reusing the setup done by the joint effort of many community members, it is a powers of tau ceremony with 54 different contributions (more info here). A list of downloadable .ptau
files can be found here.
- Install git https://github.com/git-guides/install-git
- Install Go https://go.dev/doc/install
- Minimum RAM requirement is 16GB
In the phase 2, participants add randomness to make the setup specific to the actual circuit, creating the final proving and verification keys needed for SP1. To add your contribution to the phase 2, follow the steps below:
git clone https://github.com/succinctlabs/semaphore-gnark-11.git
cd semaphore-gnark-11
go build
mkdir trusted-setup
You will need two pieces of information provided by the coordinator:
- A Presigned URL: This is a special, temporary URL that grants permission to upload your contribution. It will look like a long web address.
- The S3 Bucket Name: The name of the cloud storage bucket where the ceremony files are stored.
Once you have received these 2 pieces of information, you can run the program below:
# Make sure to add quotes around the presigned URL to avoid `&` character in the URL being interpreted by your shell
# The command below can take around 10-20 minutes to complete
./semaphore-gnark-11 p2c "<presignedUrl>" <bucketName>
The output should look like this:
Downloading previous contribution: phase2-0
Generating contribution
Uploading contribution: phase2-1
Contribution successful!
Once your contribution has been verified by the coordinator, you can attest for it on social media, providing the following info:
- Contribution URL: https://succinct-sp1-dev.s3.us-east-2.amazonaws.com/phase2-1
- Contribution Hash: db0fbfa74ace3839c07d63041355754131dbfaececfbf64638f51e693455de8d
Then you can inform the coordinator that you have added your contribution, by providing them with the hash returned by the program, so they can verify it.
Once the coordinator has verified your contribution, you can publish an attestation for it on social media, specifying the URL and hash of your contribution.
If you want, you can verify any contribution given its index. Run the following command:
./semaphore-gnark-11 p2v <index> <bucketName>
The output should look like this:
Downloading current contribution: phase2-1
Downloading phase2
Verifying contribution with hash: db0fbfa74ace3839c07d63041355754131dbfaececfbf64638f51e693455de8d
Ok!
This repository is a fork of the zkbnb-setup repository. We would like to thank the authors of the original repository for their work as this project is a slight tweak of the original work to fit our needs.
We appreciate the community efforts to generate a good universal SRS for everyone's benefit to use and for the [iden3 team for building snarkjs.
Also a special thank you to Kobi Gurkan for his contributions to the ptau-deserialzier tool and his advice on the trusted setup process.