A blockchain is like an online notebook, where all the records of the transaction are stored safely and transparently without the involvement of any centralized authority.
Networks like ethereum, BNB chain, and bitcoin are known as Layer 1(L1), in which all the translation happens directly, but when more people do transactions it becomes slow and expensive.
To solve this Layer 2(L2) solution was introduced and added at the top of layer 1, to make it fast and cost effective for the transaction, while using the main network for security.
For example: ETHEREUM uses ARBITRUM as its Layer 2 solution.
In this guide we will break down what are L2 Blockchain rollups, why they are important, and how they work.
Layer 1 can only handle a few transactions at a time, when more people do transactions at the same time, this mostly happens during the launch of NFTs when more people use it together.
Due to this:
Transaction time become slow
Increase in fees
SOMETIMES EVEN A SMALL TRANSITION CAN COST MORE MONEY
All this happens because Ethereum is made to be secured and decentralized not to be super fast.
Now, to solve this, the developer created L2 on top of L1.
WHAT DOES LAYER 2 DO?
Layer 2 works on top of layer 1 to make the transaction faster and cheaper, and then to send the summary to Layer 1.
Rollups is the popular type of L2 solution used mostly on ethereum.
In simple words, instead of sending every transaction to ethereum, l2 makes a batch(group) of many transactions, and sends it to layer 1.
This process makes the network way faster and secure.
Let’s see the process step by step:
User sends transaction to Layer 2:- When user makes a transaction like sending crypto, swapping tokens, or minting the NFTs, all this goes to Layer 2 instead going directly to Layer 1, because Layer 2 is less crowded which make the transaction faster and cheaper.
A sequencer collects and orders transactions:- There is a special system known as sequencer, the main function of sequencer is to gather the remaining transactions and update them on Layer 2.
Transactions are grouped and compressed:- Instead of sending every transactions to layer 1 directly, the sequencer:
First, group hundreds or thousands of transactions into one single batch.
Secondly, compress the size of the batch so it takes less space and send it to Layer 1.
A summary (proof) is sent to Layer 1:- With the batch l2 also sends a state root and proof.
(State root is just the code that shows the data on the network)
(proof is term that shows the transactions are valid)
Layer 1 stores and secures the result:- Layer 1 stores the shared data and finalizes it, now the stored records can’t be changed in future because layer 1 is a blockchain and once the data is stored on the blockchain it is permanent and transparent to all.
THERE ARE TWO TYPES OF ROLLUPS:-
OPTIMISTIC ROLLUPS: Optimistic rollups, first assume that all the transaction that is shared by sequencer is correct without verifying to make the transaction faster and cheaper.
After the transaction is shared to Layer 1, optimistic roll ups offer 7 days, waiting period for check ups, anyone how wants to verify the transaction can cross check, and if transaction has some kind of error, they can submit that error as a fraud proof, and Layer 1 will verify it and fix the error.
And if no one raises any fraud proof or fails to verify the transaction in the given time, then the transaction is accepted and considered as a final by Layer 1.
ZK Rollups (Zero Knowledge Rollups): ZK Rollups is also a type of rollups in Layer 2 solutions.
ZK Rollups uses mathematical proofs to verify the transactions before sending it to Layer 1.
ZK Rollup generates the proof before submitting it to Layer 1.
Now, these transactions are grouped together and a summary with the proof is submitted to the main blockchain.
Layer 1 then quickly verifies the transaction with the proof and finalizes the transaction.
There is no waiting period in ZK Rollups which makes it faster than other rollups.
TYPES OF PROOF USED BY ZK ROLLUPS:
ZK ROLLUPS uses 2 kinds of different proof systems to show that the transactions are correct.
The two different proof systems are SNARKs and STARKs.
SNARKs (Used by zkSync): SNARKs (Succinct Non-interactive Arguments of Knowledge) is a type of proof used by ZK ROLLS to show the transactions are correct.
SNARKs can create small and fast proofs which make them faster and cheaper to verify them on Layer 1.
However, SNARKs require a trusted setup, which means there is an initial setup in a secure way, this step is to be done very carefully as the security depends upon this setup.
STARKs (Used by Starknet): STARKs (Scalable Transparent Arguments of Knowledge) is also the type of proof used by ZK Rolls to show if the transactions are correct.
STARKs can create larger proofs than SNARKs, however they take up more space, but STARKs are more scalable, they are designed to be secure even in future.
STARKs does not require any type of setup to function which makes this more transparent and secure from the start.
ZkSync is a layer 2 network that uses SNARKs proof and works very similar to ETHEREUM. It supports something called ZkEVM (Zero Knowledge Ethereum Virtual Machine), which means developers can use an already existing Ethereum tool to write smart contracts in Solidity with minimal changes. zkSync is also fast and cost efficient.
What is Starknet?
Starknet uses STARK proofs, is built for high Scalability and performance, unlike zkSync it has its own coding language “cairo”, which is designed only for Zk proofs. This language is harder to understand by the developers.
Scroll is layer 2 rollup, and works almost like ethereum. It is designed so developers can move their existing app to scroll without any big changes.
It focuses on being more decentralized, that is why it uses multiple systems instead of one.
LAYER 2 Risks you should know
Layer 2 solutions can make blockchain like ethereum faster but its not completely risk free, as most of the blockchain uses a single sequencer to process transactions, if the sequencer stops working all the transactions will pause and if it blocks the user, that user will not be able to use that network.
Layer 2 also depends on smart contract, if there is any bug or error in the smart contract funds could be at risk.
In optimistic proof if one verifies the transaction in the waiting period, then the wrong transaction will be accepted.
Layer 2 solutions are transforming the crypto ecosystem by making transactions faster, secure and transparent.
Layer 2 processes the transaction and compresses it and sends it back to Layer 1, which makes this process more efficient.
Rollups like optimistic and zk have their own strength and trade-off factors, but both rollups play crucial roles in developing the blockchain scalability.
Disclaimer
This blog is for educational and information purposes only and should not be considered as any financial advice.
Blockchain technology as well as layer 2 have their own risks like smart contract bugs, and market volatility.
Always do your own research before investing your money.
Sankalp Narwariya is a dedicated crypto content writer with one year of experience in the digital asset industry. He specializes in creating clear, engaging, and informative content that simplifies complex blockchain concepts for a wide audience. His work covers a range of topics, including cryptocurrency news, market trends, token analysis, and emerging Web3 projects. Sankalp focuses on delivering accurate and well-researched information, helping readers stay updated in the fast-moving crypto space. He has a keen interest in decentralized finance, NFTs, and innovative blockchain solutions, and consistently tracks industry developments to produce timely content. With a strong understanding of SEO practices, he ensures his articles are both reader-friendly and optimized for search visibility.