gnosis / dex-zksnarks

Code to generate snark proofs for batch auction result validation of the Gnosis d.exchange
46 stars 7 forks source link

adding a script that can convert libsnark binary output to non binary #19

Closed fleupold closed 5 years ago

fleupold commented 5 years ago

If you forget to compile pepper with -UBINARY_OUTPUT any output (e.g. the exported witness) will be in binary and not human readable.

This script allows to read such an output file and convert its content into a non binary output format.

bh2smith commented 5 years ago

This looks really great although I am not sure how to use it. I found that make scripts tells me its already made, but then I wouldn't know how to call the function. Do I need to supply a binary file? Are these the files that I find in prover_verifier_shared?

fleupold commented 5 years ago

The binary file will be put into scripts/bin/pepper_binary_format_reader (cf. make command). The input would be a witness file you receive from generating a witness inside the pepper framework (e.g. ./bin/pepper_prover_hash_transform witness hash_transform.inputs hash_transform.witness)

This is assuming pepper was compiled with -DBINARY_OUTPUT (the default, which makes your witness be exported in binary instead of ASCII). If you remembered change the pepper Makefile to use -UBINARY_OUTPUT, you won't need this script.

fleupold commented 5 years ago

Thanks for testing it on your machine @bh2smith