Polygon Chain Development Kit (CDK) is an open-source framework designed for rapidly deploying Zero-Knowledge (ZK) powered Layer 2 (L2) solutions on Ethereum. Chains developed using the Polygon CDK feature a highly customizable architecture, allowing businesses to tailor their own rules and parameters much like a standalone L1 blockchain.
Why Choose Polygon CDK?
The decision to utilize the Polygon CDK is driven by a set of powerful design principles and key technical factors that cater to modern blockchain development needs.
Core Design Principles
- High Modularity: Developers enjoy extensive customization capabilities, from configuring the execution environment to selecting the native gas token.
- Enhanced Scalability: L2 chains built with the CDK achieve significantly higher transaction throughput and speed.
- Unified Liquidity: These chains ensure seamless asset transfer and interoperability within the broader Polygon 2.0 L2 ecosystem.
- Independent Data Availability (DA): Each CDK chain can leverage a dedicated Data Availability Committee (DAC), providing robust off-chain data access and reliability.
- Composability and Interoperability: Facilitates seamless interaction and asset exchange between different chains via secure bridging protocols.
- Near-Instant Finality: Chains deployed with Polygon CDK rely on cryptographic security, ensuring transaction integrity without the need for running full nodes.
Key Decision Factors
- Ethereum Scalability: CDK chains directly contribute to scaling the Ethereum network.
- Custom Business Logic: Full EVM support allows for custom gas limits, opcode compatibility, and deep technical integrations.
- Privacy Options: Enables the creation of private application-specific chains (appchains), offering confidentiality for sensitive data while leveraging blockchain benefits.
- Compliance-Oriented Design: Supports network sovereignty by allowing maintainers to choose administrators compliant with local regulations.
- Extensive Web3 Support: As a direct fork of the zkEVM stack, it simplifies service porting and leverages a comprehensive, existing ecosystem.
Understanding Data Availability in Polygon CDK
Data Availability (DA) is a critical concept that separates transaction execution from data storage. It allows transaction data to reside off-chain while remaining available for verification, dramatically improving scalability and reducing associated costs.
Within the Polygon CDK framework, the Validium mode offers a unique scaling solution for zkEVM by integrating a Data Availability Committee (DAC). This committee, comprised of trusted members, runs DA nodes to guarantee the security, accessibility, and integrity of off-chain data. Their core responsibility is to verify that everyone can access the data needed to reconstruct the L2 state from on-chain events, meaning users can always access their asset data even if the L2 operator goes offline.
👉 Explore more on-chain scaling strategies
How the Data Availability Committee (DAC) Works
DAC members are managed by a smart contract on Ethereum L1. The sequencer sends L2 batch data to the DAC members but only submits a hash of this data (the accumulated input hash) to the L1 chain.
- The sequencer signs the L2 batch data with its private key before sending it to the DAC.
DAC members provide an API service to the sequencer. They:
- Read and monitor the sequencer address from the L1 contract.
- Receive and store the off-chain L2 batch data from the sequencer.
- Verify the sequencer's signature.
- Upon successful storage, each DAC member signs the accumulated input hash and returns it to the sequencer.
The advantages of using a DAC are substantial, primarily leading to lower transaction fees due to reduced on-chain computational requirements and enhanced state privacy for applications.
zkEVM vs. Validium: A Deployment Comparison
The Polygon CDK supports two primary deployment models, each with distinct characteristics.
zkEVM Deployment
- zkEVM Node: Manages the network, processes transactions, maintains state, and interacts with L1. Its components include JSON RPC, Pool DB, Sequencer, State DB, Synchronizer, Aggregator, and Prover.
- zkEVM Contracts: A suite of smart contracts deployed on Ethereum, primarily including
PolygonZkEVM,PolygonZkEVMBridge, andPolygonZkEVMGlobalExitRoot.
Validium Deployment
This model adds a dedicated data availability layer.
- Data Availability Layer: The off-chain DAC infrastructure.
- zkEVM Node with Validium Extensions: A modified node client capable of interacting with the DAC.
- Validium-specific DAC Contracts: Smart contracts like
CDKDataCommittee.solandCDKValidium.solthat manage the committee and its verification duties on L1.
Feature Comparison Table
| Feature | zkEVM | Validium |
|---|---|---|
| Transaction Data Storage | All data is saved to L1. | Only the data hash is saved to L1. |
| Data Availability | High; all data is available on-chain. | Managed off-chain by a DAC. |
| Security | Very high, due to on-chain data and ZKPs. | Slightly lower risk if DAC members collude, but still secured by ZKPs. |
| Gas Fees | Higher. | Lower, as less data is stored on-chain. |
| Proof Generation | Uses a Prover to generate ZKPs for batch verification. | Uses a Prover to generate ZKPs for batch verification. |
| Final Settlement | Batches and their ZKPs are added to Ethereum state. | Data hashes and their ZKPs are added to Ethereum state. |
Key Components of a zkEVM Node
The node is the engine of the L2 chain, comprising several specialized components:
- Sequencer: Orders L2 transactions, drives state changes, and provides trusted finality. It works with the Executor to process transactions.
- Aggregator: Submits validity proofs for the L2 state to L1. It collects transaction batches, interacts with the Prover for zk-proofs, and aggregates them.
- Prover: Generates the zero-knowledge proofs (ZKPs) for batched transactions used to verify L2 state on L1.
- Executor: The virtual machine implementation that executes batches of transactions, handles EVM-compatible processing, and extracts metadata (state roots, receipts, logs).
- Synchronizer: Keeps the node's local state synchronized with Ethereum L1 by listening to contract events and managing blockchain reorganizations.
- EthTxManager: Handles all interactions with the Ethereum mainnet, managing nonces and gas prices for transactions sent by the Sequencer and Aggregator.
- State: Manages all state-related data and persists it to the StateDB.
- Pool: A temporary mempool for storing transactions submitted via JSON-RPC before they are picked up by the Sequencer.
- JSON RPC: The HTTP interface for users and dApps to interact with the chain.
- L2GasPricer: Calculates L2 gas prices based on the current L1 gas price.
Core Smart Contracts
The system relies on three main contracts deployed on Ethereum L1:
CDKDataCommittee Contract
This contract manages the DAC members and verifies their signatures.
- An admin can set up the committee members and the multi-signature threshold (M-of-N).
- It provides a function to verify if a
signedHashhas reached the required signature threshold.
CDKValidium Contract
This core contract manages and updates the state of the L2 chain.
- The
trustedSequencercallssequenceBatchesto submit new batches. This function internally calls theCDKDataCommitteecontract to verify the DAC signatures. - The
verifyBatchesfunction is used to validate batches of transactions by providing a zk-proof.
PolygonZkEVMBridge Contract
A bridge contract deployed on both L1 and L2, enabling secure cross-chain asset transfers.
The Data Flow Process
The end-to-end data flow within a Polygon CDK chain, particularly in Validium mode, follows a precise sequence:
- Batch Assembly: The Sequencer collects user transactions and organizes them into batches.
- Batch Certification: The Sequencer sends the batch data and its corresponding hash to the DAC nodes.
- Data Verification & Storage: Each DAC node independently verifies the batch data. Once verified, the data is stored locally.
- Signature Generation: Each DAC node generates a signature for the batch hash, certifying its integrity and authenticity.
- Ethereum Communication: The Sequencer collects signatures from DAC members and submits the batch hash to the Ethereum network for verification.
- On-Chain Verification: The rollup contract on Ethereum verifies the submitted signatures against the known DAC member list and confirms sufficient approval.
- Finalization with ZKP: The Aggregator prepares a ZKP for the batch transactions and submits it to Ethereum. This proof confirms the validity of the approved transactions without revealing their details, finalizing the state update on the L1 chain.
👉 Get advanced insights into ZK-proof technology
Frequently Asked Questions
What is the primary advantage of using Polygon CDK?
Its main advantage is providing a highly modular and customizable framework for launching scalable Ethereum L2s. Developers can tailor everything from the gas token to data availability solutions, balancing between cost, security, and privacy for their specific application.
How does Validium mode achieve lower transaction fees?
Validium significantly reduces fees by storing only transaction hashes on the expensive Ethereum L1. The bulk of the data is handled off-chain by a Data Availability Committee, minimizing the gas costs associated with calldata storage while maintaining security through zero-knowledge proofs.
Is a chain built with Polygon CDK compatible with Ethereum?
Yes, absolutely. Chains built with the CDK are fully Ethereum Virtual Machine (EVM) compatible. This means existing smart contracts, developer tools, and wallets from the Ethereum ecosystem can be ported over with minimal changes, ensuring broad interoperability.
What is the role of the Data Availability Committee (DAC)?
The DAC is a group of trusted entities responsible for storing transaction data off-chain and attesting to its availability. They provide signatures to prove the data is accessible, which allows the system to operate with lower fees while ensuring users can always reconstruct the state of the chain if needed.
How is security maintained if data is stored off-chain?
Security is maintained through a combination of cryptographic techniques. Zero-Knowledge Proofs (ZKPs) validate the correctness of all state transitions on L1. The DAC, whose members are known and managed on-chain, provides economic security for data availability. The system is designed so that if the DAC fails, users can prevent further state transitions, protecting their assets.
Can I create a private blockchain with Polygon CDK?
Yes, one of the key features is the ability to create application-specific chains with privacy features. You can configure a chain where transaction data is only visible to permissioned participants, making it ideal for enterprises and use cases requiring data confidentiality.