meilof/pysnark

Trusted setup?

Opened this issue · 8 comments

I'm wondering how trusted setup works in PySNARK.

When I output a proof, say in Bellman with zkinterface, it outputs both the constraints and the witness. Does that mean that the setup is done by the prover and there is no external trusted setup?

Never mind. It's in the README.

Actually, the readme talks about qaptools. How would it work for zkinterface?

I changed the zkinterface backend a bit so that it now generates a zkif file that contains the witness and a file that does not contain the witness (which the trusted party can then freely distributed). I also updated the README.

I'm having trouble using the new changes with the zkinterface tool. The zkInterface tool says the output violates the specification. Not entirely sure why.

PYSNARK_BACKEND=zkinterface python3 cube.py 10
cat computation.zkif | zkif validate

The statement is NOT COMPLIANT with the specification!
Violations:
- variable_0 was defined but not used.

As you mentioned, this problem seems to only occur in programs which never use constants (which unfortunately happens to be the case for the cube.py). It may be a bit overkill to fix this in pysnark. Especially since at first glance it seems wrong that the zkinterface specification should demand this.

By the way, I get more error message, do you get these as well?

The statement is NOT COMPLIANT with the specification!
Violations:
- Multiple headers.
- Multiple definition of the value of the instance variable_1
- Multiple definition of the value of the instance variable_2
- variable_0 was defined but not used.

Error: "Found 4 violations."

Yes, I get the "multiple definition" issue. It looks like the zkinterface tool reads all .zkif files in the working directory. If you remove either circuit.zkif or computation.zkif it fixes the issue.