Author

Topic: Atomic Swap - is it a best way to exchange cryptocurrencies? (Read 178 times)

legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
Atomic Swap is best way to exchange cryptocurrencies if decentralization, trustless and anonymity (considering the Atomic-swap setup is done properly) are important.
And just like achow101 mentioned, not all cryptocurrencies have HLTC, CLTV or any features with similar functionality. Coins with specific features such as Monero or non blockchain-based Cryptocurrency such as Nano and IOTA won't support Atomic Swap.

If people need decentralized/trustless, but need lots of cryptocurrencies support, they should use decentralized exchange.
staff
Activity: 3374
Merit: 6530
Just writing some code
Not all coins can have HTLCs (they don't all have OP_CLTV) so this method does not work for some coins.
member
Activity: 80
Merit: 11
In brief, this technology uses  HLTC, which is the combination  of two different technologies, hashlock and timelock. Hashlock contains a cryptographic task (something like a secret password), which guarantees that any part cannot send its funds unless another part has done so. The timelock acts as a protection in case if within a certain time one of the participants canceled the transaction or did not fulfill the contract conditions within a certain period of time.

So, in our situation, the atomic swap acts as the arbitration of the cryptocurrencies exchange transaction. An important condition is a limited time - all participants confirm their participation within certain deadlines. Otherwise, one of the terms of the exchange will be violated and the transaction will be canceled.

Let's say you decided to exchange your BTC for LTC of Anna Smith.

You open a payment channel in the  Bitcoin, while Anna Smith opens a similar payment channel in LiteCoin blockchain. After that, you need to create and specify a contract using a swap. The contract contains all the necessary information, the number of coins, wallet addresses, information about payment channels, etc.

You generate data that you sent 1 BTC to the Bitcoin-wallet of Anna Smith. However, this data contains information that as long as the number of Litecoins specified in the contract is not received on the light-coin wallet, your BTC will not be sent to Anna Smith. Similar data are specified by  Anna Smith.

Therefore, the arbitrator of the transaction is the blockchain itself, which does not allow the participants of the transaction to deceive each other. If one of the terms of the contract is not fulfilled, the transaction is simply not executed and the coins remain in the owners' hands. This allows you to ignore centralized exchanges and make transactions directly between users, which opens the possibility of creating a decentralized exchange that will not have access to the funds of users - but only to help them find each other.
Jump to: