Home / Wiki / A / Atomic Swaps

Atomic Swaps

Cryptocurrency and Digital AssetsUpdated 05 Nov 2026

An atomic swap is a direct exchange of one crypto asset for another between two parties, built so that both transfers complete or both are cancelled. Neither party has to trust the other, and no exchange or escrow agent holds the funds in between. Atomic swaps are most often discussed for trades between separate blockchains, such as Bitcoin (BTC) and Litecoin (LTC), which cannot see each other's records.

The technique applies the general atomic principle to trading. It differs from atomic payments, which are about moving money through a chain of intermediaries or pairing a payment with another leg. It is also an alternative to trading through a centralized exchange (CEX) or moving coins across chains with a crypto bridge.

01

Atomic swaps in plain terms

Imagine two strangers swapping items through two locked boxes. Alice puts her item in a box that Bob can open only with a password that Alice invented. Bob puts his item in a second box that opens with the same password. When Alice opens Bob's box she has to type the password, and doing so reveals it to Bob, who then opens her box.

Both boxes also have timers. If either person walks away, the boxes reopen for their original owners after a set time. So the trade either goes through on both sides or quietly unwinds, and neither person can take the other's item and keep their own.

02

How atomic swaps work

Most atomic swaps rely on a hash time-locked contract (HTLC), a short program supported by the scripting languages of many blockchains. A typical swap runs in this order:

  1. The initiator picks a random secret and publishes its hash, a fingerprint produced by cryptography that does not reveal the secret.
  2. The initiator locks coins on the first chain so they can be claimed by the counterparty only with the secret, or refunded to the initiator after a deadline.
  3. The counterparty, seeing the lock, locks their coins on the second chain under the same hash with a shorter deadline.
  4. The initiator claims the counterparty's coins by revealing the secret on the second chain.
  5. The counterparty reads the now-public secret and uses it to claim the initiator's coins on the first chain.

The shorter deadline on the second leg matters. It ensures the counterparty always has time to claim their side after the secret appears. Both parties keep control of their private keys throughout, which is why atomic swaps are usually run from a non-custodial wallet.

Not every chain supports HTLCs. For privacy coins such as Monero, which lack the needed scripting, developers have built swaps using adaptor signatures, a technique in which completing a signature on one chain reveals the information needed to complete the trade on the other.

03

History

The protocol was described publicly by a developer known as Tier Nolan on the Bitcointalk forum in 2013. Practical cross-chain swaps followed once both networks involved supported the necessary features; in September 2017 developers carried out widely reported swaps between Litecoin and Decred and between Litecoin and Bitcoin. The same hash-lock method later became the basis for routing payments on the Lightning Network, and for "submarine swaps" that move funds between Lightning and the Bitcoin blockchain.

On smart-contract platforms such as the Ethereum blockchain, HTLCs can be written as contracts, allowing swaps between Ether, tokens and assets on other chains that support the same hash function.

04

Uses and comparison with other methods

Atomic swaps appeal to users who want to avoid handing assets to a custodian, a priority for many after exchange failures. They remove counterparty risk in the trade itself and need no account with a platform.

MethodWho holds funds during the tradeMain risk
Atomic swapEach party, via locked contractsFailed or abandoned swaps; locked capital
Centralized exchangeThe exchangeCustodial failure or hack
Bridge plus decentralized exchange (DEX)A bridge contract or its operatorsBridge exploits

In practice most cross-chain trading still runs through exchanges, bridges and wrapped tokens, because those offer faster execution and deeper markets.

05

Limitations and regulation

Atomic swaps have several practical drawbacks:

  • Matching counterparties is hard. There is no shared order book by default, so liquidity is thin compared with exchanges.
  • Swaps are slow. Each leg needs on-chain confirmations, and a failed swap can lock funds until the time limit expires.
  • The initiator holds a free option. Between the locks and the claim, the initiator can abandon the trade if prices move, leaving the counterparty with only a refund.
  • Both chains must support compatible hash functions and time locks, or a more complex signature scheme.

Because no intermediary is involved, an atomic swap between two individuals usually involves no Know Your Customer (KYC) checks. Services that match or facilitate swaps as a business may still fall under cryptocurrency regulation, depending on the jurisdiction and on whether they take control of user funds.

Last updated 05 Nov 2026