Introduction to the WizToolKit Manual

WizToolKit is a system for working with the SIEVE IR, both on the command-line and in C++ or another language capable of interfacing with C/C++. WizToolKit is built to handle a variety of use cases and settings.

In this introduction, we’ll go over a few aspects of the IR and how it is used. The reader is expected to have a passing familiarity with Zero Knowledge (ZK).

Settings and Use-cases

Due to the complexity, ZK Proof systems are often organized into a frontend (TA1, within the SIEVE Program) and a backend (TA2). The frontend converts a human readable statement into a machine readable statement (the IR). The backend then takes a machine readable statement and proves its truthfulness. Within the backend we have a few settings for how the statement is used.

Prover

The prover must convince the verifier of a statement’s truthfulness.

Verifier

The verifier is either convinced or not convinced by the prover.

Preprocessing

The backend may wish to perform certain tasks upon a relation before it can prove and verify.

The SIEVE IR

The SIEVE IR is a format for arithmetic (and boolean) ZK circuits. There are two layers in the IR, the Circuit-IR, a somewhat low-level representation, and the Translation-IR, a higher level representation which can translate itself to the Circuit-IR or other IRs. For the time being, the Translation-IR is under development, and WizToolKit focuses on handling the Circuit-IR.

The IR is composed of the following resources:

Input Streams

An input stream is a list of values which are the inputs to a circuit. In general there are two kinds of input streams.

  • The public_input stream has values which are known to both the prover and verifier.

  • The private_input stream has values which are known only to the prover.

Circuit

The circuit is the relation for the Circuit-IR. The relation is likely the most noticable aspect of the IR, and as such gets a lot of attention from WizToolKit. The Circuit-IR uses numbered wires to connect gates together to form a Directed Acyclical Graph (DAG) with operations at each node.

Translation

The translation resource is an alternative relation format for the Translation-IR. It is currently in development, and largely unimplemented.

Configuration

The configuration, or "CCC" (Circuit Configuration Communication), conveys information backwards from the backend to the frontend. This allows the frontend to emit a circuit which is compatible with a particular backend, and hopefully also maximizes performance. It also is currently in development, and largely unimplemented.

WizToolKit

WizToolKit is a collection of many tools and libraries.

If you want to jump right into developing a backend, start with the installation guide and one of our sample backends. Otherwise, a good starting place would be with either parsing or the NAILS interpreter. Next, you may wish to look at WizToolKit’s IR Plugin offerings. For development and testing, WizToolKit provides the wtk-firealarm Non-ZK IR interpreter and a bunch of test case generation scripts.