Overview
Direct Answer
An atomic swap is a peer-to-peer exchange mechanism that allows direct transfer of cryptocurrencies across separate blockchain networks without intermediary custodians. It uses cryptographic hash time-locked contracts (HTLCs) to ensure that either both parties receive their funds or neither party loses value, eliminating counterparty risk.
How It Works
One party generates a random secret and hashes it, then creates a time-locked contract on the first blockchain requiring the receiving party to reveal that secret to claim funds. The second party mirrors this contract on the alternate blockchain with the same hash and a shorter timeout window. When the first party reveals the secret to unlock their funds, both transactions become irreversibly linked, forcing simultaneous settlement or automatic refund after timelock expiration.
Why It Matters
This mechanism reduces reliance on centralised exchanges, lowers transaction fees by eliminating intermediary markup, and decreases exposure to exchange security breaches or regulatory restrictions. It enables price discovery and liquidity across fragmented blockchain ecosystems without custody risk, particularly valuable for cross-chain asset trading.
Common Applications
Atomic swaps facilitate decentralised exchange protocols operating across Bitcoin, Ethereum, and other UTXO-based blockchains. They enable participants in liquidity pools and over-the-counter trading desks to settle trades directly, and support cross-chain bridge mechanisms that require trustless asset exchanges.
Key Considerations
Atomic swaps require both blockchains to support hash-locked contracts and possess compatible scripting capabilities, limiting applicability to simpler blockchain architectures. Successful execution depends on both parties remaining online during the reveal phase; network latency and synchronisation failures can trigger unintended refunds.
Cross-References(2)
More in Blockchain & DLT
Rollup
Protocols & NetworksA Layer 2 scaling solution that executes transactions off-chain and posts compressed transaction data to the main chain.
zk-SNARK
Identity & PrivacyZero-Knowledge Succinct Non-Interactive Argument of Knowledge — a compact zero-knowledge proof requiring no interaction between prover and verifier.
Layer 1
FoundationsThe base blockchain protocol layer that handles consensus, data availability, and transaction settlement.
Stablecoin
DeFi & FinanceA cryptocurrency designed to maintain a stable value by pegging it to a reserve asset like a fiat currency.
Web3
FoundationsThe vision of a decentralised internet built on blockchain technology, giving users ownership and control of their data.
IPFS
FoundationsInterPlanetary File System — a peer-to-peer distributed file system for storing and sharing data in a decentralised manner.
Blockchain Oracle
Smart Contracts & DAppsA service that provides smart contracts with verified external data from off-chain sources such as market prices, weather conditions, and real-world events.
Decentralised Physical Infrastructure
FoundationsNetworks that use blockchain token incentives to coordinate the deployment and operation of physical infrastructure such as wireless networks, energy grids, and compute resources.