What is a Layer-1 blockchain?
Everything you need to know about Layer-1 blockchains and why they can’t match the speeds of centralized payment systems.
By Mrig P
You can’t buy your morning coffee with cryptocurrencies since it can take anywhere from 15 seconds to a few minutes for the blockchain to process your transaction.
But why? To understand why blockchain transactions are so slow, you’ll need to know what a Layer-1 blockchain is and how its architecture limits its transaction processing speed.
This article explains what Layer-1 blockchains are and explores innovations that are helping to make them faster and more cost-effective.
What is a Layer-1 blockchain?
A Layer-1 blockchain is the base level of the blockchain architecture.
Layer-1 blockchains validate and execute transactions without support from another network, and reimburses transaction fees with cryptocurrencies.
For example, Ethereum runs transactions without depending on an external system and has its own native cryptocurrency, Ether.
Blockchains aren’t big on scalability.
While centralized payment systems like Visa process at least 1700 Transactions Per Second (TPS), Bitcoin and Ethereum are capped at 4.6 and 15 TPS respectively.
Blockchains need to access the system’s entire database to verify a transaction and add a new block.
The process is computationally intensive, limiting processing speeds to just a few transactions per second.
Vitalik Buterin, the co-founder of Ethereum, was the first to define this problem, also known as the blockchain trilemma.
Every blockchain network needs to have three properties:
Decentralization: The chain runs without depending on centralized actors. In other words, no organization or government runs it, and a distributed network of computers (nodes) manages everything.
Security: The chain can resist an attack from at least 51% of the participating nodes.
Scalability: The chain can support an increasing load of transactions.
According to the trilemma, you can only have two of the three properties at a given time.
Different approaches to solve the blockchain trilemma
Since the blockchain trilemma was first introduced, numerous measures were proposed to address it.
Some measures like Segregated Witness (SegWit) are simple soft forks where only the code changes and users continue using the same blockchain.
But others like consensus mechanism changes may cause a hard fork that splits chains and impacts the value of your cryptocurrencies.
In short, each method comes with trade-offs but both improve scalability to a great extent.
Change the consensus mechanism
In blockchain parlance, “consensus” is reached when a majority of the blocks agree on the state of the network. For example, if a network is processing a transaction, at least 51% of nodes should decide that it’s valid to execute it and add it as a block to the chain.
Theoretically, if hackers want to modify this transaction, they’ll have to attack 51% of the system to change the consensus.
Consensus mechanisms or consensus protocols ensure that the “51% attack” doesn’t occur and compromise the system.
Bitcoin’s Proof of Work (PoW) mechanism is one such example. PoW is done by miners who compete against each other to solve complex puzzles and earn BTC by adding new transaction blocks to the blockchain.
This mechanism is secure because it incentivizes users to contribute to the network, but it’s also computationally intensive and limits scalability. This is why Ethereum has opted to move to a Proof of Stake (PoS) model in which a validator is chosen randomly to create new blocks.
Such changes in consensus mechanisms can help solve some of the issues around the blockchain trilemma, but it’s still not ideal as new consensus mechanisms take years of research to develop.
Increase the block size
Since the scalability issue occurs because the block isn’t large enough to process transactions, increasing its size seems like an obvious solution.
But contrary to what one might think, increasing the block size (B) won’t solve the problem as there are other crucial factors called relay time (TR) and block generation time (TB) involved in the process.
TR is the time needed to broadcast a new block to every node on the network, while TB is the time needed to generate a new block.
Let’s imagine B is hard-coded at 1 MB. If we double its size to 2MB, it would also increase the time each node takes to download the block, which doubles TR time and places a lower limit on TB.
Here’s a hypothetical example that uses the Bitcoin network:
As of January 2021, the Bitcoin network has about 10,000 nodes, and the average time it took to update 99% of the network about a new block, TR99, was about 14 seconds.
Increasing B would push this value to 28 seconds and limit TB to 28 seconds.
If the time taken to generate a block falls below this value, a new block will be generated before all the nodes in the system receive the previous block.
This will lead to security vulnerabilities like double-spend attacks. Here, the same currency is spent twice on different transactions as the user made another transaction before the network was updated.
Currently, the Bitcoin network’s TB is about 10 minutes, and bringing the TB to 28 seconds sounds like a win. But it still won’t be enough to match Visa’s 1700 transactions per second.
Segregated Witness (SegWit)
Before understanding what SegWit is, let’s examine why it was implemented.
All transactions that take place on the chain have three components: the sender (input), the digital signature (authentication), and the receiver (output.)
The digital signature plays an essential role in these transactions as it ties a person’s identity to the transaction.
If you signed a cheque to transfer funds to another person, you can’t deny the transfer as your signature proves you authorized it.
Although this verification method looks foolproof, there’s also room for malpractice. For instance, the attacker can change the transaction ID slightly to create a new transaction.
Since the sender can’t find the original transaction on the blockchain, the attacker can ask the sender to resend funds and keep the funds from the original transaction.
These attacks are called transaction malleability, and a SegWit was initially implemented to address this issue.
By doing so, it also accidentally addressed the scalability issue by increasing the block size in the chain.
How SegWit works
SegWit is a network upgrade that aims to separate transaction signatures from the main block so the latter can process more transactions.
This means the system now has two blocks: the main block, or legacy block, and the SegWit block.
These SegWit blocks move the digital signature and other “witness data” from the Legacy block and place them in an extended block.
Since the witness data takes up 65% of the transaction size, it frees up space for more transactions within the legacy block and improves TR.
As a result, attackers can’t change the transaction ID before the nodes verify the transaction.
The upgrade also improves the TPS, but the increase isn’t enough to solve the scalability issue. This is where a more efficient solution called sharding comes in.
What is Layer-1 sharding?
Layer-1 sharding splits a network into subsets called shards and assigns a set of transactions to each.
This way, the system processes multiple transactions simultaneously instead of a single transaction.
Suppose you have a network of 10,000 nodes and 100 blocks to verify. The network randomly assigns the first 100 nodes to verify the first block, the second 100 nodes to verify the second block, and so on.
When validators verify a block, they publish a signature attesting to the verification. Now, the remaining nodes only validate the 10,000 signatures, which takes less time than verifying the blocks.
Does sharding have the same security issues as a multi-chain ecosystem?
Sharding is more secure than a multi-chain ecosystem (a system with several interconnected blockchains).
In a multi-chain ecosystem, an attacker can wreak havoc even if they get control of 0.5% of the total stake (total assets locked in the system).
But with sharding, the attacker would have to get at least 30-40% of the stake to attack the system. Given the random sampling method it employs, it becomes virtually impossible for the hacker to concentrate their power on a single shard.
Also, if a shard gets a bad block, the system throws it out and the entire chain reorganizes itself to avoid it.
Suppose there are two contracts, A and B, and contract B misbehaves. The network will revert the transaction.
Thus, sharding provides better security than multi-chain ecosystems and is scalable.
Layer-1 vs. Layer-2
As we saw earlier, Layer-1 solutions must compromise security to significantly improve scalability.
This is where Layer-2 solutions come in.
These frameworks allow transactions to be processed off-chain (chains outside the main chain) so that the main chain only receives a summary of what’s been completed.
Although this slight modification doesn’t sound like much, it significantly reduces the load on the blockchain, thereby improving its scalability and gas fees.
The Lightning Network (LN) is a separate peer-to-peer (P2P) network built atop the Bitcoin blockchain. It has two functions:
Monitor the blockchain.
Interact with other lightning nodes to transfer money.
The LN only communicates the opening and closing transactions to the main chain. Intermediate transactions between two parties are stored in a private ledger.
For example, if Alice and Bob enter into a contract to transfer 5 BTC to Bob in five transactions of 1 BTC, the Lightning Network will only show the final state of the blockchain.
In other words, the records will only show the 5 BTC that Bob received in the end instead of showing the five transactions.
The best part is that the Lightning Network doesn’t incur any gas fees unless you route payments through multiple parties. It also allows for smaller transactions or micropayments as low as 0.00000001 BTC.
Layer-1 blockchain examples
Layer-1 blockchains aren’t just limited to Bitcoin and Ethereum. They include other blockchains that support many unique use cases.
Elrond is designed to compete against big players like Ethereum and Bitcoin by improving scalability and reducing computational waste. Its unique feature is its adaptive state sharding mechanism which improves scalability by combining three types of sharding, described in the following paragraphs:
Network sharding: Handles how nodes are grouped into shards.
Transaction sharding: Maps transactions to the shards.
State sharding: The shards only have a partial view of the state, so there's cross-shard communication during transactions.
The BNB chain includes the initial Binance Chain launched in 2019 and its upgraded version, the Binance Smart Chain , which was introduced in 2020.
When Binance launched in 2019, its primary focus was to replace the poor user interface of DEXs with an ultra-fast and decentralized trading option.
After a year's successful stint, the Binance Chain launched the Binance Smart Chain to compete with Ethereum and its functionality to host DApps.
The Binance Smart Chain runs in parallel with the Binance Chain and is compatible with Ethereum, so developers can migrate DApps without experiencing any difficulties.
Solana is touted as the first web-scale blockchain network that supports transaction speeds of up to 65,000 TPS with 200 nodes under testnet conditions (a testnet is an alternate blockchain used for testing).
Its core innovation is the Proof of History (PoH) mechanism. While other blockchains rely on other nodes to verify if a transaction occurred, Solana uses cryptographic timestamps to establish the order of events.
Think of it as adding a few drops of dye to water in a container and taking a picture at fixed intervals.
If the photographs were scrambled, you’d know how to rearrange these pictures as they’re a function of time.
Each node in Solana has a clock that allows the network to reach consensus on the time and order of events without waiting for confirmation from other nodes.
The nodes can therefore verify transactions without relying on other nodes, which reduces network congestion and improves scalability.
Although DEXs have become extremely popular, it’s still not possible to trade tokens across different blockchains.
For example, Bitcoiners can’t trade BTC on Ethereum, Ethereans can only trade ERC-20 tokens on Ethereum’s DEXs, and DEXs on Solana only support SOL tokens.
The list goes on. There are P2P exchanges like Bisq that allow you to exchange Bitcoin for other cryptocurrencies or fiat currencies, but these don’t have enough transaction volume to be called a mainstream solution.
THORchain is a cross-chain DEX that allows you to trade one digital asset with another digital asset on a separate chain.
It works similar to DEXs like Uniswap, but in addition to liquidity providers who deposit their tokens in pools and traders, the THORchain has another component called THORNodes (servers or cluster of servers.)
These THORNodes consist of a THORChain node and a node for each supported chain.
For example, if a user wants to swap ETH for BTC, the Ethereum nodes will detect and agree the ETH vault has received the ETH. Then, these nodes collectively sign the BTC transaction from the Bitcoin nodes to make the exchange.
Kava features a unique co-chain architecture that combines the interoperability of Cosmos SDK and the flexibility and speed of Ethereum smart contracts.
The result is a highly scalable and secure blockchain that connects to the 30 chains in the Cosmos ecosystem and an Ethereum-compatible environment that empowers developers to deploy apps on Cosmos and Ethereum.
Also, all transactions are ultra-fast and secure as they’re powered by the Tendermint’s consensus engine and its ability to achieve block finality which guarantees that a transaction can’t be altered.
The blockchain ecosystem has developed several Layer-1 and Layer-2 solutions to deal with the blockchain trilemma.
Most Layer-1 scaling solutions negatively impact blockchains by upsetting the balance between the other two factors, decentralization and security.
Layer-2 solutions, however, build atop an existing Layer-1 solution to improve its scalability while also retaining decentralization and security.
But while Layer-2 solutions are better in this regard, that doesn’t mean Layer-1 blockchains are obsolete. There are many promising Layer-1s that have solved scalability efficiently and made great strides in decentralized finance.
Use MoonPay to buy crypto
MoonPay makes it fast and easy to buy the cryptocurrencies mentioned in this article. Buy Bitcoin and over 40 different cryptocurrencies via MoonPay with your preferred payment method and have your cryptos sent directly to your external wallet.