ConceptsCircuits

Circuits

Note: Developers using the Pluto Web Proofs SDK are not required to write circuits or have knowledge of circuit internals. The Pluto Web Proofs SDK abstracts the cryptographic complexity, providing a straightforward interface to integrate Web Proofs functionality. This documentation includes circuit details for those interested, but they are not essential for using or implementing Web Proofs in your application.


Zero-Knowledge (ZK) circuits are the core of constructing ZK proofs. Much like circuits used in computers, ZK circuits are designed to take in a set of input values and produce a set of output values.

The circuit can also impose constraints on the input values that force a requirement that certain statements evaluate to specific values. This idea is akin to assert! or require! statements in many programming languages, but rather than being part of a language, these constraints in ZK circuits exist in the circuit themselves, which is unlike typical circuits made from AND,OR, and NOT gates.

How do circuits translate to ZK proofs?

Imagine you have a computer program you want to create a proof for. You’ll write constraints for that program in a domain-specific ZK language like Circom, then Circom will output the ZK circuit itself, in the form of R1CS files.

From there, a proof can be created by plugging in the input values to the circuit in order to yield an output for those given input values. A proof can only be accepted if the inputs also satisfied the circuit constraints.

Let’s use an example - the task of finding a specific value inside of a JSON file, and using this value as the output for a program. This is important for Web Proofs (although application developers don’t need to wrangle with circuits to use the Web Proofs SDK). We have existing ZK circuits that parse JSON files and store information about the file, which can then be interpreted to provide location of the intended value in the JSON file.

By passing in a JSON file that has the ‘right’ layout of keys, values, and arrays, the ZK circuits will produce the output that one expects, or fail to generate a proof if the JSON does not have a value at the specified location.

What circuits does the Web Proofs SDK use?

We have developed various ZK circuits that are used in the Web Proofs SDK, like:

There are dedicated documentation pages at the links above that provide more detailed descriptions and links to the open-source repositories for each of the circuits listed above.