Transfer Data
Send arbitrary data (messages) cross-chain using a three-step workflow: estimate fees, send the message, and track execution.
Workflow
| Step | Command | Purpose |
|---|---|---|
| 1. Estimate | send --only-get-fee | Get fee quote |
| 2. Send | send --data | Execute transfer |
| 3. Track | show | Monitor execution |
Prerequisites
Configure RPC endpoints and wallet:
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:
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:
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
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:
ccip-cli send \
-s ethereum-testnet-sepolia \
-r 0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59 \
-d ethereum-testnet-sepolia-arbitrum-1 \
--receiver 0xYourReceiverAddress \
--data 0x1234abcdef \
--wallet ledger
Pay fee in LINK
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:
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:
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:
ccip-cli show 0xYourTransactionHash
Wait for execution to complete:
ccip-cli show 0xYourTransactionHash --wait
Or include --wait in the send command:
ccip-cli send \
-s ethereum-testnet-sepolia \
-r 0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59 \
-d ethereum-testnet-sepolia-arbitrum-1 \
--receiver 0xYourReceiverAddress \
--data "hello world" \
--wallet ledger \
--wait
Example
# 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:
| Format | Example | Behavior |
|---|---|---|
| Text | "hello world" | UTF-8 encoded automatically |
| Hex | 0x1234abcd | Used as-is (must start with 0x) |
For structured data, encode it as hex before sending:
# ABI-encoded function call
--data 0x095ea7b3000000000000000000000000...
Chain-Specific Behavior
- EVM to EVM
- EVM to Solana
- Solana to EVM
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)
Messages are delivered to a Solana program. Additional accounts may be required.
ccip-cli send \
-s ethereum-testnet-sepolia \
-r 0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59 \
-d solana-devnet \
--receiver <SOLANA_PROGRAM_ADDRESS> \
--data "hello solana" \
--account <ACCOUNT_1> \
--account <ACCOUNT_2>=rw \
--wallet ledger
Source addresses use Solana format.
ccip-cli send \
-s solana-devnet \
-r <SOLANA_ROUTER> \
-d ethereum-testnet-sepolia \
--receiver 0xEvmAddress \
--data "hello evm" \
--wallet ledger
Failures
For failed messages, see Debugging Failed Messages.
| Issue | Cause | Solution |
|---|---|---|
| Execution failed | Insufficient gas | Retry with manualExec --gas-limit |
| Receiver reverts | Contract logic error | Fix receiver contract |
| Invalid receiver | Not a contract | Use a valid contract address |
Related
- send - Command reference
- show - Command reference
- Token Transfer - Transfer tokens
- Transfer Tokens and Data - Transfer both
- Configuration - RPC and wallet setup