mpc/README.md
This project contains the client and coordinator to conduct Groth16 multi-party computation for the circuit SRS. Three components are in play:
Hosts the database, storage services and state machine of the MPC round. Provides instant API on top of them.
The coordinator is in charge of verifying contributions. When a contribution is deemed valid, it dispatches the value to Supabase (insert an entry), effectively stepping the MPC state machine.
Exposes an API to contribute at localhost:4919:
OPTIONS /contributePOST /contribute a Contribute object in body. Returns:
202 Accepted if the contribution started.503 Unavailable if the client is busy (likely already contributing).GET /contribute returns:
200 Ok if everything is ok with the body containing an encoded Status representing the client status (idle, contributing etc...).500 InternalServerError if the contribution failed unexpectedly, the body contains the error message.{
"supabase_project": "<supabase_project_url>",
"bucket": "<supabase_bucket_to_push_contribution>",
"jwt": "<supabase_logged_in_user_jwt>",
"api_key": "<supabase_anon_api_key>",
"contributor_id": "<logged_in_user_uuid>",
"payload_id": "<logged_in_user_payload_uuid>"
}
#[serde(rename_all = "camelCase")]
pub enum Status {
Idle,
Initializing,
DownloadStarted(String),
Downloading(String, u8),
DownloadEnded(String),
ContributionStarted,
ContributionEnded,
UploadStarted(String),
UploadEnded(String),
Failed(String),
Successful,
}