DEFINITION of 'Atomic Swaps'

Atomic swap is a smart contract technology that enables exchange of one cryptocurrency for another without using centralized intermediaries, such as exchanges.

Atomic swaps can take place directly between blockchains of different cryptocurrencies or they can be conducted off-chain, away from the main blockchain. They first came into prominence in September 2017, when an atomic swap between Decred and Litecoin was conducted

Since then, other startups and decentralized exchanges have allowed users the same facility. For example, Lightning Labs, a startup that uses bitcoin’s lightning network for transactions, has conducted off-chain swaps using the technology.

Cryptocurrencies and decentralized exchanges, such as 0x and Altcoin.io, have also incorporated the technology. 

BREAKING DOWN 'Atomic Swaps'

As it occurs today, the process for exchanging cryptocurrencies is time-consuming and complex. This is due to several reasons. For example, the fragmented nature of today’s cryptocurrency ecosystem presents several challenges to average traders.

Not all cryptocurrency exchanges support all coins. As such, a trader wishing to exchange her coin for another one that is not supported on the current exchange may need to migrate accounts or make several conversions between intermediate coins to accomplish her goal. There is also an associated counterparty risk, if the trader wishes to exchange her coins with another trader.  

Atomic swaps solve this problem through the use of Hash Timelock Contracts (HTLC). As its name denotes, HTLC is a time-bound smart contract between parties that involves the generation of a cryptographic hash function, which can be verified between them. (See also: Understanding Smart Contracts.)

Simply, atomic swaps require both parties to acknowledge receipt of funds within a specified timeframe using a cryptographic hash function. If one of the involved parties fails to confirm the transaction within the timeframe, then the entire transaction is voided and funds are not exchanged. The latter action helps remove counterparty risk.  

An example of an atomic swap transaction is shown below:

Suppose Alice is a trader interested in converting 100 bitcoins to an equivalent litecoins with Bob. She submits her transaction to bitcoin’s blockchain. During this process, Alice generates a number for a cryptographic hash function to encrypt the transaction. Bob repeats the same process at his end by similarly submitting his transaction to litecoin’s blockchain.

Both Alice and Bob unlock their respective funds using their respective numbers. They have to do this within a specified timeframe or else the transfer will not take place. Atomic swaps can also be used in conjunction with a lightning network to conduct off-chain exchanges. (See also: Bitcoin's Lightning Network: Three Possible Problems.)

RELATED TERMS
  1. Hashed Timelock Contract

    A hashed timelock contract is a smart contract used in cryptocurrencies ...
  2. Reverse Swap

    A reverse swap is an exchange of cash flow streams that undoes ...
  3. Cross-Currency Swap

    An agreement between two parties to exchange interest payments ...
  4. Termination Date

    A termination date is the day on which a swap contract ends, ...
  5. Swap Curve

    A swap curve identifies the relationship between swap rates at ...
  6. Swap Spread

    A swap spread is the difference between the fixed component of ...
Related Articles
  1. Tech

    Why Charlie Lee Believes Litecoin Can Be Instrumental in Bitcoin Lightning Network

    The litecoin founder is a strong proponent of the Lightning Network.
  2. Managing Wealth

    An In-Depth Look at the Swap Market

    The swap market plays an important role in the global financial marketplace; find out what you need to know about it.
  3. Tech

    How Will Lightning Network Evolve In The Future?

    Here are three ways in which Lightning Network, one of the solutions being proposed to scale bitcoin's blockchain, is evolving to solve its problems.
  4. Investing

    What's an Interest Rate Swap?

    An interest rate swap is an exchange of future interest receipts. Essentially, one stream of future interest payments is exchanged for another, based on a specified principal amount.
  5. Tech

    Three Strikes Against Bitcoin's Lightning Network

    Bitcoin's lightning network is expected to be a big leap forward for the cryptocurrency despite some drawbacks.
  6. Tech

    What is the Bitcoin "Lightning Network?"

    Bitcoin developers have touted a new "lightning network" service which may be able to provide instantaneous transactions.
  7. Tech

    How Bitcoin Works

    Miners, hashes, keys, cold storage, blocks - it's confusing. We can help you understand how bitcoin works.
  8. Investing

    CFTC Probes Banks' Use of Interest Rate Swaps

    U.S. regulators are probing banks' trading and clearing of interest rate swaps, which played a central role in the 2008 financial crisis
  9. Tech

    Why You Shouldn't Ignore Cryptocurrencies

    There are three big reasons why cryptocurrencies and the blockchain technology they are built on should be taken seriously.
  10. Tech

    Blockchain Could Make You—Not Equifax—the Owner of Your Data

    All hype aside, blockchain technology is really good at one thing: taking out the middlemen. Leaky data brokers' days may be numbered.
RELATED FAQS
  1. How do companies benefit from interest rate and currency swaps?

    Interest rate and currency swaps help companies manage exposure to rate fluctuations and acquire a lower rate than they would ... Read Answer >>
  2. What is the difference between derivatives and swaps?

    Swaps comprise just one type of the broader asset class called derivatives. Read Answer >>
  3. How do currency swaps work?

    Learn how a currency swap works, including who uses these transactions, and the mechanics and purpose of the different cash ... Read Answer >>
  4. What is a Debt for Equity Swap?

    Learn why companies issue debt for equity swaps, what they are, and how they impact shareholders and debt holders. Read Answer >>
Trading Center