ZoKrates icon indicating copy to clipboard operation
ZoKrates copied to clipboard

Cannot execute Trusted Setup procedure for a sample program from documentation

Open ruslangm opened this issue 2 years ago • 1 comments

Description

Cannot execute Trusted Setup procedure for a sample program by using the documentation taken from here.

Steps to Reproduce

  1. Init zokrates container:
docker run -u 0 -ti zokrates/zokrates /bin/bash 
  1. Create sample.zok file with the following code:
def main(private field a, private field b) -> field {
    return a * b;
}
  1. Compile the program:
zokrates compile -i circuit.zok -o circuit
  1. Grab a file which contains the parameters for our circuit with depth 2:
wget https://download.z.cash/downloads/powersoftau/phase1radix2m2
  1. Initialize a phase 2 ceremony:
zokrates mpc init -i circuit -o mpc.params -r ./phase1radix2m2
  1. Receive an error:
Failed to initialize: I/O error: y coordinate decoding error: 0xfde8fc25335eb5ec859c2818b2610b2e19ab445dac720bb1f2b0cd3336f7a1ac is not an element of the field

I'm quite a newbie here so will be grateful for advices if I'm doing something wrong.

ruslangm avatar Sep 28 '22 16:09 ruslangm

Hi @ruslangm, zcash powersoftau (in your case phase1radix2m2) uses the bls12-381 curve, you need to specify this curve in the compilation step:

zokrates compile -i circuit.zok -o circuit -c bls12-381

dark64 avatar Sep 29 '22 13:09 dark64

Hey @dark64, thanks for your reply.

ruslangm avatar Oct 28 '22 07:10 ruslangm