MPC Phase2 Suite CLI
All-in-one command-line for interfacing with zkSNARK Phase 2 Trusted Setup ceremonies
Commands
phase2cli
: CLI entry point.phase2cli auth
: Starts the Device Flow authentication workflow for Github OAuth 2.0.phase2cli contribute
: Allow a user to participate by computing a contribution for each circuit of a selected ceremony (from those currently running).phase2cli ceremony setup
: Allow the coordinator to setup a new ceremony for a particular set/variants of circuits.phase2cli ceremony observe
: Allow the coordinator to monitor in real-time who is currently contributing for a circuit of a ceremony.
Getting Started
Prerequisities
You need to have the following installed:
git >= 2.25.1
node >= 16.14.0
npm >= 8.9.0
yarn >= 1.22.18
Configuration
Clone the repository and install the packages:
https://github.com/quadratic-funding/mpc-phase2-suite
cd mpc-phase2-suite
yarn
Navigate to the cli/
folder and make a copy of the .env.json.default file and rename it .env.json. The new file will contain the following data:
{
"firebase": {
"FIREBASE_FIRESTORE_DATABASE_URL": "your-firebase-firestore-database-url",
"FIREBASE_API_KEY": "your-firebase-api-key",
"FIREBASE_AUTH_DOMAIN": "your-firebase-auth-domain",
"FIREBASE_PROJECT_ID": "your-firebase-project-id",
"FIREBASE_STORAGE_BUCKET": "your-firebase-storage-bucket",
"FIREBASE_MESSAGING_SENDER_ID": "your-firebase-messaging-sender-id",
"FIREBASE_APP_ID": "your-firebase-app-id"
},
"github": {
"GITHUB_CLIENT_ID": "your-github-oauth-app-client-id"
},
"localPaths": {
"LOCAL_PATH_DIR_CIRCUITS_R1CS": "./circuits/r1cs",
"LOCAL_PATH_DIR_CIRCUITS_METADATA": "./circuits/metadata",
"LOCAL_PATH_DIR_ZKEYS": "./zkeys",
"LOCAL_PATH_DIR_PTAU": "./circuits/ptau"
}
}
- The
firebase
object contains your Firebase Application configuration. - The
github
object contains your Github OAuth Application client identifier. - The
localPaths
object contains the paths that are going to be used for storing circuit-related files.
Usage
Local Development
Build the project
yarn build
Authenticate using Github OAuth (auth command).
yarn auth
Setup a new ceremony (setup command).
yarn ceremony:setup
Contribute to a ceremony (contribute command).
yarn ceremony:contribute
Observe contributions for a ceremony (observe command).
yarn ceremony:observe
NPM Package
You could locally install the CLI as NPM package
npm i -g
Then, you could have access to phase2cli
commands (as described above).
⚠️ 🛠 The project is a WIP, so it is not yet to be considered production ready. Handle with care 😴
Please, follow the project boards to stay up-to-date!