All posts
8 min read

Cross-Chain Swaps from TON to Arbitrum: How They Work

Cross-chain TON → Arbitrum swap via MCP: atomic HTLC escrow, non-custodial, no key custody. How the flow works and which networks are supported.

cross-chainTONArbitrumHTLCnon-custodialMCP

The TON → Arbitrum cross-chain swap: money stuck between two networks

The classic scenario: your AI agent holds a balance in a TON wallet — GRAM or USDT — but the contract it needs to pay lives on Arbitrum. That's where the cheap gas is, where the liquidity is, where the protocol is deployed. The usual route looks like this: withdraw to an exchange, wait for the deposit to clear, buy ETH, withdraw to Arbitrum, lose money on the spread and fees — all of it by hand, through a custodial service you hand your funds to "for safekeeping." For a human that's half an hour of hassle. For an autonomous agent it's a brick wall: it has no exchange account, no KYC, and by definition it should never entrust its private key to someone else's server. And every bridge is yet another integration, another single point of failure, and a steady stream of "bridge got hacked" headlines.

A cross-chain TON → Arbitrum swap targets exactly that problem: move value out of TON into another network in a single atomic trade, without handing your private key to anyone. Here's how it works under the hood, and how to wire it into an agent with five TONNode MCP tools.

Why swap from TON to Arbitrum, and which other networks are available

Arbitrum is a popular L2 destination on top of Ethereum: low fees, mature DeFi infrastructure, plenty of protocols that don't exist on TON. Typical reasons to pick it:

  • move USDT into an ecosystem where the protocol you need accepts it;
  • enter a position on an Arbitrum-native DEX or perp protocol;
  • pay a counterparty on the network they actually support.

TONNode's cross-chain swaps support six destination networks:

  • Ethereum
  • Arbitrum
  • Base
  • BNB Chain
  • Polygon
  • Avalanche

One important constraint to keep in mind: TON is always the source. The flow goes from TON into an EVM network, never the other way around. And TRON is not supported yet — if you're hoping for USDT-TRC20 directly, that route doesn't exist, so don't bake it into your agent's logic. Arbitrum here is simply one of six destinations; everything below applies word for word to a TON → Ethereum or TON → Base swap — only the destination network in the quote changes.

What an HTLC escrow is and why the swap is atomic

The core question of any cross-chain exchange: how do you trade an asset on network A for an asset on network B when the two networks share no common "referee"? The naive answer — trust an intermediary — is precisely the custodial risk we're trying to avoid.

TONNode uses an atomic HTLC escrow (Hashed TimeLock Contract — a contract with a hash lock and a timer). Think of it as two safe-deposit boxes, one on each network, both opened by one and the same secret. It rests on two properties:

  • Hash lock. A random secret S is generated and hashed into H = hash(S). Both boxes — the escrow on TON and the escrow on Arbitrum — are locked to that hash with the condition "release to whoever presents S such that hash(S) == H." Until the secret is revealed, nobody takes anything; the moment S is presented on one side, it becomes visible on the other.
  • Time lock. Each box has a deadline. If the trade doesn't come together, once the timelock expires the funds return to their original owner.

Hence the word atomic: the trade either completes on both networks (secret revealed — both escrows settle) or on neither (timelock expires — both sides get refunded). There is no in-between state of "money left TON but never arrived on Arbitrum." This is not a bridge with a shared pool that can be drained — it's a pair of independent escrows synchronized by a single secret.

The TON → Arbitrum cross-chain swap flow, step by step

The whole exchange is five tools called in order. Each one does exactly one thing.

1. get_crosschain_quote — the quote

You ask how much you'll get on Arbitrum for X GRAM (or X USDT on TON). Back comes a firm quote for the route — rate, fees, parameters.

2. build_crosschain_swap_tx — unsigned HTLC transaction + secret

The server assembles an unsigned transaction that creates the escrow on the TON side, and hands you the secret S (the key to both boxes). The transaction is neither sent nor signed yet — the user's wallet signs it via TonConnect. The secret stays with you; it's what you'll later use to settle.

3. track_crosschain_swap — trade phases on both networks

Once the TON escrow is created, the counterparty posts the matching escrow on Arbitrum. This tool shows the trade phases on both networks: whether the source escrow exists, whether the destination escrow has appeared, whether everything is ready to settle. It's your on-chain readiness detector — you literally see both boxes.

4. disclose_crosschain_secret — reveal the secret to settle

The critical security moment. The secret is revealed only after an on-chain readiness check of the escrow — that is, after the tool has verified that the counterparty's box on Arbitrum actually exists and is funded under the correct hash lock. The reasoning is blunt: until the counter-escrow is in place, you must not reveal the secret — otherwise the counterparty takes your funds without delivering their side. Once the secret is out, both sides collect what's theirs.

5. build_crosschain_refund — the insurance policy

If the trade stalls, this assembles a transaction that returns your funds from the escrow after the timelock expires. There's a dedicated section on this below.

The flow at a glance:

get_crosschain_quote      → quote for TON → Arbitrum
build_crosschain_swap_tx  → unsigned HTLC tx + secret  (your wallet signs)
track_crosschain_swap     → phases on TON and on Arbitrum
disclose_crosschain_secret→ reveal the secret after the on-chain check
build_crosschain_refund   → refund if the trade stalls

The agent only needs a plain-language prompt — it will pick and call the tools in the right order on its own:

Swap 50 USDT from my TON wallet to Arbitrum.
First show me the quote via get_crosschain_quote,
build the HTLC escrow transaction via build_crosschain_swap_tx
and let me sign it in my wallet. Then track the phases on both networks
and reveal the secret only once the destination escrow is ready on-chain.

At no step does the agent ask for your private key.

Non-custodial: the server never signs and never holds keys

This is the fundamental difference. build_crosschain_swap_tx returns an unsigned TonConnect message — the signature comes from the user's wallet, not the server. The server never signs and never holds funds or private keys.

What that means in practice:

  • The HTLC secret is handed to you in build_crosschain_swap_tx, not kept on the server; revealing it is your deliberate action via disclose_crosschain_secret.
  • The funds sit in on-chain escrow the entire time, never in a provider's wallet.
  • Even if the server wanted to "walk off" with the money, it has no way to: no keys, no signature of its own, and only you can trigger the reveal.

The same rule holds for every other "write" tool in TONNode: swaps and generate_wallet are strictly non-custodial. By contrast, the official @ton/mcp from the TON Foundation is built the other way: it's a custodial agent wallet with a split-key design, where the agent itself holds and signs with the operator key. That approach works and has its upsides (autonomous spending, NFT, DNS, official status), but it is custodial and it only works inside TON — cross-chain isn't on the table. TONNode deliberately picks the opposite trade-off: the signature always stays on the user's side. More on this model for agents in why agent swaps must be non-custodial.

What to do when a trade stalls: refunding from escrow

Cross-chain means two independent networks, and sometimes the other side doesn't deliver: the escrow on Arbitrum never shows up, or settlement gets stuck. Your money is not lost — it sits in your escrow on TON, behind the timelock.

build_crosschain_refund assembles an unsigned refund transaction — again, for your own wallet to sign. Once the timelock expires, the funds leave the escrow and return to your TON address:

The trade fell through, the escrow is hanging.
Build a refund via build_crosschain_refund and let me sign it.

This is the other half of "atomic": if the trade doesn't come together on both networks, it rolls back. In the worst case you lose a bit of time and gas, never the trade amount. No "stuck in a bridge" balance you spend months chasing through support tickets.

A practical rule for the agent: if track_crosschain_swap keeps showing no ready destination escrow and the timelock is close to expiring — do not reveal the secret; call build_crosschain_refund instead.

How to connect the cross-chain tools to an AI agent

All five cross-chain tools are part of the TONNode MCP server. MCP (Model Context Protocol) is the standard through which Claude, Cursor, ChatGPT/Codex and any other MCP client call tools. It hooks up with a single config.

Local, free (public config, full read set):

{
  "mcpServers": {
    "ton": {
      "command": "npx",
      "args": ["-y", "@tonnode/mcp"]
    }
  }
}

Running locally for free gives you the full set of read tools. The cross-chain and swap tools (trade assembly — build_crosschain_swap_tx, track_crosschain_swap, disclose_crosschain_secret, build_crosschain_refund) run on a hosted key — including the free Hobby one (see the pricing section below).

Hosted (guaranteed throughput, your own key):

{
  "mcpServers": {
    "ton": {
      "type": "http",
      "url": "https://mcp.tonnode.io/mcp",
      "headers": { "Authorization": "Bearer tn_live_…" }
    }
  }
}

The @tonnode/mcp package is open source (MIT), lives on npm and GitHub (tonnode/mcp), and talks TON's native ADNL protocol with no HTTP middlemen.

A couple of technical footnotes so your agent doesn't trip up. GRAM is Toncoin, renamed in June 2026; the network itself is still called TON — if your agent sees "GRAM" in a quote, it's the same native token. You can pay for a hosted key with GRAM or USDT on TON via TonConnect, or with BTC/ETH/SOL and other coins through an xRocket invoice in Telegram — the key is issued automatically once payment settles.

Pricing and what's included

All 16 TONNode tools — the five cross-chain ones included — are available on every plan. You only pay for throughput, never to "unlock" features:

  • Hobby — free forever, 60 requests/min;
  • Pro — $29/mo, 300 requests/min;
  • Scale — $199/mo, 1200 requests/min.

The free Hobby key is issued right after sign-in, no card required.

The short version

A cross-chain TON → Arbitrum swap in TONNode is an atomic HTLC escrow: one secret links two boxes on two networks, so the trade either completes in full or rolls back on the timelock. Five tools cover the entire flow — quote, assembly of the unsigned HTLC transaction with the secret, phase tracking on both networks, secret reveal after the on-chain readiness check, and a refund if things stall — while the server stays non-custodial: it never signs and never holds funds or keys. The same mechanism serves the other routes too: see the breakdowns of the TON → Ethereum and TON → Base swaps, plus why the first MCP-driven cross-chain value transfer out of TON matters.

Want to try it on a live agent? Grab a free Hobby key (all 16 tools, cross-chain included, 60 requests/min, no card) and take a look at the tools page.

Give your agent TON access

16 MCP tools: reads, non-custodial swaps, cross-chain and wallets. Free tier — 60 req/min, no card required.