Atomic Swaps - Blockchain Technology ExplainedsteemCreated with Sketch.

in #bitcoin7 years ago (edited)

In this article I will explain what atomic swaps are and their impact on the blockchain technology.

atomic-swaps

About 3 weeks ago the nifty guys over at the Decred project opened a new chapter in blockchain technology: They successfully completed the very first cross-chain atomic swap with Litecoin. This is a big achievement for the blockchain developers...and yet another one of them confusing, fancy, technical terms for the novice in the Cryptoworld.

But don't worry - I got your back. Let's dive in and see what it's all about!

The trust problem


Let's start with a little background: A fundamental problem in trading is the trust issue. Let's imagine the following scenario: Alice sees Bob advertising a hat online and she wants to buy it. They live far apart and don't know each other. How can they complete this transaction in a safe manner? If Alice sends the money first, Bob might choose not send the product at all. If Bob sends the hat first, Alice might back out on sending the money, since she already got her product.

You get the problem. Ideally, we want the transaction of money and item to happen simultaneously.

How can we solve this?

  1. Alice and Bob could meet in person and conduct the trade. This approach is expensive due to the money and time consumed for traveling to the meeting point for both parties, but it does solve the trust problem.

  2. They could find an escrow (third-party authority) that would receive and hold money and product until both parties have fulfilled their obligation. But what if they cannot agree on a trusted escrow? And what if the escrow is malicious and decides to scam both of them? Examining this approach, we are reminded of one of the fundamental goals of cryptocurrencies, which is to eliminate the necessity for third-party oversight and unnecessary involvement of authority for these exact reasons.

atomic-swaps-explained

It's time to swap

In the digital world it is actually possible to make the both sides of the trade dependent. We can create a programming logic that makes a trade only go through if both parties oblige. Either both parties get their respective item or neither do. This process happens in a single transfer, that executes the trades at once and it goes by the fierce name - atomic swap.

So how does this atomic swap, or as the educated reader might say instantaneous sub-molecular exchange work?

The digital safe paradigm

Let's imagine that Alice wants to trade her coin A for Bob's coin B.

Alice places her coin A into a digital safe and gives the specifications of the lock to Bob. To unlock it you would need the key and Bob's signature. Now it's Bob's turn: He creates a similar safe, making sure that his lock matches the specifications Alice gave him, and stores his coin B there. Bob's safe requires the same key, since it's built using the same lock specifications, but also Alice's signature to unlock.

We have constructed a model where each safe can only be opened by the counter-party, but uses the same key.

When Alice opens Bob’s safe to obtain the B coin, her key for the lock is revealed and Bob can use the same key Alice just revealed, to unlock the safe Alice constructed and get his A coin.

This works beautifully, since opening one safe gives the trade partner access to the other safe. Because each safe requires both key and signature to open, the safe's are secure.

If something goes wrong along the way, or someone backs out in the middle of the transaction, the digital safes have a mechanism, according to which the coins are refunded to the respective owners once a predefined time limit is exceeded and both safe's have not been opened.

Pretty neat, huh? ( ಠ◡ಠ )

Where we are now

In recent news, Creator of Litecoin, Charlie Lee, successfully completed atomic swaps using Litecoin in exchange for Bitcoin, Vertcoin and Decred. If we continue down this innovative path, the technology of atomic swaps will allow us to run them decentralized exchanges your grandmother warned you about.


atomic-swap-charlie-lee
Link to tweet

However, a current drawback should be mentioned: the recent atomic swaps all required local coin daemons. In short, this means that in order to perform an atomic swap, an average user would be required to download the blockchains of either currency.
Yeah...that's not very practical, is it?

However, the talented devs are looking into a solution to this problem. In fact, the Komodo team has already successfully completed an Electrum server atomic swap, that did not require the download of the whole blockchain.

And they aren't the only ones. Decred is looking to integrate atomic swaps into their wallets. The Komodo team is working hard on their decentralized exchange called BarterDEX and other projects like Blocknet and Lykke are ones you might want to have on your radar.

Conclusion

Atomic swaps are a significant innovation in the crypto space. We have now found a way to trade coins without having to rely on trusting a third party or exchanges, coming even closer to our vision of a completely self-governed and free crypto world! We can use alternative coins with privacy features to disassociate ourselves from the coins and protect our privacy and preserve our anonymity. We can use coins like Bitcoin as a store of value, but use other coins, with their special features, as a medium of exchange - why not get the best of both worlds?


Image sources:
http://www.todayifoundout.com/wp-content/uploads/2013/07/fission.jpg
https://www.cryptocompare.com/media/12318104/atomic-swaps.jpg

Information sources:
https://blog.decred.org/2017/09/20/On-Chain-Atomic-Swaps
https://www.cryptocompare.com/coins/guides/what-are-atomic-swaps
https://bitcointechtalk.com/atomic-swaps-d6ca26b680fe

More Articles like this:
Do you want to know more about the upcoming Bitcoin Gold fork? (Read article)
Do you want to find out more about the Ethereum Metropolis update? (Read article)

Thank you for visiting my blog! If you enjoy my content, you are welcome to follow me for more updates. ᕦ(ò_óˇ)ᕤ
- Nick ( @cryptonik ) -

Cryptonik-Logo

Sort:  

Thanks for the informative articles.

You're welcome :)

Nice and Interesting article.... Got to know what atomic swaps are all about... :)
Chk out my posts for some cryptocurrency insights and info.....:)

Thank you for the feedback.Will do!

This post received a 31% upvote from @morwhale team thanks to @cryptonik! For more information, click here! , TeamMorocco! . this is @originalworks . steem @steemprice BTC

The @OriginalWorks bot has determined this post by @cryptonik to be original material and upvoted it!

ezgif.com-resize.gif

To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message!

To enter this post into the daily RESTEEM contest, upvote this comment! The user with the most upvotes on their @OriginalWorks comment will win!

For more information, Click Here!
Special thanks to @reggaemuffin for being a supporter! Vote him as a witness to help make Steemit a better place!

$5677.86 USD/BTC
Volume: 52643.86 BTC ($298904259.33 USD)
Last Updated Tue Oct 17 08:52:59 2017

Congratulations @cryptonik! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You got your First payout
Award for the number of upvotes received

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Thanks for the info Nick. Good and simple read!

Awesome, glad you liked it :)

SatoshiLite Charlie Lee [NO2X] tweeted @ 22 Sep 2017 - 20:36 UTC

Did a cross-chain atomic swap with LTC/BTC! 😁
10 LTC for 0.1137 BTC with @JStefanop1. ⛓️⚛️💱
insight.litecore.io/address/ML9CNJ…twitter.com/i/web/status/9…

Disclaimer: I am just a bot trying to be helpful.

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by Reaper7132 from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews/crimsonclad, and netuoso. The goal is to help Steemit grow by supporting Minnows and creating a social network. Please find us in the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.


This post was resteemed by @steemitrobot!
Good Luck!

Resteem your post just send 0.100 SBD or Steem with your post url on memo. We have over 2700+ followers. Take our service to reach more People.

Pro Plan: just send 1 SBD or Steem with your post url on memo we will resteem your post and send 10 upvotes from our Associate Accounts.

The @steemitrobot users are a small but growing community.
Check out the other resteemed posts in steemitrobot's feed.
Some of them are truly great. Please upvote this comment for helping me grow.

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 58047.91
ETH 2348.61
USDT 1.00
SBD 2.37