Blockchain trilemma was the biggest challenge of the older models of blockchain technology, forcing them to compromise between scalability, security and decentralization as these attributes are not compatible with each other at a time. Ethereum network was not left out of this as it has scalability as one of the major issues. This blockchain network has its gas price steadily increasing as the number of transactions and projects being built on it keeps increasing. To tackle this rising issue, scaling solutions like ZK-Rollup are being developed. Want to know more about this scaling solution? Keep reading.
What is Zk Rollup?
ZK-Rollup, Zero-Knowledge Rollup is a layer 2 scaling solution that offers off-chain storage. It is on the Ethereum main chain and works by removing off the blockchain, condensing it into one main transaction instead of different ones that leads the blockchain into clogging with a lot of data at a time.
ZK-Rollup is simply a protocol built on Ethereum mainnet to help solve its scaling issue.
What is the Ethereum scaling issue?
The Ethereum blockchain has grown very high in popularity with an average of 48,000 transactions on it per hour. Because this platform can only operate at a speed of 14 TPS (transaction per second), backlogs become inevitable and an issue.
The blockchain begins to have delays, and with delays comes extremely high gas fees. Why are gas fees high? The simple rule of economics for demand and supply.
Ethereum has been working, researching how to combat this issue and about 3 main solutions are presently adopted. They are the Layer 1 scaling solution- most common of them, Sidechains- blockchains that run parallel to mainnet, and Layer 2 scaling solutions- they are Rollups and newest of them.
Layer 2 scaling solution, Rollups are not just the newest but also considered the best at the moment, because they are more of a general purpose design than the layer 1 solutions that were application specific.
A Rollup is a scaling solution that moves transactions outside of the blockchain mainnet. It works by taking the huge work to another section; rolls up all the transactions and then registers them as one instead of lots of individual transactions. By simply doing this, transaction speed gets to 2000 TPS instead of 14 TPS on the traditional Ethereum.
There are two types of Rollups Zero-Knowledge and Optimistic but we are focusing on Zero-Knowledge Rollup, right?
Like we established, ZK-Rollup is called Zero-Knowledge because it takes the knowledge off the blockchain, compresses it into a single transaction and then sends a proof- SNARK (succinct non-interactive argument for knowledge)- back into the main blockchain for verification. This eliminates large data of different transaction knowledge that the blockchain has to deal with at a time, this increases speed and reduces transaction costs.
It is a layer 2 scaling solution because it comprises two layers, the moving of transactions off the mainnet is first layer solution and layer two is its movement into the secondary chain.
In taking some of the loads off Ethereum blockchain network, ZK-Rollup reduces the traffic on mainnet thereby lowering demand as backlogs of data is eliminated.
Some projects that use Zero-Knowledge technology are zkSync, zkSwap, Polygon, and Loopring.
Comparing ZK-Rollup and Optimistic Rollup
Optimistic Rollup technology as the name implies, sends data from layer 2 to layer 1 and assumes it is correct.
ZK-Rollup technology after rolling up hundreds of data into one, sends the batches of rolled up transaction data from layer 2 to layer 1 alongside a cryptographic proof- SNARK for each batch, layer 1 only accepts transactions after validating this proof.
Optimistic Rollups have lower fixed gas cost per batch as verification of SNARK in ZK-Rollup is more intensive.
Withdrawal time is very fast in ZK-Rollup compared to Optimistic Rollup because someone needs to publish a fraud proof first in Optimistic Rollup.
ZK-Rollup has way more complex technology because of SNARK.
Optimistic Rollup is generally easier as ZK-SNARK proving general purpose Ethereum Virtual Machine execution is much harder than proving simple computations.
Although Optimistic Rollup needs many full nodes to redo the computation, off-chain computation costs are still lower here than in ZK-Rollup.
Validating a block is way cheaper and quicker in ZK-Rollup.
The major difference between these two Rollups still remains in their use of different security models- Optimistic Rollup transactions are valid until proven false, while ZK-Rollup assumes its transactions false until proven valid.
- SNARK makes sure the off-chain transactions are correct, this way invalid state transitions are not executed.
- There is faster transaction finality.
- Security, censorship-resistant, and decentralization is guaranteed as only necessary data are stored on layer 1.
- There is better data compression which reduces Rollup fees.
- Does not depend on assumptions, therefore users do not have to validate the chain in order to protect their funds.
- Security reliance is on trustless cryptographic mechanisms.
- Funds are withdrawn without delay.
- Some proving systems require a trusted setup which could compromise a ZK-Rollup’s security model, if not handled well.
- Associated computing costs are substantial and can increase fees for Rollup users.
- ZK-Rollups are not usually compatible with EVM, building EVM-compatible ZK-rollups is difficult due to the complexity of zero-knowledge technology.
- Lots of hardware requirements.
- Centralized operators, Sequencers can influence the ordering of transactions.
ZK-Rollup in a Nutshell
ZK-Rollup uses ZK proofs by combining plenty of off-chain transactions into one transaction, which then gets sent to the mainnet. Instead of sending hundreds of transactions individually, it is just rolled up and sent as one.
ZK proof, ZKP, is basically a way to prove that you know something without exactly showing what you know. It is being able to prove you have a solution, by showing a proof without showing the actual answer. Then with zero knowledge of this actual answer, everyone can confidently agree.
With this proof of knowledge, ZK-Rollup gets to confirm transactions faster and makes the system more scalable.
There are various ZK-Rollup scaling solutions that are available for you to explore and build with like StarkNet, ZKSync, and Mina Protocol.