Angle Explains: Heading to the rollups world

tuta
Angle Protocol
Published in
5 min readJul 29, 2022

As the Angle Borrowing module has recently been deployed on Optimism and Arbitrum, I thought it would be interesting to do a quick recap on what rollups are, how they differ from other L1s or sidechains, and how the main rollup models work today.

Before we start, let’s agree on the words.

A layer 2 is any network that allows to transact on top of another main network (layer 1). Layer 2 networks rely on their layer 1 consensus and security mechanisms. Ethereum rollups are a sub-category of layer 2s based on the main Ethereum chain. For example, Bitcoin’s Lightning Network is a layer 2 that is not a rollup.

If you want to understand how rollups work or just need a quick refresher, this is it !

Roll up your sleeves and batch the transactions

The basic aspect of rollups is that transactions are executed on a separate off-chain network (the rollup), and then rolled up together in batches to be verified and published on the parent chain together.

In that way, rollup transactions inherit the consensus and security of their layer 1, for example Ethereum. This is what differentiates them from sidechains and alternative layer 1s. Rollup transactions are regularly published and verified on Ethereum, whereas sidechains have their own consensus and security mechanisms.

By focusing on transaction computation and letting consensus in the hands of layer 1, rollups make them much cheaper and faster for users, with very few security trade-offs once transactions have been published and verified on the main chain.

If you want a more detailed overview of rollups and how they work, you can read this great article by Vitalik.

Different rollups: optimistic vs “cartesian”

The two main types of Ethereum rollups are optimistic and zero-knowledge rollups. They have some similarities, but we will focus on what makes them different: how transactions are published and verified on the main chain.

They kind of represent two ways of thinking: the believers, who trust first, and verify later, and the Cartesians, who will require an undeniable burden of proof (zk rollups).

Let’s start by exploring the believers and their optimistic rollups.

The believers: optimistic rollups

As indicated by the subtle hint in their name, optimistic rollups are optimistic: the rollup contract on Ethereum expects users transactions that are submitted from L2 to be valid.

Optimistic L2 txs are submitted by sequencers. They “rollup” transactions data and the updated rollup state, and publish them on mainnet. The contracts on Ethereum “optimistically” accept them as valid without formal verification.

Once this data is published, verifier nodes running their own versions of the L2 network can check their state root and transactions data against what has been published by the sequencer. If they detect any inconsistency, they can initiate a fraud proof on mainnet, which will replay the L2 transaction and end up slashing the sequencer’s deposit if the roots don’t match. Anyone is able to check this and initiate a fraud proof on L1.

The two main optimistic rollups on Ethereum today are Optimism and Arbitrum. Though their main architectures work similarly, they seem to be making different trade-offs in terms of growth, community, and governance.

The takeaway on Optimistic rollups is that their security mostly rely on economic slashing for dishonest txs data publishers, and the ability for anyone to dispute the state.

Now, off to the zero-knowledge rollups!

The Cartesians: zero-knowledge rollups

Zero-knowledge rollups submit a validity proof of the change in state of the L2 history, rather than the new state itself. This requires more complex off-chain computation to generate the proof, but verifying it on-chain is pretty straightforward.

These validity proofs are the complex cryptography called zero-knowledge. They ensure computational integrity of transactions, meaning that everything that is verified and published by the mainnet contract is known to be valid. There is no need for other participants to verify and potentially dispute this.

There are different types of zero-knowledge proofs: zk-SNARK and zk-STARK. They have different trade-offs in terms of size versus trust assumptions, which you can read more about here.

As zk proofs are enough to ensure the validity of the rollup transactions, they don’t necessarily need to post transaction data on-chain, which is expensive. This is the data availability trade-off: post tx data on-chain for more security but at a higher cost for users, or use another layer 2 infrastructure for tx data and get ultra-low fees, with potentially less security.

The two main zero-knowledge rollups are zkSync and Starknet. ZkSync tries to reproduce an environment as similar to the EVM as possible to allow for an easy portability of mainnet smart contracts and use cases to the rollup. Starknet takes another direction, focusing on making the proof generation as easy as possible, as shown by the development of Cairo, a programming language dedicated to generating zero-knowledge (zK) proofs. Polygon recently announced the release of zkEVM, their upcoming zero-knowledge rollup on top of Ethereum.

The takeaway on ZK rollups is that their security relies on validity proofs that ensure the computational integrity (validity) of transactions. Depending on their solution for data availability, their costs for end users can vary.

Rolling up the rollups

To summarize, rollups offload transaction computation from Ethereum, and group their data before publishing it on mainnet.

This brings a lot of benefits for users and underlying layer 1: they decrease the transaction burden on thelayer 1, reduce transaction costs and throughput for users of the rollup, while still inheriting the consensus and security of Ethereum.

Though their adoption is only beginning, they will be a game changer in terms of scalability for Ethereum.

Coupled with stablecoin protocols like Angle, they could start powering day-to-day global payment systems thanks to much smoother user experiences.

In Summary

For the high-level differences between Optimistic and zero-knowledge rollups, I have built this table for you:

Comparison between Optimistic and Zero-knowledge rollups

--

--