Rollups on Tezos [Part I]

The most anticipated feature in the Mumbai upgrade is the introduction of Smart Contract Optimistic Rollups (SCORUs) to the Tezos mainnet.

Originally published at Tezos Commons News

By Cryptonio.tez


1,250 words, 7 minute read

Rollups on Tezos Part I image 1

We’ve all heard about the upcoming “Mumbai” Tezos protocol upgrade which will introduce a lot of great features like the halving of block times from 30 seconds to 15 seconds, but the most anticipated feature is the introduction of Smart Contract Optimistic Rollups (SCORUs) to the Tezos mainnet.

But what exactly is a rollup and why do we need them? Once you answer what a rollup is, the next question that follows is: what is the difference between “Optimistic rollups” and “Zero-knowledge (ZK) rollups”? Which ones will Tezos use and how will they be different from the rollups that are being developed on other chains?

These questions and many more come to mind right away when you first hear about rollups, so in this 2-part article I will try to answer them in as simple terms as I can. So stay tuned for Part 2 when we dive into the world Tezos rollups!

What do we need Rollups for? #

Why are you not staking your tez anon?, image 2

Scalability is one of the main problems that most decentralized blockchains are facing. For a blockchain to get adopted by the masses, it needs to be able to support the millions of people interacting with it. To scale a blockchain (in a decentralized way), there are basically 2 main routes to take, the horizontal and the vertical scaling.

In simplistic terms, vertical scaling basically refers to optimizing your blockchain’s main layer (Layer 1) to be able to process data and as many transactions per second as possible by optimizing the software and increasing the size of the blocks so that more transactions are able to fit in each block. This type of optimizations, for example, have allowed Tezos’ layer 1 to increase its capacity of transactions per second from ~40 tx/s to ~1000 tx/s. Think of it this way, you’re trying to make larger blocks to scale.

With this way of scaling, however, after a certain point, you will reach a limit where in order to push it further, you will have to accept potentially bad tradeoffs like increasing hardware requirements for validators and the increasingly larger size of the blockchain’s data, which in turn means you are more than likely sacrificing decentralization as the cost of entry for newcomers gets higher and higher. This is why the last couple of years, we have seen most protocol developers focusing on horizontal scaling.

Rollups on Tezos Part I, image 2

With horizontal scaling, insteadof increasing the block efficiency to handle as much workload as possible on Layer 1, you are trying to distribute the workload of your main layer between more execution layers that are still connected to the main chain. In a way you are trying to increase the line of production of blocks. The best way to do that seems to be with the use of rollups. To put it in very simplistic terms, for horizontal scaling, think of it this way, instead of trying to make larger blocks to scale, you’re trying to make more blocks.

Now that we have a little background knowledge, let’s move on to the wonderful world of rollups.

What is a Rollup? #

5 Things You Can Do In Tezos DeFi Today!, image 4

On the Tezos blockchain, there are two things that can be posted on the blockchain: transactions and data. For example, when you send tez from one wallet to another, you are submitting a transaction to be included on the blockchain, but when you deploy a smart contract, you are submitting data to be included on the blockchain. To muddy the waters a bit more, when you’re interacting with a smart contract, you can be interacting with data and performing a transaction.

A Rollup is a piece of code that is part of the main chain (Layer 1), similar to smart contracts as they have their own address, and they allow you to take a batch of transactions from the main chain, process them all together off-chain inside the rollup nodes, and then post the data of the results and the new state of the rollup on the main chain (Layer 1), in Tezos, that would be mainnet.

You can think of a rollup, as a chain that exists alongside the main blockchain, but with a different set of validators and its own internal rules. Unlike a regular blockchain, however, a rollup doesn’t have its own consensus mechanism, instead rollups “borrow” the security guarantees of the Layer 1 because whether or not the new state is valid, it is ultimately still decided by the consensus mechanism of the Layer 1.

But how does the main chain check if the data is valid or not? Well, that process depends on the type of the rollup.

Optimistic vs ZK Rollups #

Rollups on Tezos Part I, image 4

The two most popular rollup types that are being developed around the blockchain industry are Optimistic and the Zero-Knowledge (ZK) rollups. Let’s take a look at how they work and what their differences are.

ZK Roll-ups, just as their name reveals, are built around the Zero knowledge proof concept which is a method in cryptography where one party can prove to another that “something” is true (valid) without having to reveal any unnecessary extra information for that “something”. For example, proving that a change to two users balances has occurred as a result of a legitimate transaction, without providing the transaction itself.

So using that method, ZK rollups are doing all the computations for the validity of their transactions off-chain and then post a validity proof and the new stateon the main chain in the form of a hash. With this proof, the main chain can immediately know if the new state is valid or not.

Lending on Tezos, image 4

On the other hand, with Optimistic Rollups, the default assumption is that the data that is posted on the main chain by the rollup nodes is valid (hence the name “Optimistic”). Other nodes can validate the state for themselves, and if they find that a fraudulent state has been posted, they can challenge the correctness of the new state, in which case, the main chain (Layer 1) does the calculations itself to see who is correct. So all you need is just one honest party, that checks the validity of the data.

Using this approach and in contrast to ZK-rollups, Optimistic rollups allow you to run not only transactions, but also smart contracts and different virtual machines (VMs) without raising the hardware requirements for the rollup nodes.

Rollups on Tezos Part I, image 6

Let’s recap: in this article (Part I), we learned why rollups are needed, what a rollup is, and what the differences are between Optimistic and ZK-rollups.

In Part II, we will look more into which type of rollups Tezos is about to introduce, what the requirements to originate a rollup or to run a rollup node will be, and the benefits of the way rollups will be implemented on Tezos compared to implementations on other chains.

Stay tuned for Part II!

For more information regarding Tezos rollups, please check out these sources: