Skip to main content

MEV and Front-Running Where Cross-Chain Swaps Meet

Grace Holloway 7 min read

Front-running inside a cross-chain protocol is a different animal from front-running on a single-chain DEX. The mental picture people bring from Uniswap does not transfer cleanly to HTLC swaps strung between independent chains. Bitcoin and Ethereum share no mempool, so the attack surface takes a new shape, the defences work by different means, and several familiar attack categories drop out entirely.

How Cross-Chain MEV Differs

On a single-chain DEX, value gets extracted because every transaction lands in one mempool, ordered by one validator set, executed in one atomic context. A front-runner spots your pending swap, slips in a higher-priority transaction, nudges the pool price, and pockets the slippage your trade then swallows. This class is well studied, with a healthy body of research and several mitigations.

HTLC cross-chain swaps have no shared mempool at all. A Bitcoin-to-Ethereum swap produces transactions on two chains, ordered by different miners or validators and priced in different fee markets. No single ordering point exists where an attacker could manipulate both legs at once.

Some single-chain categories therefore vanish. The classic Uniswap sandwich, with a bot pressing transactions in before and after yours inside one block, has no cross-chain equivalent. Nothing on Bitcoin and Ethereum answers to the idea of a shared same block.

What replaces them is a separate family of ordering risks, and nearly all of them cluster around the information that leaks during the preimage reveal.

The Preimage Reveal Leaks the Secret

Everything in an HTLC swap turns on one moment: the preimage going out to claim funds on one chain. The secret becomes readable in that chain's mempool well before it confirms, and anyone watching can see it and react.

On the revealing chain, an attacker able to land a transaction ahead of the real claimer might try to substitute themselves as the recipient. That demands a competing transaction with a higher fee and then winning the race for block inclusion. A properly built HTLC ties the claim to both the preimage and the authorised claimant's signature, so the preimage by itself achieves nothing. Pulling off the attack would require the claimant's key too.

All of that assumes the implementation is correct. An audit checklist for HTLC protocols should verify explicitly that the claim condition reads preimage plus signature, never preimage alone. Any implementation accepting a bare preimage folds to this attack on every chain with a competitive fee market.

Timelocks as a Cross-Chain Risk

The timelock plays two roles at once: safety mechanism and potential attack surface. Risk climbs in the stretch between expiry and the initiator's refund landing.

Take a swap on a failure path, where the counterparty never reveals. The initiator's timelock lapses and they broadcast a refund. If the chain is congested at that instant, the refund fights for block space against everything else. A skilled attacker can hold the refund back by front-running with a space-eating transaction, then monetise whatever secondary value comes from knowing the swap failed. How much that is worth depends on context, but the surface exists and any security analysis ought to say so.

We handle it by watching expiry windows and front-loading fee estimation for refunds so they confirm before the edge of the window. The refund is not fired at expiry; it is queued ahead of time with a fee estimate tuned to current mempool conditions.

What Routing Tells Liquidity Providers

Before swap locks exist, the routing layer has to find and contact liquidity providers. For a short interval, the provider knows where the swap is headed before the chain does.

A provider could, in principle, trade on that knowledge, say by shifting its own liquidity on a downstream venue before the swap finishes. We have no record of anyone doing this to our protocol. The asymmetry, though, is structural, and a protocol that never names it has not properly examined its MEV exposure.

Defences aim to shrink the routing window and keep full swap parameters out of the provider's hands early. Selection and locking happen without revealing the destination address until the HTLC is committed, so the provider has less to act on while the window is open.

Behaviour That Is Not MEV

Some activity that looks like extraction in cross-chain contexts is simply the protocol working, or ordinary competition.

Rival refund transactions at expiry: several parties racing for one refund on a failed swap extract nothing when each claims only what it is owed. The HTLC lets exactly one authorised party succeed, so the race produces a winner and a handful of rejected transactions, not value pulled from someone else.

Fee bumping on a stuck claim: a node that rebroadcasts a pending claim with a higher fee during congestion is managing confirmation risk, not extracting value. Implementations should support fee bumping for pending claims instead of abandoning them to a jammed mempool.

Telling these cases apart from real attacks shapes how you build monitoring. Alert on every competing transaction near expiry and the false positive rate will bury the team. The target should be transactions competing with an illegitimate claim structure, not every contest over block space around an HTLC event.

What Still Has No Fix

Mempool observation cannot be prevented. Anyone running a full node on the destination chain sees a preimage before it confirms. The answer is to make the claim demand more than the preimage, not to hide the preimage.

Coordinated mining attacks, where one party controls enough hash rate on the destination chain to reorganise a block holding a claim, fall outside what HTLC design alone can stop. For large swaps, confirmation depth is set so that a reorg would cost more than it could win. That is a probabilistic defence, never an absolute one.

The liquidity provider information window is narrower than it once was, not gone. At the protocol's current stage, the residual exposure is acceptable. As volumes grow and the prize for exploiting that window grows with them, the routing architecture will need another look against the value at risk.

Said plainly: HTLC cross-chain swaps present a smaller MEV surface than single-chain DEXs, but the surface is genuine and has a particular shape. Teams integrating non-custodial cross-chain swaps should map which attacks apply to them and what the protocol does or does not cover, rather than concluding that a missing shared mempool erases MEV risk.

Back to Protocol Notes

Read the Security Model

The docs and security overview cover HTLC design, state transitions, and integration patterns in full.