Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Groth16 proofs

Proof generation

From what I've found so far, the steps to generating a groth16 proof are as follows. Note that steps 1-4 are all done in /host/src/main.rs.

  1. Generate a succinct proof.
  2. Extract the seal from the inner receipt and convert to Vec<u8>.
  3. set up a Reader & a Writer (to pass to the seal-to-json utility).
  4. Call to_json. This will output a JSON file with the seal data (I believe this must be named input.json).
  5. Check the /groth16/ dir for the generated proof file input.json, and make sure it's correctly formatted (See notes below)
  6. Follow the instructions to setup and build the docker image in the RISC0 Groth16 Proof README
  7. run the docker container to generate the proof.json. ex: docker run --rm -v ~/groth16-exploration/groth16:/mnt risc0-groth16-prover

This is as far as I've made it so far. The proof generation (step 7) is failing with the following error:

  + WITNESS_FILE=/tmp/output.wtns
+ ulimit -s 16384
+ mkfifo /tmp/output.wtns
+ prover stark_verify.cs stark_verify_final.pk.dmp /tmp/output.wtns /mnt/proof.json
+ stark_verify /mnt/input.json /tmp/output.wtns
terminate called after throwing an instance of 'std::runtime_error'
  what():  Error loading signal iop: Not enough values

/app/prover.sh: line 24:     9 Aborted                 stark_verify /mnt/input.json "$WITNESS_FILE"
+ echo 'stark_verify failed'
21:37:34 DBG constraint system loaded took=306.767038
21:37:35 DBG proving key loaded took=452.122482
Error: failed to load witness: failed to parse file: invalid magic number

Notes

JSON Formatting

It seems the seal-to-json utility is outputting malformed json. This may not be consistent behavior but it's something to be aware of. At the end of the file, it terminates with a trailing comma, but has no closing ] or }. I've just been manually editing the file to remove the trailing comma and properly close the { and [.

About

A place to explore the use of groth16 proofs

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages