WHAT ARE LAYER-1 (ON-CHAIN) SCALING SOLUTIONS?
The importance of scalability to blockchain technology can’t be over-flogged. Without solutions that enable blockchain and its applications (including cryptocurrency, Web 3.0, and the metaverse) to efficiently scale for billions of users, the blockchain will never reach its full potential.
What is A Layer-1 Blockchain?
Layer-1 blockchains are blockchain networks that can validate and finalize transactions without waiting for another network layer. Examples are Bitcoin, Ethereum, Binance Smart Chain (BSC), Solana, etc. If a transaction is initiated on any of these networks, it is finalized there without additional approval from any network.
What is a Layer-1 Solution?
The first layer-1 blockchains (Bitcoin and Ethereum) were poorly scaled. With increased usage, the network can become unstable. But, of course, we cannot abandon these major cryptocurrencies and their many applications. Hence, blockchain technologists developed some on-chain scalability solutions that make direct modifications to the blockchain to improve the network capacity of layer-1 blockchains; these solutions are called “Layer-1 solutions.”
Two prominent examples of Layer-1 (on-chain solutions) are Sharding and Segregated Witnesses.
What is Sharding?
Sharding is a computing technique that facilitates faster data processing via horizontal partitioning of a database.
In a typical blockchain, particularly the native Proof-of-Work blockchains like Bitcoin and Ethereum, all nodes verify all transactions before allowing a confirmation; this is done to prevent malicious transactions. It is believed that when each node verifies each transaction, the majority will reject malicious ones, and the blockchain will remain secure.
Indeed, the PoW blockchains achieved optimal decentralization and security; however, they failed to scale for a mass user base. As a result, sharding was implemented in the blockchain to partition the workload on the entire network so that each node can only verify transactions on its partition (shard).
For example, suppose a PoW blockchain network operates at 25 Transactions per Second (TPS), and it becomes partitioned into 4 shards. In that case, it can scale up to allow 100 TPS since all nodes across the shards work simultaneously.
Does Sharding Pose Security or Decentralization Risks?
Many blockchain experts are concerned about the potential risks sharding causes to a blockchain. The major worry is that attackers don’t have to target the entire network to carry out malicious intent; instead, they only need to attack a shard. This shows a decline in security, which could spell doom for blockchain participants.
However, Ethereum, one of the pioneers of blockchain sharding, set up its structure such that no node is permanently assigned to a shard. Hence, the frequent reshuffling of validating nodes across shards makes it difficult for attackers to attack a single shard since they have no prior information about the shard their corrupted node will be assigned to — It is entirely random.
Some other people worry about the level of decentralization on the blockchain. They opine that the entire network isn’t decentralized, and unlike typical PoW blockchains, decentralization is limited to each shard. However, sharding has proven to be largely decentralized since the blockchain partitioning only separates data processing; it doesn’t separate data access, i.e., all nodes in a shard can see the information of nodes in another shard, but they don’t process or store the information seen.
Some Blockchains that have adopted sharding include Ethereum 2.0, NEAR, Polkadot’s, and Shardeum.
What Are Segregated Witnesses (SEGWIT)?
While sharding was implemented on Ethereum and a few other blockchains, the Bitcoin network implemented a protocol update known as Segregated Witnesses (SEGWIT).
SEGWIT’s core purpose wasn’t for scalability but to counter transaction malleability in Bitcoin’s blockchain.
What is Transaction Malleability?
Transaction malleability is an attack that involves a person changing the Transaction ID (TX ID) before it is validated by the network.
How is this possible?
For example, suppose Mr. Elon wants to send 5BTC to Mr. Jeff; he opens his wallet, inputs Mr. Jeff’s wallet address, and sends 5BTC. As soon as the transaction is sent, Mr. Jeff (the malicious recipient) can instantly alter the TX ID to change a few details (the witness data).
Once changed, two transactions will be waiting to be confirmed in the mempool (the original transaction) and (the altered transaction). Regardless of which transaction is confirmed, 5 BTC will be sent to Mr. Jeff. However, if the miners validate the altered transaction first, the original transaction will fail (to prevent double-spending).
At this point, the Malicious Mr. Jeff will complain to Mr. Elon that he hasn’t received anything, and when Mr. Elon checks the transaction hash he sent, he will see a failed transaction. If Mr. Elon isn’t careful enough to investigate the issue, he will send another 5BTC to Mr. Jeff, and he will have been tricked into making the same payment twice.
How Does SEGWIT Stop Transaction Malleability?
SEGWIT’s solution to stopping transaction malleability is simple. First, the protocol update suggested that witness data should be removed from transaction data so malicious attackers like Mr. Jeff cannot trick people into making multiple transactions.
Since the Witness data is now separated from transaction data, allowing a block to hold more transaction data since the block size remains unchanged. Hence, the Bitcoin network can move from completing 3 TPS to 7 TPS.
As a result, SEGWIT kills two birds with a stone, stopping transaction malleability, and facilitating scalability.
Concerns About the SEGWIT Protocol
Indeed, the SEGWIT protocol makes the Bitcoin network faster by separating signature data (which can take up to 65% of block size) from the transaction data. However, it does not significantly make the Bitcoin network scalable enough to be used like traditional payment systems that can complete thousands of transactions in a few seconds.
Since the SEGWIT protocol update was only a soft fork, many network participants have refused to use it. They believe that it doesn’t efficiently solve the problem of scalability, and it reduces the fees miners earn. Hence, some Bitcoiners use the Segwit Bitcoin addresses, and others use the native addresses (Legacy).
As a soft fork protocol, SEGWIT is backward compatible, so transactions can move seamlessly between SEGWIT and Legacy addresses.
What Does The Future Hold For Layer-1 Blockchains
It is essential for blockchain developers to continually find solutions to the blockchain scalability problem, to facilitate mass adoption. This can be achieved explicitly by establishing newer consensus mechanisms that can scale for mass usage without compromising decentralization and security.
Solana is one such blockchain that was recently developed to achieve 50,000 TPS without relying on a Layer-2 solution. In addition, the blockchain’s Proof-of-History consensus mechanism allows rapid confirmation of transactions. However, that isn’t the end; the blockchain will continually develop to establish newer solutions that facilitate the mass adoption of cryptocurrency and blockchain technology into our world.
We hope that we have provided vital insights into Layer-1 scalability solutions. Check out our article that broadly explains why scalability is essential for the blockchain.