Skip to main content
Version: 0.96.0

Transfer Data

Send arbitrary data (messages) cross-chain using a three-step workflow: estimate fees, send the message, and track execution.

Workflow

StepCommandPurpose
1. Estimatesend --only-get-feeGet fee quote
2. Sendsend --dataExecute transfer
3. TrackshowMonitor execution

Prerequisites

Configure RPC endpoints and wallet:

Bash
.env
RPC_SEPOLIA=https://ethereum-sepolia-rpc.publicnode.com
RPC_ARB_SEPOLIA=https://arbitrum-sepolia-rpc.publicnode.com
USER_KEY=0xYourPrivateKeyHere

Required balances on source chain:

  • Gas for source transaction
  • CCIP fee (native token or LINK)

Step 1: Estimate Fee

Get the fee quote before sending:

Bash
ccip-cli send \
-s ethereum-testnet-sepolia \
-r 0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59 \
-d ethereum-testnet-sepolia-arbitrum-1 \
--receiver 0xYourReceiverAddress \
--data "hello world" \
--only-get-fee

Output:

Fee: 0.000123456789012345 ETH (native)

To get the fee in LINK:

Bash
ccip-cli send \
-s ethereum-testnet-sepolia \
-r 0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59 \
-d ethereum-testnet-sepolia-arbitrum-1 \
--receiver 0xYourReceiverAddress \
--data "hello world" \
--fee-token LINK \
--only-get-fee

Step 2: Send Message

Simple text message

Bash
ccip-cli send \
-s ethereum-testnet-sepolia \
-r 0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59 \
-d ethereum-testnet-sepolia-arbitrum-1 \
--receiver 0xYourReceiverAddress \
--data "hello world" \
--wallet ledger

Hex-encoded data

For binary data or contract calls, use hex encoding:

Bash
ccip-cli send \
-s ethereum-testnet-sepolia \
-r 0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59 \
-d ethereum-testnet-sepolia-arbitrum-1 \
--receiver 0xYourReceiverAddress \
--data 0x1234abcdef \
--wallet ledger
Bash
ccip-cli send \
-s ethereum-testnet-sepolia \
-r 0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59 \
-d ethereum-testnet-sepolia-arbitrum-1 \
--receiver 0xYourReceiverAddress \
--data "hello world" \
--fee-token LINK \
--wallet ledger

With custom gas limit

For receivers with complex message handling:

Bash
ccip-cli send \
-s ethereum-testnet-sepolia \
-r 0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59 \
-d ethereum-testnet-sepolia-arbitrum-1 \
--receiver 0xYourReceiverAddress \
--data "hello world" \
--gas-limit 500000 \
--wallet ledger

With estimated gas limit

Automatically estimate gas with a buffer:

Bash
ccip-cli send \
-s ethereum-testnet-sepolia \
-r 0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59 \
-d ethereum-testnet-sepolia-arbitrum-1 \
--receiver 0xYourReceiverAddress \
--data "hello world" \
--estimate-gas-limit 10 \
--wallet ledger

Step 3: Track Message

Check message status:

Bash
ccip-cli show 0xYourTransactionHash

Wait for execution to complete:

Bash
ccip-cli show 0xYourTransactionHash --wait

Or include --wait in the send command:

Bash
ccip-cli send \
-s ethereum-testnet-sepolia \
-r 0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59 \
-d ethereum-testnet-sepolia-arbitrum-1 \
--receiver 0xYourReceiverAddress \
--data "hello world" \
--wallet ledger \
--wait

Example

Bash
# Estimate fee
ccip-cli send \
-s ethereum-testnet-sepolia \
-r 0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59 \
-d ethereum-testnet-sepolia-arbitrum-1 \
--receiver 0xAB4f961939BFE6A93567cC57C59eEd7084CE2131 \
--data "cross-chain message" \
--only-get-fee

# Send message
ccip-cli send \
-s ethereum-testnet-sepolia \
-r 0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59 \
-d ethereum-testnet-sepolia-arbitrum-1 \
--receiver 0xAB4f961939BFE6A93567cC57C59eEd7084CE2131 \
--data "cross-chain message" \
--wallet ledger

# Track execution
ccip-cli show 0xabc123... --wait

Data Format

The --data option accepts two formats:

FormatExampleBehavior
Text"hello world"UTF-8 encoded automatically
Hex0x1234abcdUsed as-is (must start with 0x)

For structured data, encode it as hex before sending:

Bash
# ABI-encoded function call
--data 0x095ea7b3000000000000000000000000...

Chain-Specific Behavior

Messages are delivered to the receiver contract's ccipReceive function. The receiver must implement the IAny2EVMMessageReceiver interface.

Receiver requirements:

  • Must implement ccipReceive(Client.Any2EVMMessage)
  • Must be a valid smart contract (not an EOA)

Failures

For failed messages, see Debugging Failed Messages.

IssueCauseSolution
Execution failedInsufficient gasRetry with manualExec --gas-limit
Receiver revertsContract logic errorFix receiver contract
Invalid receiverNot a contractUse a valid contract address