Wednesday, July 3, 2024

What’s The Difference Between Optimistic Rollups And ZK Rollups? Layer 2 Solutions For Ethereum Scaling?

Ethereum is growing at a rapid pace. Today, its market cap is over $200 billion. Ethereum blockchain is the fastest, most efficient and most secure way to build decentralised applications.

The network’s popularity, combined with the fact that it boasts the largest number of dApps on a single blockchain platform, has led to network congestion. This has resulted in high fees, slow transactions, and scalability has become a big issue. Despite its success, Ethereum has struggled to scale as quickly as other blockchains like Bitcoin.

What are the challenges with Ethereum scalability?

The current challenge with Ethereum scaling is that it takes too long to process transactions on the blockchain. Scalability is an important aspect of blockchain technology because it determines how many transactions can be processed per second (TPS). If a blockchain does not have high TPS, then it cannot support large-scale applications like those that would require millions of users to use the same system simultaneously. When thinking about the future and widespread adoption, this is something that needs to be tackled. We have seen some solutions for this, but they all suffer from low throughput and high gas costs.

The Ethereum blockchain has been in the news a lot lately, due to a scaling problem caused by so many people using it. The core idea behind the Ethereum network is to use decentralised consensus algorithms (of which there are many) to verify transactions and create new blocks of data on top of a blockchain (a chain), but this method has its limitations and causes transaction delays when too many people want their transactions processed at once. The main solution for this issue is called Layer 2 scaling solutions. These are methods that allow for faster processing times and lower fees than base Layer 1 solutions (which include regular mining). Layer 2 approaches move some transactions off-chain onto an intermediary layer between users and miners; they will occur quickly so they can be verified later by miners or other nodes on the network without slowing down processing times significantly.

The most popular solution is off-chain payments, which involves moving transactions outside of the blockchain so that they can be processed faster. This is done by utilising non-custodial payment channels or sidechains. Another method is sharding — breaking up transaction processing into smaller pieces so they can be completed in parallel. This allows transactions to be completed faster without increasing gas costs or fees. Although these solutions do work, they come with their own set of problems: off-chain payments are centralised and rely on intermediary parties for processing; sharding requires massive amounts of computing power to execute properly, and both methods require complex upgrades to existing infrastructure that take time and money to implement successfully (and even then there’s no guarantee they will work).

What’s the difference between Optimistic Rollups and ZK Rollups?

Rollups are regular smart contracts on Ethereum that serve as the relay between the mainchain and Layer 2, where computations occur. Rollups have become a popular Layer-2 scaling solution for blockchain networks. These protocols store transaction data on the mainchain but move transaction activity to a sidechain. However, because the mainchain and sidechain are interoperable, they run in parallel and continue to communicate. As a result, blockchain networks become more scalable as computationally intensive processes move off the mainchain, which reduces congestion. Layer 2 solutions like ZK Rollups and Optimistic Rollups are growing in popularity among Ethereum developers for improving scalability. ZK Rollups involve a rolling hash algorithm that allows a single node to compute a large amount of data in parallel. Optimistic Rollup is an optimistic replication protocol that allows nodes to process multiple transactions in parallel. Together, these two technologies can be used to significantly improve the efficiency of Ethereum applications.

What are ZK Rollups?

ZK Rollups are a novel approach toward making Ethereum transactions more scalable by allowing nodes in its network to store only parts of blocks instead of all transactions ever executed through it.

ZK Rollups rely on zero-knowledge proof (ZKP) for all state transitions to function correctly and are a useful technology for Ethereum smart contract developers. A zero-knowledge proof is a protocol that allows for one party to prove to another party that a given statement is true, without conveying any information apart from the fact that the statement is indeed true. Afterwards, each transaction is compared to the smart contract on the mainchain. If there are no discrepancies between these two data sources, then the transaction will be accepted and the rollup can be completed successfully. This allows you to prove that these two transactions were sent by the same person without revealing any information about either one of them.

The way this works is by creating Merkle roots out at different points along the timeline where each block was created—and then sending them off over time until every single transaction contained within those blocks has been accounted for. However, there are some downsides with this method such as increased latency on block propagation times since packets have less information inside them than their predecessors did before being transmitted across different networks (which means less efficiency). Data privacy is a key concern for many organisations. Zero-knowledge proofs (ZKPs) are a promising technology to provide data privacy in blockchains and other distributed systems. However, ZKPs have been criticised for their high computational cost, which makes them unsuitable for large-scale applications. The main advantage of ZK Rollups is that they allow for significantly faster transaction confirmation times, as well as greater scalability and throughput.

What are Optimistic Rollups?

Like ZK Rollups, optimistic rollups are a Layer 2 solution that runs parallel to the Ethereum mainchain. However, it only publishes the bare minimum of information to the mainchain.‍ Optimistic rollups improve throughput and latency on Ethereum’s base layer by moving computation and data storage off-chain and by processing transactions outside of Ethereum Mainnet, reducing congestion on the base layer and improving scalability. Optimistic Rollups allow for the efficient transfer of data between applications. The algorithm behind them requires that each node has access to all data before they can process it optimally, which means you’re going to need a lot more computing power than ZK Rollups does.

ZK Rollups are thought to be more efficient than Optimistic Rollups in transaction rate. Although zero-knowledge proofs take more computer resources than other options, they can be used to speed up the process of verifying a transaction. The speed of zero-knowledge rollups makes them more attractive than optimistic rollups from a processing perspective. There is no waiting period for these transactions, meaning that zero-knowledge rollups are posted to the underlying blockchain faster than optimistic ones.

What are examples of projects helping to scale Ethereum?

The Ethereum network is a good example of how blockchain technology can be used for a wide range of purposes. Scalability is one of the most important issues facing Ethereum but many projects are aiming to help solve this issue in order to drive wide-scale adoption of the blockchain.

Scroll

Scroll is a zero-knowledge, Ethereum Virtual Machine-based Layer 2 Rollup. It aims to provide unlimited scalability, lightning-fast confirmation latency, full decentralisation, and trustless privacy. It does so by building upon ZK Rollup and high-performance off-chain distributed systems. The team is also working on creating a proof market via a decentralised network in which zero-knowledge proofs can be generated for those who want to outsource their proving mechanism.

zkSync

zkSync is a Layer 2 scaling solution that offers cheaper and faster transactions than the main Ethereum blockchain (Layer 1). Layer 2 solutions move most activity away from Layer 1, while still inheriting its security and finality. zkSync significantly reduces gas costs without sacrificing security or user control. zkSync gives you: low gas, high speeds, security, frictionless transfers, and censorship resistance.

Polygon

Polygon is a secondary Ethereum scaling solution. It is a layer-2 solution is a blockchain that runs in parallel to a mainnet but processes transactions outside of it, leading to higher transaction throughput and cheaper gas prices. Polygon is a cryptocurrency formerly known as MATIC and a technology platform that connects and scales blockchain networks. It was introduced in 2019 to overcome Ethereum blockchain restrictions, including transaction speed, throughput, and gas prices. While maintaining the security, interoperability, and structural benefits of the Ethereum blockchain, the Polygon platform can boost a blockchain project’s flexibility, scalability, and independence.

StarkNet

StarkNet is a permissionless decentralised ZK Rollup. It operates as an L2 network over Ethereum, enabling any dApp to achieve unlimited scale for its computation – without compromising Ethereum’s composability and security, thanks to StarkNet’s reliance on the safest and most scalable cryptographic proof system – STARK.

dYdX

dYdX is an Ethereum-based decentralised trading platform that leverages spot, margin, and perpetual trading. To pursue its ambitions of scaling decentralised trading, dYdX collaborated with StarkWare, an Ethereum scaling solution, to provide a Layer 2 protocol of cross-margined perpetual contracts to users. The collaboration with StarkWare not only enhances the efficiency of its transaction but also reduces trading fees and minimum trading sizes, making gas fees become 0 finally.

Immutable X

Immutable X is a Layer 2 scaling solution that’s used for NFT projects on Ethereum. The primary features available with the Immutable X platform include scalability, near-zero gas fees and the ability to launch projects quickly. Immutable X is designed to solve many of the issues that the Ethereum blockchain has with scalability and gas fees. As a Layer 2 technology, this supplemental protocol is essentially positioned on top of the Ethereum blockchain to enhance throughput without needing to reduce security or decentralisation. The Immutable X token, IMX, is an ERC-20 token. Its purpose is to improve the verification process for NFTs, which benefits developers and creators alike.

Aztec

Aztec is a Layer 2 solution that uses zero-knowledge proofs and confidential transactions to enable confidential transactions for any generic digital asset on Ethereum, including existing assets. The Aztec Network essentially allows users to privately access their favourite layer 1 apps in a faster, cheaper way. Layer 1 refers to blockchains that run independently of other blockchains – as contrasted with layer 2 solutions that aim to speed up transactions on existing blockchains like Ethereum.

Arbitrum

Arbitrum is a Layer 2 solution for Ethereum (ETH) — the largest blockchain for decentralised applications (dApps) in the world. It was launched in August 2021 by Offchain Lab and aims to provide lower gas fees and faster TPS. As it was primarily designed for Ethereum, this Layer 2 solution was launched for Arbitrum smart contracts, in that it was built to help streamline the automation of smart contracts on its own platform while still relying on the Ethereum blockchain’s robust security. Arbitrum rolls up multiple smart contracts or transactions into one and then submits them to Ethereum in the same way as any Layer 2 solution. However, its specific combined offering of security, scalability, low cost and compatibility with Ethereum is why it has had such widespread adoption.

Boba Network

Boba is a Layer 2 ETH scaling and augmenting solution built by the Enya team as core contributors to the well-known OMG Foundation. Boba is a next-gen Ethereum Layer 2 Optimistic Rollup scaling solution that reduces gas fees, improves transaction throughput, and extends the capabilities of smart contracts. Boba offers fast exits backed by community-driven liquidity pools, shrinking the Optimistic Rollup exit period from seven days to only a few minutes, while giving LPs incentivised yield farming opportunities. Boba’s extensible smart contracts will enable developers across the Ethereum ecosystem to build dApps that invoke code executed on web-scale infrastructure such as AWS Lambda, making it possible to use algorithms that are either too expensive or impossible to execute on-chain.

Final thoughts

Layer 2 rollups are one of the many solutions that are being developed to overcome Ethereum’s scalability challenges. There are currently quite a few decentralised projects making use of Optimistic Rollups while others use ZK Rollups instead; as a result, it’s difficult to communicate between them both. If we look at what Vitalik Buterin thinks about this, he has suggested that ZK Rollups will beat Optimistic Rollups in Ethereum’s Layer 2 scaling showdown – stating that while Optimistic Rollups are more mature, the fundamentals of ZK Rollup technology will allow it to supersede Optimistic Rollups in the long run. ZK Rollups are indeed faster when moving funds to and from the mainnet and this is what may lead to wider adoption of them in the longer term.

Despite the increased speeds, one thing that ZK Rollups lack is an Ethereum Virtual Machine (EVM), making them hard to run decentralised applications like DeFi protocols. The EVM is the main processing unit on the Ethereum blockchain for decentralised applications. ZK Rollups are difficult to build applications on, and they make it hard to optimise Ethereum Virtual Machine compatibility. Optimistic Rollups, on the other hand, allow developers to migrate their applications from Layer 1 to Layer 2 almost seamlessly. Despite many people suggesting ZK Rollups as the one that will come out on top, there is still discussion around Optimistic Rollups reigning supreme. As it currently stands, they are much cheaper, enjoy full compatibility with EVM and existing tooling, and one of the only challenges is that Layer 1 bridging is slower in the absence of fast bridging services. We think that both rollups will most likely coexist in the future.


This space moves at the speed of lightning! Stay updated on the latest in the space by subscribing to the Web3 Wrap-Up newsletter for a weekly summary on what’s happening in Crypto & Web3. ✨

Explore additional topics

Explore Other Topics