# How to Deploy Your Own Hyperlane on Polygon zkEVM

gm gm gm!!!  

New chains are popping up by the minute, so getting liquidity there is a burning issue. Hyperlane tries to solve this with permissionless bridges. Hyperlane is a permissionless protocol, which means you can deploy your own Hyperlane on any chain without asking the core team. In this guide, you will learn how to deploy Hyperlane on [Polygon zkEVM](https://wiki.polygon.technology/docs/zkevm/) Testnet, [Polygon](https://wiki.polygon.technology/docs/pos/getting-started/) Mumbai Testnet and Sepolia.

There are five steps we need to follow so LFG🚀

[![Subscribe to the Developer DAO Newsletter. Probably Nothing](https://sitemedia.ams3.digitaloceanspaces.com/blog_banner_v1_d1653cce08.png align="left")](https://devdao.to/blog-newsletter-1)

## Prerequisites

* [Yarn](https://classic.yarnpkg.com/lang/en/docs/cli/install/)
    
* [Git and GitHub knowledge](https://github.com/)
    
* Understanding of blockchain
    
* Optional: Solidity experience
    

## 1. Setting Up the Keys

Deploying Hyperlane includes smart contracts, validators, and relayers, each requiring a key pair.

### The Deployment Keys

To deploy smart contracts, you must have a key pair with the funds for all the chains you will be deploying.

To create the keys, follow these steps:

* Open your Terminal and enter the following command
    
    ```bash
    cast wallet new
    ```
    
    This will generate new keys for you, which will look something like this 👇🏻
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695271307360/af69b0d0-75a9-421b-b7c2-53147bc13899.png align="center")
    
    <div data-node-type="callout">
    <div data-node-type="callout-emoji">⚠</div>
    <div data-node-type="callout-text">THIS IS A TESTING WALLET.</div>
    </div>
    
* Save your public address and private key.
    
* Fund your address with the tokens of all the networks.
    
    * For tokens on Polygon zkEVM Testnet and Polygon Mumbai Testnet, use [Polygon faucet.](https://faucet.polygon.technology/)
        
    * For tokens on Sepolia, you can use the [Alchemy faucet](https://sepoliafaucet.com/).
        
### The Validator Keys

This tutorial will use the default [Hyperlane's Multisig ISM](https://docs.hyperlane.xyz/docs/protocol/sovereign-consensus/multisig-ism). Multisig ISM is a module that takes several signatures from validators before completing the transaction. We use 4 addresses with the threshold 1.

Copy any 4 of your public addresses for later use.

> Note: Make sure to have a private key secured for the public addresses you use. You can generate key pairs using the above method.

## 2. Cloning the Deploy Repository

The Hyperlane team provides you with a repository that you can use to deploy Hyperlane on your preferred chain.

Follow these steps to set up the Hyperlane deployment repo:

* Open your terminal at your preferred directory.
    
* ```bash
      git clone https://github.com/hyperlane-xyz/hyperlane-deploy.git
    ```
    
* ```bash
      cd hyperlane-deploy
    ```
    
* ```bash
      yarn install
    ```
    
## 3. Adding a Custom Chain to Hyperlane

Hyperlane provided a [few chains in the SDK](https://docs.hyperlane.xyz/docs/resources/addresses). To add a chain missing from this list, follow these steps:

* Open `config/chains.ts`, where you will find the configuration example for adding new chains.
    
* Add the following configuration for the Polygon zkEVM Testnet:
    
    ```typescript
      polygonzkevmtestnet: {
        name: 'polygonzkevmtestnet',
        chainId: 1442,
        protocol: ProtocolType.Ethereum,
        nativeToken: {
          name: 'ether',
          symbol: 'ETH',
          decimals: 18,
        },
        rpcUrls: [
          {
            http: 'https://rpc.public.zkevm-test.net',
          },
        ],
        blockExplorers: [
          {
            name: 'Polygon Scan',
            url: 'https://testnet-zkevm.polygonscan.com',
            apiUrl: 'https://api-zkevm.polygonscan.com/api',
          },
        ],
        isTestnet: true,
      },
    ```
   
## 4. Adding the Validator Keys

We will use the default [Multisig](https://docs.hyperlane.xyz/docs/protocol/sovereign-consensus/multisig-ism) as our Interchain Security Module.

Follow these steps to set up the keys:

* Open `config/multisig_ism.ts`. You will find the configuration example for adding new chains and their keys there.
    
* Add the keys for your validator:
    
    ```typescript
      polygonzkevmtestnet: {
        threshold: 1,
        type: ModuleType.LEGACY_MULTISIG,
        validators: [
          '0xabcabcabcabcabcabcabcabcabcabcabcabcabca',
          '0xabcabcabcabcabcabcabcabcabcabcabcabcabca',
          '0xabcabcabcabcabcabcabcabcabcabcabcabcabca',
          '0xabcabcabcabcabcabcabcabcabcabcabcabcabca',
        ],
      },
    ```
    
* `threshold` is 1, which means only one of the validator's signatures is required.
    

**Woohoooo!!!** You are done setting up the Hyperlane deployment on Polygon zkEVM testnet with remotes Mumbai and Sepolia.

---

## 5. Deploying Your Hyperlane

To deploy Hyperlane, run the following command on your terminal.

```bash
DEBUG=hyperlane* yarn ts-node scripts/deploy-hyperlane.ts --local polygonzkevmtestnet \
  --remotes mumbai sepolia \
  --key 0xbeda2b3910bae7dbfb4e65e9c0931f001066d4f0df257b77ad55093fa271bde2
```

In the above command,

* we are running the `deploy-hyperlane.ts` script
    
* with `polygonzkevmtestnet` as `local` chain and
    
* `mumbai` and `sepolia` as remotes. Since `mumbai` and `sepolia` are already provided by the Hyperlane SDK we don't need to add the configurations again.
    
* the value after `key` param is your private key to the address that contains funds for all the networks.
    

After running the command, wait for a few minutes till your terminal looks like this 👇🏻

---

Congrats!!! You just deployed Hyperlane on Polygon zkEVM Testnet.

To test this deployment, you must run validators and relayers for all the chains you deployed (local + remote). To learn how to set up validators and relayers, check out these guides on the Hyperlane blog 👇🏻

%[https://blog.hyperlaneindia.xyz/hyperlane-relayers-setup-guide] 

%[https://blog.hyperlaneindia.xyz/hyperlane-validators-setup-guide] 

---

Thanks for reading this article; I hope you learned something today.

<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">If you wanna explore more check out the <a target="_blank" rel="noopener noreferrer nofollow" href="https://docs.hyperlane.xyz" style="pointer-events: none">Hyperlane Docs</a>, and if you have any queries get them resolved in <a target="_blank" rel="noopener noreferrer nofollow" href="http://t.me/c/1264208834/1" style="pointer-events: none">Hyperlane India Telegram Channel.</a></div>
</div>

Let me know if you have any doubts on [*Twitter*](https://twitter.com/megabyte0x)*,* [*Lenster*](https://lenster.xyz/u/megabyte0x) *or* [*LinkedIn*](https://linkedin.com/in/megabyte0x)*.*

***Happy Learning 🙌🏻***

***Keep Building 🧱🚀***


