- Given limited transaction capacity available on the Ethereum base blockchain, a variety of in-development Layer 2 scaling techniques aim to increase throughput by conducting transaction activity off-chain.
- State Channels have fast finality times and privacy features, yet present operational challenges surrounding node liveness and are difficult to generalize beyond payment use cases.
- Sidechains offer considerable customizability across areas such as consensus mechanisms, yet some designs introduce a trusted third party to bridge cross-chain transfers.
- Rollups are an emerging category that do not require semi-trusted operators to maintain the root contract, yet offer comparatively modest total transaction throughput gains.
Transaction scalability, particularly with respect to Ethereum, has long been a working issue for the blockchain industry. In order to fulfill its broad mission as a general purpose smart contract platform supporting a wide variety of decentralized applications, it must have the technical capacity to support a significant number of transactions. The base Ethereum blockchain currently supports roughly 15 TPS, has been periodically overwhelmed by applications such as Cryptokitties or popular ICOs, and has seen a network utilization of over 70% for most of the last 2 years. A key approach to alleviating this issue are Layer 2 (L2) networks, which reduce burden on the base blockchain (L1) by aggregating transactions on a seperate, linked network and settling on L1 when necessary. Layer 2 is not the sole venue on which scaling upgrades can be implemented; the transition to a sharded Proof of Stake L1 in ETH 2.0 is also intended to have scalability benefits. However, given repeatedly extended timelines and coordination difficulties surrounding the ETH 2.0 rollout and higher penalty for L1 consensus failure, L2 approaches present a more iterable, isolated, and immediately impactful complement.
State Channels: More Trustless, yet Operational Challenges
A state channel is an off-chain network running parallel to a blockchain that allows two parties to send off-chain transactions between one another and settle on the base blockchain when necessary. A state channel is considered a generalized form of a payment channel, except that it allows the channel to represent any state of a smart contract, beyond transactions and balances. Counterparties that are not directly connected through a channel can have transactions routed through a routing node. The Bitcoin Lightning Network is a major example of a payment channel network; broadly, the concept of payment/state channels has long been a discussion point for the industry, and is not unique to Ethereum.
A key concept for state channel networks is the idea of an arbitrator (or ‘judge’) contract, which is a smart contract deployed on the base blockchain that represents the root state of a channel and represents the core source of truth for activity that happens within that state channel. In general, unique arbitrator contracts must be deployed for each state channel. This contract can be arbitrarily complex, ranging from a simple accounting of address balances in a payment channel to (for example) the full economic rules for a game. State updates that occur within a channel can always be interpreted by the arbitrator contract. When the counterparties want to close the channel and settle, both submit a final state to the arbitrator contract. If these states are equivalent, the channel is closed without issue. If not, or if only one party has submitted a final state, a challenge period begins during which the other party may submit an alternative state. Depending on the implementation, the arbitrator contract may slash deposited funds of accounts who submitted an invalid state.
Incremental transactions within a channel have a very low marginal cost, since only the two parties need verify it. However, creating a channel initially requires a transaction on the base blockchain, which may have a high one-time cost. This makes state channels well-suited to applications where two parties have a long-term relationship with many transactions back and forth.
State channels have fast finality times, since transactions only need be signed by the two counterparties, who always have the option of enforcing this state on the base blockchain by closing the channel.
Relative to bidirectional payment channel networks, it is more difficult to generalize to applications with many users and a high volume of complex state changes. Applications with a more limited scope and number of counterparties can be executed more efficiently.
Since state channels are closed by submitting a transaction to the base blockchain, channel closings are limited by L1 capacity. In a scenario where many users withdraw funds and close channels, this may cause congestion or validation errors on the base blockchain. Such a scenario has not occurred to date on any state or payment channel networks, given their comparatively low use relative to base blockchain capacity.
State channels may present complications for economic incentives on the base chain, as transaction fee revenue may not accrue to base chain participants who are ultimately providing security. This is particularly relevant for L1 chains where transaction fees are a primary form of reward for nodes. An example of this is the Bitcoin Lightning Network; in a hypothetical future state where coinbase block rewards are minimal and most transactions occur on Lightning and do not pay base chain fees, base chain miners may not have enough incentive to effectively secure the network.
Major Ethereum Layer 2 projects using state channels include:
- Raiden is an early payment channel network, partially funded through a 2017 token sale for RDN, which is used to pay transaction routing fees and to pay third-party watchtower services for monitoring channels states when a user node goes offline. Raiden uses a similar Hashed Timelock Contract architecture as Lightning to route payments. Raiden’s mainnet has seen relatively low use throughout its history, with current total network channel capacity of 2 WETH. This lack of adoption could be related to the use of a payment token, which introduces an additional degree of complexity for users versus paying transaction fees in WETH.
- Connext is a state channel network built on the Counterfactual framework. There is no associated token, with all fees to routing nodes paid in ETH or WETH. Connext is used by dApps such as Spankchain and Mosendo, which implement individual hubs on which users can send transactions at no cost. Connext focuses on use cases related to conditional transfers, and nodes earn fees for providing routing services.
- Celer is a state channel network with a native token CELR that functions as a staking mechanism for both channel liquidity and a watchtower-like mechanism (State Guardians Network) that monitors transactions when users are offline. To provide off-chain routing with adequate liquidity to function, Proof of Liquidity Commitment (PoLC) incentivizes users to lock up tokens, with rewards issued in CERL should they opt to verifiably back the network. Celer was funded through a 2019 private sale and subsequent IEO, and has a particular focus on gaming applications through the CelerX SDK.
Broadly, state channels are in an early stage of development and adoption, with no clear category leaders yet emerging. At present, state channels seem most suited to applications with a fixed group of parties, prioritize transaction privacy, and requiring fast finality times including rapid settlement back to the base chain. Broader application classes, particularly more complex uses of smart contracts beyond payments, are still in development.
Sidechains: Customizable, yet May Rely on Trusted Third Parties
The second major category of Layer 2 scalability approaches are sidechains, which are blockchains that are associated to a parent blockchain and can exchange assets through a two-way peg. In brief, a token holder on the main chain locks their tokens by sending them to an output address, which releases a proportional number of tokens (determined by the peg) on the sidechain. The consensus mechanism, node architecture, and miners on the sidechain may be distinct from those of the main blockchain. Outside of the Ethereum ecosystem, a notable example of a sidechain is Liquid, which is a Bitcoin settlement network for traders and exchanges. A key consideration in sidechain design is the mechanism for moving assets between chains in a secure fashion, either relying on trusted custodians (such as Liquid), or non-custodial architectures and fraud proofs (such as Plasma).
Base blockchain transaction volume is limited to the deposits and withdrawals through the peg contract, and need not scale with the number of total users. This is in contrast to a state channel network, where a new channel must be opened for each pair of counterparties.
Sidechains generally do not inherit the consensus security of the related chain. Sidechain nodes operate fully independently to confirm transactions. The nodes in some permissioned sidechain architectures can confiscate funds or perform an invalid transaction without a user having recourse on the main chain. This is in contrast to state channel designs, which are ultimately secured by the underlying chain’s consensus mechanism and do inherit its security profile.
Major Ethereum Layer 2 projects using sidechains include:
- Plasma is a non-custodial Ethereum sidechain framework proposed by Vitalik Buterin and Joseph Poon in 2017. Unlike many other sidechain approaches that rely on a trusted operator to arbitrate movement of funds between the main and side chains, Plasma aims to use a system of fraud proofs at allow funds to trustlessly move between chains. Each Plasma sidechain is rooted in an Ethereum smart contract through which deposits and withdrawals flow, and can define its own consensus mechanism and block time tailored to a particular application. Transaction validity is enforced during a challenge period following a Plasma chain withdrawal. There are a variety of development teams working on Plasma implementations including Minimum Viable Plasma and Plasma Cash (NFT support), though the project has not yet been developed with the full functionality described in the whitepaper. Further commentary on Plasma-specific challenges is found here.
- OST (formerly Simple Token) is a platform for creating branded tokens, issued on customizable sidechains, backed by the native OST token. Typical users of the OST platform are companies who wish to issue branded tokens, often focusing on payments, for integration into existing business lines. The OST architecture is broadly similar to many other sidechain implementations: companies stake OST in a smart contract, forming a value-backing for branded tokens issued on a sidechain, where the issuer, the OST Foundation, and the OST company act as validators. Sidechains are customizable in their consensus mechanism and token supply mechanics. While not a general purpose platform across all types of Ethereum transactions, OST does offer a modular framework for the issuance and low cost transactions of branded ERC-20 tokens. OST was funded through a 2017 token sale and has gained adoption through consumer applications such as Pepo.
- POA Network is an Ethereum sidechain framework using a Proof of Authority consensus mechanism. The root POA blockchain is an EVM-compatible smart contract platform with a known set of validators who stake POA tokens. The project also aims to enable interoperability with the Ethereum blockchain via its open source POA Bridge technology, which is a modified version of the open-source Parity bridge. This bridge can be used by anyone to connect Ethereum-compatible networks with one another. A notable release for POA is the xDAI sidechain, on which a POA version of the Dai stablecoin can be transacted with minimal fees across a network of ten validators.
- Skale is a framework for on-demand sidechains, each of which are operated by a group of randomly selected Skale nodes. Each sidechain is highly configurable across chain size, consensus mechanism, virtual machine, and parent blockchain. SKALE tokens function as a staking mechanism for sidechain nodes. Users can deploy existing EVM contracts to Skale sidechains, which have considerably higher gas limits than the Ethereum chain and can support more complex applications. Skale has raised over $25m through private SAFT token sales and aims to launch a mainnet in early 2020 with a focus on gaming and DeFi applications.
Outside of Ethereum-specific projects, others are developing interoperable sidechain networks with a similar set of functionality. For example, Cosmos is a network of independent parallel blockchains with BFT consensus, connected through the Cosmos Hub blockchain. Sidechains within the Cosmos network use the Tendermint BFT consensus engine, can be public or private chains, and are highly configurable to fit individual applications. While Cosmos is a distinct blockchain and network from Ethereum, its support for the Ethereum Virtual Machine (EVM) and ability to port existing Ethereum smart contracts through the Ethermint tool effectively make it a sidechain framework for Ethereum applications. Cosmos was funded through a 2017 token sale for ATOMs, which function as a staking mechanism for Cosmos Hub. The Cosmos network launched mainnet in March 2019, and several applications are now utilizing the Cosmos SDK to launch their own custom blockchains. Notable examples of Cosmos sidechains include Binance Chain, Althea, and Aragon.
Sidechains have seen arguably seen more development progress and mindshare than state channels, which projects working on both network-wide (Plasma) and application-specific (OST) approaches. Sidechains hold particular appeal for projects that require a blockchain customizable across various aspects of cryptoeconomic design, such as consensus mechanism and supply controls, while still remaining interoperably with the L1 chain.
Rollups: An Emerging Hybrid Approach
Beyond state channels and sidechains, a blog post by Vitalik Buterin highlights a third class of L2 scaling approaches that is beginning to gain traction. Rollups, at a high level, bear similarities to Plasma: a smart contract on the base chain holds funds and maintains a cryptographic commitment to the sidechain state. The key differentiator for Rollups is that unverified sidechain transaction data is published to the base blockchain by default. These techniques can be described as ‘on-chain data storage, off-chain computation’ hybrid L2 approaches. This technique uses the base blockchain to verify transaction data availability, but does not verify validity. While storing transaction data on-chain does have a storage cost and present a potential bottleneck, the cost is less than performing full execution.
The underlying technical issue that this design seeks to address is known as the data availability problem. A brief summary: one way to cheat or disrupt an L2 system is to not publish a full record of transactions that occurred on L2 to the L1 root contract. In this scenario, it is not possible to reliably determine if this missing data is due a malicious submitter or a malicious challenger; thus, it is not clear which party to penalize. The Rollup approach avoids this issue by publishing all L2 transaction data on-chain by default. In order to reduce data costs on the base chain, L2 transaction data is compressed through BLS signature schemes and the calldata Solidity function.
In one variant, ZK Rollups, the root contract operator must generate a SNARK proof for every state transition. In Optimistic Rollups, an updated state is published by the contract operator without generating a proof every time; if an incorrect state is published, a third party can generate a dispute and slash the operator’s stake. Unipig, a fork of Uniswap, is a recently released test application utilizing Optimistic Rollups.
The fraud proofs used in Rollups require only one user to provide proof to the aggregator contract, and that user can be a third-party to actual transactions happening within the contract. This is in contrast to state channel approaches that require counterparties to be online and challenge invalid transactions posted to the base chain. Instead, in Rollup, security enforcement can be provided by anyone; this represents a significant user experience advantage, in that non-technical users need not be online (or delegate responsibility to a particular third party, in the case of watchtowers).
The cryptography (zkSNARKS) and game theory are less tested in production networks, relative to older technologies such as state channels. Most Rollup implementations are still in a Proof of Concept stage.
Further commentary on the outlook for Rollups from the development group Matter Labs is found here, and from Plasma Group here. Broadly, Rollups are a promising category of L2 scaling solution presently in a Proof of Concept phase.
Developing effective scaling solutions, through Layer 2 approaches or otherwise, is a key challenge for the industry today. While there is no clear leader in the category of approach taken -- State Channels, Sidechains, Rollups, or otherwise -- meaningful development progress is apparent and may soon offer projects further capability to build consumer-ready applications. Each approach presents key tradeoffs in security, node liveness requirements, customizability, and finality times that are important for industry stakeholders and in-development projects to consider. Ultimately, a broad variety of L2 scaling approaches may find use in industry projects and interoperate with L1 scaling approaches to afford Ethereum its much-needed improvements. Smith + Crown expects that the continued development of this area will have significant implications for the industry as a whole.