git clone https://github.com/JacobEberhardt/ZoKrates
cd ZoKrates
docker build -t zokrates .
docker run --name zokrates -ti zokrates /bin/bashmkdir zksnark && cd zksnark
truffle initNow, add the computation that a prover needs to prove (and the one that the verifier will verify) in the file computation.code.
Copy the file computation.code to the zokrates container
docker cp computation.code zokrates:/home/zokrates/
Go to the zokrates container
./zokrates compile -i computation.code
./zokrates setup
./zokrates compute-witness --interactive -a 3512941527679
<enter private inputs>
524287
6700417
./zokrates generate-proof4. Generate verifier.sol and copy proof.json and verifier.sol from the zokrates container to the truffle project
./zokrates export-verifier
docker cp zokrates:/home/zokrates/proof.json .
docker cp zokrates:/home/zokrates/verifier.sol contracts/.See verifierTest.js
truffle compile
truffle migrate
truffle test