A comprehensive guide on Polygon CDK and its deployment
Tags: polygoncdk
Published: 2023-11-28 08:33:30

<p>Building Zk-powered layer-2 chains can be complex. You will need extensive protocol-specific knowledge, the method of bootstrapping its components— sequencer, data availability layer, prover, etc, and other infrastructure-level operations. Polygon Chain Development Kit (PDK) tackles all these challenges with its significant emphasis on modularity and ready-to-use product suite consisting of a prover, customizable virtual machine, DA layer, and sequencer. For a detailed examination, let’s dive deeper into the concept of Polygon CDK through this comprehensive guide on the <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Polygon CDK chain</a> and its deployment.</p>
<h2 id="h-what-is-polygon-chain-development-kit-cdk">What is Polygon Chain Development Kit (CDK)?</h2>
<p>Polygon Chain Development Kit (CDK) is a highly modular and fully open-source framework for seamless deployment of custom ZK-powered <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Polygon CDK chain deployment</a> . Web3 projects building with Polygon CDK have the choice to tailor their chain based on their use case-specific requirements. This customization may include the choice of using virtual machine, prover, sequencer types, data availability solutions, operational mode (e.g. Validium), gas tokens, and more. Chains that are built using CDK are interconnected, which enables them to achieve benefits such as near-instant finality, massive scalability, and a unified liquidity pool. WIth all these attributes, <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Polygon CDK</a> opens up multitude of opportunities for web3 projects.</p>
<figure class="wp-block-image aligncenter size-large"><a href="https://www.zeeve.io/appchains/"><img src="https://www.zeeve.io/wp-content/uploads/2023/10/deploy-a-Polygon-CDK-Chain_BANNER-1024x131.png" alt="" class="wp-image-48528"/></a></figure>
<h2>Key factors for Polygon CDK’s adoption&nbsp;</h2>
<p>Polygon CDK is being adopted on a rapid scale for a variety of factors, including the infinite-scalability, customization facility, shared liquidity, and <a href="https://www.zeeve.io/blog/blockchain-interoperability-key-for-global-blockchain-adoption/">interoperability</a> features. Below are some of the key factors that encourage web3 projects for Polygon CDK chain deployment:&nbsp;&nbsp;</p>
<li><strong>Ethereum scaling: </strong>Polygon CDK chains are designed to scale <a href="https://www.zeeve.io/blockchain-protocols/deploy-ethereum-blockchain/">Ethereum</a> layer-1. The framework allow web3 projects to build their custom Zk-powered chains as Layer-2, and meanwhile it inherits the excellent security and data integrity from the <a href="https://www.zeeve.io/blockchain-protocols/deploy-ethereum-blockchain/">Ethereum blockchain</a>.&nbsp;</li>
<li><strong>Inter-chain interoperability: </strong>All the CDK chains can interoperate with each other, share data, and asset via the native Zk-bridge. This interoperable infrastructure of <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Polygon CDK</a> promotes a cross-chain future for dApps.</li>
<li><strong>Near-infinite scalability:</strong> All the chains deployed with Polygon CDK have the option to customize the TPS capacity of their chain, which can be multiplied further to achieve hyper-scalability without compromising on security since CDK chains are integrated with advanced <a href="https://www.zeeve.io/blog/cryptographic-hash-algorithms-benefits-functionality-and-applications/">cryptographic</a> security.&nbsp;</li>
<li><strong>Customization of business logic:</strong> CDK chains maintain full Ethereum equivalency. With that, they facilitate customization of gas limits, opcode compatibility, and technology integrations that allow projects to design their specific business logic using <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Polygon zkEVM</a>.&nbsp;</li>
<li><strong>Private appchains: </strong>Polygon CDK facilitates the creation of sovereign chains or <a href="https://www.zeeve.io/appchains/">appchains</a> that can prioritize privacy options. For example, only authorized members can access the apps, post transactions on the ledger, or see the proofs. This way, projects can maintain confidentiality on their applications while still leveraging the decentralization attributes of blockchain.</li>
<li><strong>Support for extensive web3 services</strong>: CDK-based chains can easily port a range of web3 services. For example, you can use <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">ZKrollups-as-a-service</a> solutions to automate the deployment of some of your chain’s components, use centralized sequencers, data storage services, and web3 tools.<br></li>
<li><strong>Unified liquidity: </strong><a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Polygon CDK chain</a> offers ‘unified liquidity’ feature to enable seamless transfer of assets and liquidity across various chains within the Layer-2 ecosystem. This concept tackles the issue of ‘walled garden’ from <a href="https://www.zeeve.io/blockchain-protocols/deploy-polygon-blockchain/">Polygon Network</a> and offer a highly efficient digital economy. If you want to learn in-depth analysis of Polygon CDK’s approach of solving ‘Walled Garden’ issue and enabling <a href="https://www.zeeve.io/blog/blockchain-interoperability-key-for-global-blockchain-adoption/">interoperability</a> to the chains— check our descriptive blog given below:                   </li>
<p><a href="https://www.zeeve.io/blog/polygon-cdk-solving-appchain-walled-gardern-and-interoperability-issues/"><strong>How Polygon CDK is solving ‘Walled Garden’ and interoperability issues in appchain ecosystems?</strong></a></p>
<h2>How to deploy a Polygon CDK Chain: the step-by-step process</h2>
<p>This quick-start guide explains how to set up and <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">deploy Polygon CDK-based chain</a>. As we know, Polygon CDK is currently being tested and it will soon be ready for production-grade deployment. However, various CDK validiums have actively been deployed on testnet that can seamlessly transit to mainnet, once its available.&nbsp;</p>
<p>Now, let’s <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">deploy Polygon CDK chain</a>. For this, you will need the following prerequisites.:</p>
<p><strong>Prerequisites:&nbsp;</strong></p>
<li>Linux operating system (example, Ubuntu Server 22.04 LTS)</li>
<li>A minimum of 16GB RAM with 4-core CPU</li>
<li>AMD64 architecture system</li>
<li>Docker&nbsp;</li>
<li>Docker compose&nbsp;</li>
<li>Web3 wallet. E.g Metamask</li>
<h3>Steps to deploy Polygon CDK-based chain</h3>
<p><strong>Step1: Downloading the necessary configuration files:</strong></p>
<p>At first, download all the necessary CDK chain configuration files from repository.&nbsp;</p>
<p>The repository will include the following main files:</p>
<li>Docker-compose.yml: Defines necessary containers for setting up your CDK chain.&nbsp;</li>
<li>Config: Includes a range of commands that enable you to manage the CDK Validium node.</li>
<li>Makefile: Contains all key configuration files for CDK Validium.</li>
<p>Run the below command to clone repository and navigate across it:</p>
<pre class="wp-block-code has-background" style="background-color:#f7f7f7;font-size:16px"><code>git clone https://github.com/Snapchain/zkValidium-quickstart.git 
cd zkValidium-quickstart</code></pre>
<p>Now, create your .<em>env </em>file by coping from the demo:</p>
<pre class="wp-block-code has-background" style="background-color:#f7f7f7;font-size:16px"><code>cp .env.demo .env</code></pre>
<p><strong>Step:2 Deploying your CDK validium:</strong></p>
<p>Once you clone the repository and set the working directory, its time to deploy the CDK Validium. For that, pull all the important Docker images and Docker Hub using the below command:&nbsp;</p>
<pre class="wp-block-code has-background" style="background-color:#f7f7f7;font-size:16px"><code>docker-compose pull</code></pre>
<p><strong>Start the local CDK Validium:</strong></p>
<pre class="wp-block-code has-background" style="background-color:#f7f7f7;font-size:16px"><code>make run</code></pre>
<p><strong>Check the status of containers to ensure all services work properly:</strong></p>
<pre class="wp-block-code has-background" style="background-color:#f7f7f7;font-size:16px"><code>docker-compose ps</code></pre>
<p><strong>Step:3 Interacting with the Validium– testing it:</strong></p>
<p>Kudos! Your <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Polygon CDK chain</a> is now up and running on local host. Now, let’s test its functionalities.</p>
<li>First, you need to verify the block explorer. To do this, navigate through the localhost:4001 where a page similar to below will appear.</li>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jx0tbezsfo15ei5ilcmz.png)
<li>Add your network to any web3 wallet (like Metamask). Set the network to Ethereum mainnet—&gt; go to ‘Networks’—&gt; ‘Add network manually’. Provide details such as chain ID (add 1001), currency symbol (can be anything), RPC Url (http:://localhost:8123), and block explorer URL (http:://localhost:4001).<br></li>
<li>Save the inputs and, switch to the local testnet.</li>
<p>Next, a default account will be created with private key and tokens. To check the balance on the wallet, you need to import this account. Upon this, the current balance will be shown. Now, you can use these <a href="https://www.zeeve.io/blog/introduction-to-token-standards-erc-20-erc-721-erc-777-and-erc-1155/">tokens</a> for various purposes such as sending to other addresses, creating transactions, paying gas fee, etc.</p>
<p><strong>Step:4 Using the bridge</strong></p>
<p>Polygon CDK comes with a native bridge with interactive UI. You can use this bridge to transfer funds between Layer-1 and Layer-2 chains.&nbsp; To do this, you first need to add RPC URL to the wallet, and rest of the details like previous step. Next, connect your wallet and proceed. Once connected successfully, you can use this bridge to transfer funds from <a href="https://www.zeeve.io/blockchain-protocols/deploy-ethereum-blockchain/">Ethereum</a> mainnet to cdk-validum (CDK chain).</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/me6tmxraog5ph06exalr.png)
<h2>Projects building their custom Zk-powered L2 chain with Polygon CDK</h2>
<p>Web3 projects– whether building from scratch or transitioning to Zk-powered chains, they are shifting to <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Polygon CDK</a> on a huge scale. Below are some of the recent projects that are building on the CDK ecosystem:&nbsp;</p>
<p><strong>Manta: </strong>Manta Network is the latest project to shift to Polygon CDK, spinning its own <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Zk-powered Rollup</a>— Mata Pacific <a href="https://www.zeeve.io/blockchain-protocols/deploy-polygon-zkevm-node/">zkEVM</a>. With this transition, Manta aims to leverage strong security guarantees, few -seconds finality, modularity, and sovereignty offered by the CDK framework. Also, Manta plans to lap into the liquidity of various <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">CDK chains</a> using trustless ZK bridge that connects to <a href="https://www.zeeve.io/blockchain-protocols/deploy-ethereum-blockchain/">Ethereum</a>. This connectivity will further allow Manta to enable atomic swaps between L1 and L2 chains. Overall, Manta is building a highly scalable, customizable, and robust <a href="https://www.zeeve.io/rollups/">Rollup ecosystem</a> with Polygon CDK.&nbsp;</p>
<p><strong>Astar Network: </strong>Astar Network is another latest project building its ZK powered custom L2 chain using <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Polygon CDK</a>. The chain will implement better <a href="https://www.zeeve.io/blog/web3-explained-the-ultimate-beginners-guide/">web3</a> strategies while guaranteeing increased security, scalability, and <a href="https://www.zeeve.io/blog/how-blockchain-is-changing-the-way-we-deal-with-data-privacy/">privacy</a>. It will further allow Astar zkEVM to offer functionalities such as full EVM–equivalence, bridging of ETH from testnet to Astar zkEVM, token faucets, advanced block explorers, and a variety of customizable ZK-based features.&nbsp;</p>
<p><strong>Plena Finance: </strong>Plena finance— the leading <a href="https://www.zeeve.io/blog/banking-the-unbanked-defi-promoting-financial-inclusion/">DeFi</a> project has recently announced that the platform is transitioning to a SuperApp– Plena crypto super app built with Polygon CDK. The app will provide a more intuitive and unified experience. For this, it accepts transaction fees in any <a href="https://www.zeeve.io/blog/introduction-to-token-standards-erc-20-erc-721-erc-777-and-erc-1155/">token</a> with CDK’s Account Abstraction feature, 30% cheaper transactions, custody of funds, quick wallet recovery, and superfast transaction confirmation.&nbsp;</p>
<p>Other leading Polygon CDK projects include Immutable, Gnosis Pay, Wirex, Canto, Capx, AaveGotchi, and Idex.</p>
<h2>Deploying a Polygon CDK chain on Zeeve: Try our 1-click Sandbox!&nbsp;</h2>
<p>Zeeve removes the complexity of <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Polygon CDK chain deployment</a> with its one-click deployment interface that offers rich customization options for all kind of projects. With <a href="https://www.zeeve.io/">Zeeve</a>, you do not need any hardware/software setup, node infrastructure, ZK components like DA layers, sequencer, or prover. That’s because Zeeve provides you 'Sandbox environment' where you can test and deploy your Zk-powered chain with few clicks.</p>
<p>The Sandbox comes with a highly optimized default CDK chain setup that you can use just the same or configure it as per your CDK chain’s requirements. The configuration options includes general configurations, blockchain-level configurations, <a href="https://www.zeeve.io/blockchain-protocols/deploy-polygon-zkevm-node/">zkEVM</a> configurations, RPC configurations, infrastructure, and wallet management. Also, you will get a complete set of protocol-level components to integrate into your chain such as nodes, wallets, bridges, wallets, and data indexing tools. The <a href="https://www.zeeve.io/blog/zkrollups-as-a-service-simplifying-launch-of-zero-knowledge-rollups/">whole process of deploying your Polygon CDK chain with Zeeve</a> is very simple and easy to understand so that anyone- with or without technical knowledge can use it.</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4f4fg8nf7e9n7v9thr3x.png)
<p>On top of this, <a href="https://www.zeeve.io/">&nbsp;Zeeve</a> monitors your Polygon CDK chain on critical parameters, maintaining its uptime and performance. The monitoring dashboard further produces real-time alerts to keep you updated.&nbsp;</p>
<p>For more information on how Zeeve is simplifying the deployment and maintenance of <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Polygon CDK chains</a>, connect with our blockchain experts. And, if you are working on a complex <a href="https://www.zeeve.io/rollups/">Rollup</a> project— whether <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Zk</a> or <a href="https://www.zeeve.io/appchains/optimistic-rollups/">Optimistic</a>, we are happy to address all your concerns. Drop us an email or <a href="https://www.zeeve.io/talk-to-an-expert/">schedule a one-to–one call with us</a>.&nbsp;</p>