What is rollups
Optimistic rollups
Optimistic rollups derive their name from their operational approach. In this method, a secondary actor within layer two, termed as an aggregator, conducts transactions off-chain and subsequently publishes only the transactional data and the updated state root on-chain. This process does not involve proof of validity; nodes across both layers optimistically assume the correctness of computations executed by this actor. As a result, main network nodes are not required to validate every transaction upon each new rollup submission, thereby alleviating the computational burden on layer one nodes. Although specific implementations may vary in their detailed procedures, optimistic rollup systems generally adhere to a consistent overarching structure.
ZK rollups
ZK rollups also enhance performance by transferring transaction execution from layer one to layer two. However, unlike the innocent-until-proven-guilty approach, aggregators in ZK rollups present a proof alongside the published state root and transaction data, affirming the accuracy of the transaction execution process. This proof, known as a validity proof, is generated using cryptographic tools such as Zero-Knowledge Succinct Non-interactive Arguments of Knowledge (ZK-SNARKs). The term "zero-knowledge" indicates that the verifier does not need access to the input data for the computation to be convincing, while "succinct" denotes that the proof size and verification time grow at a slower rate compared to the computation itself. Moreover, "non-interactive" means that no back-and-forth exchanges are required between the prover and verifier; a single message suffices for the prover to demonstrate a valid computation with coherent inputs and outputs. This streamlined process eliminates the need for verifiers to conduct the computations themselves, making ZK-SNARKs highly valuable in blockchain systems and peer-to-peer networks where extensive communication is impractical.