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. Lightning Network

    Lightning Network is a second layer to bitcoin's blockchain that ...
  2. Forward Swap

    A forward swap is an agreement between two parties to exchange ...
  3. Reverse Swap

    A reverse swap is an exchange of cash flow streams that undoes ...
  4. Stock Swap

    A stock swap is the exchange of one equity-based asset for another. ...
  5. Replacement Swap

    A replacement swap is a substitute for an existing swap arrangement ...
  6. Swap

    A swap is a derivative contract through which two parties exchange ...
Related Articles
  1. 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.
  2. Trading

    What Warren Buffet Calls "Weapons of Mass Destruction": Understanding the Swap Industry

    A full analysis of how the swap industry works.
  3. Trading

    An Introduction To Swaps

    Learn how these derivatives work and how companies can benefit from them.
  4. Trading

    Different Types of Swaps

    Identify and explore the most common types of swap contracts. Swaps are derivative instruments that represent an agreement between two parties to exchange a series of cash flows over a specific ...
  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

    Is Bitcoin's Lightning Network a Game Changer?

    The Lightning network promises faster transaction speed and micropayments on bitcoin's blockchain.
  7. Tech

    Will Bitcoin Cash Undergo A Hard Fork?

    Bitcoin Cash, the cryptocurrency which was created out of a bitcoin fork, may go through a similar process due to internal tensions in its community.
  8. Tech

    Is Litecoin The Future of Cryptocurrency?

    Litecoin’s drama-free community gives it less volatility and a steady trend, making it great for arbitration, trading, spending, or even fundraising.
  9. Tech

    What is the Bitcoin "Lightning Network?"

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

    Billionaire Jack Dorsey Bets on Blockchain as Bitcoin Price Craters

    Bitcoin's price tumbled more than 6% even amid news that Twitter billionaire Jack Dorsey is betting on blockchain.
RELATED FAQS
  1. When was the first swap agreement and why were swaps created?

    Learn about the history of swap agreements, the first swap agreement between IBM and the World Bank, and how swaps have evolved ... 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 does an entrepreneur choose a business structure?

    Interest rate swaps involve exchanging interest payments, while currency swaps involve exchanging an amount of cash in one ... Read Answer >>
  4. What is the difference between derivatives and options?

    A derivative is a financial contract that gets its value from an underlying asset. Options offer one type of common derivative. Read Answer >>
  5. What are some examples of risks associated with financial markets?

    Find out about the different types of risks for different classes of assets including volatility, counterparty risk and default ... Read Answer >>
Trading Center