Site iconSite icon ForkLog

A Second Wind for DeFi: How Developers Scale Ethereum

A Second Wind for DeFi: How Developers Scale Ethereum

Scaling Ethereum has been one of the most discussed issues since the network’s launch.

Against the backdrop of rapid growth in the DeFi sector and NFT euphoria, gas costs remain extremely high. The Ethereum ecosystem is becoming less attractive to retail users, who are increasingly looking at Binance Smart Chain (BSC), Huobi ECO Chain and other more centralized platforms with fast transactions and small fees.

Ethereum advocates place great hopes on the second version of the platform. However, despite the successful launch Phase 0, the coveted sharding and full operation of the system are still a long way off.

Fortunately, active development and deployment of second-layer solutions are under way and are capable of significantly improving Ethereum’s scaling in the near- and medium-term.

  • There is a wide range of second-layer (L2) solutions for scaling Ethereum. Each has its advantages and disadvantages.
  • Vitalik Buterin is convinced that Rollups could increase Ethereum’s throughput by hundreds of times even before the launch of the second version of the network.
  • In the future, second-layer solutions could coexist with the sharding PoS-system of Ethereum 2.0, enabling it to process thousands of transactions per second.

The Perennial Problem

Ethereum is an ecosystem of thousands of decentralized applications (dapps), in which several million transactions occur daily. The flip side of popularity is that the higher the economic activity and demand for ETH, the stronger the competition for the network’s scarce resources, raising gas costs and, accordingly, users’ transaction costs.

In February 2021, the average fee for a simple transfer reached $40. Exchanging ERC-20 tokens on Uniswap or depositing funds into a DeFi service like Compound could cost $100 or more. Since then, the situation has changed little, despite some stagnation in the Ethereum ecosystem and Berlin hard fork, which proposed changing the gas-cost calculation algorithm.

Dynamics of the average Ethereum transaction fee over the last three months. Data: Blockchair.

Miners stand to gain significantly from this state of affairs, a substantial portion of their income coming from transaction fees.

Monthly earnings of Ethereum miners. Data: ForkLog analytical report.

Against this backdrop, alternative platforms gained popularity — Binance Smart Chain (BSC), Solana and Polkadot.

The total value locked (TVL) in the BSC ecosystem reached $35 billion.

Data: Defistation as of 15.04.2021.

This is about 60% of the current level of the Ethereum-based DeFi ecosystem, if tokenised bitcoins such as WBTC and renBTC are not counted ($12.16 billion as of 15.04.2021).

Data: DeFi Pulse as of 15.04.2021.

The rapid daily transaction growth on BSC underscores strong demand for its services, even as Ethereum stalls.

Data: BscScan.

Ethereum’s corresponding metric is lower than Binance Smart Chain’s by almost a factor of three — 1.38 million against 3.87 million transactions per day. This reflects high gas costs and the still-pressing scaling problem.

The exponential growth in TVL and transaction counts on the BSC ecosystem amid Ethereum’s stagnation signals retail users’ interest in new platforms and, at the same time, their indifference to decentralisation and censorship resistance.

Case: Binance Smart Chain: why users choose low fees over decentralisation

To withstand stiffer competition and maintain its status as the leading platform for dapps, developers must raise Ethereum’s throughput and reduce fees without compromising security and decentralisation.

Illustration of the scalability trilemma, which implies the difficulty of building a blockchain platform that is fast, decentralized and secure. Developers often must choose and optimise at most two of the three components.

To some extent, in addressing the perennial scalability trilemma, solutions are being developed that can significantly boost Transactions per second (TPS) and reduce fees without compromising decentralisation and security. The deployment of such solutions is aimed at reviving economic activity and lifting the Ethereum ecosystem from stagnation.

Two Approaches to the Problem

There are two main avenues for solving Ethereum’s scalability problem:

The base layer of Ethereum (L1) can currently handle only about 15 TPS. L2 solutions can significantly raise this figure — to 2,000-4,000 TPS.

One might ask why all these crutches on top of the old system, which will sooner or later merge with a new, far more productive PoS blockchain? In fact, second-layer solutions can coexist with sharding within Ethereum 2.0, potentially enabling thousands or even millions of transactions per second in the future.

“As soon as Phase 1 arrives and Rollups move into the Eth2 ecosystem using data sharding for storage, we will reach the theoretical maximum of around 100,000 TPS,” says Vitalik Buterin in Rollup-centric Ethereum roadmap.

Second-Layer Solutions

Second-layer scaling technologies aim to extend the capabilities of the first layer by processing a substantial portion of transactions off-chain, i.e., off L1. These solutions can increase transaction speed, system throughput, and reduce gas costs.

There are many L2 scaling options, each with its own advantages and drawbacks. Many projects, including Polygon (formerly Matic), use several of them.

Some solutions like Optimistic Rollups are designed to scale the network in the near- and medium-term. Others require refinement and are aimed at a longer-term horizon.

L2 solutions can also be grouped into:

Let us look in more detail at the various approaches to scaling.

Channels — one of the earliest widely discussed scaling solutions. They allow participants to repeatedly send transactions to one another off the main network. The base layer handles only two transactions — opening and closing a channel.

Illustration of how channels work.

This approach significantly reduces the load on the main network — channels can potentially process thousands of operations per second, delivering a high level of security for the system.

However, the technology has significant drawbacks. First, channels do not assume open participation — users must be known in advance, and funds must be locked in a multisig contract.

Creating a channel also takes time. At the same time, active monitoring of the system is required to identify potential miscreants.

Second, channels are specialized solutions, unsuitable for applications involving complex smart contracts.

State channels are distinguished — State channels — and their subtype — payment channels. The concept underpins the well-known second-layer solution Lightning Network, used to scale Bitcoin.

State channels are employed in projects such as Raiden Network, Connext, Perun and Celer. The latter mainly uses state-channel technology but also employs sidechains compatible with Ethereum, Polkadot and NEO.

Plasma. This is yet another second-layer solution, originally proposed by Joseph Poon and Vitalik Buterin.

Plasma uses smart contracts and Merkle trees to create an unlimited number of child chains — copies of the parent Ethereum network.

Parent and child chains in Plasma.

The main blockchain is relieved by the child chains, enabling fast and inexpensive transactions.

Merkle tree in the context of Plasma.

Child chains are non-custodial and trustless. In other words, users retain control of funds, and the number and composition of participants is not fixed. Plasma also features a higher level of security relative to channels.

One drawback of the solution is the lengthy withdrawal period from L2. Like with channels, Plasma is not suited to scaling applications built on complex smart contracts. The solution supports only simple functions such as transfers and exchange operations.

The OMG Network project employs its own implementation of the technology called MoreViable Plasma. An adapted version of the solution is also used in Polygon.

Sidechains. These are independent blockchains that are compatible with Ethereum, with their own consensus models and block parameters.

Plasma’s child chains are similar to sidechains, but there are notable differences. The former relies on Ethereum’s security, operating in a trustless environment. Their high throughput makes Plasma child chains optimal for payments.

Sidechains — independent blockchains operating in parallel to Ethereum, with their own tokens. They are two-way pegged to the main Ethereum network and pass information when updating the ledger’s state.

Interoperability with the second-largest cryptocurrency network is provided by EVM compatibility. Therefore, smart contracts operating on the base network can be deployed in sidechains such as xDai, enabling many use cases.

The technology is relatively mature. Depending on the implementation variant, sidechains can achieve throughput up to 10 000 TPS.

Sidechains do not operate in a trustless environment; they are not as mature in safety terms and not as decentralised as Ethereum. Sidechain tokens must retain value and be economically viable.

Rollups lower the load on the network by grouping transactions and moving some computations off Ethereum — into sidechains. Rollups also generate cryptographic proofs (SNARKs) used to commit transactions to the blockchain and reconcile states between the base chain and the second-layer chain.

There are two main types of Rollups: ZK-Rollups and Optimistic rollups.

Optimistic rollups operate on an EVM-compatible virtual machine, the Optimistic Virtual Machine (OVM). It can interact with existing Ethereum smart contracts. Consequently, broad deployment of Optimistic Rollups could spur further growth in the DeFi sector in the near- and medium-term.

The Optimism project is actively developing Optimistic Rollups, with the mainnet launch expected in July.

Earlier, the synthetic assets platform Synthetix carried out a preview launch of the L2 Optimistic Ethereum solution. Uniswap’s developers pledged to implement Optimism’s technology soon after the release of the third version of the decentralized exchange, planned for May 5.

Loopring and Deversifi are examples of decentralized exchanges using ZK-Rollups. The zkSync developers plan to launch a testnet in May of an EVM-compatible version of this second-layer solution.

Rollups can coexist with Ethereum 2.0, increasing its throughput and capacity.

Validium. Like ZK-Rollups, this solution uses validity proofs, but data is not stored on the main Ethereum network. Validium chains can operate in parallel. Such an approach can yield a throughput of up to 20,000 TPS. Withdrawals are instant.

Disadvantages include:

Validium is used by Matter Labs and StarkWare.

The above solutions can be combined, which is why many projects adopt a hybrid approach to second-layer scaling.

For example, Polygon positions itself as an L2 aggregator and plans to launch ZK-Rollups, Optimistic Rollups and other solutions in addition to its working Matic PoS Chain and its own Plasma implementation. Celer combines state channels with sidechains.

Conclusions

The consequences of the still-unresolved scaling problem have made the Ethereum ecosystem a victim of its own success — the more users and activity, the higher the cost of operations.

Second-layer scaling solutions for Ethereum are rapidly evolving, with a broad spectrum. The news agenda of recent months and activity by various projects illustrate the community’s focus on Rollups and Phase 1 of Ethereum 2.0, which envisages sharding.

Vitalik Buterin is confident that Rollups and, to a lesser extent, Plasma and channels can solve the scaling problem, at least in the near- and medium-term, before the full launch of Ethereum 2.0.

Widespread adoption of L2 requires users to adapt to new solutions, substantial changes to wallets, oracles and dapps. Cross-chain interoperability between different L2 solutions is also needed. All these challenges require stepping up work on new infrastructure, with a particular emphasis on Rollups.

The results of developers’ efforts will be deemed satisfactory if Ethereum transitions smoothly to PoS, while preserving its status as the leading dapps platform.

Follow ForkLog news on Telegram: ForkLog Feed — the full news stream, ForkLog — the most important news, infographics and opinions.

Exit mobile version