All you need to know about Atomic Swaps

Atomic swap is cryptographically secured smart contract cross-chain transection between one crypto to another. It is first introduced by Komodo Platform. Atomic swaps are one of the most important things when it comes to exchanging cryptocurrencies. Atomic swaps allows individuals to trade crypto without having any third party involvement this is the main highlight of atomic swap.

How it works

Let suppose Alice have 1 Bitcoin and she wants it to exchange with 10 ethereum, in traditional way she has to go on centralized exchanges which’s involves high risk of fraudulent but she only wants to exchange it in decentralized manner so let suppose another random guy Bob have 10 Ethereum and he also wants to convert his 10 ETH to 1 BTC so Alice and Bob could make a tarde so there are two scenarios might happen.

  1. Alice sends her 1 btc to Bob but Bob never sends his 10 Eth back to Alice.
  2. Alice receives Bob’s 10 Eth but she never sends back her 1 btc to Bob.

In order to prevent these kind of scenarios atomic swap uses something called Hash Time Locked contracts. It ensures that transaction between them are completely trustless. For Example – If Alice receives Bob’s 10 eth and she failed to send her 1 btc to Bob or vice versa then Hash Time Locked contract prevent these kind of fraudulent situation.

How Hash Time Locked contracts works (HTLCs)

In HTLCs there are two concept

  1. Hash Locked
  2. Time Locked

So, in order to have a trade between Alice and Bob, both must have to submit their transaction to their respective blockchain, Alice on the Bitcoin blockchain and Bob on the Ethereum blockchain. First Alice must have to generate a private key that only she knows then using her private key she’ll have to sign a 1 BTC transaction to Bob then she sends the hash of the transaction to Bob, then Bob’ll sign his 10 Eth transaction back to Alice using Alice’s hash sent so after signing the transaction now Alice is able to redeem her 10 Ethereum sent by Bob then after redeeming Bob’s 10 Eth now Bob also can redeem his 1 bitcoin sent from Alice. So even Alice has her private key before Bob there is no way to fraud to Bob because Alice transaction have already committed on the blockchain. She can’t reverse her 1 btc. There is one thing to keep in mind Bob can’t redeem his 1 BTC sent by Alice before redeeming Alice her 10 Eth sent by Bob first.

So there is a problem in between

What if Alice signed a 1 btc transaction on the blockchain to Bob but Bob’d never send his 10 Eth transaction using Alice transaction hash. Here’s Time Lock contracts comes into play. What it does is basically sets a time limit for transaction. When blockchain will not get Bob’s transaction back to Alice under a fixed period of time then Alice transaction which is already committed on the blockchain will reverse to her wallet and this same applies for Bob as well.

Ledger Nano X - The secure hardware wallet

The Latest

What Was The Reason For NFTs Being Banned From Steam?

Digital currency fluctuations are a problem for...

How Nvidia Got Attacked For Money?

Nvidia ha*ked has nothing to do with...

Is Superman Present In New The Batman Universe?

Matt Reeves wants to focus on just...

Is Rockstar Releasing New Update For The GTA Triple Remaster?

The patch will probably be released by...

How Critics Rated The Batman?

More critics' satisfaction for us, let's look...

Is Spin Off Of The Office Possible?

Is Spin Off Of The...

Will Elden Ring Server Be Down?

To solve some problems of the multiplayer...

How James Gunn Introduced 3 Of His Favorite Games?

Interest in the genre of role-making, don't...

How Is Uncharted Performance On Box Office?

Batman is lurking for Nathan Drake, yet...

Is Silent Hill Creator Making A Horror Game?

A project for the future with more...

What New Information Came Out For The GTA 6 Game Map?

To think about, The old rumors were...

What To Know About PlayStation Shared Service?

There is nothing left until the introduction...

How The Dark Knight Rises changed Tom Hardy?

Severe physical changes, the cost of playing...

Will Loki Series Have Any Effect On Doctor Strange 2?

Although, Loki is likely to be in...

How Far Dragon Age 4 Development Has Reached?

With separation of the game producer from...

Will The Blacklist Have Tenth Season?

Average performance over a decade and thrilling...

When Will PlayStation State Of Play Event Take Place?

Will the release date of God of...

Shocking How Call Of Duty Mobile More Than A Billion?

Contribute to the revenue of the mobile...