The Atomic Swap is nothing more than a smart contract. This contract allows the exchange of one cryptocurrency for another cryptocurrency.
The 1st Atomic Swap was performed by Altcoin Exchange on October 7, 2017. The exchange between Bitcoin and Ethereum blockchain. There is also another contender for who was 1st in such a swap, conducted between Decred and Litecoin.
Atomic Swaps can be off the blockchain or conducted directly between the blockchains of different cryptocurrency exchanges.
To use the Atomic Swap between cryptocurrencies of exchanges, they must incorporate the technology to do so.
Taking a Closer Look at the Atomic Swap
Right now, exchanging cryptocurrency is complex and time-consuming. For several reasons, the problem is a fragmented ecosystem and the understanding of the average trader.
Also, exchanges do not support all coins. Suppose Jody wants to trade her coin for another that the exchange does not support. In that case, she may have to make several conversions in other intermediate coins to make her trade happen—a lot of hoops to jump through for a simple trade. There is also another risk if the trader wants to exchange her coins with another trader.
Atomic Swaps eliminate this problem through the use of HTLC, or Hash Timelock Contracts. HTLC is a smart contract between the parties that contains a cryptographic hash equation that can then be verified.
Both parties must accept and accept the receipt of funds in an established time frame, or the exchange is null. If either party fails to confirm the transaction within this time frame, it is immediately void. The funds are not exchanged. This process stops counter-party risks.
An Example of an Atomic Swap transaction:
Jody is interested in converting 50 Bitcoins to an equivalent amount of Lite coins with Sam. Jody generates a cryptographic hash function number to encrypt this transaction. Sam does the exact same thing at his end by submitting a transaction on Lite coin’s blockchain.
Jody and Sam now unlock their funds using the numbers they generated. They have done all of this in the respective time frame. If they had not made it in the time frame, the transaction would have failed.
By using Atomic Swaps, all trust issues between trading across platforms have been minimized, eliminating other parties just taking the cryptocurrency in the process.