Arbitrary Messaging: Canton as Destination
This tutorial demonstrates how to send arbitrary data from Ethereum Sepolia to Canton and execute the message on Canton using the ccip-starter-kit-canton.
Introduction
When Canton is the destination chain, the source send happens on Ethereum Sepolia and execution happens on Canton. For data-only messages:
- You call the CCIP Router on Sepolia via
any2canton:data. - CommitteeVerifier operators validate and aggregate proofs.
- You run
any2canton:manual-execto execute on Canton โ the SDK finds or creates a compatibleCCIPReceiver.
What You Will Build
In this tutorial, you will:
- Send a data-only message from Sepolia to your Canton party with
any2canton:data. - Wait for source finality and Committee Verifier proofs on the indexer.
- Execute the message on Canton with
any2canton:manual-exec. - Track progress in the CCIP Explorer.
Understanding Arbitrary Messaging (any2canton)
Key points when Canton is the destination:
- Two-step flow: Send on Sepolia, then manually execute on Canton (all
any2cantontutorials use manual execution on Canton). - Receiver: Defaults to the
partyincanton-config.json. Override with--cantonReceiveron send or--receiveron manual exec. - Finality: Default
--finality finalizedwaits for Sepolia finality before execution is allowed. Pass--finality 32(or another block depth) for faster-than-finality. - Fee payment: CCIP fees on Sepolia default to native ETH. Pass
--feeToken linkto pay in LINK.
See the Canton as Destination flow in the overview.
How the Scripts Work
scripts/any2canton/ccipSendData.ts:
- Resolves the Canton receiver party from
canton-config.json. - Builds and sends a data-only CCIP message via the SDK's
sendMessageon Sepolia. - Prints the CCIP Message ID and a copy-pasteable
any2canton:manual-execcommand.
scripts/any2canton/manualExecute.ts:
- Looks up the message using the Sepolia source transaction hash from the send output.
- Fetches proofs from the indexer and disclosures from Global CCIP EDS.
- Calls
CantonChain.executeโ the SDK resolves or creates theCCIPReceiverand submits to the ledger.
Running the Tutorial
Prerequisites Check
-
Complete prerequisites.
-
Confirm Sepolia ETH balance:
Terminalnpm run check-balance -- --chain sepolia --token link
Step 1: Send from Sepolia
npm run any2canton:data -- --dataString "Hello Canton"
Pay fee in LINK:
npm run any2canton:data -- --dataString "Hello Canton" --feeToken link
Request faster execution with block-depth finality (32 confirmations):
npm run any2canton:data -- --dataString "Hello Canton" --finality 32
Override the Canton receiver party:
npm run any2canton:data -- --dataString "Hello Canton" --cantonReceiver 'yourParty::1220โฆ'
Expected send output
๐ง Sending data from Sepolia โ Canton: "Hello Canton"
Receiver party: yourParty::1220โฆ
๐ CCIP Message ID: 0xโฆ
๐ CCIP Explorer: https://ccip.chain.link/#/side-drawer/msg/0xโฆ
๐ Source transaction: https://sepolia.etherscan.io/tx/0xโฆ
โ๏ธ Execute on Canton once the message is finalized on Sepolia:
npm run any2canton:manual-exec -- 0x<messageId>
Save the CCIP Message ID (๐ CCIP Message ID) โ or the Sepolia source transaction hash (๐ Source transaction) โ from the send output for the execution step. any2canton:manual-exec accepts either.
Step 2: Execute on Canton
Wait until the message is ready โ timing depends on --finality:
finalized(default): Wait for Sepolia finality (often 15+ minutes).- Block depth (e.g.
32): Wait for the specified number of Sepolia confirmations.
Monitor status in the CCIP Explorer. When proofs are on the indexer, run:
npm run any2canton:manual-exec -- <sepoliaTxHash | messageId>
You can pass either the Sepolia source transaction hash or the CCIP Message ID (0xโฆ). They share the same 0x+64-hex shape, so the script resolves the message from whichever matches. Examples:
# By Sepolia source transaction hash
npm run any2canton:manual-exec -- 0x5a814d64666f60d2777c5425e8d0ea5a4b1bc9a3215eaeabced8b248050a3b99
# By CCIP Message ID
npm run any2canton:manual-exec -- 0x1220e4133ede8f2daf2e665b53321da54d1bd0b8e00fb1cece20b63079c1d48d6a5b
Expected execution output
โ๏ธ Executing on Canton (OffRamp 0xโฆ)โฆ
Resolving CCIPReceiver, fetching EDS disclosures, and submitting to the ledger โ often 1โ3 minutes with no further output.
โ
Canton execution transaction: https://lighthouse.testnet.cantonloop.com/transactions/โฆ
Verification
- Confirm SUCCESS in the CCIP Explorer.
- Inspect the Canton execution transaction on Canton Lighthouse.