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
Light Node
FoundationsA blockchain node that only downloads block headers and relies on full nodes for complete transaction verification.
Zero-Knowledge Proof
Identity & PrivacyA cryptographic method allowing one party to prove knowledge of information without revealing the information itself.
Solidity
Smart Contracts & DAppsA programming language designed for writing smart contracts on the Ethereum Virtual Machine.
Immutability
FoundationsThe property of blockchain data that prevents alteration or deletion once recorded on the ledger.
Fungible Token
Tokens & AssetsA blockchain token where each unit is identical and interchangeable with any other unit of the same token.
Cold Wallet
FoundationsAn offline cryptocurrency storage solution disconnected from the internet for maximum security.
Hard Fork
FoundationsA radical change to a blockchain's protocol that makes previously invalid blocks or transactions valid, requiring all nodes to upgrade.
Appchain
FoundationsA purpose-built blockchain designed for a single application or use case, offering customised consensus, throughput, and governance optimised for specific requirements.