Template Proofs
Last updated
Last updated
Motivation
On L2, a block is produced every two seconds. The proof system processes block batches and generates a validity proof, which is then verified on L1 to ensure the off-chain work is done correctly. During this process, the circuits are separated to run in parallel, significantly speeding up the proof generation. On top of proof system optimization, having this concurrent design allows for horizontal scaling in the future. However, proof generation remains resource and time-intensive, having multiple independent machines for each proving service comes with a non-trivial cost.
Due to this cost, Zircuit does not provide a proof for every batch. Zircuit uses a so-called template proof for many blocks in order to keep L1 up-to-date with these L2 outputs. The addition of these template proofs ensures a seamless operation by preventing gaps caused by the proof generation process. In the future, these template proofs will be retired, and every block will be associated with a complete validity proof. The use of these template proofs enables Zircuit to scale up proving capacity on-demand over time.
Template proofs fill the gap between consecutive blocks which have a validity proof.
This process is illustrated in the following figure.
Consecutive green blocks indicates a batch that will have a template proof.
Consecutive teal blocks indicates a batch that will have a validity proof.
When the block provers are available (i.e., not proving something else), consecutive blocks are batched and processed through the proof system. Then, two things happen:
A template proof is generated for all blocks between the enqueued validity proof batch and the previously generated validity proof batch. This template proof is always the same and is recognized by the verifier on L1.
The validity proof and the template proof are published to the L1 Zircuit contracts. The verifier automatically validates the template proof. The validity proof is verified by the L1 Zircuit contracts.