0xPARC ZK Learning Group

https://dev.to/tonyolendo/the-complete-full-stack-guide-to-getting-started-with-zero-knowledge-proofs-using-circom-and-zk-snarks-part-2-58o

  • x is declared as public input

  • if not declared, assumes inputs are private.

Public vs Private inputs

  • public and private inputs to the circuit.

  • Public signals are variables that are public for everyone, if one takes a look on the blockchain, one can see these public variables are open for everyone to see.

  • Private values are only available to the proof creator.

circle-info

all output signals of the main component are public (and cannot be made private),

For example, you want to prove you know a x such that y = f(x), x would be private, but y would be public.

  • out would be y [signal output out]

Examples

NonEqual

  • Template NonEqual checks that in0 and in1 are not equal to each other.

  • If they are not equal, the difference btw the signals is non-zero.

  • To check that the signals are non-zero, we verify that the inverse exists.

Distinct

  • Checks if all elements of an array are unique.

  • Takes an array of n signals as input.

  • i,j a pair signals

  • for each pair, we want to check that they are not unique.

  • for each pair we will create a non-zero sub-circuit; and wire it up

Last updated