Solana GMP Integration Introduction

Solana is a blockchain that has been integrated with the Axelar Network via the Interchain Amplifier. This integration enables cross-chain communication between Solana and other blockchains in the Axelar ecosystem.

Sending messages between Solana and other blockchains follows similar patterns as GMP messages on other chains, such as EVM chains. The core packages for Axelar’s integration with Solana can be found in the axelar-amplifier-solana repository.

The integration consists of two main components:

  1. Gateway Program - Authenticates and facilitates the sending and receiving of cross-chain messages.
  2. Gas Service Program - Handles cross-chain gas payment for message delivery.

Sending a message from Solana to another chain involves these steps:

  1. Pay gas - Call the Gas Service with the payload hash and destination details to pay for execution on the destination chain.
  2. Send message - Trigger the call contract instruction on the Gateway to emit the cross-chain message.
  3. Relayer processes - Axelar’s relayer picks up the message and routes it through the Axelar Network to the destination chain.

Receiving a message on Solana from another chain involves:

  1. Message approval - The message marked as approved by Axelar’s Verifier Set on the Gateway program via the approve message instruction.
  2. Relayer execution - Axelar’s relayer calls your destination program’s execute instruction.
  3. Message validation - Your program validates the message via CPI (Cross-Program Invocation) to the Gateway program via the validate message instruction.
  4. Payload processing - Once validated, your program processes the message payload and executes your program’s own logic.

When working with Axelar on Solana, keep in mind:

  • Program Derived Addresses (PDAs): Solana programs use PDAs instead of private keys for signing. Your program will need a signing PDA to call the Gateway.
  • Cross-Program Invocations (CPIs): Interaction with the Gateway and Gas Service happens via CPIs.
  • Account Model: Unlike EVM’s storage model, Solana uses an account-based architecture where state is stored in separate accounts.
  • Anchor Framework: The Axelar Solana programs are built using the Anchor framework, which provides helpful abstractions.

💡

Note: The Gateway Program handles message authentication and state management, while your destination program handles the actual message execution and business logic.

Edit on GitHub