Layer-1 vs Layer-2: Understanding the blockchain's trilemma

Festus Authority
7 min readJul 13, 2022

Since the inception of Bitcoin in 2008, the finance sector has gone through rapid growth with the implementation of blockchain technology to eliminate third parties, stressful protocols, and delayed transactions. The adoption of this technology has grown rapidly wide with statistics showing millions of increases since its inception. This growth has a large effect on blockchain's scalability. In this article, we shall be studying blockchain and the solution to its scalability

What is the blockchain?

Blockchain uses a distributed ledger technology that is, it has its data/transaction distributed over various computers referred to as nodes and uses a peer-to-peer form of network to reach consensus. For short, a blockchain is a digital chain that has its data stored in blocks. Each block of the chain is updated with data from the previous blocks making the blockchain data immutable. Blockchain innovation brought decentralization and a trustless looppolicy. A form of mechanism where third parties or intermediaries are exempted.

The primary invention of bitcoin's blockchain is to create a successful digital currency that is secured, trustless, decentralized, and can't be double-spent. Another unique feature of the blockchain is that transactions can be tracked publicly. Any random person can get access to the blockchain's transaction record thereby making it transparent. The blockchain solidly powers the cryptocurrencies we have today.

Adopting a sort of mechanism that involves money without going through scrutinized protocols to ensure the security of the money might be considered risky. But, the blockchain has kept this card in check by gaining users' trust with a trust-less policy. Before a transaction is recorded on the block, the blockchain ensures a consensus is reached, that is there is an agreement on the validation of the record.

Consensus mechanism

The consensus mechanism of a blockchain is vital to its mode of operation. There are various mechanisms used in the crypto world but two have proved to be sovereign over others. We have the PoW which stands for Proof of Work and the PoS which stands for proof of stake. These mechanisms work in different ways to validate a transaction. Let's dig in full.

How does PoW work

Bitcoin brought PoW into the limelight as it uses the mechanism to sustain its decentralized and trustless policy. The PoW is just one out of every other validation process out there.

So, as the name implies PoW simply means validators do "work" and get rewarded. For Bitcoin, miners compete against each other by solving complex cryptographic calculations and the winner gets rewarded with a bitcoin.

Though easier said than done, the miners use an advanced computer system that requires a lot of energy to power. These computer systems are the nodes to confirm transactions on the blockchain. Each transaction behind the scene is the cryptographic calculation to be solved, the solution is called a hash.

The higher the computational power, the higher the tendency of getting the calculations solved faster. To prevent double spending, when a node solves a particular calculation, it notifies other nodes to confirm and move on with the next block.

How does a PoS work

Proof of stake is another mechanism to reach consensus in the blockchain. As compared to PoW, it does not require high-end computation before it would validate or verify transactions instead, it uses tokens.

Anyone who wants to become a validator stakes a certain amount of cryptocurrency as required by the protocol, then the mechanism selects at random the node to validate the transaction.

In the case of Ethereum 2.0, to become a validator you must have staked up to 32ETH. The transaction is verified by a certain number of nodes making sure it conforms to the protocol before it is added to the block.

Now, the probability that a certain node would be chosen is dawn on the number of coins staked. Also, PoS allows users with lesser coins to join staking pools owned by nodes.

Blockchain Trilemma

The blockchain is becoming a backbone tool for various sectors including financial, medical, sports, entertainment, e.t.c. when building Blockchains, developers are faced with 3 issues which are security, decentralization, and scalability- referred to as the blockchain trilemma.

The blockchain trilemma is a word coined by Vitalik Buterin the Ethereum co-founder, to describe the three issues faced by developers when building blockchains thereby making them sacrifice one for the other two.

The blockchain trilemma is decentralization, security, and scalability. These three features are believed to be solidly unachievable at once making one a trade-off for the other two.

courtesy: Blockchain Tricker

Blockchain's Decentralization

The blockchain offers a decentralized network in the sense that, centralized authorities or third parties decision-makers are eliminated.

The technology runs on smart contracts which are self-executing algorithms. Smart contracts run when the requirements for certain decisions are met. The blockchain in the finance sector made Defi. Which makes users enjoy traditional finance/banking benefits without going through rigorous traditional procedures.

Blockchain's security

A fact in blockchain and security is a 51% compromise attack will give a hacker opportunity to double spend.

Double-spending is a threat to blockchain security if measures are not put in place. Just like in the example of the bitcoin and Ethereum hard forks where hackers were able to launch the 51% control attack and were successful due to the minimal hash power they have compared to the native blockchain.

Bitcoin and Ethereum are known as well secured blockchains because no proof of a successful 51% attack. It is more profitable to mine bitcoin than to launch the attack because of the vast amount of hashing power on the network which makes it cost-effective.

Blockchain's Scalability

Scalability in blockchain means the ability to perform thousands of transactions per second without affecting the other two features of the blockchain. This means as adoption increases with the blockchain, efficiency in transactions is either maintained or increased without affecting the other two cores of the blockchain.

Efficiency in scalability has been a toothache in the crypto space as projects have established solid decentralization and security protocol. This has led to applying the industry's layer-1 and layer-2 solutions.

Layer1 network

The layer-1 network is the same as the main blockchain architecture. The layer-1 network serves as a building block for other protocols, networks or blockchains to be built upon it. The bitcoin, Ethereum, and bnb are all tokens of the layer 1 blockchain. That's, they are the native tokens to the base blockchain network. These tokens interact directly with the blockchain's protocol to run transactions such as gas fees or executing smart contracts.

Layer-1 solutions for scalability

The layer-1 solutions for scalability have been implemented by some token blockchains already while some are still in the process of implementation. The solutions are listed below:

Changing the consensus mechanism

The consensus mechanism for bitcoin and Ethereum is PoW which requires high computation power to mine. The PoW allows bitcoin to process 7 transactions per second which are relatively slow to adoption is getting.

A solution to this is seen in the proposed Ethereum upgrade to its Ethereum 2.0 using PoS as an alternative to the PoW mining system. This is to improve the throughput for transactions without reducing its efficiency of decentralization and security.

Sharding

This is another layer-1 solution to increase throughput. It works by breaking transactions into shards. It's a form of database partitioning whereby information is split between different nodes of the network with consistent updates, the shards provide proof of the transaction to the main network.

Tezos, Zilliqa, and Quantum blockchain use shards to increase their transaction throughput.

Layer-2 network

A blockchain is referred to as a layer-2 if its protocol is built on another blockchain. Layer-2 is effectively built to be the solution to the blockchain's scalability issues. A popular example is bitcoin's lightning network which was created to increase its TPS.

Layer-2 solutions for scalability

Sidechains

These are distinct from the main blockchain though connected with a two-way bridge. Sidechains independently perform their transactions using an alternative consensus mechanism that is, they own validating nodes to reach consensus and not by relying on the main blockchain. Sidechains another advantage is the increase in throughput and low gas fees which are achieved due to the block parameters they use.

In relative to solving the blockchain's trilemma, sidechains sacrifice decentralization and security for scalability. This simply means each sidechain is responsible for its security thereby posing a threat to the system as a whole.

Statechannels

Statechannels are two-way communication channel that only records the final state of the transaction on the blockchain. Statechannels make use of the on-chain and off-chain processes. It uses the off-chain to facilitate throughput and enhance scalability. The consensus algorithm makes use of smart contracts or multi-signature rather than validating nodes. Just like sidechains, statechannels sacrifices decentralization and security as tradeoffs to achieve a speedy and higher transaction rate.

Conclusion

The blockchain's trilemma is being solved using different approaches as explained above with effort seen from different blockchain companies to effectively build a structure that its throughput would be better than the traditional payment system- such as VISA which handles a transaction of 24,000 per second. In this quest, the blockchain is still growing big with more scalability options to make it more effective.

--

--