Off-Chain Solutions

Note: Data in this section last updated August 26th, 2022

What are off-chain solutions?

Off-chain solutions – also known as Layer 2 solutions because they are built β€˜on top’ of a Layer 1 blockchain such as Ethereum – aim to increase scalability while retaining the security and decentralization of the underlying blockchain.

For the purposes of this article, I will highlight four main types of Layer 2 solution:

  • State Channels

  • Custodial Sidechains

  • Non-Custodial Sidechains

  • Rollups

Landscape of Layer 2 Solutions

Before diving in, however, it’s important to remember the three basic functions of a smart contract platform:

  • Execution: Run programs via smart contracts

  • Data: Store important data such as account balances

  • Security: Provide consensus protocols secure the network

Several of these Layer 2 solutions increase efficiency by taking responsibility of at least one of these functions off of the main chain. For example:

  • Custodial sidechains remove all responsibility from the main chain by maintaining their own security, storing their own data and performing their own execution. For this reason, many people argue that they are not really β€œLayer 2” solutions at all, but are simply separate blockchains

  • Non-Custodial sidechains utilize the security of the Layer 1, but lessen the load by keeping their own data and doing their own execution

  • Rollups utilize the security and data of the Layer 1, but do their own execution

To summarize:

While most Layer 2 solutions increase speed, many still suffer from similar tradeoffs in functionality, security and decentralization. More detail on this is below:

State Channels

State channels are a very basic scaling solution where two or more users take their transactions β€œoff-chain” and then submit the final results back to the chain. For example, if Alice and Bob frequently transact with one another, they may elect to break off into a state channel for most of their transactions to increase speed and save on fees.

While state channels can be very fast and cheap, they suffer from three main flaws:

  • Participants must already know and trust each other

  • Users must lock up a large sum of capital

  • State channels can’t execute smart contracts

While easy to implement, these flaws make state channels unappealing and it is expected that they will continue to lose relevance.

Popular state channels include Bitcoin’s Lightning Network and Ethereum’s Raiden Network.

Custodial Sidechains

Custodial Sidechains are Ethereum-compatible, independent blockchains that maintain their own security. These chains connect to the Ethereum network through a bridge, and users can transfer their tokens to them and process transactions in parallel.

Like the multi-chain solutions described above, adding additional blockchains is a very effective method of reducing congestion on the network, and therefore reducing fees. In addition, because they are completely separate blockchains, sidechains can choose to run protocols – such as Proof-of-Stake – that allow them to operate much faster.

The fact that they are separate blockchains are also their greatest flaw. Users are effectively trusting an entirely different entity with their assets, so if the sidechain breaks (or worse, its creators are malicious) users could lose everything they transferred to that chain.

Given that they are entirely separate blockchains, many would argue that sidechains are not true Layer 2 solutions at all.

Major sidechain projects include Polygon’s Matic Network and Skale.

Non-Custodial Sidechains

The security flaws of custodial sidechains led to the development of β€œnon-custodial” sidechains. These solutions are also separate blockchains, but they rely on the security of the main chain.

They do this by 1) removing data from the main chain, 2) performing the necessary calculations and 3) returning the results to the main chain in regular intervals.

Unfortunately, anytime data is taken off-chain, we have to assume that there is a chance that it has been manipulated. As such, non-custodial sidechains have mechanisms designed to prove that the data hasn’t been tampered with.

There are two types of non-custodial sidechains:

  • Validium: When returning data to the main chain, Validium sidechains submit a cryptographically secure "validity proof" to the network, showing that all calculations are valid. The mechanics of this proof are out of the scope of this article, but for reference it is called a β€œzero-knowledge proof” because it can be used to prove something is true without relaying any additional data.

  • Plasma: Plasma takes the opposite approach. Instead of submitting a proof, it is assumed that the data is correct BUT users can easily check this through a "fraud proof", which means that there is a 7-14 day waiting period that allows validators to review and reverse the transaction if they suspect fraud.

At first glance, non-custodial sidechains seem like ideal L2 solution as they retain the important benefits of custodial sidechains (i.e. speed) while also retaining the security of the main chain. Unfortunately, they suffer from a few drawbacks:

  • Both Plasma and Validium have limited functionality when it comes to smart contract execution

  • Plasma can take weeks to complete a withdrawal

  • Validium is faster than Plasma (10 – 30 min), but can be expensive due to the computational requirements of zero-knowledge proofs

Major plasma projects include Polygon’s Plasma Chain and OMG and major Validium projects include Starkware and Loopring.

Rollups

While non-custodial sidechains move both data and computation to a separate blockchain, rollups only move computation off chain. That way, users know that important data, such as their account balance, is secured on ETH.

ZK and Optimistic Rollups Execute Transactions Off-Chain

Because rollups execute off-chain, they still need a way to prove to the main network that they’re not being malicious. In these types of proof, we find the two different flavors of rollups:

  • zk rollups: Like Validium, zk rollups use zero-knowledge proofs (that’s where they get the name) to show that all calculations are valid.

  • Optimistic rollups: Optimistic rollups use β€œfraud proofs” in a manner similar to Plasma – they institute a waiting period that allows validators to challenge transactions they believe might be fraudulent. This is an important role for validators, who risk having their collateral slashed if they fail to catch a dishonest submission.

In general, zK rollups are faster but offer less functionality, while optimistic rollups have more functionality but are also slower due to the potential of fraud challenges.

As zK rollups mature and more functionality is added, many expect for them to become the dominant L2 solution for ETH.

In fact, Vitalik wrote: β€œ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.”

Major optimistic rollup solutions include Optimism and Arbitrum and major zK- rollup projects include ZKSync, Loopring and Starkware.

Last updated