Easy to understand Ethereum Layer 2 scaling solutions: Channels vs Plasma vs Rollups

The Overpacker Journal
Coinmonks
Published in
6 min readOct 18, 2021

--

All layer 1 blockchain network has the blockchain trilemma problem: Decentralization; Security; Scalability. And scaling solutions are trying to scale up the performance of the network with little or no compromise of the other two properties.

Ethereum has undoubtedly been the leader in smart contract-based blockchain. The large demand from dApps has driven the transaction fee up to as high as 70 USD in May 2021. Now the average transaction fee might have dropped down to 20–40 USD but this number is still very expansive and inaccessible to many. While ETH 2.0 efforts are underway to scale the base layer itself through sharding and a transition to proof of stake, layer 2 solutions are still needed, both to immediately improve the congestion on the current Ethereum network, and to set the stage for mass adoption in post-ETH 2.0 era.

State Channels

If you have not heard of state channels, you would have probably already know what payment channel is. Payment channel is one form (the most used kind) of the state channels. Lightning Network of the Bitcoin network is a good example of a payment channel in the blockchain. Examples of state channels in Ethereum include Raiden, Celer Network, Connext, and statechannels.

Channels in Ethereum is best suited for a group of known parties who engage in a large volume of transactions and already have high confidence between the group directly. Channels also require a large sum of capital to be locked up the channels’ smart contract.

Channels is the earliest scaling solution. However in 2021, given it does not support general-purpose smart contract and many DeFi applications. It is expected that we will be seeing less and less of it.

Plasma

Plasma can be considered as Ethereum’s native “sidechain” that uses smart contracts and Merkle trees to create an unlimited child chain. Those child chains are almost a replicate of Ethereum but have their consensus mechanism and business logic. Plasma keeps both the transaction data and computation in the chid chain then posts the state data to the root chain (Ethereum) in regular intervals. Plasma relies on a bonded fraud proofs system for security. When a participant requests a withdrawal in the plasma blockchain, it will need to wait for a challenge period (7–14 days) which allows other people in the child chain time to submit a proof to challenge the withdrawal. If the transaction is valid, the owner will receive the fund after the challenge period. If the withdrawal is proved to be fraudulent, that batch of transactions and all the batches after will be reverted. In the event of a block withholding attack, plasma child chain participants can rapidly and cheaply do a mass-exit back to Ethereum without placing trust on the plasma childchain validator, which means plasma is still secured by the underlying Ethereum mainnet. Examples of plasmas include OMG Network, Plasma and Loom Network.

StarkWare’s Validium uses zero-knowledge proofs (rather than fraud proofs) in plasma which solved this long withdrawal time problem. Will explore this solution further in a future post.

It is worth pointing out that sidechains like Binance Smart Chain or Polygon are actually not layer 2 scaling solutions of Ethereum. They are, in fact, a separate blockchain of their own that have their own consensus mechanisms and security properties. However, given these sidechains’ code are highly similar to Ethereum’s, which makes them bridging with Ethereum very easy. And many will say these sidechains are not as decentralised as Ethereum is, hence, they are not as secured a network as Ethereum and plasma are.

One fatal weakness for Plasma in the era of DeFi. Any systems where the state of an object can be changed without the owner’s consent (eg. Uniswap) do not work well with Plasma. Even though other sidechains can bridge between plasma chain and those DeFi applications but it is not optimal with the additional complexity. So next, we have rollups.

Rollups

2 key differences distinguish plasma from rollup.

  1. While plasma keeps all the transaction data and computation off-chain, rollup keeps some of the data on the Ethereum blockchain. So all Ethereum nodes can verify the transaction on the rollup sidechain not just the participant in the sidechain. The obvious benefits are enhanced security and avoided centralization.
  2. Rollups are general-purpose, and one can even run an EVM inside a rollup, allowing existing Ethereum applications to migrate to rollups with almost no need to write any new code.

The on-chain transaction data in rollup are highly compressed to include only the necessary data needed for the network to verify the transaction, other data like state storage will stay off-line in the rollup child chain. Smaller data size is what allows rollups to still have good scalability over the layer 1 main net.

There are 2 types of rollups right now.

  1. Optimistic Rollup, which uses fraud proofs (same as Plasma), as a result, there will also have a longer withdrawal time for optimistic rollup — data in the optimistic rollup batch include 1) compressed rollup tx data, 2) pre-state root hash and 3) post-state root hash
  2. ZK-Rollup, which uses validity proofs: additionally, every ZK-Rollup batch includes 4) a cryptographic proof called a ZK-SNARK which proves that the post-state root is the correct result of executing the batch. No matter how large the computation, the proof can be very quickly verified on-chain, therefore withdrawal on zk-rollup will be immediate.

While no one knows how the future holds for which scaling solution will win out in the future. Vitalik wrote this in his blog “In general, my own view is that in the short term, optimistic rollups are likely to win out for general-purpose EVM computation and ZK rollups are likely to win out for simple payments, exchange and other application-specific use cases, but in the medium to long term ZK rollups will win out in all use cases as ZK-SNARK technology improves.”

I believe a graph or a table speaks a thousand words, so here is a summary table to help you quickly recap how much scaling solutions have improved over the years.

Pros and Cons of Channels, Plasma and Rollups
Comparison on Channels, Plasma and Rollups

if you like what i wrote, you can also follow me on Twitter at @overpacker_sc

Join Coinmonks Telegram Channel and Youtube Channel learn about crypto trading and investing

Also Read

--

--