zkp demystify zokrates

pipeline

source file

an example, square.zok

1
2
3
4
def main(private field a, field b) {
assert(a * a == b);
return;
}
  • The keyword private signals that we do not want to reveal this input, but still prove that we know its value.

compile

1
zokrates compile -i root.zok

after compile, it generates below files

  • out
  • out.r1cs
  • abi.json

setup

Performs a trusted setup for a given constraint system

1
zokrates setup

options

  • -i, –input Path of the binary [default: out]
    it generates below two files
  • proving.key
  • verification.key