Back to Blog

Blog

Check out our blog with the latest news, stories and announcement from the NeonEVM ecosystem.

All
Tutorials

Effortless Cross-Chain Communication with Neon EVM, Hyperlane and Solana’s Speed (Part 1)

Written by
Daria Agadzhanova
Published on
04 Sep 2024
Copy link

In the ever-evolving landscape of blockchain technology, interoperability has become a crucial factor for widespread adoption and efficient ecosystem growth. Today, we're diving into an exciting development that brings together the best of multiple worlds: cross-chain messaging, EVM compatibility and Solana’s speed.

In this blog post, we will dive into the process of deploying Hyperlane contracts to Neon EVM, enabling cross-chain messaging between Neon and Ethereum, and utilizing Warp routes for token transfers. But here's the kicker – we're not just connecting Ethereum to another EVM-compatible chain. Through Neon EVM, we're actually opening a fast lane directly to Solana's high-performance blockchain.

By the end of this guide, you'll have a clear understanding of how to:

  1. Add Neon EVM to Hyperlane's supported networks
  2. Implement cross-chain messaging between Neon and Ethereum (or any other EVM-compatible chain)
  3. Set up Warp routes for seamless token transfers
  4. Leverage Neon EVM as a bridge to tap into Solana's unique capabilities

Whether you're a developer looking to expand your dApp's reach, or a blockchain enthusiast curious about the future of cross-chain interactions, this tutorial will showcase how Neon EVM is paving the way for a more interconnected and efficient blockchain ecosystem.

Let's dive in and explore how we can break down the barriers between chains and unlock new possibilities in decentralized applications!

What is Neon EVM

Neon EVM is the first parallelized EVM on Solana. Neon empowers developers to build and deploy dApps seamlessly from EVM chains to Solana, all from their existing codebase.

What is Hyperlane

Hyperlane is an interoperability protocol that facilitates seamless communication between different blockchain networks.

n this tutorial, we will add Neon EVM to the networks supported by Hyperlane, deploy a Hyperlane warp route and seamlessly send messages and tokens across chains.

Adding Neon EVM to Hyperlane

Prerequisites:

To create a custom chain config for Neon, run:

hyperlane registry init

Follow the prompts to set up your RPC URL, chain name, and chain ID. Setting up block or gas properties is optional.

? Enter http or https rpc url: https://devnet.neonevm.org
? Enter chain name (one word, lower case) neondev
? Enter chain display name NeonDev
? Detected chain id as 245022926 from JSON RPC provider, is this correct? yes
? Is this chain a testnet (a chain used for testing & development)? yes
? Do you want to add a block explorer config for this chain yes
? Enter a human readable name for the explorer: blockscout
? Enter the base URL for the explorer: https://neon-devnet.blockscout.com/
? Enter the base URL for requests to the explorer API: https://neon-devnet.blockscout.com/api-docs
? Select the type (family) of block explorer: blockscout
? Optional: Provide an API key for the explorer, or press 'enter' to skip. Please be sure to remove this field if you intend to add your config to the Hyperlane registry:
? Do you want to set block or gas properties for this chain config no
? Do you want to set native token properties for this chain config (defaults to ETH) yes
? Enter the native token's symbol: NEON
? Enter the native token's name: NEON
? Enter the native token's decimals: 18

After this, you will have the following config saved to your .hyperlane folder.

   blockExplorers:
     - apiUrl: https://neon-devnet.blockscout.com/api-docs
       family: blockscout
       name: blockscout
       url: https://neon-devnet.blockscout.com/
   chainId: 245022926
   displayName: NeonDev
   domainId: 245022926
   isTestnet: true
   name: neondev
   nativeToken:
     decimals: 18
     name: NEON
     symbol: NEON
   protocol: ethereum
   rpcUrls:
     - http: https://devnet.neonevm.org

Next, add the private key from your wallet and run:

export HYP_KEY=<YOUR_PRIVATE_KEY>
hyperlane core init

Follow the CLI prompts and create a deployment config:

owner: "YOUR_WALLET_ADDRESS"
   defaultIsm:
     type: trustedRelayerIsm
     relayer: "<DEPLOYMENT_ADDR>"
   defaultHook:
     type: merkleTreeHook
   requiredHook:
     owner: "YOUR_WALLET_ADDRESS"
     type: protocolFee
     beneficiary: "YOUR_WALLET_ADDRESS"
     maxProtocolFee: "100000000000000000"
     protocolFee: "0"

We are going to deploy the Hyperlane Protocol contracts to Neon EVM. Before proceeding, make sure you have enough devnet tokens from neonfaucet.org. Since contract deployments on Neon are more expensive than a normal transaction, it is recommended to have at least 600 testnet NEON, since we are deploying multiple contracts.

Next, run:

hyperlane core deploy

You should see the output similar to this, with your deployment addresses:

Screenshot 2024-08-26 at 22.09.12.png
Screenshot 2024-08-26 at 22.09.59.png

Now, let’s go ahead and relay a test message from Ethereum testnet to Neon devent:

hyperlane send message --relay --origin holesky
--destination neondev --body "hello:)"

Screenshot 2024-08-26 at 22.12.00.png

After the message is relayed, we can click on the link, provided in terminal and check the transaction.

https://neon-devnet.blockscout.com/tx/0xfe621b2b402d8172f0a37496d67746ed15daeeeed0fd318e1625769917fd1ed5

Screenshot 2024-08-26 at 22.13.10.png

And here we can see our message in the UTF-8 format in transaction input.

We can also check out Neonscan and see the transaction hash on Solana.

Let’s scroll down to instruction data. And here we have our original message encoded in hex format:

Screenshot 2024-08-26 at 22.19.11.png

Let's take a moment to appreciate what we've achieved here. We've successfully sent a message from Ethereum to Neon EVM and Solana with zero reconfiguration and using only Solidity contracts.using Neon EVM and Hyperlane. Our simple "hello:)" message started on Ethereum, passed through Hyperlane, and landed on Neon EVM and Solana. We can verify this journey by checking the transaction on both Neon's block explorer and Solana's Neonscan. This opens up many possibilities for real life usage. Imagine having your identity verified on Ethereum and being able to use it seamlessly on Solana-based applications. Or DAOs could make decisions on Ethereum or an L2 and have them automatically executed on Neon.

Latest

From the Blog

The latest industry news, interviews, technologies, and resources.
View all posts
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
By subscribing, you agree to receive marketing and promotional updates from Neon.