Topics In Demand
Notification
New

No notification found.

How to scale your dApp with the power of zkRollups?
How to scale your dApp with the power of zkRollups?

December 27, 2023

23

0

 

Leveling blockchains as  the next big technology revolution with the innate capability of adding trust, transparency  and security for enterprise applications wouldn’t be an understatement. But to make this possible, we may need to come out of the monolithic architecture of blockchains and create separate layers for execution, data availability and consensus for some of the applications, matching the privacy and scalability demands of production-grade dApps, without losing the security and cost efficiency. 

Zk-Roll Ups can help us achieve this. . In this article, we shall dive deep to understand Zk-Rollups that use both Zero-knowledge and Rollups technology to help scale Decentralized applications.  

What are Zero Knowledge Roll-Ups?

Zero Knowledge roll-ups introduce a noble solution where the base layer or L1’s need not have to compute transactions in entirety. On the contrary, they can push them on the L2’s, where the required computations can be executed and supporting proofs can be published on the L1 layers as call-data for verification through off-chain VMs. In this way, instead of the L1s choking because of extensive network usage, they can ease the network activity to host a whole new lot of use-cases on top of their ecosystem. 

Benefits of Zero Knowledge Roll-ups for dApps

Low Gas Cost: Since ZKPs post very minimal data to validate a transaction, they occupy very less space on the block. As a result, instead of just a few transcations fitting in a block space, ZKPs accommodate more transcations in the space. Hence, lowering the gas fees by a significant margin. 

Higher Throughput: ZKPs allow the blockchain structure to break into layers as a standalone computation ecosystem. Owing to such a remarkable solution, they completely ease the base layer congestion by only allowing the necessary information to be validated on-chain, while the remaining of the computations can be moved to the L2 layer. 

Privacy: ZKPs ensure privacy by providing only the necessary proof of information instead of providing the complete information. In this way, the user can be sure of protecting their privacy while using the ZKP systems. 

Security: Rollups are much more secure because they inherit the validator security of the underlying base chain. The most important aspect is, users can always bring their assets back to the Layer1 if they are not convinced with the L2 security. 

Faster Transaction finality: zkRollups has faster transaction finality. As soon as the proofs are sent to the base chain,  the state is immediately updated. But it may take some time to accumulate a batch of transactions before they are submitted to L1. Though the zkRollups sequencers give soft confirmations on the transaction status on L2, and that can be useful for many user applications. 

How Do Zk-Rollups Work?

When a transaction is submitted to a zkRollup, it basically goes to the sequencers, the nodes that are in-charge of ordering the transactions, executing them, batching them together and then submitting to the L1 contract. Though most of the sequencers are centralized at the moment, there are works going on where shared sequencers and direct decentralized sequences could be used in a modular setup.

Anyways, so the work of zkRollups are then, lowering the transaction size from every separate data representing one transaction to a bundled-up transactions rolled into batches with a verifiable Merkle Tree hash-proofs to be posted as validity proofs. .

As you can see from the image, a group of transcations are bundled as one and pushed to the L2’s. The L2’s, which is the ZKP environment, computes the transcations and provide a validity proof to be posted on L1. 

On the L1, there is a smart contract that maintains the rollup state. 

Types of ZK Rollups

Zk-Snark 

ZK-SNARK or also known as Zero-Knowledge Succinct Non-interactive Argument of Knowledge enables applications to scale in significant proportion  in comparison to L1s because they move the computation off-chain and post very little data. 

As a result, they have the capability of reducing the blockchain size in an unprecedented manner. MINA protocol has already been using the SNARK protocols which has reduced the size of its blockchains from GBs to KBs because SNARKs perform computation off-chain and only post minimal information on the  mainchain as validity proofs. 

Zk-STARKs

Zk-STARKs or  Zero-Knowledge Scalable Transparent Argument of Knowledge uses a single off-chain STARK verifier for data  and an on-chain STARK proving system makes them not depend on a trusted set-up but the process of the verification is long enough to make them more gas- intensive in comparison to SNARKS. Along with this, SNARKs came much earlier than STARKs which give them an adoption age over SNARKs. 

So, despite the efficacy they bring with respect to scaling Dapps with very little security threats, STARKs have a long way to go until they do everything that SNARKS do with the same cost efficiency but less dependency on a trusted set-up. Such a technology innovation could help STARKs win an edge over SNARKs in adoption in the age of the ZKPs. 

PLONKs 

PLONK or Permutations over Lagrange-based for Oecumenical Non Interactive arguments of Knowledge could be summed as a perfect fusion of both ZK-Snark and Zk-Starks inheriting their advantages and building on top of their drawbacks. For example, unlike SNARKs that require a trusted set-up, PLONKs need a universal, upgradable trusted set-up that can be changed as per the use-cases of the project. So, it would not simply put a cap on the verifiers to be of a certain proportion; rather, they can join the system and validate based on the project requirements without other verifiers having any knowledge of the same. 

The LagRange based permutation combinations which boast fancy cryptography using Polynomial commitments will make PLONKs even Quantum Resistant using the Lattice Based Cryptography. How’d that happen? The Kate Commitments which use a trusted Setup and Elliptic Curve Pairings would demand the compromise of the system through a public based information as evident through a secret message. But since Lattices will be in place, it makes the system completely resilient to sabotage or compromise through a joint nexus of verifiers. 

Difference Between Different Zk-Rollup Solutions: A TL,DR

Basis  SNARK  STARK  PLONK 
Algorithmic Complexity  O{(N*Log (N)} O(N * poly-log(N)) O(μ log d
Communication Complexity Size  ~O(1) O(poly-log(N)) O(µ)
Size Estimate 1 TX Tx: 200 bytes, Kev: 50 MB 45 KB  Less than 10kb
EVM Verification Gas Cost  ~600k (Groth16) ~2.5M (estimate, no impl.) 1 million To The Cost of ETH Gas Cost 
Trusted Setup  Yes No Hybrid 
Post Quantum Secure  No Yes Yes
Crypto Assumptions  Strong  Collision Resistant hashes  Group of Unknown Order 

Implementing Zk-Rollup solutions for Scaling Dapps 

While integrating the ZK-rollup solution in your application architecture, you need to be mindful of compatibility, low cost intensive proof systems but it is equally important to acknowledge some drawbacks nonetheless. In this regard, a few ZK-Roll Up solutions have left their trails; 

Zk-Sync Era 

ZK-Sync Era developed by Matter LABS as an EVM compatible roll-up solution prioritizes data availability by posting only minimal information on-chain. As a result, it could compress data by a significant proportion to take down the transaction cost; meanwhile increase the TPS by leaps and bounds. At the time of writing, ZK Sync Era became the first ZkEVM to hit mainnet which has already hosted the NFT project named ZkApes. In the upcoming days, we might also see TOFU going live on Zk-Sync Era. 

zkSync Hyperchains 

In the world of Dapps, walled gardens might allow you to have full control over your sovereignty but it doesn’t guarantee one unified system for all. That’s why the need of the hour is to provide a better stack based infrastructure that can give you the trade off of decentralization while ensuring scalability and security. Hyperchains, as a ZkSync powered ecosystem has  achieved that for the world of dapps. Through the use of hyper chains, Dapps  can enjoy the same scalability experience similar to the Internet despite using decentralized networks..  

You can think of your own application like Uniswap launching its own sequencers and tech infra using the Hyper Chains to scale its ecosystem. The technology stack has been designed in such a way that it can introduce recursive scaling which shall batch transactions in ZKPs and these transcations  will be further batched into a single proof to ensure even greater compression and scalability.   

Polygon ZkEVM 

Polygon ZkEVMs allow Dapps to create optimized Ethereum instances through a recursive STARK based tech infrastructure which amplifies decentralization, flexibility, scalability and even interoperability. In addition to this, Polygon ZkEVM also introduces EVM Equivalence ecosystem which allows multiple Dapps to interoperate among each other without compromising the scalability and liquidity. While the Zk Proofs have enabled transaction validity, the use of ETH as the base L1 layer guarantees security that dapps need for adoption and scalability happening in tandem. 

Polygon CDK

Polygon CDK provides scalability, robust data availability, LXLY bridges and unified liquidity to supercharge your Dapps. Building on top of the Polygon CDK could help you optimize your project as per the user-centric approach that can determine its success . Polygon CDK also boasts a DAC which could be pivotal for scaling your DAPPs because developers will get the flexibility to choose the Validium framework that can complement their Dapp needs. As a result, applications built on top of the Polygon CDK experience the same impact as L1s or separate chains but with a trade off of experiencing a near infinite scalability because they can break the execution layer, settlement layer and data availability layer as per the use case requirement. Hence allowing business logic customization as per the evolution of the project. 

 

About The Author 

Author

Dr. Ravi Chamria is co-founder CEO of Zeeve Inc, an Enterprise Blockchain company. He has an experience of 18+ years in IT consulting spanning across Fintech, InsureTech, Supply Chain and eCommerce. He is an executive MBA from IIM, Lucknow and a prolific speaker on emerging technologies like Blockchain, IoT and AI/ML.

Passionate About: Blockchain, Supply Chain Management, Digital Lending, Digital Payments, AI/ML, IoT

Specialities: Strategic Management, Technology Innovation, Product Management


That the contents of third-party articles/blogs published here on the website, and the interpretation of all information in the article/blogs such as data, maps, numbers, opinions etc. displayed in the article/blogs and views or the opinions expressed within the content are solely of the author's; and do not reflect the opinions and beliefs of NASSCOM or its affiliates in any manner. NASSCOM does not take any liability w.r.t. content in any manner and will not be liable in any manner whatsoever for any kind of liability arising out of any act, error or omission. The contents of third-party article/blogs published, are provided solely as convenience; and the presence of these articles/blogs should not, under any circumstances, be considered as an endorsement of the contents by NASSCOM in any manner; and if you chose to access these articles/blogs , you do so at your own risk.


Zeeve is an enterprise-grade Blockchain Infrastructure Automation Platform. Join the growing list of clients that trust us with their Blockchain initiatives

© Copyright nasscom. All Rights Reserved.