Cross-chain message relaying
What is cross-chain message relaying?
Cross-chain message relaying is delivering each message a bridge or messaging protocol carries, such as a token transfer or a contract call, to its destination chain together with the proof the protocol signed; it’s the job a bridge relayer or executor does.
Protocol teams, apps that deliver their own messages and relay providers run it, because on most protocols a message isn’t executed until someone submits it and pays the destination gas, and since the destination contract checks the proof itself, the relayer decides how fast messages arrive, not whether they’re valid.
With Goldsky, Turbo Pipelines records each message your app sends, and a Compose task fetches each proof once the protocol signs it and delivers it from a gas-sponsored wallet; for USDC moved through Circle’s protocol, see completing cross-chain USDC transfers.
Who uses cross-chain message relaying?
Bridge and messaging protocol teams, apps that deliver their own cross-chain messages, and relay providers; acting on one chain when any event happens on another is cross-chain automation.
How a cross-chain message gets relayed
The diagram follows one message from the source chain to its execution on the destination chain, and shows who does each step. Your setup may differ.
Send a message on the source chain
A user’s transfer or your app’s call starts on one chain as a message addressed to a contract on another.
The protocol’s source contract records the message and emits an event with it, such as a burn for a token transfer. Until the message is delivered on the other chain, the user’s funds or instruction are in flight.
Record each message to deliver
Handled by Goldsky TurboA message nobody records is never delivered, and the user’s funds stay stuck between chains.
Keep the messages you’re responsible for, such as your app’s own, with the identifier the protocol tracks them by. A list built only from a live connection to a node can miss messages sent while the connection was down.
With Goldsky, a Turbo Pipelines pipeline reads the protocol’s source contract on each chain, keeps your app’s messages with a SQL filter and writes them to a table in your Compose app’s Postgres database, in a schema of its own. A message a reorg undoes is deleted from the table.
How reorgs reach your tables (opens in a new tab)Fetch the proof once the protocol signs it
Handled by Goldsky ComposeThe destination contract accepts a message only with the protocol’s proof that it was sent, such as an attestation or a set of signatures.
The protocol signs a message only after the source chain reaches the finality it requires, so the proof isn’t ready straight away and the relayer keeps checking until it is. Some protocols return message bytes that differ from the source event, and the relayer has to submit the bytes the proof covers.
A Compose task on a cron trigger, as often as every second, reads the undelivered messages with
Call an API from a task (opens in a new tab)ctx.db.queryand requests each proof withctx.fetch, which retries failed calls and records each response on the run. A message whose proof is still pending waits for the next run.Check the delivery before paying gas
Handled by Goldsky ComposeA delivery that reverts or repeats still costs gas.
Most protocols let anyone deliver a message, so another relayer may have delivered it first. Confirm the call would succeed before sending it.
Goldsky Compose wallets can
Simulate a call before sending (opens in a new tab)simulatethe delivery call against current state, so a message already delivered or a call that would revert is never sent.Deliver the message and its proof
Handled by Goldsky ComposeThe message takes effect when the destination contract verifies the proof and runs it, such as minting the transferred tokens.
Delivery needs gas on the destination chain, so a relayer serving many chains usually keeps native tokens on each of them. The destination contract checks the proof itself, so a relayer can delay a message but can’t forge one.
The task sends the call with
How Compose wallets pay gas (opens in a new tab)writeContractfrom a Compose smart wallet, whose gas is sponsored and paid through your Goldsky bill and whose nonces Compose manages, so the task keeps no native tokens on each chain. WithonReorgset toreplay, a delivery a reorg removes is sent again.Run the message on the destination chain
Once the destination contract accepts the message, the user’s funds or instruction have arrived.
The contract marks the message delivered, so a second delivery reverts with an error saying so. A relayer should count that error as a success and stop retrying.
Follow up on undelivered messages
A message that never arrives is a user’s money stuck between chains, and the user will ask where it is.
Messages pending well past the protocol’s usual time, or failing on every run, need a person: a proof may have expired and need reissuing, or the destination call may revert for a reason the relayer can’t fix.
What you control
- Your team
- Follow up on undelivered messages
Questions and answers
What is a crypto relayer?
A crypto relayer is a service that takes a message one blockchain produced, such as a bridge transfer, and submits it on another chain with the proof the protocol signed, paying that chain’s gas. On most bridges and messaging protocols anyone can relay, because the destination contract checks the proof itself: a relayer can delay a message but can’t forge one. Protocol teams, apps and independent providers all run relayers.
Security and deployment
- SOC 2 Type IIIndependently audited security controls.
- Dedicated infrastructureSingle-tenant options for production workloads.
- Data residencyCloud, on-premises or co-located.
More use cases that run protocol automation
- Run your own oracle price feedPush prices and other data to contracts on many chains.
- Smart contract automation and keepersRun recurring or event-driven contract calls a protocol needs to keep working.
- Onchain circuit breakersPause a token, market or payout when a rule is breached.
- Cross-chain automationAct on one chain when an event happens on another.
- Complete cross-chain USDC transfersFetch Circle’s attestation for each USDC burn your app makes and submit it on the destination chain, so the USDC mints there.
- Onchain interest rate, funding rate and volatility feedsPublish interest rates, funding rates and volatility benchmarks to contracts.
- VRF and verifiable randomness for smart contractsDeliver signed random values to contracts for prize draws, lottery allocations and random selection, checkable by anyone.
Use cases built the same way
- Authorize and capture stablecoin paymentsHold a buyer’s stablecoins in an escrow contract at checkout, capture them to the merchant as orders ship, void what can’t be filled and refund after capture.
- Programmable escrow for B2B stablecoin paymentsHold a buyer’s stablecoin payment until delivery, a milestone or a deadline, then release it to the seller or refund the buyer.
- Cross-chain transfer trackingSee every cross-chain stablecoin transfer as settled, in flight or stalled, and catch the stuck ones.
- Prediction market creation and resolutionCreate and resolve prediction markets automatically, with every write retried and traced.
Relay cross-chain messages with Goldsky
We’ll map it to your systems and show you what Goldsky runs, so your team builds the product, not the pipelines underneath it.