How an atomic swap works
An atomic swap is a direct trade of one cryptocurrency for another across different blockchains, with no exchange or intermediary in the middle. It uses a smart contract trick called a hashed timelock, which guarantees that either both sides of the swap complete or neither does. The word atomic means all-or-nothing: there is no state where one party gets paid and the other does not.
Worked example
You want to swap a coin on one chain for a coin on another, directly with a counterparty. The atomic swap locks both deposits in linked contracts: when you claim your side with a secret, that same secret automatically releases the other side to your counterparty. If either party fails to complete in time, both deposits unlock and return to their owners. Neither of you can cheat the other.
Atomic swaps versus exchanges
Atomic swaps remove the custodial risk of trusting an exchange to hold your funds, the appeal of fully decentralised trading. The trade-off is complexity, limited liquidity, and slower execution. On Volity, trading crypto as spot or CFDs gives instant execution and deep liquidity within a regulated framework, the opposite trade-off: less autonomy, far more convenience and speed.
Why it matters
Atomic swaps prove crypto can trade peer-to-peer across chains without a trusted middleman, but their complexity and thin liquidity keep them niche. Know they exist as the trustless alternative to exchanges. Related: smart contract and DeFi.
Learn more in our crypto trading guide.