How to scale your dApp with the power of zkRollups?
Tags: zkrollups, polygoncdk
Published: 2023-12-15 10:30:38

<p>Leveling blockchains as&nbsp; the next big technology revolution with the innate capability of adding trust, transparency&nbsp; 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.&nbsp;</p>
<p><a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Zk-Roll Ups</a> can help us achieve this. . In this article, we shall dive deep to understand Zk-Rollups that use both Zero-knowledge and <a href="https://www.zeeve.io/rollups/">Rollups technology</a> to help scale Decentralized applications.&nbsp;&nbsp;</p>
<h2 id="h-what-are-zero-knowledge-roll-ups">What are Zero Knowledge Roll-Ups?</h2>
<p><a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Zero Knowledge roll-ups</a> 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.&nbsp;</p>
<figure class="wp-block-image aligncenter size-large"><a href="https://www.zeeve.io/rollups/"><img src="https://www.zeeve.io/wp-content/uploads/2023/11/Blog-Banner-4-1024x130.png" alt="" class="wp-image-50262"/></a></figure>
<h2 id="h-benefits-of-zero-knowledge-roll-ups-for-dapps">Benefits of Zero Knowledge Roll-ups for dApps</h2>
<p><strong>Low Gas Cost:</strong> Since <a href="https://www.zeeve.io/blog/what-are-zero-knowledge-proofs-and-why-are-they-important-for-blockchain/">ZKPs</a> 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.&nbsp;</p>
<p><strong>Higher Throughput:</strong> 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.&nbsp;</p>
<p><strong>Privacy:</strong> <a href="https://www.zeeve.io/blog/what-are-zero-knowledge-proofs-and-why-are-they-important-for-blockchain/">ZKPs</a> 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.&nbsp;</p>
<p><strong>Security: </strong>Rollups are much more secure because they inherit the <a href="https://www.zeeve.io/validator-nodes/">validator</a> security of the underlying base chain. The most important aspect is, users can always bring their <a href="https://www.zeeve.io/blog/comprehensive-guide-on-tokenized-real-world-assets/">assets</a> back to the Layer1 if they are not convinced with the L2 security.&nbsp;</p>
<p><strong>Faster Transaction finality:</strong> <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">zkRollups</a> has faster transaction finality. As soon as the proofs are sent to the base chain,&nbsp; 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.&nbsp;</p>
<h2 id="h-how-do-zk-rollups-work">How Do Zk-Rollups Work?</h2>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6g6lkpq14x7ehnnh2kms.png)

<p>When a transaction is submitted to a <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">zkRollup</a>, 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.</p>
<p>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. .</p>
<p>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.&nbsp;</p>
<p>On the L1, there is a smart contract that maintains the rollup state.&nbsp;</p>
<h2 id="h-types-of-zk-rollups">Types of ZK Rollups</h2>
<h3 id="h-zk-snark">Zk-Snark&nbsp;</h3>
<p><a href="https://www.zeeve.io/blog/demystifying-zksnarks-snarks-explained-for-beginners/">ZK-SNARK</a> or also known as Zero-Knowledge Succinct Non-interactive Argument of Knowledge enables applications to scale in significant proportion&nbsp; in comparison to L1s because they move the computation off-chain and post very little data.&nbsp;</p>
<p>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 <a href="https://www.zeeve.io/blockchain-protocols">blockchains</a> from GBs to KBs because SNARKs perform computation off-chain and only post minimal information on the&nbsp; mainchain as validity proofs.&nbsp;</p>
<h3 id="h-zk-starks">Zk-STARKs</h3>
<p>Zk-STARKs or&nbsp; Zero-Knowledge Scalable Transparent Argument of Knowledge uses a single off-chain STARK verifier for data&nbsp; 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, <a href="https://www.zeeve.io/blog/demystifying-zksnarks-snarks-explained-for-beginners/">SNARKs</a> came much earlier than STARKs which give them an adoption age over SNARKs.&nbsp;</p>
<p>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 <a href="https://www.zeeve.io/blog/top-10-zero-knowledge-proof-projects-for-2023/">ZKPs</a>.&nbsp;</p>
<h3 id="h-plonks">PLONKs&nbsp;</h3>
<p>PLONK or Permutations over Lagrange-based for Oecumenical Non Interactive arguments of Knowledge could be summed as a perfect fusion of both <a href="https://www.zeeve.io/blog/demystifying-zksnarks-snarks-explained-for-beginners/">ZK-Snark</a> 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.&nbsp;</p>
<p>The LagRange based permutation combinations which boast fancy <a href="https://www.zeeve.io/blog/cryptographic-hash-algorithms-benefits-functionality-and-applications/">cryptography</a> 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.&nbsp;</p>
<h2 id="h-difference-between-different-zk-rollup-solutions-a-tl-dr">Difference Between Different Zk-Rollup Solutions: A TL,DR</h2>
<figure class="wp-block-table aligncenter"><table><tbody><tr><td>Basis&nbsp;</td><td>SNARK&nbsp;</td><td>STARK&nbsp;</td><td>PLONK&nbsp;</td></tr><tr><td>Algorithmic Complexity&nbsp;</td><td>O{(N*Log (N)}</td><td>O(N * poly-log(N))</td><td>O(μ log <a href="https://eprint.iacr.org/2022/1355.pdf">d</a>)&nbsp;</td></tr><tr><td>Communication Complexity Size&nbsp;</td><td>~O(1)</td><td>O(poly-log(N))</td><td>O(µ)</td></tr><tr><td>Size Estimate 1 TX</td><td>Tx: 200 bytes, Kev: 50 MB</td><td>45 KB&nbsp;</td><td>Less than 10kb</td></tr><tr><td>EVM Verification Gas Cost&nbsp;</td><td>~600k (Groth16)</td><td>~2.5M (estimate, no impl.)</td><td>1 million To The Cost of ETH Gas Cost&nbsp;</td></tr><tr><td>Trusted Setup&nbsp;</td><td>Yes</td><td>No</td><td>Hybrid&nbsp;</td></tr><tr><td>Post Quantum Secure&nbsp;</td><td>No</td><td>Yes</td><td>Yes</td></tr><tr><td>Crypto Assumptions&nbsp;</td><td>Strong&nbsp;</td><td>Collision Resistant hashes&nbsp;</td><td>Group of Unknown Order&nbsp;</td></tr></tbody></table></figure>
<h2 id="h-implementing-zk-rollup-solutions-for-scaling-dapps">Implementing Zk-Rollup solutions for Scaling Dapps&nbsp;</h2>
<p>While integrating the <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">ZK-rollup solution</a> 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;&nbsp;</p>
<h3 id="h-zk-sync-era">Zk-Sync Era&nbsp;</h3>
<p><a href="https://www.zeeve.io/blockchain-protocols/deploy-zksync-era-node/">ZK-Sync Era</a> 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, <a href="https://www.zeeve.io/blockchain-protocols/deploy-zksync-era-node/">ZK Sync Era</a> became the first <a href="https://www.zeeve.io/blockchain-protocols/deploy-polygon-zkevm-node/">ZkEVM</a> 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.&nbsp;</p>
<h3 id="h-zksync-hyperchains">zkSync Hyperchains&nbsp;</h3>
<p>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 <a href="https://www.zeeve.io/appchains/zksync-hyperchains-zkrollups/">ZkSync </a>powered ecosystem has&nbsp; achieved that for the world of dapps. Through the use of hyper chains, Dapps&nbsp; can enjoy the same scalability experience similar to the Internet despite using decentralized networks..&nbsp;&nbsp;</p>
<p>You can think of your own application like Uniswap launching its own sequencers and tech infra using the <a href="https://www.zeeve.io/appchains/zksync-hyperchains-zkrollups/">Hyper Chains</a> 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 <a href="https://www.zeeve.io/blog/what-are-zero-knowledge-proofs-and-why-are-they-important-for-blockchain/">ZKPs</a> and these transcations&nbsp; will be further batched into a single proof to ensure even greater compression and scalability.&nbsp;&nbsp;&nbsp;</p>
<h3 id="h-polygon-zkevm">Polygon ZkEVM&nbsp;</h3>
<p><a href="https://www.zeeve.io/blockchain-protocols/deploy-polygon-zkevm-node/">Polygon ZkEVMs</a> allow Dapps to create optimized <a href="https://www.zeeve.io/blockchain-protocols/deploy-ethereum-blockchain/">Ethereum</a> instances through a recursive STARK based tech infrastructure which amplifies decentralization, flexibility, scalability and even <a href="https://www.zeeve.io/blog/blockchain-interoperability-key-for-global-blockchain-adoption/">interoperability</a>. 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 <a href="https://www.zeeve.io/blog/what-are-zero-knowledge-proofs-and-why-are-they-important-for-blockchain/">Zk Proofs</a> 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.&nbsp;</p>
<h3 id="h-polygon-cdk">Polygon CDK</h3>
<p><a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Polygon CDK</a> 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 . <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Polygon CDK</a> 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.&nbsp;</p>
<h2 id="h-launch-your-dapp-on-a-zkrollup-with-zeeve">Launch your dApp on a zkRollup with Zeeve</h2>
<p>If you have already convinced on the value adds of ZKPs for your dApps, the next step is to choose the right zkScaling solution. As we discussed above, there are public <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">zkRollup chains</a> (<a href="https://www.zeeve.io/blockchain-protocols/deploy-zksync-era-node/">zkSync Era</a>, <a href="https://www.zeeve.io/blockchain-protocols/deploy-polygon-zkevm-node/">Polygon zkEVM</a>) offering the ZK capabilities and there are solutions like Hyperchain and <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Polygon CDK</a> that lets you create your own application-specific zkRollup blockchains. Which one is best for you depends on your scalability, customization and modularity requirements. But whichever solution is preferred for your application, <a href="https://www.zeeve.io/">Zeeve</a> provides access to that with nodes and complete network infrastructure.&nbsp;</p>
<p>You can get access to the <a href="https://www.zeeve.io/blockchain-protocols/deploy-polygon-zkevm-node/">Polygon zkEVM</a> and <a href="https://www.zeeve.io/blockchain-protocols/deploy-zksync-era-node/">zkSync Era</a> public mainnet nodes and also can get 1-click sandbox access to <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Polygon CDK</a> and zkSync Era’s Hyperchain through an automated no-code deployment dashboard. The additional infrastructures for your <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">zkRollup chains</a>, like block explorers, faucets, data indexers can also be set up using <a href="https://www.zeeve.io/">Zeeve platform</a> easily using our <a href="https://www.zeeve.io/rollups/">Rollups-as-a-service(RaaS)</a>. And all these comes with an 99.9% uptime guarantee and Enterprise SLA.&nbsp;</p>
<p>If you have any further doubt regarding choosing the right ZK scaling solution for your dApp, <a href="https://www.zeeve.io/talk-to-an-expert/">get in touch with our Zeeve experts</a>. Schedule a call today and see how Zeeve can simplify your <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">zkRollup deployment</a> experience.&nbsp;</p>