atomic swap
An atomic swap lets two people trade assets on two different blockchains without trusting each other or any intermediary, with a guarantee that the trade either completes fully on both sides or fails on both sides — never the dangerous in-between where one party pays and the other walks away. 'Atomic' borrows the database meaning: indivisible, all-or-nothing. No coins are ever locked into a third-party exchange; each party keeps custody until the swap settles.
The classic construction uses two hash time-locked contracts, one on each chain, bound by the same secret. Suppose Alice wants to give BTC for Bob's LTC. Alice picks a random secret, hashes it, and locks her BTC so it can be claimed only by revealing the preimage of that hash (or refunded to her after a timeout). Bob, seeing the hash, locks his LTC with the same hashlock but a shorter timeout. Alice claims the LTC by revealing the secret — which now becomes public on Bob's chain — and Bob uses that revealed secret to claim the BTC. If anyone stalls, the timelocks refund both sides.
The elegance is that revealing the secret to claim one asset is exactly what enables claiming the other, so the two legs are cryptographically chained. The limitations are practical: both chains must support compatible hashlocks and timelocks, swaps are slow (you wait out block confirmations on both chains), there is no built-in price discovery, and the timelock asymmetry creates a subtle 'free option' problem where the party who acts second can wait and abandon the swap if prices move. These frictions are why most cross-chain trading shifted to bridges and liquidity networks, though atomic swaps remain the trust-minimized ideal.
Atomic swaps are genuinely trustless but suffer the 'free option' flaw: because of the timelock gap, the second party can observe prices and abort cheaply, effectively holding a short-dated option against the first party. This, plus speed, is why they never became the dominant trading rail.