What is Atomic Cross-Chain Swap? How it works?

in #cross7 years ago

Hey everyone! Hope you're having a great day. Today I wanna talk about Atomic cross-chain swaps.

What is Cross Chain Atomic Swap?

It's a way to do cryptocurrency to cryptocurrency exchanges without relying on third parties.

What is the problem that it's trying to solve?

Say for example we wanna trade: I wanna give you some Decred and I wanna buy some Litecoin from you. In this case, we argue on a price and then, if it's just a normal swap, there's one big problem: cryptocurrency transactions cannot be reversed. In that case, the person who sends the cryptocurrency first stands a significant disadvantage.
Say for example you send Litecoin to me. If you send it first and I check that the transaction occured then you have to trust me to send you the Decred. If I am malicious then I can just disappear off with your Litecoin and never send you the Decred.
Unfortunately, with cryptocurrencies transactions, there's virtually no guarantee if you don't do this Cross-Chain Atomic Swap. There are of course other ways to do it through third parties and exchanges but you have to rely on that third party and you have to trust it.
So with Cross Chain Atomic Swaps, they try to solve this problem. So you have to rely on mathematics to solve it. Such that, you can send me the Litecoin safely knowing forward if I don't send you the Decred you can get your Litecoin back.

How does this work?

atomicswaps.png

It's gonna start with me forming a secret. So once I decide on the secret, I can send a transaction which says if you know my secret you can get my Decred. On your side, you can say: Hey, I wanna send a transaction if you reveal your secret you can get Litecoin.
So that way, the moment I reveal my secret, I can immediately get your Litecoin. And you, once the secret has been revealed, you can immediately get the Decred. So this relies on the assured mathematics of hash functions.
In terms of the technical details, it relies on the person creating a contract to generate a secret random number, form a hash function and provide the hash of that secret. And because hashes cannot be reverted, once you know the hash you can't actually find out what is the secret that generated the hash. Then, that secret number is kept saved until I decide to reveal it. That way, you can plugin that hash of the secret into the hash of your transaction.
And if I want to receive Litecoin, I must reveal the secret. The moment I do that you can receive the Decred as well.
That is the basis of how Cross Chain Atomic Swap works. Mathematically it is proven to work.
There has been a successful completion of an Atomic Swipe between Litecoin and Decred last September without a hitch.
As mentioned on Decred's Github page, Decred cross-chain atomic swapping does support Bitcoin (Bitcoin Core), Litecoin (Litecoin Core), Vertcoin (Vertcoin Core) and Particl (Particl Core) blockchains.
Also, and more important, Cross Chain Atomic Swaps can be performed between Bitcoin and Ethereum (Github open source project here)

How can this be extended?

Well, there are a few good applications of this early on. A shop that accepts Litecoin can now accept Decred easily using Cross Chain Atomic Swaps.
Another way is: it can be extended with exchanges. Currently, we have this huge problem where we have to place our trust in exchanges.
The problem, of course, is that it happens that the exchange shut down or get hacked. So, using Cross Chain Atomic Swaps we can do transactions while keeping our cryptocurrencies safe. And If our transactions don't go through, we can always recover that cryptocurrency.

The current state of this project is in a command prompt state. If you look at Decred at Github, you find it is very much a text page transaction. This can be extended into a graphical interface and this can be built upon. But it's good to see that the foundation of this was built and a successful example has been used already.
Unfortunately, that doesn't apply to fiat currency. We can't do crypto to fiat transactions without exchanges.
In a far future, we hopefully do crypto to crypto transactions without exchanges instantly and at the best price.

This was a brief introduction to Cross Chain Atomic Swaps technology. If you have questions feel free to ask them below.

Peace and Love

Sources:
Box Mining
Cody Burns Medium Page
Verge Currency Blog

Sort:  

decredproject Decred tweeted @ 19 Sep 2017 - 19:31 UTC

Just completed the first $DCR <> $LTC cross-chain atomic swap with @SatoshiLite. Huge shout-out for debugging with… twitter.com/i/web/status/9…

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

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

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!

Congratulations @amja! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:
SteemitBoard World Cup Contest - Croatia vs England


Participate in the SteemitBoard World Cup Contest!
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: @good-karma and @lukestokes


Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Congratulations @amja! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You made more than 5000 upvotes. Your next target is to reach 6000 upvotes.

Click here to view your Board of Honor
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

SteemFest3 and SteemitBoard - Meet the Steemians Contest

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @amja! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Crypto Exchange In Australia?

This is a good article on the best crypto exchange Australia!?