Peeling back the onion.

An overview of blockchain layers.

Matt Marks
Via Protocol
13 min readJun 13, 2022

--

Layer-1 / Base blockchains

Layer-1 blockchains are standalone protocols that can validate and finalize transactions independently from other networks, as they have their own consensus mechanisms and are responsible for their own security via a pool of miners or validators. The very first layer-1 blockchain was Bitcoin, introduced in 2009 and a sort of ‘proof of concept’ for all other blockchains and for the concept of blockchain itself. Despite the unique contribution of Bitcoin, the protocol only allowed for the transfer of value among individuals, and therefore its applications have so far been limited.

Ethereum, launched in 2015, was the first fully programmable blockchain thanks to its smart contracts capability. It opened up unprecedented opportunities for developers to build any sort of apps and protocols on top of that basic infrastructure. The mushrooming of use cases such as DeFi, NFTs, and gaming spurred wider blockchain adoption. However, more users and more use cases quickly brought to the network’s congestion and prohibitive gas fees.

Blockchains, in a similar way to traditional payment systems, verify and record transactions among users. Two key measures of the efficiency and speed at which these protocols can process transactions are transaction finality, the time required to make a certain transaction confirmed and immutable, and transaction throughput, the rate at which valid transactions are committed by a blockchain in a defined time period (transactions per second, or tps). While MasterCard or Visa can process about 20,000 transactions per second, Bitcoin can only process 7 per second, and Ethereum about 15. This is because of the decentralized nature of blockchains, which means they rely on multiple nodes scattered across the world who cooperate without a central authority. In order for transactions to be accurate and trustworthy, these nodes need to reach a consensus on the state of the network, which takes time. Therefore, scaling blockchains is much harder than centralized systems, and it is even more so when trying to preserve high degrees of decentralization and security. Vitalik Buterin, Ethereum’s co-founder, famously presented the Scalability Trilemma, the apparent impossibility for single blockchains to achieve Scalability, Security, and Decentralization at the same time.

Choose your fighter

Alt-L1s

Scaling, therefore, became the major hurdle for blockchains, a challenge that stimulated a wide variety of solutions. One first attempt was brought by the so-called alternative layer-1s, or alt-L1s, independent blockchains that try to scale on one single layer by adopting innovative designs and consensus mechanisms and creating their own ecosystem of apps and protocols. In 2020 there was a burst of alt-L1s, the ‘2020’ generation: Solana, Near, Avalanche, and many more.

Solana tries to solve the scalability problem by improving the Proof of Stake consensus mechanism with a unique system known as Proof of History. Proof of History produces a cryptographic timestamp that certifies that a certain event, or transaction, has happened after a certain time. This allows optimizing the order with which transactions are processed by validators, thus saving time and allowing for higher throughput. Solana is currently the 5th largest blockchain in terms of TVL, with about $4 billion locked in an ecosystem of about 70 major protocols.

TX flow through the Solana Network

Near Protocol is a Proof of Stake, layer-1 blockchain set to overcome the scalability problem with a unique sharding design called Nightshade. Shards are sub-blockchains, each with a subset of validators, that can process transactions independently. Nightshade models the system as a single blockchain, in which each block contains all the transactions from all the shards. However, each participant of the network only maintains the state that corresponds to their shard. NEAR’s Nightshade is theoretically limitless (by increasing the number of shards) and can handle millions of transactions per second. Currently, Near Protocol is the 13th largest chain in terms of TVL, with just above $500 million dollars locked across less than ten major protocols.

How Near Works

Avalanche is a Proof of Stake, Layer-1 blockchain, that achieves scaling (about 4,500 tps) thanks to repeated sub-sampling, requiring many small, random subsets of validators, to confirm transactions before the transactions are considered finalized, thus enabling faster finality and lower costs than alternative blockchains. Avalanche is currently the 4th largest chain in terms of TVL, with just above $4 billion dollars locked, representing slightly less than 4% of the total TVL in crypto.

How Avalanche Consensus Works

While some alt-L1s like Avalanche opted for a higher degree of compatibility with Ethereum and chose an EVM-compatible design, other blockchains like Solana or Near have created new standards and programming languages (Rust). EVM-compatible chains can benefit from Ethereum’s ecosystem of apps, developers, and users, and well-tested protocols and functionalities that non-EVM chains might take years to build and perfect. They can, for instance, benefit from a versatile block explorer (Etherscan), a wallet used by millions (Metamask), and a robust and well-audited multi-sig solution (Gnosis Safe) within their first few days of mainnet.

Talking about scaling through a more efficient layer-1 architecture, Ethereum itself is going through a deep restructuring process, moving from Proof Of Work to Proof of Stake (’The Merge’, happening in Q3/Q4 2022) and adopting sharding (set for 2023) as part of a scaling strategy that should allow it to reach a throughput of thousands of transactions per seconds.

Layer-2

Trying to achieve the three attributes on the base blockchain layer is considered by many an impossible task. That is also why Ethereum has been trying to scale, along with the abovementioned restructuring process, by building a multi-layer structure and relying on layer-2 protocols. Layer-2 protocols process transactions outside the main chain (’off-chain’) but ultimately settle back to layer-1 in order to ensure it has similar security and decentralization guarantees. This lets layer-1 handle security, data availability, and decentralization, while layer-2s handle scaling. There are two main types of L2s.

  • Sidechains, like Polygon, are separate blockchains that run parallel to Ethereum, have their consensus method and are responsible for their own security, and have a native token (like MATIC for Polygon) to settle transactions and transfer assets between side and main chains. Sidechains are connected via a two-way bridge to the main chain, whose principal function is to provide dispute resolution. Polygon is currently the 6th largest chain and represents over 2% of the total TVL, with about $2.5 billion locked.
How Polygon Works
  • Rollups bundle hundreds of transactions and then post them as a single transaction on layer-1, thus inheriting L1’s security. Bundling hundreds of transactions distributes the L1 transaction fees across everyone in the rollup, making it cheaper for each user. There are two types of rollups: optimistic rollups process hundreds of transactions off-chain and submit them as a single transaction to Ethereum, assuming that all transactions are valid. If an invalid transaction is suspected, the proof is run to see if this has taken place. Zero-knowledge rollups, on the other hand, bundle hundreds of transactions off-chain, produce a cryptographic valid proof, and submit it to Ethereum as proof that the transactions submitted are valid. Overall, optimistic rollups (Optimism and Arbitrum) still dominate compared to zero-knowledge (zkSync which is EVM-compatible, and StarkNet which is not and has its own programming language, Cairo) although there are a lot of expectations for the upcoming breakthroughs and potential of zero-knowledge technology.

The advantages of L2 are clear. Firstly, they can focus on executing transactions without having to spend on security, in terms of rewards to a network of validators, since they can benefit from Ethereum’s one. This means that they can sustainably keep transaction fees low, while other L1s are trying to keep fees low while having high costs for security.

These new satellites of Ethereum govern themselves and produce their own economies. But after every few blocks, they bundle up their aggregate economic activity and make a transaction to the L1. In exchange for an ETH tax to process a transaction, the security power of the Ethereum L1 is bestowed on the L2.

End-to-end message flow for an L1 <> L2 deposit and withdrawal

Secondly, they benefit from the Ethereum network effect, thus solving the cold start problem of attracting developers and users to their ecosystem. Interestingly, Ethereum itself and other L2s all benefit from each other’s growth and network effect, since there is complete interoperability among them. Additionally, since Ethereum, doesn’t need to adapt to accommodate L2s, an infinite number of L2s can theoretically be added, thus infinitely scaling Ethereum. Finally, L2s often work as a testing ground for Ethereum, which can therefore benefit from a lot of experimentation on mainnet chains rather than testnet.

Several major decentralized apps (DApps) are already deployed on L2s: Balancer is on Ethereum, Polygon, and Arbitrum; Aave, Curve, and Uniswap are on all Ethereum L2; yarn.finance is on Ethereum and Arbitrum; OpenSea is on Ethereum and Polygon, with Immutable coming soon. Overall, the most successful projects are all on Ethereum and its L2s, which is reflected by the fact that these chains, along with EVM-compatible ones, capture the vast majority of the TVL:

Market Share in % TVL

Layer-0

While L2s offer a great solution for scaling but they can only do that for Ethereum, alt-1s overcome the scalability difficulties of conventional chains well, but as their number multiply, they also contribute to ecosystem fragmentation and generate a new problem: interoperability, the idea that two different blockchains may connect and interact without a centralized intermediary. Some solutions, such as EVM-compatible chains, bridges, and multi-chain protocols like Aave or SushiSwap, offer some degree of interoperability, but they cannot provide default and seamless cross-chain communication. Layer 0 and layer 3 protocols have been trying to solve this.

Layer-0 protocols have one approach to interoperability (Cosmos with its SDK and Inter-blockchain communication protocol that powers Terra, and Polkadot, with its parachains with the first auction happened in late 2021) by creating a new, relay chain layer on which customized blockchains can easily build atop. While layer-1 projects allow for decentralized applications (dApps) to be built on the blockchain, layer-0 projects allow for entire blockchains to be built on top of them, inheriting the security of the substrate (pooled security). Layer-0 allows for cross-chain interoperability between blockchains built on their substrate, ensuring flexibility and sovereignty to developers building on these chains. Developers on layer-1 protocols have to make compromises on the design and efficiency of their dApps because the underlying layer-1 protocol is optimized for the average use case rather than the specific developer’s use case. With layer-0, on the other hand, developers can take some basic building blocks (including consensus mechanism and security, which means that they don’t have the bootstrapping problem of finding validators and nodes to ensure security at the beginning), and build a blockchain optimized for the specific use-case they need (DeFi, gaming, social media, and so on). Another problem Layer-0 solve is the sovereignty problem: dApps built on Layer-1 depend on the stability of the underlying blockchain. If there is a bug, for example, each dApp built on that chain is affected. This is not the case for chains built on Layer-0 protocols. Overall, layer-0’s core principles are composability, the idea that developers don’t have to spend time re-inventing the wheel but can mix and match existing core components, and flexibility, the idea that different use cases have different needs which can be better addressed by a unique and dedicated blockchain. The two most important blockchains that have adopted this approach are Polkadot and Cosmos.

  • By using Polkadot’s Substrate framework, anyone can build an application-specific Polkadot blockchain, called parachain. All parachains are connected to a relay chain, which is responsible for the network’s shared security, consensus, and cross-chain interoperability. Polkadot’s native token, DOT is used for validators’ staking, governance, and bonding (auction for parachains). Parallelly, each parachain can also have its own token. Acala, Moonbeam, Parallel Finance, Astar, and Clover were the first five parachains to launch at the end of 2021. One limitation of Polkadot, at least at the current state of things, is that the number of parachains available is limited, and therefore each is assigned via an auction process for the duration of one year.
  • Cosmos has its own SDK which provides the tools necessary to build independent customized blockchains, called Zones. The main chain, Cosmos Hub, transfers assets and data between the connected Zones and provides a shared layer of security through the Inter-Blockchain Communication Protocol (IBCP). Zones all work together using Tendermint, Cosmos’s custom consensus mechanism, and a general application interface. Fees in Cosmos are payable in the network’s crypto ATOM. Developers have so far built hundreds of blockchain projects on Cosmos, including Binance Chain (BNB), Terra (LUNA), Crypto.com Coin (CRO), and more.
How Cosmos Works

Although creating truly multi-chain application environments where any type of data or asset, not just tokens, can be transferred, Polkadot and Cosmos can only ensure interoperability across chains built on their own ecosystem.

Layer-3

Layer-3 protocols try to overcome this limitation by adopting a different approach to interoperability. Instead of creating a new blockchain ecosystem with a relay chain and multiple interconnected and independent chains, layer-3s are interoperability protocols that can connect already existing blockchains, expanding the concept of multi-chain interoperability.

LayerZero protocol is a so-called “omnichain” designed to deliver interoperability and composability across blockchains. Its technology will enable users to send tokens or any kind of message in a single transaction across applications that live on various chains. The firm’s goal is to “create the generic messaging layer that underpins all interoperability between blockchains” and solve what they define as the bridging trilemma, delivering fast finality, shared liquidity across chains, and the ability to use native assets as opposed to their wrapped counterparts. The answer to the bridging trilemma is the recently-launched Stargate, a protocol for swapping tokens across different blockchains with a single transaction. The benefit of LayerZero, compared to traditional bridging, is that users do not have to lock their assets, and only have to pay the gas fee on the source chain. Furthermore, unlike traditional bridges, LayerZero is a generalized messaging protocol, and it therefore can support a wide range of data and applications like gaming, social media, and more.

How LayerZero Works

Ethereum-L2 StarkWare also announced that it’s planning for Layer-3, which would deliver hyper-scalability. While LayerZero’s L3 is about multichain interoperability and therefore is scaling horizontally, StarkWare’s L3 is building another level on top of L2, thus scaling vertically. While L2s are general-purpose independent blockchains that help Ethereum scale, some applications may need specific tailoring that could better be addressed by a new and separate layer (something similar to the idea of layer-0 blockchains). Serving as layer-2, StarkNet would validate multiple layer-3s, each dedicated to various use cases, with a backward settlement process to Ethereum in a recursive structure. The main advantage of scaling a blockchain vertically is that, almost like an ever-growing skyscraper, it may also be extended to additional layers for fractal layering solutions.

How StarkWare works
Layers of StarkNet

Closing thoughts

Blockchain layers competition has not been a winner-takes-all race, and there are plenty of applications being built on a variety of chains and layers, making interoperability, along with scalability, a key challenge to solve. Despite the blossoming of alternative chains and languages, however, signs point to a persistent predominance of the Ethereum ecosystem which, making the most of its first-mover advantage, endures as the industry’s standard. Ethereum accounts for almost 65% of the Total Value Locked in crypto, has the largest ecosystem of tools, apps, and protocols, and is 2.8x larger than the second-largest ecosystem. Moreover, this trend is consolidating, especially after the demise of Terra and in view of the upcoming Ethereum version 2, and a lot of effort and investment is being thrown into Ethereum layer-2 solutions, notably optimistic and zero-knowledge rollups like Optimism, which raised $150 million in March and just launched its own token, and StarkWare, which raised $100 million in May. Finally, even some of the largest alt-L1s are seeking interoperability with Ethereum through EVM implementations on their own chain: Solana with Neon, NEAR with Aurora, and Cosmos with Evmos. Overall, it is still highly advantageous to build on Solidity and EVM-compatible chains, thanks to the mature ecosystem and the huge network effect. It remains to be seen whether a multi-chain approach that addresses specific use cases and communities may gain more traction, driving demand for omnichain protocols that let different chains seamlessly communicate. Ideally, we will live in a world where we can move data, identities, and social graphs across chains as easily and seamlessly as cross-chain liquidity aggregation protocols allow to swap tokens.

About VIA

Thanks to its intelligent routing system, the cross-chain liquidity aggregation can automatically scan over 41 DEXs across 13 networks and 11 of the most popular cross-chain bridges in order to let users swap tokens on the fastest and cheapest routes, seamlessly. The VIA Protocol aggregator uses liquidity from the protocol’s execution pool in the target chains, allowing users to efficiently route orders across all the available liquidity sources within 60 seconds.

VIA cross-chain aggregator supports two types of routing:

  • Basic routing
  • Advanced routing (coming soon)

Basic routing

If there are bridges between networks with sufficient liquidity, the exchange will occur directly from the source chain to the target chain.

✨Advanced routing✨

If a direct exchange does not exist, lacks liquidity, or is less profitable, the exchange will occur with a few intermediate steps. Regardless, the swap will be run in the backend by the Via protocol to provide a completely seamless experience for users.

Also, don’t forget about Trusted Token List that we have for Devs.

To learn more about VIA Protocol, check out:

See you on cross-chain,
The VIA Protocol Team.

--

--