Crypto glossary
Atomic swap
An atomic swap is a trustless trade of coins on two blockchains that either completes on both sides or not at all, usually via hash time-locked contracts.
An atomic swap lets two people exchange assets on separate chains, for example bitcoin for litecoin, without an exchange or bridge. Each side locks funds in a hash time-locked contract (HTLC). Alice locks her coins behind the hash of a secret only she knows; Bob locks his behind the same hash. When Alice claims Bob's coins she reveals the secret, which lets Bob claim hers. If anyone stops, the time locks return funds to their owners.
The technique, first demonstrated in 2017, proved that cross-chain trading does not require custodians. It underpins Lightning Network routing and submarine swaps between on-chain and Lightning bitcoin, and decentralised exchanges focused on native assets have used HTLC-based swaps to trade BTC without wrapping.
Atomic swaps never became mainstream. Both chains must support compatible hash and time-lock scripts, the parties need to stay online, matching a counterparty is slow, and the first mover gives the other side a free option to walk away if prices move. Many products called atomic swaps today are actually bridges or custodial services.
Example
Two users trade BTC for LTC: both lock coins in HTLCs using the same hash, and when the first claims, the revealed secret lets the second claim within the time limit.
