An article to understand what is Optimistic Rollup — HKToken Course 18
Optimistic Rollup is a layer 2 technology which scales Ethereum smart contracts and DApps up to 100–2000 transactions per second (TPS). Its major advantage over other solutions is the fact it enables turing-complete smart contracts on layer 2 using Optimistic Virtual Machine (OVM), reducing the cost of user transactions.
There are two types of rollup: Optimistic and ZK Rollup. Rollup works similar to Plasma in the sense both scale Ethereum by moving transactions off-chain onto a layer 2 sidechain which is secured by the mainnet, AKA layer 1. Both solutions deploy smart contracts to the mainnet which hold all the funds deposited into the sidechain and proof of the current state of the sidechain. Sidechain users and operators maintain the sidechain and ensure valid state transitions are committed to the mainnet contract. The method of submitting state transitions (or new sidechain blocks) differs between Rollup and Plasma.
How does Optimistic Rollup work?
Bonded aggregators bundle user-submitted transactions into rollup blocks on the sidechain. Users pay aggregators fees to submit their transactions and the new sidechain state root (AKA the optimistic rollup block) to the mainnet.
Anyone can become an aggregator and begin to process rollup blocks by putting down a bond in the mainnet contract. Additionally, anyone can download the rollup blocks and earn a reward for proving a state transition is invalid. When a user successfully invalidates a block, they slash the aggregator’s bond and the bond of any aggregator who built on top of the invalid block. The challenger earns a portion of the slashed bonds.
What’s the difference between: Optimistic Rollup and ZK Rollup?
ZK Rollups submit ZK-SNARK proofs to the mainnet Rollup contract. And then, the mainnet smart contract verifies and accepts any valid proofs. This process happens almost instantly and scales immensely. Whereas, Optimistic Rollups sacrifice some scalability in order to accommodate smart contracts on layer 2. Also, there needs to be a slight delay to grant users time to challenge invalid blocks from bonded aggregators.