This repo contains code for the Hekaton divide-and-aggregate zero-knowledge proof scheme.
The code is organized as follows:
cp-groth16contains our implementation of Mirage, along with our interface for writing "staged" circuits that can be easily integrated with commit-and-prove SNARKsdistributed-proverimplements our DNA SNARK, and also implements the experiments described in the paper.mpi-snarkimplements the MPI binary that runs the distributed prover on an MPI-compatible cluster.slurm_scriptscontains various scripts required for running these experiments on our cluster. The most salient of these are thesetup_benchscript and therun_single_benchscript, which respectively perform SRS generation and circuit proving.
- The code in this repo is not production-ready. It is the product of a small research team. Use with caution.
- We do not implement a standalone verifier for our proofs. The prover runs a verification routine here, but we haven't exposed it as its own function.
- We do not implement an interface for specifying public inputs to circuits.
This is a Rust library, and so can be compiled by using the cargo build tool.
To install cargo (and rust), follow the instructions here: rustup.rs.
This library is currently supported only on Linux; any relatively recent distribution should work.
A second dependency is OpenMPI; install this from your package manager of choice.
The existing scripts for reproducing experiments are specialized for our university cluster. So you won't be able to run these to completion on your system.
To simply compile and run experiments locally, one can invoke the commands in the following scripts:
slurm_scripts/setup_task.shto perform SRS generationslurm_scripts/my_task.shto invoke the distributed prover and benchmark its performance.
Specifically, the steps are as follows:
-
First, switch to the
distributed_proverfolder. -
For setup for main scalability experiments:
cargo run --release setup-big-merkle \
--num-subcircuits <num_subcircuits> \ # specifies number of subcircuits
--num-sha2-iters <num_iters_of_sha2> \ # specifies subcircuit size
--num-portals <num_shared_wires> \ # specifies number of shared wires
--key-out <file_name> # specifies file to store the generated SRS
- For setup for verifiable key directory experiment:
cargo run --release setup-vkd \
--num-subcircuits <num_subcircuits> \ # number of subcircuits
--key-out <file_name> # specifies file to store the generated SRS
- For setup for VM experiment:
cargo run --release setup-vm \
--num-subcircuits <num_subcircuits> \ # number of subcircuits (increasing this increases the size of the overall circuit)
--num-cycles-per-subcircuit 1024 \
--key-out <file_name> # specifies file to store the generated SRS
- Next, to run any of the corresponding experiments, simply invoke the following command:
cargo run --release work \
--key-file <file_name> \ # the file produced in the steps above
--num-workers <num_workers> \ # the number of MPI workers to use for this experiment.