By Trustless Labs

Image source: Trustless Labs

There are currently two types of Rollup SDKs: ZK and OP, mainly based on Arbitrum Orbit, OP Stack, ZK Stack, and Polygon CDK. This article provides a comprehensive introduction and comparative analysis of these four solutions. Among them, Polygon CDK shows great potential due to its scalability, security flexibility, and cost advantages.

Whether it is Manta's transition from OP Stack to Polygon CDK or the fair launch of ZKFair, Polygon CDK has enabled projects to handle huge total locked value (TVL) and ecosystems. We believe that ZK Rollup is the ultimate solution for Rollup scalability. Polygon CDK gradually dominates the market by leveraging its advantages such as modularity, customizability, multiple data availability solutions, and low entry barriers. Combined with the outstanding performance of the flagship project ZKFair, we believe that Polygon CDK is the most promising and optimal solution in the current ZK Rollup SDK.

1. Rollup SDK Overview

From the perspective of underlying technology implementation, Rollup SDKs can be divided into two categories: one is the OP-Rollup SDK that maintains security based on Optimistic fraud proofs, and the other is the ZK-Rollup SDK that relies on zero-knowledge proofs to establish on-chain trust. OP-R SDK was originally proposed by Optimism, introducing the concept of OP Stack. In March 2023, Arbitrum launched the Orbit solution. Soon after, ZK-R SDK appeared, and representative solutions include ZK Stack from zkSync and Polygon CDK proposed by Polygon.

1.1 Orbit Decision

Arbitrum Orbit is designed to allow modifications to the Arbitrum Nitro codebase. It has perpetual and recursive permissions, allowing the creation of Orbit chains that can host other chains under the same licensing conditions. Orbit chains can settle to various Arbitrum networks, but do not support network switching after deployment. It supports AnyTrust and Rollup chain types to meet different security and cost requirements.

 

Image source: https://koreablockchainweek.com/blogs/kbw-blog/arbitrum-101

As shown in the figure, the goal of Arbitrum Orbit is to enable developers to build Arbitrum's second-layer or even third-layer network. Developers can choose between Arbitrum Rollup (all transaction data is published on the settlement layer) and AnyTrust Chain (transaction data is maintained by the DAC Data Availability Committee and DACerts data availability proof is published to the settlement layer, similar to Validium). They can customize Gas Tokens and economic models, etc. At the same time, Arbitrum is also promoting Stylus, which enables developers to use Orbit to build Rollup based on EVM and WASM VM at the same time. Arbitrum Orbit users can flexibly choose to build their three-layer network based on Arbitrum One or Arbitrum Nova, and its settlement layer is located on the Arbitrum second-layer network. This means that transaction fees on the third-layer network will return to the second-layer network of the Arbitrum protocol. If you want to build a second-layer network based on Ethereum as the settlement layer, you need to obtain code license authorization from Offchain Labs or Arbitrum DAO.

1.2 ON STACK

OP Stack consists of software components that make up the infrastructure of the Optimism mainnet. OP Stack has undergone Bedrock iterations, helping to build the Optimistic Rollup network and supporting the Optimism Superchain (interconnected second-layer network). Its architecture includes the Ethereum Virtual Machine (EVM) for the execution layer, a single sorter module for processing transactions, and a multi-layer network for data formatting, settlement, and governance.

After the recent upgrade of OP Stack to Bedrock, the cost of a single transaction has been reduced by more than 70% through the optimized transaction compression strategy. At the same time, multiple transactions can be processed in the same second-layer block, reducing the size of state data. The refinement of these components makes development more convenient. This is exactly where OP Stack's competitive advantage lies.

 

Image source: https://docs.optimism.io/stack/explainer

In its SuperChain plan, all Rollups using OP Stack will be integrated into standardized OP chains. These chains can communicate directly through the cross-chain message protocol and share a common Ethereum cross-chain bridge. In addition, the transaction ordering on these chains will be handled by the same sorter network.

1.3 ZK Stack

ZK Stack is a modular, open-source framework designed for building custom ZK-powered second- and third-layer networks (Hyperchains) based on zkSync Era code. Developed under an open-source license, ZK Stack is freely available, promoting ease of use and community engagement. Hyperchains built using this framework connect seamlessly in a trustless network, ensuring low latency and shared liquidity for enhanced interoperability. ZK Stack leverages the reliability of zkSync Era to provide a secure foundation, while its emphasis on community contribution and ownership provides a degree of support for a decentralized ecosystem. The sovereign nature of this framework gives developers a degree of autonomy over their Hyperchains, helping to build a system that is somewhat decentralized and sustainable. In addition, ZK Stack is suitable for a variety of use cases, including games, social networks, and enterprise applications, providing some tailor-made solutions for specific needs. With its asynchronous connection options, ZK Stack becomes one of the tools to build decentralized blockchains that are somewhat secure, customizable, and interoperable.

Image source: https://x.com/zerokn0wledge_/status/1673436051199922176?s=20

zkSync Era overcomes the fragmentation of cross-network liquidity. As a pioneer, Hyperchain has led the way in creating this ultra-scalable unified liquidity network and set an example for other networks to follow.

However, despite its power, ZK Stack is not a one-size-fits-all solution for all situations. For traditional decentralized finance (DeFi) applications or non-fungible token (NFT) projects, deploying on an existing Hyperchain, such as zkSync, may be more efficient and provide synchronization with other protocols.

1.4 Polygon CDK

Polygon CDK is an open source and modular codebase designed to simplify the complex process of building and launching ZK-driven second layer (L2) chains on Ethereum. This toolkit enables developers to design networks based on their specific needs, providing core modularity for enhanced flexibility. The use of zero-knowledge proofs ensures the cryptographic security and near-instant finality of transactions. By deploying a chain using CDK, developers can launch automatically interoperable ZK-driven L2 networks that connect to shared ZK bridges, forming the value layer of the Internet.

Image source: https://polygon.technology/blog/introducing-polygon-chain-development-kit-launch-zk-l2s-on-demand-to-unlock-unified-liquidity

Developers can customize the chain's execution environment, select zkEVM, choose "validium" mode, and choose a centralized sorter. Customization capabilities also extend to data availability with local DACs, adjusting the release time of ZK proofs, and specifying tokens for Gas. Notably, despite these customization capabilities, NFT Chain can seamlessly interoperate with other Polygon chains and share liquidity. The modularity of CDK ensures flexibility without sacrificing scalability or disrupting liquidity. As one of the core technical components of Polygon 2.0, the Interop Layer plays a key role, accepting ZK proofs, aggregating them, and publishing the proofs and updated chain states to Ethereum, ensuring near-instant finality and cross-chain execution. Polygon's cutting-edge ZK technology, such as zkEVM, ensures that chains developed with CDK remain future-proof and can benefit from continued technological advancement. The on-chain security deployed by CDK relies on cryptography, providing a more secure, interconnected, and infinitely scalable value layer without complex incentives.

Image source: Trustless Labs

2. In-depth analysis of Polygon CDK: the leader in the Rollup SDK track

2.1 Scalability and Compatibility

Using Polygon CDK, developers can directly deploy a Rollup that is completely equivalent to EVM, facilitating EVM developers to seamlessly migrate to the ecosystem. At the same time, Polygon CDK achieves a high degree of modularity by decomposing the various components of Rollup into independent services. For example, the synchronizer is responsible for synchronizing blocks between the first and second layers, the prover generates proofs, the sequencer verifies transactions and packages blocks, and the RPC service provides external access. Rollup creators can extend specific services as needed.

Using Polygon CDK, a phase zero Rollup can be created where the state root of the second layer is submitted to the first layer. At the same time, the state of the Rollup can be reconstructed based on all the data on the first layer. In addition, the first layer contract will verify the legitimacy of the ZK proof to ensure that all state changes in the second layer are completely legal.

Polygon CDK supports a dedicated data availability layer and data availability committee, ensuring reliable data availability even when Validium is selected. Polygon CDK supports various parameter customizations, allowing developers to choose between zk-Rollup and Validium modes to build their own second layer. It also supports customization of parameters such as Gas Token, Gas fee, proof submission frequency, batch size, etc.

2.2 Performance and Cost

Polygon CDK enables fast zero-knowledge proof generation through recursive STARK and Polygon Zero. With optimized hardware settings, it can reach over 2000 TPS, far exceeding the throughput of the Ethereum mainnet. At the same time, it allows for more frequent validity proofs to be configured, enabling the first layer to quickly verify the state of the second layer, providing fast finality for the second layer.

Rollup allows for custom Gas Tokens and Gas fee collection rules, giving developers the freedom to reduce costs for Rollup users. In addition, the maintenance cost of Rollup depends on the size of the data submitted to the first layer, and zkSNARK proofs are smaller, so the maintenance cost is lower. According to official data, the average Gas fee per transaction on Polygon Zkevm is only 0.000294 ETH.

3. Polygon CDK Case Study

3.1 ZKFair

Polygon's ZK proof system is based on mathematical proofs and provides a stronger security model than OP Stack's socio-economic incentive-driven fraud proofs. In addition, Polygon CDK's modularity and sovereign framework provide unparalleled flexibility for development, features that ZKFair leverages for its tailor-made blockchain solutions. At the same time, Polygon CDK's focus on interoperability and shared liquidity is critical to the prosperity of blockchain networks. It allows seamless integration with Ethereum and other Polygon chains, attracting a large user base and liquidity pools. While each SDK has its advantages, Polygon CDK has become a compelling option in the Rollup SDK space with its modularity, advanced security, interoperability, and flexible cost-performance balance.

ZKFair chose to use Polygon CDK in line with its goals of scalability, performance, and economic flexibility, which are critical for innovative projects in blockchain technology. Leveraging the customizable parameters provided by Polygon CDK, ZKFair deployed a Rollup with the stablecoin USDC as the Gas Token. Leveraging CDK's configurable gas fees, ZKFair implemented a customizable gas adjustment solution that achieved a fair distribution of governance tokens. This marks the successful launch of the first second layer based on Polygon CDK, with its total locked value (TVL) growing from 0 to $160 million in three days. In the first two weeks of launch, the second layer had more than 450,000 active addresses and processed more than 5 million transactions.

Using the modular design of Polygon CDK, ZKFair plans to migrate its data availability (DA) layer from the Data Availability Committee (DAC) to Celestia. Integrating with Celestia's modular data availability (DA) layer for data expansion greatly reduces gas costs in the ZKFair ecosystem, providing a more cost-effective and user-friendly blockchain experience compared to other solutions.

3.2 Manta’s transition from OP Stack to Polygon CDK

Manta's transition from OP Stack to Polygon CDK reflects its pursuit of improving user experience, especially in terms of accelerating withdrawal settlement. The zkEVM technology in Polygon CDK provides fast settlement and strong security through ZK proof, which is significantly better than OP Stack's Optimistic Rollup. Another important reason for Manta's transition is the integration with the broader Polygon ecosystem. This transition enables Manta to leverage the shared liquidity of the Polygon network and enhance ecosystem integration through a trustless ZK bridge.

in conclusion

This report's exploration of various Rollup SDKs highlights the dynamic diversity of blockchain technology. While each SDK - Arbitrum Orbit, OP Stack, ZK Stack, and especially Polygon CDK - has made significant contributions to the blockchain ecosystem, more and more projects are choosing to use Polygon CDK in search of scalability, security, and efficiency. This preference is reflected in Manta's strategy of turning to Polygon CDK for a better user experience and ZKFair's strategy of choosing Polygon CDK for its strong security and flexibility.

With its ZK technology, interoperability, and cost-effective solutions, Polygon CDK has emerged as not only an innovation tool, but also a comprehensive solution to modern blockchain challenges. It bridges the gap between ideal and reality, providing a platform that aligns with the growing needs of the blockchain community. This makes Polygon CDK not only an SDK, but also a catalyst for the next wave of blockchain innovation, pushing projects like ZKFair into new realms of performance and scalability. In the evolving blockchain technology landscape, Polygon CDK is a prominent path that combines efficiency, security, and accessibility to chart a future that is not only technologically advanced, but also inclusively progressive.