As we know, Bitcoin appeared back in early 2009. But it wasn't until 2017 that blockchains became mainstream. And it wasn't until November 2021 - almost 12 years after bitcoin's appearance - that the market capitalization of the entire crypto market reached its peak of $2.9 trillion.

The rise of the first cryptocurrency created immeasurable value and changed the way society perceives money and who controls the financial flow. But along the way, blockchains became victims of their own success. They could not handle the increased traffic, resulting in either long transaction times or high fees.

To understand why this is so, we need to understand why blockchain networks are also called Tier 1 networks, what Tier 2 networks are, and what distinguishes blockchains from ordinary computer networks.

Blockchains vs. computer networks

At a basic level, all blockchains are computer networks. Computer networks are made up of groups of network members, known as nodes. They exchange data and share computing resources. These nodes can connect to each other in many different ways. There are four basic types of computer networks: 

    • Ring - A node connects to two other nodes, creating a bidirectional ring.

    • Bus - A node connects to only one other node.

    • Star - the server node connects to the client nodes.

A star is the most common computer network because it is fast and cheap. In star architectures, the central server node (node) transmits data directly to other nodes, so data does not have to go through each node on its way to the others. And since the server node provides computing resources directly to the client nodes, such a system is very efficient. However, the performance cost will be high - we get centralization both in terms of control and single points of failure (SPoF). A single point of failure causes the whole network to fail.

In contrast, peer-to-peer (P2P) networks do not use server nodes to coordinate the network. Instead, each node acts as a client and server, sharing computing resources across the network. This principle solves the problem of centralized management and SPoF, so it is an ideal solution for P2P money, such as Bitcoin.

The downside of decentralization is that peer-to-peer networks are difficult to scale. This problem also applies to blockchain networks because they are protected by P2P networks' consensus mechanisms. Vitalik Buterin, co-founder of Ethereum, called this problem the scalability trilemma (also known as the blockchain trilemma);

How a Layer 1 blockchain works (Layer 1)

To solve the scalability trilemma, blockchain networks have begun to adopt different approaches. These approaches are called Layer 1 - the base layer of the blockchain network. Bitcoin, Ethereum and Solana are all examples of Layer 1 blockchains;

One of the most obvious ways to solve the scalability trilemma on Layer 1 was to increase the block size. This allows the blockchain to process more transactions per data block. The larger the block size, the more transactions it can process per second.

There is a disadvantage here. Increasing the size of the block requires node operators to use more powerful computers. Fewer operators can afford such a purchase, which leads to more centralization;

When billionaire Ilon Musk proposed increasing Dogecoin block size by 900%, Ethereum co-founder Vitalik Buterin indicated  that the blockchain would not be decentralized if ordinary users with consumer-level PCs could not run the node.

Modern Layer 1 networks solve the scalability trilemma with consensus and sharding mechanisms.

Consensus protocols

Consensus algorithms are at the very core of blockchain. For bitcoin and other cryptocurrencies to have value, the P2P network must solve two key problems: double spending and incentives.

Double spending is when someone uses the same scarce resource (e.g., money) twice. This problem is inherent in digital technology because such files can be copied endlessly. To solve this problem, blockchains make each transaction unique by using timestamps and hashes, and by adding them to packages of transactions called blocks. To spoof a transaction, a node would have to spoof the entire block.

This is where consensus algorithms come into play. They coordinate all the nodes of the network in a decentralized way. For a block to pass, the network must verify the data it contains. It is important to note that if some network nodes send false data, the network will continue to work as long as most node validators control the processing power of the network (hash rate).

ТThis networking is called the Byzantine Generals Task (BFT, Byzantine Fault Tolerance). In a decentralized network, it is extremely important that the network works, even if some of its nodes are unreliable or not working. Otherwise, the blockchain would stop.

In addition to solving the problem of double spending, consensus protocols encourage nodes to continue processing transactions. This is just as important: Why would anyone sacrifice their computing power and pay huge power bills for free?

In the case of Bitcoin, node operators (miners) expend computing resources. They are rewarded for their work per block in the form of BTC. This algorithm is known as proof-of-work (PoW);

Other blockchains, such as PoS, use validators as node operators. Instead of expending energy-intensive computing power, validators rely on stacking (blocking) resources - coins - to achieve the same goal of consensus coordination;

For example, after moving to PoS, Ethereum will require a steak of 32 ETH for the right to become a validator. After validators stack funds, they will begin to receive a commission for each transaction.

So, consensus protocols pose obstacles for attackers that are almost impossible to overcome. For example, in the case of bitcoins, they must have a processor with more than 51% of the power of the entire network. This is impossible to achieve given the size of the blockchain;

Sharding

Another layer 1 scalability solution is sharding. It splits the network into small databases called shards. Each shard runs its own transactions and adds blocks with its own nodes;

By distributing processing across multiple small shards, we take the load off the main consensus engine, which results in higher TPS.

But there's one thing. Because each shard is smaller, it is easier for a criminal to accumulate the funds or processing power needed to control the network. For this reason, sharding has yet to be tested on a large blockchain to prove its reliability;

Ethereum is leading the way on this issue. It plans to implement sharding after the transition from PoW to PoS consensus in 2022. Sharding will divide Ethereum into 64 segments.

The network will try to solve sharding security problems by randomly assigning nodes to shards.

There are other sharding experiments that seek to solve the scalability trilemma. The Swiss Distributed Technology Research Foundation (DTR), consisting of seven universities, launched in 2019 a special project Unit-e, which aims to become a scalable global payment network. Another project, Radix, partially organizes shards rather than framing them on a single timeline, as Ethereum does.

Are scalability solutions for Layer 1 coming soon?

Intervention in the blockchain network is a delicate matter. Most people still view cryptocurrency with disbelief. Bitcoin has been overcoming these fears for more than 10 years, so its Layer-1 updates are more conservative.

The latest Taproot Bitcoin update added Schnorr digital signatures. They allow the network to merge multiple transactions to reduce fees and increase scalability. However, Bitcoin still prioritizes Layer-2 solutions for true scalability across the Lightning network.

We see the same in the Ethereum blockchain. It has dozens of Layer 2 networks built on top of Layer-1.

In both cases, L2 protocols take the workload off the L1 core network, process it elsewhere, and return the data back to L1 in a much more efficient way. L2 uses different scalability techniques to achieve this goal, as shown in the table above.

However, working together L1 and L2 ecosystems also has challenges. Tokens have to be moved across special bridges, and every dApp has to be integrated into every L2. If we used L1 networks exclusively, it would make life easier for developers and users.

Many L1 blockchains have tried to solve the scalability problem. Including Cardano, Algorand, Elrond, Fantom, Avalanche and Harmony. But none of them have become as popular and recognized as Bitcoin or Ethereum. The technology is still in its infancy. Therefore, it is too early to conclude whether blockchains with working mainnets have significant success compared to BTC or ETH;

What is Layer 2 blockchain (Layer 2)

Ethereum in its current iteration processes about 15 transactions per second. This has caused a number of problems: the network is often overloaded, which sometimes leads to extremely high commissions (gas).

There is hope that Ethereum 2.0 will improve scalability, but there is still a long way to go before the update is complete. And with ether usage peaking around 1 million transactions a day, it needs other solutions today. That's what Tier 2 is for.

Layer 2 is what is built on top of the underlying blockchain to improve its scalability.

Examples of Layer 2 solutions

Ethereum Tier 2 solutions fall into several categories, and each has a different approach to making the network more scalable.

Channels

Каналы предлагают пользователям способ совершения нескольких транзакций офф-чейн (вне сети), отправляя только две транзакции на уровень расчетов, то есть Ethereum. Это обеспечивает высокую пропускную способность при низких затратах, однако существуют ограничения. 

Участники должны быть известны заранее, и они также должны внести средства в контракт multisig (мультиподпись). Это означает, что сеть необходимо регулярно контролировать, чтобы обеспечить безопасность средств. Также требуется время для настройки каналов между пользователями, что не позволяет активно участвовать в транзакциях.

Примеры каналов – протоколы Connext и Raiden.

Plasma

Решения Plasm используют хеш-деревья, которые создают дочерние цепи к основному блокчейну. Это способствует быстрым транзакциям с меньшими затратами, поскольку блоки не рассчитываются в основной сети, и нет необходимости хранить данные в реестре.

Однако есть некоторые ограничения для решений Plasma. Платформа поддерживает только определенные транзакции, поэтому, например, более сложная деятельность DeFi невозможна. При снятии средств потребуется более длительное время, возможно перебои и проблемы. Также нужно, чтобы кто-то контролировал сеть, проверял безопасность средств и хранил данные.

Примеры решений Plasma – протоколы OMG и Polygon (SDK Polygon также настроен поддерживает ZK rollups, optimistic rollups и автономные сети).

Sidechains

Сайдчейны работают отдельно от основного блокчейна и действуют независимо, используя собственный алгоритм консенсуса. Они подключаются к Ethereum через двусторонний мост (кроссчейн). Сайдчейны совместимы с Ethereum Virtual Machine, но имеют ограничения: они менее децентрализованы, чем основная сеть. 

Кроме того, алгоритм консенсуса не регулируется Layer 1, и валидаторы сайдчейна могут скоординировать свои действия для преступных целей.

Примеры сайдчейнов xDAI и Skale.

Rollups

Rollups perform Layer 2 transactions and send data to the underlying blockchain. This means they get a layer of security from Ethereum, but can perform transactions outside of it.

There are two types of roll-ups. The first one is ZK (zero knowledge), which combines multiple transfers into a single transaction. The second type is optimistic rollups, which work in parallel with Ethereum.

ZK rollups group transactions and take some of the computation outside of the main blockchain. For proof and consistency with the underlying blockchain, they create what is known as a succinct non-interactive argument of knowledge (SNARK). This is a cryptographic proof that is sent to the underlying layer, and only one transaction is actually sent to Ethereum. ZK rollups allow fast transactions, but the volume of these transactions is limited.

Meanwhile, optimistic rollups deploy smart contracts that already exist in Ethereum. In this way, optimistic rollups enable integration, a major requirement of DeFi. But there is a disadvantage: such rollups are more vulnerable to attacks and require more time per transaction.

Validium

Validium is similar to ZK rollup technology in that it uses zero-disclosure evidence. But the data is stored offline. This gives up to 10,000 transactions per second with no delays in withdrawals and less risk of attack;

But there is a disadvantage - not all kinds of smart contracts can be run in Validium.

Examples of Validium solutions are StarkWare and DeversiFi.

#blockchains #layer-1 #layer-2