Table of contentsIntroduction to Atomic Swap/atomic cross chain trading.
How does atomic swap work
Hash and preimage
The all-or-none feature
Advantages of atomic swap
Disadvantages
Decentralized exchanges competing with centralized exchanges using atomic swap
Conclusion
Introduction to Atomic Swap/atomic cross chain tradingThe atomic swap also known as atomic cross chain trading was introduced on the BitcoinTalk forum by Tier Nolan in 2013. Exchanging trading platforms are really important in cryptocurrencies trading but with the introduction of atomic swap, it is very possible to trade (convert) cryptocurrencies without the use of exchanges. Atomic swap is a peer-to-peer crypto trade between two people without the need of any third party.
As an illustration, Mr A may have bitcoin and decide to convert it for another coin with Mr B without the need of exchanges. This can be done using atomic swap technology.
How does atomic swap worksAtomic swap uses a smart contract called
Hashed Time Lock Contracts (HTLC) in which the hasklock locks coins in a digital box until an access code is revealed. The initiator of the trade will have the access code called preimage and only him knows the code.
For example, Charles is the initiator, he has bitcoin and want to trade it for litecoin with Tim.
Charles will put the bitcoin in a digital box and lock it with the hash lock. After, he will send the bitcoin locked in a box to Tim. Tim will receive the box but will not be able to unlock it until Charles unlock the litecoin box that Tim will send. So, Tim will lock litecoin in digital box too using Charles hashlock and send the litecoin locked in the box to Charles. After Charles receive the litecoin locked in the box, neither of them can get access to the coins because it is in locked boxes but Charles will use the access code to unlock the litecoin and immediately, Tim bitcoin box will unlock too. So, it is very safe to use.
Hash and preimageThe lock on the boxes is called hash as explained above while the access code/passcode that Charles used to unlock the box is called preimage. This helps in the protection of the cryptocurrencies in which the two party transactions are secure.
The all-or-none featureImmediately the initiator initiate the deal, there will be a time range that the two box should be unlocked with the access code. If this time range is over, the deal is automatically canceled. It is possible that the initiator can set the time range.
Advantages Decentralization, no need for any third party like exchanges. Just only the initiator and acceptor are involved.
It support off-chain and on-chain swap. The off-chain swap means using lightning network for the swap.
It is a feeless trading, only blockchain fee is required.
Scalability and interoperability makes atomic swap a better option
Process is less likely to be attacked by hackers compared to exchanges. It is even said to be hack proof.
They are not regulated by governments and can not be subjected to government regulations
Disadvantages It is not novice-friendly and also not user-friendly to an extent.
It is not well establish yet and the technology need more development for making trading between two people.
It might still be able to be attacked by hackers but it will be very hard.
Cryptocurrencies supported must support Hashed Time Lock Contracts and the cryptocurrencies must have the same hash algorithm for on-chain swap.
Only few wallets still support swap order.
Decentralized exchanges competing with centralized exchangesThe main reason for the adoption of atomic swap was to create an alternative swapping of cryptocurrencies in which exchanges are not going to be involved, only two people are to be involved in the crypto exchanging. But, later, non-custodian exchanges using atomic swap to compete with non-custodian exchanges. This is a great advantage for the more adoption of atomic swap and this makes crypto trading a lot easier on some wallets.
Conclusion
The atomic cross chain trading makes cryptocurrencies more decentralized, but need to be well adopted. It makes peer-to-peer trading easy between two people. But, getting more adopted as non-custodian exchanges are using it as a means to help in exchanging cryptocurrencies.
https://hackernoon.com/atomic-swaps-simply-explained-how-to-swap-cryptocurrencies-without-a-middleman-6cd29680c32ehttps://99bitcoins.com/atomic-swaps/https://www.forbes.com/sites/lukefitzpatrick/2019/09/02/a-complete-beginners-guide-to-atomic-swaps/amp/https://steemit.com/cryptocurrency/@cryptowarrior88/atomic-swaps-basics-advantages-and-disadvantages