Arbitrary Messaging: EVM to TON

This tutorial demonstrates how to send a CCIP arbitrary message from an Ethereum Virtual Machine (EVM) chain to the TON blockchain using Chainlink CCIP. You will learn how to deploy a receiver contract on TON, send a message from Ethereum Sepolia, and verify its delivery.

Introduction

This tutorial covers sending a data-only message from Ethereum Sepolia to a receiver contract on TON Testnet. When you send a message using CCIP:

  1. The ccipSend transaction is submitted to the CCIP Router on the source EVM chain.
  2. The Router deducts the protocol fee and forwards the message to the CCIP Decentralized Oracle Network (DON).
  3. The DON delivers the message to the Receiver_CCIPReceive handler of your receiver contract on TON Testnet.
  4. Your receiver contract acknowledges delivery by sending Router_CCIPReceiveConfirm back to the TON CCIP Router.

What You Will Build

In this tutorial, you will:

  • Deploy a MinimalReceiver contract on TON Testnet.
  • Configure a CCIP message with a text payload.
  • Send the message from Ethereum Sepolia to your deployed receiver.
  • Pay for CCIP fees using native ETH or LINK.
  • Monitor and verify cross-chain message delivery on TON.

Deploy the Receiver on TON

Before sending a message, you need a receiver contract deployed on TON Testnet. The starter kit includes a deploy script for the MinimalReceiver contract:

Terminal
npm run deploy:ton:receiver:minimal

On success, the script prints output similar to the following:

๐Ÿš€ Deploying MinimalReceiver contract to TON Testnet...

๐Ÿ“ค Deploying from wallet: EQBTzZB_jpRo1oR3wLsxhrS7tPLUDteL9NN_83S1fWwanyHK
Explorer: https://testnet.tonviewer.com/EQBTzZB_jpRo1oR3wLsxhrS7tPLUDteL9NN_83S1fWwanyHK
๐Ÿ’ฐ Wallet balance: 106.538102666 TON

โณ Compiling MinimalReceiver.tolk...
๐Ÿ“ Contract will be deployed at: EQBt4-OlEHzH_MsmHdl_YsL26f3OPpV2jRzZ34zxo9E2xasT
๐Ÿ“ Router address (authorized caller): EQB9QIw22sgwNKMfqsMKGepkhnjXYJmXlzCgcBSAlaiF9VCj

โณ Sending deployment transaction...

โœ… MinimalReceiver deployment initiated!
๐Ÿ“ Contract address: EQBt4-OlEHzH_MsmHdl_YsL26f3OPpV2jRzZ34zxo9E2xasT
๐Ÿ“ Next steps:
1. Wait 1-2 minutes for the transaction to be confirmed
2. Copy the contract address above โ€” pass it as --tonReceiver when sending messages
3. Verify deployment on TON explorer:
   https://testnet.tonviewer.com/EQBt4-OlEHzH_MsmHdl_YsL26f3OPpV2jRzZ34zxo9E2xasT
4. Send a test message to the deployed receiver:
   npm run evm2ton:send -- --sourceChain <source-chain> --tonReceiver EQBt4-OlEHzH_MsmHdl_YsL26f3OPpV2jRzZ34zxo9E2xasT --msg "Hello TON from EVM" --feeToken native

Save the contract address โ€” you will pass it as --tonReceiver in the next step.

How the Script Works

The evm2ton/sendMessage.ts script handles the EVM-side interaction with the CCIP Router on your behalf. Here is what happens behind the scenes:

  1. Context Initialization: The script connects to the EVM chain and loads your wallet from the EVM_PRIVATE_KEY environment variable.
  2. Argument Parsing: It reads your command-line arguments (--sourceChain, --tonReceiver, --msg, and --feeToken) to determine the source chain, receiver address, message content, and fee payment method.
  3. Address Encoding: It encodes your TON receiver address into the 36-byte format expected by the EVM-side CCIP message using encodeTONAddress().
  4. Message Construction: It builds the EVM2AnyMessage struct using buildCCIPMessageForTON(receiverBytes, messageData, 100_000_000n, true, selectedFeeToken). The 100_000_000n nanoTON gasLimit covers receiver execution on TON. Note that allowOutOfOrderExecution must be true โ€” TON-bound lanes require it, and the Router will reject the message otherwise.
  5. Fee Estimation: It calls getCCIPFeeForTON() to retrieve the CCIP protocol fee from the on-chain Router, then applies a 10% buffer.
  6. Sending: For native fees, it calls router.ccipSend(destChainSelector, message, { value: feeWithBuffer }). For LINK fees, it checks the current allowance, approves the Router if needed, then calls router.ccipSend(destChainSelector, message).

Send the Message

Run the following command to send a message from Ethereum Sepolia to your deployed receiver on TON:

Terminal
npm run evm2ton:send -- \
  --sourceChain sepolia \
  --tonReceiver <YOUR_TON_RECEIVER_ADDRESS> \
  --msg "Hello TON from EVM" \
  --feeToken native

Replace <YOUR_TON_RECEIVER_ADDRESS> with the address from the deployment step. To pay fees in LINK instead of ETH, pass --feeToken link.

Understanding the Output

When the script executes successfully, you will see output similar to the following:

๐Ÿงช Testing EVM โ†’ TON Messaging

๐ŸŒ Source Chain: sepolia
๐Ÿ’ธ Fee Token: native
โœ… Connected to EVM, Block: 10554561
๐Ÿ“ค Sending from: 0x8C244f0B2164E6A3BED74ab429B0ebd661Bb14CA
๐Ÿ’ฐ Balance: 8.088902489560498964 ETH

โœ… Transaction submitted!
   Hash: 0x581ea250df1538f6ef999c98db7fb30897d62efecad6614f09d67f7c05f18dec

โณ Waiting for confirmation...
โœ… Transaction confirmed in block: 10554562
๐Ÿ“‹ Message ID: 0xcf5c283fb14942e82498b0a1887bb2c525f0a8a065b5682230af4518dc53bff0
๐Ÿ” Track on CCIP Explorer: https://ccip.chain.link/#/side-drawer/msg/0xcf5c283fb14942e82498b0a1887bb2c525f0a8a065b5682230af4518dc53bff0


โณ Message is being processed by CCIP network...
โณ Expected delivery: 5-15 minutes (staging environment)

๐Ÿ” Monitor your transaction:
   https://sepolia.etherscan.io/tx/0x581ea250df1538f6ef999c98db7fb30897d62efecad6614f09d67f7c05f18dec

๐Ÿ” Monitor delivery on TON:
   https://testnet.tonviewer.com/EQBt4-OlEHzH_MsmHdl_YsL26f3OPpV2jRzZ34zxo9E2xasT

๐Ÿ’ก Run verification script after 10-15 minutes:
   npm run utils:checkTON -- --sourceChain sepolia --tonReceiver EQBt4-OlEHzH_MsmHdl_YsL26f3OPpV2jRzZ34zxo9E2xasT --msg "Hello TON from EVM"

The CCIP Message ID and Explorer link let you track the message lifecycle across chains.

Verification

After sending, verify delivery on TON in the following ways.

Track on CCIP Explorer

Use the CCIP Explorer URL printed in the output to monitor the full cross-chain message lifecycle:

https://ccip.chain.link/#/side-drawer/msg/<YOUR_CCIP_MESSAGE_ID>

Verify Delivery on TON

CCIP delivery from Ethereum Sepolia to TON Testnet typically takes 5โ€“15 minutes. After waiting, run the verification script:

Terminal
npm run utils:checkTON -- \
  --sourceChain sepolia \
  --tonReceiver <YOUR_TON_RECEIVER_ADDRESS> \
  --msg "Hello TON from EVM"

When the message has been successfully delivered, you will see output similar to the following:

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
  EVM โ†’ TON Message Verification
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐Ÿ“ Receiver Contract: EQBt4-OlEHzH_MsmHdl_YsL26f3OPpV2jRzZ34zxo9E2xasT
๐ŸŒ Source Chain: sepolia
๐Ÿ” Looking for message: "Hello TON from EVM"
๐Ÿ” Expected sender: EQB9QIw22sgwNKMfqsMKGepkhnjXYJmXlzCgcBSAlaiF9VCj (CCIP Router)

๐Ÿ“Š Fetching recent transactions...

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
  โœ… CCIP MESSAGE FOUND
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐Ÿ“จ Most Recent CCIP Message:
   From:                EQB9QIw22sgwNKMfqsMKGepkhnjXYJmXlzCgcBSAlaiF9VCj (CCIP Router โœ“)
   Message ID:          0xcf5c283fb14942e82498b0a1887bb2c525f0a8a065b5682230af4518dc53bff0
   CCIP Explorer:       https://ccip.chain.link/#/side-drawer/msg/0xcf5c283fb14942e82498b0a1887bb2c525f0a8a065b5682230af4518dc53bff0
   Value:               0.1 TON
   Message:             "Hello TON from EVM"
   Time:                2026-03-30T16:10:45.000Z
   TX Hash:             21048345fbf52bf7c02f64d587bf6a6dd9567ad1786cd2abeaa1c1399f940f86

   ๐Ÿ“ Received 1 minute(s) ago

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
  VERIFICATION RESULT
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โœ… Message verified successfully!

   โœ“ Message content matches: "Hello TON from EVM"
   โœ“ From CCIP Router

๐Ÿ“Š Total CCIP messages found: 3
   (showing most recent above)

๐Ÿ”— View on explorer:
   https://testnet.tonviewer.com/transaction/21048345fbf52bf7c02f64d587bf6a6dd9567ad1786cd2abeaa1c1399f940f86
   Receiver: https://testnet.tonviewer.com/EQBt4-OlEHzH_MsmHdl_YsL26f3OPpV2jRzZ34zxo9E2xasT

Verify on TON Explorer

You can also verify delivery directly on the TON Testnet block explorer:

  1. Visit testnet.tonviewer.com
  2. Search for your receiver contract address
  3. Under Transactions, you should see an incoming message from the CCIP Router (EQB9QIw22sgwNKMfqsMKGepkhnjXYJmXlzCgcBSAlaiF9VCj) containing your payload

Get the latest Chainlink content straight to your inbox.