The two key types of rollup: Optimistic rollups vs Zero-knowledge rollups
Both Optimistic and Zero-knowledge rollups are designed to verify transactions at lightning speed, but they do so in markedly different ways.
How do Optimistic rollups work?
An Optimistic rollup, as the name might suggest, assumes that all transactions are valid by default. It doesn’t do any calculation as standard; it simply acts as a kind of notary, recording each transaction and posting the data on layer 1.
However, all transactions can be challenged by the community during a designated time period. So if you think one of your transactions, or that of another person, looks a bit off, you can request verification.
Once the rollup receives this verification request, it runs the computation and confirms/rejects the transaction.
How to Zero-Knowledge rollups work?
Unlike Optimistic rollups, Zero-Knowledge rollups do the math on every single transaction. But they don’t do all the math.
To determine whether a ‘prover’ (the party that wants to prove the validity of their transaction) is telling the truth, the ‘verifier’ asks them a series of questions. The prover will only have the answers if they’ve done the correct calculations.
It’s important to note here that the verifier doesn’t ask for the information itself. They simply want confirmation that the prover possesses it.
This is an extremely tricky topic to get your head round (trust us, we’ve been there!) so here’s a helpful analogy.
Let’s say you’re a maze with only one way out. There’s a locked door in one of the chambers, which can only be opened with a secret code. When you complete the maze, someone challenges you to prove you know the code.
However, you don’t have to give them the code. There’s only one way through the maze, and it includes the locked door; simply by passing through the door, you’ve shown that you have the code.
Ok, that’s a really simple way of explaining it but we hope you get the picture!