Most cross-chain users do not spend much time thinking about execution models. Still, execution models matter when you answer one simple question: βWill my assets actually arrive where I intended them to go?β
That is the problem atomic execution is meant to solve. In the research literature, atomic cross-chain swaps are designed so that either the exchange completes for all sides, or no honest participant ends up worse off. That idea may be expressed more simply: either the intended assets are delivered as quoted, or the swap fails and funds return in full.
So what is atomic execution?
In a cross-chain swap, “atomic” means the exchange either completes fully on both sides or returns all funds β no partial outcomes. The term originates in database transaction theory, where an atomic operation either completes fully or rolls back entirely, leaving the system in a consistent state.
On a single blockchain, transactions already execute atomically by default β a failed step reverts the whole transaction. Cross-chain swaps don’t carry that guarantee automatically, because atomicity doesn’t extend across chains without a protocol to enforce it.
A cross-chain route typically involves multiple chains, multiple liquidity sources, and multiple confirmation environments. The more components involved, the more chances exist for one leg to settle while the other stalls. That specific failure case is exactly what atomic cross-chain swap execution is designed to eliminate.
How atomic swaps usually work
Atomic swaps are what make trustless cross-chain exchange possible β and a Hashed Timelock Contract (HTLC) is how they’re enforced.
An HTLC locks funds behind two conditions: a hash lock, which releases funds only when a secret value is revealed, and a time lock, which triggers a refund if the secret never appears before a deadline. Applied across two blockchains, this structure produces an atomic swap β one where either both legs complete or both legs refund, with no partial outcome possible.
- Hash lock: funds are claimable only by whoever reveals the correct secret matching the shared hash.
- Time lock: if the secret isn’t revealed before a set deadline, locked funds become refundable to the depositor β no third party required.
- Atomicity: the whole swap completes for both sides, or neither side loses funds. There’s no in-between.
- The same secret hash is embedded in both contracts, connecting two otherwise separate blockchains without a central coordinator.
How the cross-chain flow works
The cross-chain sequence runs in four steps, and the order matters β each step creates the condition the next one depends on.
- The swap starts when the user accepts a quote, generates a secret value, and locks the source-chain asset in an HTLC tied to the hash of that secret; the secret stays private.
- Once that source-side lock is confirmed on-chain, the counterparty β typically a market maker β locks the destination-chain asset in a corresponding HTLC using the same hash, so both contracts now share the same condition.
- Step three is the hinge the whole mechanism turns on: the user reveals the secret to claim the destination-side asset. Because that reveal is recorded on-chain, the counterparty can read the secret directly from the chain and use it to claim the source-side asset.
- If either deadline expires before the secret surfaces, both contracts unwind: the user reclaims the source-side asset and the counterparty reclaims the destination-side asset, and neither side ends up worse off than before the attempt began.
Final thoughts
Atomic execution sounds technical, but its value is simple.
It means a cross-chain swap should behave like one protected action, not a chain of fragile handoffs. It means the user is not asked to accept a half-completed route, a broken in-between state, or a messy recovery process as normal. In STON.fiβs architecture, the quote defines the intended result, HTLCs link both sides of the swap through shared conditions and deadlines, and the all-or-nothing outcome is the trust promise users feel.