This repository manages a trusted setup ceremony for a zero-knowledge circuit. Each participant contributes randomness to ensure that no single person knows the "toxic waste" that could compromise the system's security.
The ceremony is sequential - each participant builds upon the previous contribution. This approach ensures the security of the final parameters as long as at least one participant is honest.
- Preparation time: ~5-15 minutes to set up your environment
- Contribution time: ~5-10 minutes of uninterrupted time when it's your turn
- Availability: You should be responsive in the communication channel during your turn to avoid delays for other participants
- Docker installed on your system
- Git for cloning the repository
- Git LFS (Large File Storage) for handling large files
- Familiarity with running commands from the command line
- Download and install Git LFS from git-lfs.github.com
- Set up Git LFS for your user account:
git lfs install
This repository uses Git LFS to manage large files generated during the ceremony. Without Git LFS, you won't be able to properly clone or contribute to the repository.
For maximum security of the ceremony, we recommend:
- Use a freshly installed operating system
- Disconnect from the internet after downloading the necessary files
- Use a computer with a hardware random number generator
- Securely delete or physically destroy storage media after participating
However, any contribution is valuable and appreciated, even if it doesn't follow all these recommendations.
-
Fork this repository to your GitHub account
-
Clone your forked repository:
-
Recommended: Clone without full history (shallow clone)
This method is faster and minimizes network traffic:git clone --depth 1 https://github.com/<Your-GitHub-Username>/trusted-setup-ceremony.git cd trusted-setup-ceremony
Note: The
--depth 1
flag fetches only the latest snapshot of the repository without full commit history. -
Alternative: Clone with full history
If you need the complete commit history, use the following:git clone https://github.com/<Your-GitHub-Username>/trusted-setup-ceremony.git cd trusted-setup-ceremony
Warning: Cloning with full history may take more time and use significant network bandwidth.
-
-
Pull Large Files for the Latest Contribution
This repository uses Git LFS to manage large files. Pulling all large files at once, rather than just the ones needed for your contribution, may exceed the GitHub bandwidth limits and significantly slow down the process. To avoid this, fetch only the large files required for the latest contribution:
git lfs pull -I "$(ls -d ./contributions/* | sort -V | tail -n 1)/*.zkey"
This command identifies the folder with the largest number in its name under
./contributions/
(names of folders with contributions there starts with numbers) and pulls only the*.zkey
files (large files) from that folder.
Choose one of the following methods to contribute:
docker run --rm -it -v $(pwd)/contributions:/app/contributions --user $(id -u):$(id -g) pantherprotocol/trusted-setup-ceremony:latest contribute
docker build -t trusted-setup-ceremony .
docker run --rm -it -v $(pwd)/contributions:/app/contributions --user $(id -u):$(id -g) trusted-setup-ceremony contribute
npm install
npm run contribute
During the contribution process, you will be asked to:
- Enter your GitHub username
- Provide random entropy (by typing randomly on your keyboard)
- Wait for the process to complete, which will create a new folder with your contribution and attestation
After contributing, verify that your contribution was processed correctly:
docker run --rm -it -v $(pwd)/contributions:/app/contributions --user $(id -u):$(id -g) pantherprotocol/trusted-setup-ceremony:latest verify
docker build -t trusted-setup-ceremony .
docker run --rm -it -v $(pwd)/contributions:/app/contributions --user $(id -u):$(id -g) verify
npm install
npm run verify
Commit and push your changes to your forked repository.
Please commit *.zkey
files separately from other files. This approach allows the coordinator to manage two branches effectively:
- The
master
branch, which contains only thezkey
files from the latest contribution to minimize network bandwidth usage. - The
complete
branch, which keeps all files from every contribution, enabling full auditability and verification of the entire ceremony.
By separating zkey
files into their own commits, the coordinator can easily synchronize these branches, ensuring efficient bandwidth usage without compromising the ability to verify the entire process.
git add ./contributions/**/*.zkey
git commit -m "Add contribution from YOUR_GITHUB_USERNAME (1/2)"
git add .
git commit -m "Add contribution from YOUR_GITHUB_USERNAME (2/2)"
git push origin main
Then create a pull request to merge your contribution back to the main repository.
If you encounter issues with the contribution process:
- Ensure your firewall allows the required connections
- If using a NAT router, consider enabling UPnP or setting up port forwarding
- Try the alternative contribution methods listed in section 2
If the standard contribution method fails, you can try:
- Submitting a PR with your contribution files
- Uploading files to cloud storage (Google Drive, Dropbox) and sharing the link
- Using a secure file transfer tool like Magic-Wormhole
The commands shown above work as-is on Linux and macOS systems.
On Windows, use one of these command formats:
PowerShell:
docker run --rm -it -v ${PWD}/contributions:/app/contributions pantherprotocol/trusted-setup-ceremony contribute
Command Prompt:
docker run --rm -it -v %cd%/contributions:/app/contributions pantherprotocol/trusted-setup-ceremony contribute
If you encounter path issues, use absolute paths:
docker run --rm -it -v C:\full\path\to\trusted-setup-contrubutions:/app/contributions pantherprotocol/trusted-setup-ceremony contribute
The official ceremony Docker image is available on Docker Hub:
docker pull pantherprotocol/trusted-setup-ceremony:latest
You can use a specific version by replacing :latest
with a version tag like :0.1
.
-v $(pwd)/contributions:/app/contributions
mounts thecontributions
folder in your current directory to the container--user $(id -u):$(id -g)
ensures the container runs processes with the same user (UID) and group (GID) as the current local user, preventing permission issues when writing to mounted volumes-it
enables interactive input required for the contribution--rm
removes the container after execution- The Docker image supports both AMD64 (x86_64) and ARM64 architectures
If you are coordinating the ceremony:
- Initialize the repository by copying r1cs and zkey files to the
0000_initial
folder - Push this initial setup to the repository