Pil Stark
!!!info This document describes the three phases of the PIL-STARK proof-verification process viz. the setup phase, proving phase, and verification phase. The de
This document describes the three phases of the PIL-STARK proof-verification process viz. the setup phase, proving phase, and verification phase.
The description given here is by no means the architecture of the PIL-STARK system.
Simply put, PIL-STARK is a special STARK that enables:
- The state machine prover (SM-prover) to generate STARK proofs for any state machine written in PIL.
- The state machine verifier (SM-verifier) to verify STARK proofs generated by the prover.
Hence there is a PIL-STARK component in the SM-prover which is the generator of a STARK proof, and another PIL-STARK component in the SM-verifier which is the actual verifier of the STARK proof.
Since the SM-prover and the SM-verifier, who are separate and independent entities, require certain PIL-STARK parameters prior to proving and verification, the system needs some preprocessing phase. Call this phase, the setup phase.
The PIL-STARK proof-verification process therefore consists of three (3) phases, the setup, the proving, and the verification. These are outlined below.
PIL-STARK setup phase
The setup phase can be considered to have three 'components', the , the setup and the .
Compilation with PILCOM
As part of PIL-STARK's preprocessing phase, a novel PIL compiler, called , is used for compiling a file into a parsed file.
The compilation of the file into a parsed file is the first step in this phase of the PIL-STARK proof-verification process.
Setup executor
The takes as input the PIL file from and computes evaluations of the state machine's constant polynomials. For each state machine, described by the file compiled with , the execution process is carried out only once.
PIL-STARK setup
The PIL-STARK setup takes the PIL file from , the evaluations of the constant polynomials from the , and the STARK configuration information in the form of a file as inputs. It then creates a Merkle tree with the evaluations of all the constant polynomials, called the
It outputs PIL-STARK parameters; the which is a Merkle tree of evaluations of the constant polynomials, the which is a STARK-specific information, and the which is the root of the .
Overall, the setup phase of PIL-STARK takes the file describing the state machine and STARK-specific parameters as inputs. Its outputs are the evaluations of the constant polynomials, the , the , the , as well as the PIL file from .
We emphasise that the setup phase of PIL-STARK is run only once for a particular file describing the state machine. A change in the file means a fresh setup needs to be executed.

PIL-STARK proving phase
The proving phase consists of two main components:
- the .
- the PIL-STARK proof .
SM-prover's executor
The executor in the SM-prover's takes as inputs; the PIL file from and another file of inputs, called . In the case of our mFibonacci SM, the inputs in includes the initial values of the registries and .
The SM-prover's executor builds the values of polynomials that are to be committed. Its output is the evaluations of the committed polynomials, per proof. These evaluations of committed polynomials are actually the SM's execution trace.
Note that the input values in the file can be varied without altering the actual state machine. The reason the state machine remains intact is due to fact that the file, that was initially compiled in the setup phase, is not affected by any change in the input values of the SM-prover's executor.
However, with every set of inputs, the SM-prover's executor computes corresponding evaluations of the committed polynomials to be used in generating the respective STARK proof. In other words, each new set of inputs determines a new set of evaluations, which in turn determines the STARK proof generated by the PIL-STARK Generator.
PIL-STARK proof generator
This STARK Proof Generator takes the evaluations of the committed polynomials from the SM-prover's executor, the evaluations of the constant polynomials from the setup phase, together with the and the as inputs.
This is where the evaluations of the committed polynomials, from the SM-prover's executor, are Merkelized. And all elements of the ultimate STARK proof are generated, these include; the witness and the required openings of the committed polynomials.
The output of the STARK Proof Generator is a and the , which are values to be publicised.
For the PIL-STARK proving phase as a whole, also as depicted in Figure 9 below:
- there are five (5) inputs; the file, the PIL file from , the evaluations of the constant polynomials from the setup phase, as well as the and the .
- and there are two (2) outputs; a and the .

PIL-STARK verification phase
The verification phase is constituted by the PIL-STARK verifier.
As it is common practice amongst zero-knowledge proof-verification systems, the size of the verifier's inputs is very small compared to that of the prover's inputs. For example, while the proving phase takes the whole as one of its inputs, the verifier takes the instead.
The and the from the prover, together with the and the from the setup phase are the inputs for the verifier.
And the verifier's output is either an if the proof is accepted, or a if the proof is rejected.

PIL-STARK is, all-in-all, a specific implementation of a STARK that can be used as a generic tool for proving state machines' polynomial identities.
The actual implementation of PIL-STARK uses recursion. That is, hundreds of STARK proofs are proved with another STARK proof, and these STARK proofs of other STARK proofs are also proved with a single STARK proof. This achieves exponential scalability than it would otherwise be possible.
The code for implementing PIL-STARK is found in the zkEVM repository here.
Last updated on
Pil Stark Demo
!!!note This document is a DIY implementation guide for the PIL-STARK proof-verification system. Before delving into the implementation, we first ensure the bou
Verification Scheme
The zkEVM's basic proof system, for proving correctness of all state machine computations, is a STARK[^1]. The zkProver's fundamental configuration: - It utilis