Blockchain & DLTFoundations

Atomic Swap

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

On-Chain Governance

Foundations

A decentralised decision-making process where protocol changes are proposed, debated, and voted on through blockchain-based mechanisms by token holders or validators.

Modular Blockchain

Foundations

A blockchain architecture that separates execution, consensus, settlement, and data availability into independent layers, enabling specialisation and improved scalability.

Programmable Money

Smart Contracts & DApps

Digital currency embedded with executable logic that can enforce spending conditions, automate payments, and integrate with smart contracts for conditional financial operations.

Web3

Foundations

The vision of a decentralised internet built on blockchain technology, giving users ownership and control of their data.

Decentralised Identity

Identity & Privacy

A self-sovereign identity framework where individuals control their own digital identity credentials without centralised authorities.

Liquid Staking

DeFi & Finance

A mechanism that allows users to stake cryptocurrency while receiving a liquid derivative token representing their staked position, maintaining capital flexibility during the lock-up period.

Account Abstraction

Smart Contracts & DApps

A blockchain architecture improvement that allows smart contracts to act as user accounts, enabling features like social recovery, gas sponsorship, and batched transactions.

Token Standard

Tokens & Assets

A technical specification defining the interface and behaviour of tokens on a blockchain, such as ERC-20 for fungible tokens and ERC-721 for non-fungible tokens.