Atomic swap

From Infogalactic: the planetary knowledge core
Jump to: navigation, search

Lua error in package.lua at line 80: module 'strict' not found. An atomic swap allows for the exchange of one cryptocurrency for another cryptocurrency without the need for a trusted third party.

Overview

In traditional cryptocurrencies a trusted third party such as an cryptocurrency exchange or decentralized exchange (DEX) is necessary to perform a swap of cryptocurrencies in order to prevent one party from sending a currency without receiving a currency in return. An atomic swap is an all-or-nothing way to trade cryptocurrencies without those risks. An atomic swap system can use a hash time-locked smart contract so that a party must deliver the currency to be swapped within a specified time, or else the transaction will be cancelled. This preserves atomicity in that either the swap will take place, or no currency will be swapped.[1][2][3]

Atomic swap process

Atomic swap or atomic cross-chain trading (ACCT) is a mechanism, where two (or more) parties own coins in separate cryptocurrencies, and want to exchange them without having to trust a third party. The term “atomic” here means indivisible, and refers to the fact that sending cryptocurrency on one chain and sending other cryptocurrency on the other chain cannot be performed independent of each other. If these transactions could be performed independent of each other, then while one party could fulfill their side of the bargain and send some cryptocurrency on one chain, the other party would have the option of going back on their end of the bargain and simply not following through with the protocol, ending up with both cryptocurrencies.

A decentral exchange where two parties, A and B, want to exchange cryptocurrencies can be based on the following process:

  1. A generates some random data (called the secret) x.
  2. A generates T x1 (the payment) containing an output with the chain-trade smart contract in it. It allows coin release either by signing with the two keys (Ak and Bk) or with (secret x, Bk). This transaction is not broadcast. The chain release script contains hashes, not the actual secrets themselves.
  3. A generates T x2 (the contract), which spends T x1 and has an output going back to Ak. It has a lock time in the future and the input has a sequence number of zero, so it can be replaced. A signs T x2 and sends it to B, who also signs it and sends it back.
  4. A broadcasts T x1 and T x2. B can now see the coins but cannot spend them because it does not have an output going to them, and the tx is not finalized anyway.
  5. B performs the same scheme in reverse on the alternative chain. The lock time for B should be much larger than the lock time for A. Both sides of the trade are now pending but incomplete.
  6. Since A knows the secret, A can claim his coins immediately. However, A, in the process of claiming his coin,reveals the secret x to B, who then uses it to finish the other side of the trade with (x, Bk).

Atomic swaps have the disadvantage that both chains need to implement the atomic swap (of course in addition to being capable to provide smart contracts) in order for this to work.[4][5]

History

The idea of atomic swaps was first described in 2013 by Bitcointalk user Tier Nolan.[6]

The atomic cross-chain transfer wallet plugin between Burst and Qora was made publicly available on October 1, 2016.[7]

ZCash releases their tool atomic swap tool, ZBXCAT, in experimental stage Oct 2017.[8][9]

Usage

In September 2017, Decred began to support atomic swaps between Decred, Bitcoin and Litecoin .[6]

Using multi-hop locks, atomic swaps can be realized without hashing.[10]

A Lightning Network is a second, optional layer that removes the mining fee and creates an instantaneous transaction.[11][12][8] Lightning Network was released March 2018 by Lightning Labs.[13]

See also

References

  1. Lua error in package.lua at line 80: module 'strict' not found.
  2. Lua error in package.lua at line 80: module 'strict' not found.
  3. Lua error in package.lua at line 80: module 'strict' not found.
  4. Lua error in package.lua at line 80: module 'strict' not found.
  5. Lua error in package.lua at line 80: module 'strict' not found.  This article incorporates text from this source, which is in the public domain.
  6. 6.0 6.1 Lua error in package.lua at line 80: module 'strict' not found.
  7. Lua error in package.lua at line 80: module 'strict' not found.
  8. 8.0 8.1 Lua error in package.lua at line 80: module 'strict' not found.
  9. Lua error in package.lua at line 80: module 'strict' not found.
  10. Lua error in package.lua at line 80: module 'strict' not found.
  11. Lua error in package.lua at line 80: module 'strict' not found.
  12. Lua error in package.lua at line 80: module 'strict' not found.
  13. Lua error in package.lua at line 80: module 'strict' not found.