- Install opam and ocaml 4.14.0
# after install opam
$ opam init
$ opam switch create 4.14.0
$ opam switch 4.14.0
$ eval $(opam env)- Install dependent ocaml packages
$ opam install menhir dune fmt logs alcotest- Install dependent python packages (no longer needed)
$ python3 -m venv pyenv
$ source pyenv/bin/activate- Install OPB solver. This step is necessary to partition a ZK protocol into multiple parts. We have tested on Gurobi-10.0: Gurobi
- Build
$ dune buildThe verifier coordinator runs:
$ dune exec -- ou cut --proto examples/merkle.ou --noc 3The generated EMP files will be output to two folders merkle_prover and merkle_verifier.
The prover coordinator then evaluates dependent variables using initial secret:
$ dune exec -- ou eval --input examples/merkle.in.ou --proverdir merkle_prover --verifierdir merkle_verifierBoth prover and verifier coordinators then compile their own code in two directories. Please follow this guide to install the dependent libraries before compiling the generated code.
# enter merkle_prover/ and merkle_verifier/ and run
$ makeBoth coordinators will obtain three executables: part0, part1 and part2.
They then distribute these executables to individual provers and verifiers respectively.
Each pair of prover and verifier run the same pair of executables on the same port. For example, the first pair both run the following command in a folder containing a data directory:
$ ./part0 12345Note that the generated code assumes the executables from both sides are run in the same machine. But you can let them run on different machines by changing the communicating IP addresses in part*.cpp.
TODO
If you are using vscode, you can enable syntax highlight for all .ou files by moving the ou-vscode-syntax directory into ~/.vscode/extensions/ if you use Linux or %USERPROFILE%\.vscode\extensions if you use Windows.