Skip to content

GlossaryLayers and protocols

Atomic swap

Also · Submarine swap · Swap

An atomic swap exchanges funds across 2 chains or layers so that both legs happen or neither does, using a shared secret and timelocks. Submarine swaps move value between Lightning and on-chain.

Trading on-chain bitcoin for Lightning bitcoin, or L-BTC for BTC, normally requires trusting someone to send second. An atomic swap removes that. Both sides lock funds in HTLCs tied to the same hash. Claiming 1 side reveals the secret that unlocks the other. If nobody claims before the timelocks expire, both sides get refunded. The exchange either completes or unwinds.

A submarine swap is the Lightning flavour, a service that pays an on-chain address when you pay a Lightning invoice, or the reverse. It is how many wallets refill channels or move savings off Lightning. Atomicity covers the protocol, not the business. The provider can be slow, charge fees or run out of liquidity, and recovering a failed swap still costs a transaction.

In French · Échange atomique (atomic swap)

Related terms

Maps

Definition reviewed on October 22, 2026