Here for the API?Start building with us today

Learn about DeCommas API
Layer One and Layer Two Decentralized Networks
layers
April 06, 2022

Layer One and Layer Two Decentralized Networks

Decentralization is the foundation of the cryptocurrency market, which solved the problem of trusted third parties in financial transactions. Any bitcoin and altcoin transaction is validated by various kinds of consensus of peer nodes on the network, and anyone can run their own node and verify the state of the blockchain – that’s why these networks are called “permissionless”.

And validation of transactions using geographically-distributed nodes is not the only breakthrough of blockchain technology. Vitalik Buterin gave the world the ability to launch smart contracts on the blockchain and the freedom to write code. The launch of Ethereum is often compared to the next industrial revolution, which is already changing the world of finance, virtual games, management of documents, and infrastructure.

Unfortunately, many blockchain advantages lead to one major disadvantage – poor scalability. Synchronization of nodes with an ever-growing history of transactions on the blockchain, in addition to the size of blocks, limits the volume and speed of transactions.

Buterin’s trilemma

Vitalik Buterin coined the term “scalability trilemma”, in which it is impossible to speed up transactions and allocate enough resources to run smart contracts without sacrificing either decentralization, network security, or scalability.

The blockchain is simply a thread of limited capacity blocks that is validated and added by miners. Before transactions are added to the block, they are first sent to the so-called “mempool”. Miners select the transactions offering the highest fees first, keeping the lower fee transactions for later.

An increase in mempool volume forces users to increase fees, thus raising miners’ rewards.

Moving some of the transactions out of the blockchain while maintaining the connection between the main chain and the second layer is a way to solve the trilemma. This is how extra levels known as Layer 2 (L2) solutions came about.

L2 networks’ configuration

One of the approaches to increase scalability is called “sidechains”. Sidechains are blockchains with their own set of nodes and a consensus mechanism. A sidechain can be a fully independent L1 blockchain, as opposed to an L2 protocol. The latter is always directly linked to the core network through:

  • Using the same tokens as the underlying blockchain, freely moving between the layers.
  • Following the main-chain fundamental rules.

Layer 2 protocols do not issue any crypto; issuance only occurs on the underlying blockchain.

In the case of sidechains, token transfers happen via so-called “bridges”. Developers launch smart contracts on both the L1 core network and the sidechain network, which thus allows for cryptocurrency to be sent back and forth.

The funds received are locked in one network, and the exact same amount of value is issued in the other network. This operation is further validated by the sidechain miners, after which the frozen assets are then burned.

Apart from the rules listed above, the configuration and number of additional blockchains is not limited, and depends on the popularity of the L1 network. For example, there are more than a dozen Ethereum sidechains.

How to choose the right L2 network?

The security of transactions and token distribution in an L2 network is determined by the block validation mechanism. Blocks are validated by consensus among all nodes, or by a given majority of Layer 2 protocol nodes.

The most common variant is the Proof of Stake mechanism, in which validators lock collateral that can be seized in case of a fraud attempt. Typically, Layer 2 networks do not have that many nodes – plus, there is always the human factor and the possibility of a hacker attack to consider.

The most reliable and popular consensus is mathematical proof. For example, Ethereum’s L2 blockchain protocols use different types of zero-knowledge proof (ZK proof) technology, which eliminates human error or fraud attempts by individual validators.

Unfortunately, ZK proof consensus sidechains are not yet able to work with smart contracts, which limits the network to simple token transfers. Currently, the Matter Labs team has deployed a testnet version of zkSynk 2.0, in which zero-level proof is combined with the Solidity language. This is the first operating ZK proof solution with L2 smart contracts.

While zkSynk tests are underway, PoS algorithms lead in terms of popularity and the volume of total value locked (TVL). The analytical resource l2beat.com provides a ranking for Ethereum sidechains to help users decide which is the right one for them.

In the list above, TVL comes first, while the Market share column represents the percentage of the market that each project occupies. The Arbitrum network has attracted 50% of all funds in L2 networks mainly due to its versatility, which is reflected in the Purpose column.

However, its algorithm is based on the Fraud proof validation mechanism, meaning that whitelisted validators self-check transactions. These details can be seen when switching to the Risks tab, which provides information on the validation algorithm, data availability, and other parameters.

If you click on the project’s title, l2beat.com will provide its detailed description.

Conclusion

While L2 networks are linked to the core L1 blockchain, sidechains are separate things with their own set of validators – and oftentimes even a separate consensus. The user saves on fees, but in return, takes on the risk of code vulnerabilities and accepts higher centralization levels.

A number of L2 networks are in beta mode, which absolves developers of responsibility for possible deposit security issues. An investor should be aware that cryptocurrency to be HEDL should rather be stored on the main blockchain, and L2 networks should only be used for speculative transactions.

Nevertheless, second layer solutions are an extremely important step in the adoption of cryptocurrencies and because of all the described benefits we at DeCommas chose Optimism L2 as one of our vectors of development. Stay tuned!