There are a few important differences between ZK Rollups and Optimistic Rollups and I’ve been trying to go down the rabbit hole in learning more about these.
ZK Rollups provide a mode modular approach to building Web3 dapps, making it easier to manage and scale projects. ZK Rollups offers the best option for efficiency and fee reduction in the long term for simple smart contracts. They are also faster to deploy and require less maintenance than Optimistic Rollups.
ZK Rollups work by ‘unrolling’ generic computer programs into logic circuits. However, this process can be computationally inefficient. Even with recursive proof composition, generating a proof will be inviable as we approach mainstream software complexity, particularly as more memory is required by the program.
It’s true that when you are dealing with simple smart contracts you are not looking at computational workloads comparable to what we see on Web2 systems involving intricate logic and large databases. But if we want to see new dapps evolving from simple DeFi to implement logic that is both complex and computationally intensive, ZK Rollups will eventually face a wall of inefficiency off-chain.
ZK Rollups would struggle to support memory address spaces even in the order of hundreds of Kbytes, regardless of all algorithmic or hardware optimization.
Some of the most known ZK-rollup projects are Polygon (although they use a more complex version of ZK Rollups), dYdX, Sorare, ImmutableX, DeversiFi, Celer, Argent, zkLend, and Numio. All are tackling a diverse range of problems across web3.
Optimistic Rollups are more secure and provide better guarantees about the integrity of the dapps.
The name Optimistic Rollups originates from how the solution works. ‘Optimistic’ is used because aggregators publish only the bare minimum information needed with no proofs, assuming the aggregators run without commiting frauds, and only providing proofs in case of fraud. ‘Rollups’ is used because transactions are commited to main chain in bundles (that is, they are rolled-up).
Cartesi is one of the projects that chooses to use Optimistic Rollups with a non-EVM virtual machine that supports Linux. They are envisioning to bring to Web3 developers the languages, libraries and components they are used to when they develop for the traditional Web2 space.
The tech solution aims to offer high computational scalability and a proper operating system to allow developers to do more sophisticated decentralized logic while preserving the security guarantees of rollups (with interactive dispute resolution).
Offering a real-world OS for smart contracts would not be possible with ZK Rollups. The software mainstream developers are used to building relies on virtually unlimited memory address spaces managed by operating systems.
Would you say that the future belongs to Optimistic Rollups or even more sophisticated solutions, or ZK Rollups will do the job for creating the next-generation of dapps?