This library constitutes one of the two main parts of the zk-gen
platform.
In this first prototype of the library, we implemented a recently published polynomial commitment scheme and plugged it into the Marlin protocol. The library includes the following components:
- FRI: FRI is a standalone library implementing the Interactive Oracle Proof of Proximity (IOPP) described in Fast Reed-Solomon Interactive Oracle Proofs of Proximity.
- VLPA19 VLPA19 is an implementation of the polynomial commitment scheme desribed in Transparent Polynomial Commitment Schemes with Polylogarithmic Complexity. It uses FRI as a black-box.
- zk-interace / Marlin Integration This is a frontend that reads in an R1CS zkif file from zkinterface, and runs Marlin on it using VP19
More details about these components can be found in software_overview.md.
Make sure you have exactly one version of rustc
installed on your computer. Run rustup install stable
. Then:
-
fri
: Navigate tozk-gen/fri
and runcargo test
-
vlpa19
: Navigate tozk-gen/vlpa19
and runcargo test --lib vlpa19
-
zkinterace-marlin
: Navigate tozk-gen/zkinterface-marlin
and runcargo test
.
- Ensure you have an R1CS instance, witness, and relation.
- Navigate to
verifier_setup
and runcargo run -- {instance} {relation}
. This will create a file calledsrs
. Docp srs ../prover
- Navigate to
prover
and runcargo run -- {instance} {relation} {witness} {key} {proof}
. This will create two files,key
andproof
. Docp key ../verifier
andcp proof ../verifier
. - Navigate to
verifier
and runcargo run -- {instance} {relation} {key} {proof} {output}
. This will create a file calledoutput
that contains a1
if the proof was accepted and a0
otherwise.