ATOMIC SWAPS IN A NUTSHELL

in #atomicswaps7 years ago (edited)

You might have heard of this term in regards to cryptocurrencies but still don't really understand what it's about. In this post I'll go over the basics of what an atomic swap is and how it works.

atom-nuclear-e1494526137525.jpg
Credit

The idea behind an atomic swap is to exchange cryptocurrencies directly without going through a third-party. For instance, if Bob wanted to exchange 59 Litecoin for 1 bitcoin with Jane, what it would involve is a contract which would handle taking both sides of the exchange and once both sides have put in the agreed amounts, it releases the cryptocurrencies to their appropriate wallets. If Bob sends the agreed amount and Jane grows cold feet, there'll be a mechanism where the contract will time-out after a while and Bob will get his Litecoin back. So it's either both sides put in the agreed amounts or the transaction doesn't happen.
This can be done with contracts and certain blockchains have interoperability in regards to that. Interoperability enables coins/tokens built on this blockchain perform what's called "on-chain atomic swaps" ( i.e the chains have the ability to interact with each other).
The other way to do it would be off-chain which involves the lighning network. The lightning network would be like a side-chain or side-channel where the transactions could happen.

The main advantage of atomic swaps is that you don't have to worry about third-party exchanges. The downside to exchanges is that you have to deposit your coins and at that point you're technically no longer in control of their keys. You have the right to the coin, to move it around and withdraw it but you technically don't posses it as long as it's on the exchange. Atomic swaps on the other hand provide a trustless means of exchange that doesn't require you to give up the control of the keys of your cryptocurrencies.

We could see atomic swaps become more mainstream as things progress and decentralized setups for exchanges become more prominent in the future.

If this post was helpful please resteem, upvote and comment.

Thanks for reading..