澳洲幸运5官方开奖结果体彩网

Atomic Swap: Definition and How It Works With Cryptocurrency Trade

What Is an Atomic Swap?

An atomic swap is an exchange of cryptocurrencies from separate💝 blockchains. The idea is to remove centralized intermediaries like exc♛hanges and reduce the steps needed to trade tokens, but many exchanges and businesses have created swap solutions to make the process easier.

The term atomic derives from the term "atomic state" in which a state has no substates. This refers to a cryptocurrency transaction between two people using different blockchains that either happens or it doesn't—there are no alternatives.

Most atomic swap-enabled wallets and blockc꧟hains use smart contracts. Smart contracts are programs within blockchains that execute when certain conditions are met. In this case, the conditions are that each party agrees to the transaction before a timer runs out. Using a smart contract in the tꦅrade prevents either party from stealing a cryptocurrency from the other.

Atomic swaps are also called 澳洲幸运5官方开奖结果体彩网:cross-chain atomic swaps.

Key Takeaways

  • An atomic swap is a cryptocurrency exchange between two parties that wish to exchange tokens from different blockchains.
  • Atomic swaps are helpful if you only have one cryptocurrency but need to use another in a transaction.
  • Special wallets or exchange services are needed to conduct an atomic swap because the technique is still being developed and refined.

Understanding Atomic Swaps

Each cryptocurrency is supported by a blockchain, designed only to accept transactions in specific tokens. For example, the Bitcoin and Ethereum blockchains each have a n😼ative token tไhat cannot be transferred to the other. You first need to convert them to fiat currency and then buy the other using other cryptocurrencies and exchanges to get the one you want. Depending on the cryptocurrency, this can take several trades. Atomic swaps allow you to exchange tokens from different blockchains in one trade.

Som⛎e decentralized exchanges can conduct atomic swaps for you. A decentralized exchange (DEX) has no centraꦕl authority regulating it; it is a platform you can trade on without third parties. You can also choose from cross-chain swap providers, where you transfer your digital assets into another wallet, conduct the swap, and transfer them back out.

Fast Fact

Atomic swaps rely 𓆉on each par𒁃ty to provide proof through key encryption and acceptance of both parties through the encrypted key.

History of Atomic Swaps

The concept was conceived shortly after altcoins—cryptocurrencies other than Bitcoin—materialized. The creation of altcoins meant some cryptocurrency owners became interested in moving capital between coins. This type of token swap first appeared in September 2017, when an atomic swap between Decred and Litecoin was conducted.

Since then, startups and decentralized exchanges have created ways to facilitate swaps and given users the same ability. For example, Lightning Labs, a startup that created the Lightning Network for Bitcoin transactions, has conducted off-chain swaps utilizing the technology.

Special cryptocurrency wallets have also been developed that are capable of cross-chain atomic swaps—Liquality has developed a wallet that will swap Bitcoin, ETH, and more by connecting to swap providers like 1inch, Jupiter, and Sovryn.

Atomic Swap Process

In an atomic swap, two token owners agree to exchange their tokens. A smart contract is programmed to lock the tokens of both owners, and redeem them in the tokens desired. For instance, if Alice wanted to trade one bitcoin (BTC) for an equal amount of Bob's monero (XMR), the smart contract would lock both amounts on their respective blockchains. Once Alice and Bob agree on the trade, the smart contract would redeem Bob's BTC on the Bitcoin network and Alice's XMR on the Monero network.

Atomic swaps use Hash Timelock Contracts (HTLC) to automate the exchange of tokens. As its name denotes, HTLC is a time-bound꧋ sma🉐rt contract between parties that involves generating one cryptographic hash on each end.

Fast Fact

A cryptographic hash function is an algorithm that converts data of variable length, such as a person's wallet address and transaction information. It converts it to a hexadecimal number with a fixed length. In general, the number that is generated is called the hash.

HTLC requires both parties to acknowledge receipt of funds within a specified timeframe. If one party fails to confirm the transaction within the timeframe, the entire transaction is voided, and funds are not transferred. This eliminates counterparty risk,🍸 or the risk that one party will accept the offered coins and d⛦ecline the transfer of their coins.

How to Do an Atomic Swap

Atomic swaps sound complicated, but for most users, they can be very simple. Atomic swap-enabled wallets or decentralized exchanges like Atomic Swap or Uniswap let you choose from your cryptocurrency to swap for another token. The swap might be labeled "Exchange" or "Swap" in the wallet's interface.

Once you've selected the appropriate action, you choose the tokens you want to swap; you'll see the amount you'll receive in the token you're swapping. The interface should tell you the swap rate and network fees, let you double-check the transaction, and give you a button to press to initiate the trade.

Depending on the network, whether you're using an exchange or trading with another user, the swap can take several minutes to complete. For example, Atomic Wallet's instructions state that a swap should take about 20 minutes, but other wallets or decentralized exchanges might take less or more time.

What Is the Atomic Swap Mechanism?

Atomic swaps are generally initiated by users and executed by a smart contract. The smart contract can be programmed in many ways♍, but most tend to lock up the tokens being swapped or burn them, then 🍸issue the new tokens to the transferees.

What Are the Benefits of Atomic Swaps?

When two entities want to trade tokens, they can use an atomic swap to ensure no third parties are involved. This technique is faster and🎶 generally cheaper than going through exchanges or other token swap service providers.

Is an Atomic Swap Anonymous?

In most cases, the only publicly available information is the token amounts and the users' public addresses. However, if other information has been made available, these addresses can be traced back to their owners, so they are realistically pseudonymous.

The Bottom Line

The term atomic swap is used to refer to two users trading tokens from incompatible blockchains. The swaps are generally executed by smart contracts, which lock or burn the original tokens and issue new ones on the corresponding blockchains.

The comments, opinions, and analyses expressed on Investopedia are for informational purposes only. Read our  for more info.

Article Sources
Investopedia requires writers to use primary sources to support their work. These include white papers, government data, original reporting, and interviews with industry experts. We also reference original research from other reputable publishers where appropriate. You can learn more about the standards we follow in producing accurate, unbiased content in our editorial policy.
  1. Decred. "."

  2. Lightning Labs. "."

  3. Liquality. "."

  4. Uniswap. "."

  5. Atomic Wallet. ""

Compare Accounts
The offers that appear in this table are from partnerships from which Investopedia receives compensation. This compensation may impact how and where listings appear. Investopedia does not include all offers available in the marketplace.

Related Articles