Scalability
To effectively compete with traditional data and finance systems, blockchain needs to be scalable. Currently, Visa claims to have the capability of processing over 65,000 transactions per second (TPS). Ethereum currently processes a measly 15 TPS, while Bitcoin only performs 7 TPS. This is what makes the fees on these networks so high - when the network is congested, fees spike to reduce demand and therefore keep the amount of transactions at a minimum.
How can blockchain solutions be scaled effectively to compete with corporate systems processing tens of thousands of transactions per second?
Networks such as Bitcoin, Ethereum, Avalanche, Binance Smart Chain, and Solana are called Layer Ones (L1s). They are called L1s because they serve as the infrastructure layer for decentralized systems. L1s operate through consensus mechanisms (Proof of Work, Proof of Stake, etc.) and as a result of their decentralization, they are considered to be the most secure layer. They are responsible from preventing attacks on the network, as well as for settling all transactions that occur.
Because of their security, most these chains tend to be limited in their TPS rate. As a result, a new solution was introduced:
Layer 2 blockchains
A Layer Two (L2) blockchain is a network that is literally built on top of a L1 network for the purpose of scalability. L2s operate by bundling incoming transactions and then sending all of them as a single transaction to the L1 for settlement. This system drastically reduces settlement time for transactions, as well as the cost of processing them; while transactions on Ethereum (an L1 blockchain) average around $10-$20 during peak times and can take several minutes to settle, transactions on Base (an L2 built on top of Ethereum) average fees of <$0.01 data-preserve-html-node="true" and settle nearly instantly.
L2s operate on a variety of different scaling solutions, but there are three main systems that make up a majority of the L2s in the crypto ecosystem:
Side Chains, Optimistic Rollups, and Zero-Knowledge Rollups.
Side Chains
Side chains are blockchains that essentially run in parallel to L1s. These chains have their own consensus mechanisms (usually Proof of Stake) that let them process and confirm all transactions that occur on the chain before sending them to an L1 to be permanently settled.
The Polygon network is an example of an L2 that runs on a side chain. It utilizes this system by having its own side chain that is responsible for processing all transactions that occur on the network and then periodically sending them as a single transaction to the Ethereum network for settlement. As a result, Polygon can, theoretically, process up to 65,000 TPS, with each transaction costing pennies.
Even though Polygon is built on top of Ethereum, it still operates entirely as its own blockchain network with its own gas token, MATIC. All transactions that occur on the chain are paid for in this token and not in ETH. Polygon simply leverages the security and decentralization of the Ethereum network to settle transactions while providing a scalable environment. The result of this system is that Polygon has much cheaper transactions and a faster settlement time than Ethereum.
Source: IQ.wiki
Check out this article by Coin Telegraph for a beginners guide to the Polygon ecosystem and its token MATIC.
Optimistic Rollups
Source: Etherscan
Optimistic Rollups operate by bundling transactions together and sending them directly to a L1 for validation and settlement. Unlike side chains, these systems do not have their own consensus mechanism to verify transactions. Instead, they operate by assuming that all transactions are correct.
Optimistic rollups follow these steps to settle transactions on the L1:
- Once a block is full, all transactions are submitted in a compressed format (to take up less data) to the L1 chain.
- The L1 validators then have a challenge period to look through the new block and submit fraud proofs, or proof of invalid transactions.
- If the sequencer that is responsible for bundling transactions and sending them to the L1 submits an invalid transaction, then it gets penalized.
- If no invalid transactions are found, then the block is settled on the L1.
This system of penalizing the sequencer creates a secure method of sending transactions to a L1 because it disincentivizes the sequencer to submit fake transactions at the risk of losing money.
Zero Knowledge (ZK) Rollups operate similarly to Optimistic Rollups with one key difference: they can prove a transaction to be accurate without revealing any of the data inside it.
ZK Rollups use a tool called a Zero-Knowledge (ZK) Proof that uses advanced cryptography to verify that a transaction is legitimate without referencing any of the data that the transaction holds. This lets the validator prove that a transaction is valid without revealing any of the data actually stored within that transaction, making it ideal for maintaining a private network for sensitive data.
Similar to Optimistic rollups, ZK rollups have a block sequencer that collects all the transactions that occur on the chain, but instead of sending the block directly to the L1 to be verified, it creates a cryptographic proof that verifies all the transactions within that block to be valid and then sends the block to the L1.
Optimism, aptly named for its use of optimistic rollups, is a popular L2 built on top of Ethereum. The Optimism sequencer is responsible for collecting all the transactions that occur on the chain and sending them to Ethereum to be validated and settled. This image illustrates the blocks being sent from Optimism to Ethereum, where each transaction listed represents a block full of transactions being delivered. The blocks are sent as Binary Large Objects (blobs), which is a compressed data format that is able to attach data directly to a block.
For a more detailed look into how Optimism works, check out the Optimism Docs.
Check out the address of the Optimism batch inbox on Etherscan
Zero Knowledge (ZK) Rollups
Source: ZKSync
ZKsync is an ecosystem built on top of Ethereum that utilizes ZK rollups to create scalable blockchains with faster and cheaper transactions. This image represents the lifecycle of transactions that go through ZKsync:
- Users submit their transactions to the ZKsync sequencer, which creates the blocks on the L2
- The sequencer sends the block to a Prover, which creates the ZK Proof that verifies the transactions in the block are correct
- The Proof is then sent to the L1 (Ethereum), where a smart contract verifies it to be correct
- Once the proof is verified, the block is settled on the L1
Check out the ZKsync documentation to learn the technical details of this process and how Zero Knowledge Rollups work.
💡 What about the other layers?
While L1 and L2 are the most common layers, L3s have begun to arise as well. L3s are built on top of L2s and are generally referred to as App Chains. These app chains are generally built to be more specialized and customizable chains to be utilized for specific ecosystems. App chains today are mainly being developed to host on-chain games, as well as some DeFi applications.
L0s are the base of the entire blockchain world. They provide the base infrastructure for L1s and are also what make inter-blockchain communication possible. You can’t directly interact with a L0, only the L1 chains built on top of it.
What are some more advanced scaling mechanisms?
While L2s offer a great solution to the scalability issue, developers are looking to scale L1s directly in order to get their increased security. One solution that arose is the idea of Sharding.
Sharding consists of breaking up a blockchain into smaller groups called shards which would work in parallel to process transactions. Each shard would essentially operate as its own chain with its own validators and block sequencer for processing incoming transactions. The shards communicate with one another, and a main shard would monitor the network and maintain integrity.
Through sharding, a blockchain would be able to process incoming transactions in parallel to one another. Instead of all the nodes operating the network having to verify one block at a time, all the shards would verify blocks side by side. This will drastically increase the amount of transactions per second the network is capable of handling.
Source: Blockchain Lab
The Ethereum network currently has over 900,000 node operators contributing to the network through its Proof of Stake system. If it were to integrate a traditional sharding system, this upgrade would split up the node operators into 64 separate shards, where each shard will have about 14,000 node operators. This process would increase the TPS rate of the network by 64 times, since all 64 shards will be processing transactions in parallel to one another, bringing it from 15 TPS to 960 TPS.
How can Sharding become even more efficient?
While 960 TPS is a lot better than 15 TPS, it’s still not nearly high enough to compete with the likes of Visa or Solana. Furthermore, sharding results in a lot of complications for the chain, including:
- Non-uniform gas fees: if each shard on the network has its own sequencers and validators, they could operate at different speeds and as a result, have differences in fee amounts. This can lead to users utilizing one shard more than the others, creating an imbalance and bringing the TPS rate back down.
- Communication issues: there would be a significant increase in the complexity of the chain, where multiple independent groups of validators would have to agree on the state of the chain. Instead of one large group of validators working together to process transactions, having multiple smaller groups can create disagreement about the correct state of the chain.
As a result, Ethereum developers came up with a solution that could scale the network to process hundreds of thousands of transactions per second: Danksharding.
Danksharding eliminates the traditional sharding mechanism of literally splitting up the network into multiple parts. Instead, it focuses on data-sharding, where the network splits up data from each block into shards to process that data at a significantly faster rate.
Danksharding works by utilizing the previously mentioned Binary Large Objects (blobs) to randomly sample transaction data. Whenever a new block full of transactions is submitted, multiple blobs (up to 64) will be attached to each block produced on the network, and all the transaction data will be saved onto them. Each validator will then sample small parts of each blob to verify the data it holds is correct. Since the validators don’t have to check every single transaction coming in and instead are only sampling a small amount of data, they will operate much faster and therefore create a higher TPS rate for the network.
Here is a step by step breakdown of how Danksharding on Ethereum will work:
- Incoming transactions will be bundled into rollups, with each rollup storing all of the associated data from these transactions within blobs attached to the rollup.
- New blocks will consist of multiple rollups, therefore exponentially increasing the amount of transactions able to be stored per block. Each new block will have up to 64 attached blobs, all of which contain the associated data of the transactions that need to be verified.
- The validators will all sample random parts of each blob to verify that all transactions are valid. Once the validators verify the data from the blobs to be accurate, the new block is added onto the blockchain.
Source: DCFT (all 3 diagrams)
This system also solves the problem of storing additional transactional data through a very simple solution: deleting the blobs.
The blob data is only required to verify the incoming transactions are valid. After all of the transactions are settled, the blob that stores all of the extra data will be deleted after a certain period of time, which will free up space on the network.
💡 Proto-Danksharding
While the ultimate goal of the Ethereum network is to reach a full Danksharding state, there are tons of adjustments that need to be made in order to prep the network for this upgrade. One of the biggest ones that was implemented in early 2024 was Proto-Danksharding. This upgrade, also known as EIP-4844, is what introduced the idea of storing rollup data in blobs.
L2s on top of Ethereum are now able to send transaction data to Ethereum by storing it in blobs. However, each block can currently only hold up to 6 blobs, not 64 as envisioning in the danksharding system. Rollup-based L2s such as Optimism currently use this system to verify transactions, which serves as a way to test the reliability of blobs before fully integrating them into the Ethereum network.
For further reading and more technical details, check out the Danksharding page on the Ethereum website that goes into much deeper detail about how this system works.
📋 Practice Question