The Polygon CDK Architecture

Created by Obinna Johnson, Modified on Fri, 14 Mar at 7:00 PM by Obinna Johnson

Polygon Chain Development Kit (CDK) is a modular, open-source blockchain stack for developers launching sovereign L2 chains powered by zero-knowledge (ZK) proofs.


it is helpful to first understand the role of each component in the system.

Users:

CDK-built chains are EVM-compatible and work with existing Ethereum tools and libraries.

Users and developers can use wallets like MetaMask and libraries like Ethers.js to interact with them as they would with Ethereum.

Transactions are submitted using the same JSON-RPC interface and go into a pending pool on L2.

Sequencer

The sequencer proposes transaction batches to the network upon executing them. That is, it rolls up transactions into batches and adds them to the consensus contract on L1.


The sequencer is responsible for two vital tasks in the system:

  1. Executing transactions submitted by L2 users.

  2. Sending batches of transactions to the L1 smart contract.


The sequencer reads transactions from the pending transaction pool and executes them on the L2, effectively updating the state of the L2 and providing this information back to the user. Once this process is complete (typically in a matter of seconds), users are free to continue interacting with the L2 as if the transaction was finalized.

In the background, the sequencer periodically creates batches of transactions and sends multiple batches of transactions to the L1 smart contract in a single transaction.


L1 Smart Contract (Consensus Contract “PoE”)

Multiple smart contracts deployed on Ethereum (L1) coordinate to finalize transactions from L2.

A main rollup contract is deployed, that:

  • Receives and stores transaction batches from L2 (some L2 designs may not use Ethereum for data availability).

  • Verifies ZK-proofs from the aggregator to confirm transaction validity.




Aggregator & Prover

The aggregator is responsible for periodically reading batches of L2 transactions that have not been verified yet, and generating ZK-proofs for them to prove their validity.

To do this, the aggregator sends the batches of transactions to a prover. The prover generates ZK proofs and sends them back to the aggregator, which then posts the proof back to the L1 smart contract.



Verifier

Verifier is a special smart contract which is able to verify any zk-SNARK cryptographic proof (validity proof generated by the prover as submitted by the aggregator). The SNARK verifier proves the validity of every transaction in the batch. It is the core entity in any zk-rollup architecture as it verifies the correctness of each proof, thus ensuring the integrity of state transitions.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article