Zokrates / ZoKrates

A toolbox for zkSNARKs on Ethereum
https://zokrates.github.io
GNU Lesser General Public License v3.0
1.8k stars 360 forks source link

Can not reproduce nova experiment #1344

Open ferjcast opened 12 months ago

ferjcast commented 12 months ago

Description

Can not reproduce nova experiment from https://zokrates.github.io/toolbox/experimental.html

Environment

Steps to Reproduce

Option 1 :

zokrates compile -i sum.zok --curve pallas 
echo "\"0\"" > init.json
echo "[\"1\", \"7\", \"42\"]" > steps.json
zokrates nova prove

Gives:

Could not open nova.params: No such file or directory (os error 2)

Option 2:

zokrates compile -i sum.zok --curve vesta -o nova.params
echo "\"0\"" > init.json
echo "[\"1\", \"7\", \"42\"]" > steps.json
zokrates nova prove

Gives:

Could not deserialize nova.params: EOF while parsing a value at offset 624

sum.zok:

def main(public field sum, private field element) -> field {
    return sum + element;
}
dark64 commented 12 months ago

Hi @ferjcast

It seems you are missing the setup part. You get nova.params by running zokrates nova setup after compilation in option 1. This should be mentioned in the docs as well so good catch!

ferjcast commented 12 months ago

Thank you. It worked.

ferjcast commented 11 months ago

Hi,

In regards with the experiment, I'm failing in how to read the final output returned in the proof (the compression and the verification work). How would I be able to get the answers from the proof.json file? In the example would be 50 for the first run and 100 for the second. Thank you.