Cointime

Download App
iOS & Android

Scaling The Ethereum Using Rollups-Layer 2

Validated Project

Over the past few years, we have witnessed an exponential increase in demand for Ethereum transactions, which has led to skyrocketing gas prices (increased transaction fees). Rollups offer a solution to perform transactions secured by blockchain at a lower cost. The basic idea strongly resembles the concept of shadow chains proposed by Vitalik Buterin in 2014.

What is a Rollup?

Rollup is an L2 scaling solution that extends the concept of sidechains. They help reduce the load of Ethereum by performing transaction executions on L2 (off-chain). Unlike the sidechain example which we discussed, rollups save certain data corresponding to each transaction on Ethereum. Rollups group transactions into batches, execute them off-chain and store some data related to each transaction on the main chain. Let’s find out more about rollups.

Rollup Vs Sidechain

Sidechains are secondary blockchains which occasionally communicate with the main chain (L1). Sidechains have independent consensus mechanisms and protocols; thus, Ethereum cannot guarantee the security of a sidechain. Whereas a rollup relies on the security of the L1 blockchain. It will function properly as long as the Ethereum is live. All transactions are

stored on the blockchain and executed off-chain by a central entity. Rollups group transactions into batches and compress them. It increases the throughput by reducing the size of each transaction and by removing the need for execution on L1. The verification part is done on the blockchain.

How do rollups work?

Let us see an example.

In the Ethereum network, transactions from an account can only occur sequentially. Alice wishes to transfer some tokens to Bob, Carol and David. She has to first transact with Bob, wait for it to be confirmed, next transact with Carol and so on. When she finishes the transactions, it will take approximately 36 seconds (assuming an optimal situation) or longer.

Rollups offer a solution to reduce the overall time and price to carry out these transactions by exempting Ethereum from doing the execution.

To understand this concept, let’s review what happens when a user submits a transaction.

Ethereum maintains the state of the blockchain, which refers to the current balance held by each account (contract & user accounts), and current values assigned to the state variables in the contract. This data is represented using Merkle Patricia Tries, which are stored in Key-Value databases like LevelDB or CouchDB. A transaction is a request for state transition. When the transaction: Alice transfers 10 ETH to Bob is processed, Ethereum will check if Alice has enough amount to pay Bob, debits her account balance and credits Bob’s account. This will alter the data stored in the trie, which will generate a new root value.

Assume we have a rollup. Rollup will maintain a state that records the addresses and account states being handled by them. The state of a rollup is stored on the L1 chain by a rollup smart contract.

>> Alice will submit all three transactions to the rollup. Each transaction will require a state change.

>> The rollup will process the transactions into a batch (block). This will generate the new state root.

>> The compressed set of transaction batch, previous state root and current state root will be sent to the smart contract.

>> The rollup contract on the L1 checks if the previous state root in the batch matches its current state root. It will update the state root to the new value if it is a match.

How can Ethereum secure Rollups without executing the transactions in L1?

This is the factor which makes rollups different from a sidechain. Ethereum guarantees the genuineness of the state updates. This approval is represented in the form of proof. Rollups prove their correctness to Ethereum using particular proofs that allow Ethereum to verify the transaction processing without actually executing the transactions.

What is the role of the proof?

Rollups are categorized based on the nature of the proof.

Optimistic rollups such as Arbitrum and Optimism are based on fraud proofs. They follow an optimistic perspective and assume that transactions are valid unless someone challenges them. They post the updated state to Ethereum without posting any proof. Anyone can post a batch of transactions. To challenge it, one should execute the same transactions and submit a proof of incorrect computation called fraud-proof on the rollup smart contract. The contract will verify this. If incorrect computation is detected, that batch of transactions and subsequent batches will be reverted. The contract maintains a history of previous state root upgrades and the corresponding batch hashes. An incentive mechanism rewards the participating entities so that they are tempted to produce correct claims and challenge incorrect claims.

Zk Rollups(Zero-knowledge) submits a validity proof along with every batch of transactions. The validity proof is a cryptographic proof which proves the new root has been computed correctly from the submitted batch of transactions. This proof is checked by the contract. Zk-proof represents the mathematical certainty that whatever is posted on L1 is valid and occurred on the rollup. If the proof evaluates to true, the transaction can be considered final. StarkWare and Zksync are working on ZK-rollups in Ethereum.

Optimistic rollups are less expensive and suitable for general-purpose computations. Generally optimistic rollups are EVM-compatible. However, they have limited throughput. Though the proof computation is technically challenging and costly, zk rollups offer better data compression and faster finality. This makes zk rollups fit for financial applications. EVM compatibility of zk-rollups is an active research area.

The proofs ensure that even if the validators/operators of the rollup act wrongly, they cannot steal any funds since the ultimate security guarantees are derived from Ethereum.

How does rollup compress data?

Many fields typical to an Ethereum transaction can be omitted or represented in a storage-efficient way in rollup transactions. For example, every Ethereum transaction has a nonce value, which is incremented for every subsequent transaction of the sender. But a rollup transaction does not require a nonce value since it can be computed from the previous state. Another example is the recipient’s address. In rollups, the address is replaced by an index value much smaller.

Rollups try to replace data with computation wherever possible. They can reduce the overall size of a transaction to almost one-tenth of its Ethereum equivalent.

How can rollups reduce cost?

Batching multiple transactions together reduces overall transaction fees by

spreading fixed costs over all transactions within a given batch. The L2 operators also apply some compression techniques to minimize the data posted to Ethereum.

Rollups convey their state roots back to Ethereum using calldata for storage. Calldata is currently the cheapest form of storage on Ethereum.

Summing up

Rollups execute transactions “off-chain” from the main network (L1), batch (“rollup”) these transactions into a single block, and then send that block to the L1 as a single transaction. In short, thousands of transactions can be processed off-chain and represented by submitting a single transaction to the main network. In this way, rollups can significantly increase the scalability and throughput of the underlying L1 blockchain.

References

[1] Cosimo Sguanci, Roberto Spatafora, Andrea Mario Vergani, “Layer 2 Blockchain Scaling: a Survey”.

[2]Gangwal, Ankit & Gangavalli, Haripriya & Thirupathi, Apoorva. (2022). A Survey of Layer-Two Blockchain Protocols.

[3]https://ethereum.org/en/layer-2/

[4] https://vitalik.ca/general/2021/01/05/rollup.html

[5] https://www.preethikasireddy.com/post/a-normies-guide-to-rollups

[6] https://medium.com/blockchain-biz/a-comprehensive-guide-for-those-with-zero-knowledge-on-rollups-79a592fb96a4

(By Sumi Maria Abraham, Research and Development Engineer, Kerala Blockchain Academy)

Comments

All Comments

Recommended for you

  • Xinjiang launches special campaign to combat illegal fundraising, with key areas including virtual currency, blockchain, etc.

    According to Chang'an Xinjiang Public Account, Xinjiang Autonomous Region and Corps have launched a joint special action to crack down on illegal fund-raising, with key areas including third-party wealth management, fake private equity, fake gold exchange and other traditional fields, as well as emerging fields such as virtual currency, blockchain, cultural tourism, film and television investment, and debt resolution services. It is reported that key cases include cases involving more than 100 million yuan and cases that have been criminally filed for more than five years.

  • A British court has postponed the final sentencing of Wen Jian, a British-Chinese national involved in the country's largest Bitcoin money laundering case, until May 24.

    On May 11th, it was reported that Jian Wen, a 42-year-old British Chinese citizen, was found guilty of "participating in arranging money laundering" in the UK's largest Bitcoin money laundering case. He could be sentenced to up to 14 years in prison. Jian Wen's defense lawyer, Mark Harries, stated that due to the judge's busy schedule, the UK court has postponed Jian Wen's final sentencing, which was originally scheduled for May 10th, to May 24th.

  • Web3 startup Star Nest completes $6 million in Pre-A round of financing

    Hong Kong Web3 music startup Star Nest announced that it has completed a $6 million Pre-A round of financing, led by Chuangqi International Limited, a wholly-owned subsidiary of Hong Kong Stock Exchange-listed company Guofu Innovation. Star Nest will collaborate with Armonia Meta Chain to develop the Star Nest SpaceStar metaverse game, which includes music, role-playing, and social features.In addition, Star Nest plans to launch its NEST project in the third quarter of 2024. Nest will receive 2.1 billion NEST tokens tailored for the project, and Star Nest will use the NEST token to build a more complete music industry token economic system. The NEST token will be widely used for purchasing performance tickets, chain game cooperation, metaverse consumption, governance voting, and other activities.

  • Over $594 million worth of PYTH is staked

    According to Dune data,  there are currently 1,201,167,362 PYTH tokens in the staked state, with a total staked value exceeding $594 million. The number of PYTH stakers has reached 151,211.

  • US Department of Justice: Tornado Cash indictment has nothing to do with "free speech"

    On May 11th, the US Department of Justice explained why the motion to dismiss the criminal case against Tornado Cash founder Roman Storm was invalid. The Department of Justice reiterated that their indictment was not related to whether the Tornado Cash computer code had freedom of speech or was protected by the First Amendment of the Constitution. The defendant was not charged for publishing computer code, but for using it to facilitate profitable illegal activities.

  • USDC circulation decreased by $100 million in the past week, with a total circulation of $33 billion

    According to official data,as of May 9th, Circle has issued approximately $2 billion USDC and redeemed approximately $2 billion USDC in the past 7 days, with a decrease in circulation of approximately $100 million. The total circulation of USDC is $33 billion, with a reserve of $33.1 billion, including approximately $3.3 billion in cash and Circle Reserve Fund holding approximately $29.8 billion.

  • SEC rejects Coinbase's request for appeals court ruling on cryptocurrency rules

    The US SEC has rejected Coinbase's request to appeal to the court to review whether traditional securities rules are applicable to cryptocurrencies. In its application, Coinbase stated that it hoped the appeals court would consider whether the Howey test, which has long been used for securities evaluation, should be applied to digital assets. However, the SEC pointed out that Coinbase has not successfully demonstrated the need for such an evaluation. The SEC stated that Coinbase is attempting to create a "new legal test," but this attempt was rejected by the court. The court found that Coinbase's arguments lacked consistency and did not successfully demonstrate the existence of decisive issues. Currently, the judge responsible for hearing the SEC's case against Coinbase will make a ruling on Coinbase's intermediate appeal motion.

  • Colombian President Suspected of Accepting $500,000 in Illegal Crypto Donations

    Colombian President Gustavo Petro is suspected of accepting over $500,000 in digital token donations from a fraudulent cryptocurrency project during his 2022 election campaign. A former contractor revealed that the illegal donation occurred during a meeting in February 2022 that discussed the advantages of cryptocurrency and the possibility of working with the government. This allegation is one of the latest charges faced by President Petro during his election campaign, with the Colombian Prosecutor's Office investigating his campaign last year.

  • Fed's Kashkari: The bar for another rate hike is high, but it cannot be ruled out

    The Federal Reserve's Kashkari expressed a cautious attitude towards restrictive monetary policy; he is adopting a wait-and-see attitude towards future monetary policy; he is in a wait-and-see state to see if inflation is stagnating; the threshold for raising interest rates again is high, but this possibility cannot be ruled out; if inflation data supports it, the Fed will maintain interest rates.

  • The 133rd Ethereum ACDC meeting: The goal is to complete the devnet within 7-10 days

    The Ethereum developers held their 133rd ACDC conference call. First, they outlined the latest research on Ethereum protocol confirmation rules. Then, they discussed Pectra updates related to EIP-7547 and CFI states, and decided to put them on hold temporarily. They also updated the v1.5.0-alpha.1 specification. Regarding the implementation updates for devnet-0, most teams are making progress, but there are also some unexpected complexities. The goal is to complete devnet within 7-10 days.