Blockchain Skyscrapers (2)

Nouhaila Fellahi
The Innostation Publication
6 min readJul 24, 2022

Not sure if you were alive back in the 1800s, but when I was (the good old days), the main problem in New York was how to host more people since citizens were flooding the city. Prices of everyday utilities started rising and roads started congesting and causing trouble for everyone.

The solution that they found was to “build-up”, and that was how skyscrapers came to be.

Let’s say you and your friend live in different skyscrapers. You still live in the same city, of course. You use the same subways and public transportation networks, frequent the same stores and obey the same rules and laws.

A skyscraper gives many different levels to a city, but there’s no way for you to live your entire life above the city without having at least a few interactions and connections in the ‘main level’ of the city.

This is how roll-ups can be described. Roll-ups can provide you with cheaper gas fees, larger bandwidth, and near nonexistent waiting times for transaction mining. If these features were included in a layer 1, it would have to sacrifice either decentralization or security because of something called the blockchain trilemma.

Think of the blockchain trilemma like the famous ‘life trilemma’ that everyone talks about, “you can only choose two”.

Oh Life trilemma 😩

This is a choice that roll-up developers have to make — security & scalability, decentralization and scalability, or decentralization and security.

Roll-ups can defy this rule. As they are inherent to blockchains, they can profit from their security and decentralization while keeping the chain scalable enough to be useful to day-to-day users.

What are roll-ups?

When an account wants to move and perform some sort of transaction or activity on a roll-up, it sends the amount of funds it wants to hold on the ‘side-chain’ to a smart contract that ‘locks’ the funds in and ‘creates’, or mints them to that user’s account on the roll-up.

Remember, cryptocurrencies are just bits of 0’s and 1’s, meaning that funds can be “cloned” wherever needed without losing any value. There’s no physical or tangible value that we’re dealing with.

The biggest problem that roll-ups are trying to solve is to have transactions take up less computing power and less storage. This consequently means larger bandwidth, shorter pending times for transactions, and cheaper gas fees.

Roll-ups help get rid of this problem by batch-processing thousands of requests off-chain. Once a certain batch of transactions (the size of the batch depends on the roll-up and its protocol), a ‘proof-of-transaction’ is submitted to the main chain as a single transaction. This proof comes in the form of a root hash or a zk-SNARK/zk-STARK. These proofs allow for the main chain to process all the transactions that happened on the layer of the roll-up, or off-chain, with the same amount of computation it would take to verify a single transaction.

Rollups, on the other hand, are a “hybrid” layer 2 scheme. Rollups move computation (and state storage) off-chain, but keep some data per transaction on-chain.There are two types of roll-ups, Optimistic roll-ups and ZK (zero-knowledge) roll-ups. And in this second part of the series, I’ll be telling you all you need to know about ZK-Rollups. — Vitalik Buterin.

What are Zero-Knowledge-Rollups (ZK)

zk-Rollups are, as the beginning of this article might have spoiled, roll-ups. They are smart contracts that drive the processing/verification of blocks off-chain. The smart contract of a certain zk-rollup maintains the state root. This is a Merkle-root of the state of everything on the roll-up. It updates by receiving ‘batches’ from nodes. For the sake of not getting lost in the next few paragraphs, keep in mind that any node on the network can submit a “batch”.

A batch, in this context, refers to the submission of a new state for the chain that a node sends to the smart contract in order to update the state of the roll-up. It contains the previous state of the blockchain compressed and computed with a group of transactions in order to form a new state root. The careful reader must be wondering by now: “how secure can a chain if anyone can submit a new state root?”

How do you feel about adding a new word to your dictionary today? In the case of a zk-rollup, batches are submitted along with a zk-SNARK. (Oh what a fun word that is… ) A zk-SNARK stands for zero-knowledge Succinct Non-interactive Argument of Knowledge. They are brief cryptographic proofs used to prove the validity of the batch corresponding to it. Only these mini-proofs need to be run on the main chain to validate a batch, not all the transactions included.

Environmentally friendly(ier)

zk-Rollups use up way less computational energy. And since less electricity usage = less pollution, it consequently also means zk-Rollups are environmentally friendlier.

This is one of the biggest pros of zk-Rollups for the people who have often been pushed away from blockchain because of its environmental impact. The reputation that blockchain is not environmentally friendly has started and been spread because of a consensus mechanism called Proof-Of-Work. It’s the mechanism that the first few blockchains used, including Bitcoin and Ethereum (until a few years ago). It became extremely popular and built an unbreakable reputation for the blockchain industry, leaving it with a bad image and reluctant users.

Privacy

Why, of course, transparency is definitely one of the main benefits of blockchain, but transparency has its limits. Honest nodes have honest reasons to keep their sensitive information private, and this is where zk-Rollups and zk-SNARKS come in.

I know, almost for a fact, that your childhood math teacher told you at least a couple of times to “show your work”, and to “prove that your conclusion is correct by showing your steps”. But that’s often not how it works in the real world. Individuals and organizations have sensitive data and intelligence that they need to keep private — from financial records, passwords, IDs and so much more.

“The zk-SNARK provides a way for a party to prove the accuracy or existence of one piece of data without actually revealing it.” Forbes

ZCash is already on the case🕵️‍♀️. Its Zerocash protocol protects the identity of the payer, the recipient, and the amount. Instead of making all that information public, users can choose to pay others with anonymous “zerocoins.” (Zerocoin used to only hides a payment’s origin, but not its destination or amount, then it was improved upon by some of the same authors.)

Have your pockets been hurting?

ZK-rollups become cheaper the more people use them, in contrast to the Ethereum main chain, which becomes more expensive the more traffic it gets. The reason for it is that when the rollup transactions are batched together using a zk-SNARK and are sent to the main chain, they are all processed as a single transaction. The zk-SNARK has encrypted information about each transaction, but the zk-SNARK itself only needs to be processed once. So when we do our math correctly, the more people use the zk-Rollup, the cheaper the transactions get.

“layer 2 construction that increases scalability through mass transfer processing rolled into a single transaction,”

“The unique thing about zero-knowledge proofs is that they stay small even when the work that is verified with them grows significantly,” observes Lucas Vogelsang, Co-founder and CEO of Ethereum-powered DeFi platform Centrifuge.

Once you go ZK, you can’t go back…

zk-Rollups were built to be flawless improvements on all aspects of the blockchain. Although they’re far from being perfect, we’re able to see use cases for zk-Rollups all around the cryptocurrency world and blockchain industry. It will be a few years before we can conquer such a complicated technology, but the hope for a better blockchain ecosystem keeps researchers and developers looking at zk-Rollups as a solution full of potential.

(Now even if Bitcoin goes down by 20% in half a day, at least I won’t have to worry about gas prices eh?!)

--

--