Skip to main content
The TypeScript SDK is WIP. This guide shows the raw two-step flow you can wire up today.

Full flow at a glance

This guide walks through every step.

Prerequisites

Service URLs and contract addresses used below are documented in endpoints and helpers.

1. Register the recipient (first time only)

Calling again for the same address returns existing keys.

2. Approve the bridge contract on chain A

amountIn + reward is what the bridge pulls when createIntent is called.

3. Call createIntent on chain A

Publishes the public solver-facing offer. The contract emits the public fields plus an encrypted blob that’s only recoverable by the relayer’s key, the on-chain recovery anchor.
At this point the intent is live on-chain but the relayer doesn’t yet know who the funds go to on the destination side.

4. Submit the encrypted recipient bundle

Use the storeRecipients helper from endpoints and helpers:
This fetches the relayer’s ECIES public key, encrypts { recipients, amounts }, and POSTs to the relayer. Only the relayer (and later the winning solver, under re-encryption) can read this.

5. Track to completion

waitForCompletion is in endpoints and helpers. See tracking intents for the full state machine.

6. Recipient side (chain B)

Funds land at a Safe at a fresh stealth address on chain B. The recipient:
  1. Lists their stealth balances via GET /recipient/addresses with a signed request.
  2. Derives the stealth key for a specific delivery via POST /recipient/derive-stealth-key.
  3. Signs a Safe transaction and calls POST /recipient/relay-proxy. The relayer broadcasts it and pays gas, so the recipient doesn’t need native gas on chain B.
Full recipient flow in retrieving funds.

Intent states and what happens at each

failed, expired, and cancelled never lose funds. The bridge contract’s escape path refunds the sender.

What happens under the hood

After step 4 submits the encrypted bundle, Tachyon:
  1. Batches your intent with other live intents that share the same token pair and chain pair.
  2. Broadcasts to solvers in plaintext: rate, token pair, total batch amount, available fees. No sender or recipient info.
  3. When a solver bids to fill some portion of the batch, re-encrypts your recipient bundle to that solver’s key.
  4. Solver delivers on chain B to the stealth Safe.
  5. Attestation from the secure enclave is verified on-chain before the sender’s funds are released to the solver.
The only actor that ever sees the plaintext recipient address is the one solver that won the bid for your intent.

Error handling

Common failure modes: See error reference for the full list.

Try it on testnet

Five-minute version of this guide.