How the transactions are processed using SNARKs

Sequencers & Aggregators form zk-SNARK circuits for validity proofs

zk-SNARK circuits is employed to verify the validity proofs by a smart contract, which is designed to check if each state transition is done correctly. The verification process involves two steps: batching of transactions and validation of the batched transactions, executed by Sequencers and Aggregators in a two-layer model.

Firstly, Sequencers roll-up transaction requests into batches and add them to the PoC smart contract. Then, Aggregators check the validity of the transaction batches proposed by the Sequencers and generate validity proofs. Then, Aggregators are responsible for checking the validity of the transaction batches and provide validity proofs. Any Aggregator with access to the transaction batch is free to submit the proof to demonstrate the correctness of the state transition computation in a permissionless manner.

Simply speaking, every transactions under PoC smart contracts are executed by two basic calls: A call to receive batches from Sequencers, and another call to request batches to be validated from Aggregators. This process is visualized in Figure 5 below.

Figure 5. How the transactions are processed using SNARKs

The implementation of zk-SNARK attest to the correctness of the zk-STARK proofs produced by STARK Proof Builder also helps in reducing the gas costs.

Last updated