Send messages from XRPL

In addition to transferring tokens across chains, Axelar enables cross-chain communication through Axelar's General Message Passing (GMP). GMP enables developers to call any function on any other connected chain. For example, smart contracts on EVM-compatible chains, such as the XRPL EVM, can be triggered directly from the XRP Ledger (XRPL).

To send a message from one chain to another, there are some key aspects to consider:

  • The destination chain must be an EVM-compatible chain, as executing messages requires a smart contract.
  • The destination contract address must inherit from AxelarExecutable

Sending a message from XRP Ledger to XRPL EVM

To send a message from the XRP Ledger (XRPL) to the XRPL EVM, a Payment transaction is used with the following key parameters:

  • Amount: Represents the value of the asset to be sent. If the message does not include an asset transfer, this can be set to 1 drop (the smallest XRP unit).
  • Destination: The address of the Gateway on the XRP Ledger.
  • Memos: Hex-encoded data required for the function call, including:
    • The type of call to initiate.
    • The destination chain on the Axelar network.
    • The contract address on the destination chain to which the message is sent.
    • The payload hash, which contains the data to be sent to the destination contract. This payload must be ABI-encoded. The ethers AbiCoder can be used for encoding the payload.

See Axelar's documentation for a guide on making GMP contract calls.