Atomic swap: Difference between revisions

[checked revision][checked revision]
No edit summary
m (CryptoUser moved page Commoninfo:atomicswap to Atomic swap)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{#seo:
{{#seo:
                     |title= Atomic Swap
                     |title= Atomic swap — Decimal Wiki
                     |titlemode= append  
                     |titlemode= append  
                     |keywords= Atomic Swap
                     |keywords= Atomic Swap
                     |description= Atomic Swap
                     |description= Atomic Swap
                     }}
                     }}
<div class="mikio-article-content">
'''Atomic swap''' is a method of rapid exchange between two [[cryptocurrency|cryptocurrencies]] operating on different [[blockchain]]s, without an intermediary representing some exchange. This process (known as atomic [[cross-chain]] trading) is based on [[smart contract]]s and allows users to trade [[coin]]s directly from their [[wallet]] to store cryptocurrency. As a result, control over the [[transaction]] is carried out exclusively by the parties involved in it.
 
Atomic swaps can be carried out both '''on—chain''', that is, directly between blockchains of different cryptocurrencies, and '''off-chain''' — outside the blockchain.
   
   
<div class="mikio-tags">
The first such exchange was made on September 19, 2017 between the cryptocurrencies [[Decred]] and [[Litecoin]].


 
== How does atomic swap work? ==
</div>
Mary has 100 [[ETH]], and she wants to exchange them for an equivalent amount of [[DEL]]. The traditional mechanism assumes that Mary should go to the exchange, replenish her account and issues an order to sell her ETH coins. In the case of atomic swap, Mary can directly exchange her ETH for DEL, the right amount of which John has.
<span id="atomarnyj_svop"></span>
= Atomic Swap =
   
   
<div class="level1">
First, Mary makes a deposit in ETH to the address of the contract, it acts as a guarantor. When the latter is created, Mary generates a [[key]] to access it. She then shares the [[cryptography|cryptographic]] [[hash]] of this key with John. Please note that John cannot access Mary’s ETH yet because he only has the hash of the key (the keyhole), and not the key itself.
   
   
"Atomic swap" is a method of rapid exchange between two cryptocurrencies operating on different blockchains, without an intermediary representing some exchange. This process (known as atomic cross-chain trading) is based on smart contracts and allows users to trade coins directly from their wallet to store cryptocurrency. As a result, control over the transaction is carried out exclusively by the parties involved in it. Atomic swaps can be carried out both on—chain, that is, directly between blockchains of different cryptocurrencies, and off-chain - outside the blockchain.
John then uses the hash provided by Mary to create another secure contract address where his DEL will be stored. To get DEL from John’s «safe», Mary has to use the same key, thus providing her currency to John (due to a special function called hash lock). This means that as soon as Mary demands ETH, John, in turn, will request DEL, and therefore the currency exchange will be completed.
   
   
The first such exchange was made on September 19, 2017 between the cryptocurrencies Decred and Litecoin.
«Atomic swap» structures the transaction in such a way that the parties depend on each other to ensure the successful completion of the exchange. Transactions are created so that if for some reason the transaction is terminated, all funds are returned to their owners after a certain period of time set by each party.
 
</div>
== How does it work technically? ==
<span id="kak_rabotaet_atomarnyj_svop"></span>
When performing atomic swaps, [[hash timer contract|hash timer contract (HTLC)]] is used. As the name implies, HTLC is a temporary [[smart contract]] that includes the generation of a cryptographic [[hash function]] that can be verified by the exchange participants. In other words, HTLC requires the recipient of the payment to confirm receipt of funds by generating a cryptographic confirmation of the payment before the deadline. Otherwise, the transaction is invalidated and the funds are returned to the sender.
= How does atomic swap work? =
 
== Issues of atomic swaps ==
<div class="level1">
For the successful implementation of atomic swaps in their original form, the user needs to download the [[blockchain]]s of both currencies. For an average user, this process is extremely inconvenient, but a solution to this problem has already been found in whole or in part.
Masha has 100 ETH, and she wants to exchange them for an equivalent amount of DEL. The traditional mechanism assumes that Masha should go to the exchange, replenish her account and issues an order to sell her ETH coins. In the case of atomic swap, Masha can directly exchange her ETH for DEL, the right amount of which Ivan has.
First, Masha makes a deposit in ETH to the address of the contract, it acts as a guarantor. When the latter is created, Masha generates a key to access it. She then shares the cryptographic hash of this key with Ivan. Please note that Ivan cannot access Masha's ETH yet because he only has the hash of the key (the keyhole), and not the key itself.
Ivan then uses the hash provided by Masha to create another secure contract address where his DEL will be stored. To get DEL from Ivan's "safe", Masha has to use the same key, thus providing her currency to Ivan (due to a special function called hash lock). This means that as soon as Masha demands ETH, Ivan, in turn, will request DEL, and therefore the currency exchange will be completed.
"Atomic swap" structures the transaction in such a way that the parties depend on each other to ensure the successful completion of the exchange. Transactions are created so that if for some reason the transaction is terminated, all funds are returned to their owners after a certain period of time set by each party.
</div>
<span id="kak_texnicheski_ehto_rabotaet"></span>
= How does it work technically? =
<div class="level1">
When performing atomic swaps, [[commoninfo:hashtimercontracts|hash timer contract (HTLC)]] is used. As the name implies, HTLC is a temporary smart contract that includes the generation of a cryptographic hash function that can be verified by the exchange participants. In other words, HTLC requires the recipient of the payment to confirm receipt of funds by generating a cryptographic confirmation of the payment before the deadline. Otherwise, the transaction is invalidated and the funds are returned to the sender.
</div>
<span id="problemy_atomarnyx_svopov"></span>
= Issues of atomic swaps =
<div class="level1">
   
   
For the successful implementation of atomic swaps in their original form, the user needs to download the blockchains of both currencies. For an average user, this process is extremely inconvenient, but a solution to this problem has already been found in whole or in part.
The [[Decimal]] team is actively working on the practical implementation of the concept of atomic swaps and has already offered its users a [[cross-chain exchange]] from the [[DecimalChain|DecimalChain blockchain]] to the [[Ethereum|Ethereum blockchain]] for convenient access to the market of [[decentralized finance]] built on [[ERC-20]] [[token]]s. To do this, the user only needs to fill out a simple form on his [[Decimal Console|personal console]].
   
   
The Decimal team is actively working on the practical implementation of the concept of atomic swaps and has already offered its users a cross-chain exchange from the DecimalChain blockchain to the Ethereum blockchain for convenient access to the market of decentralized finance built on ERC-20 tokens. To do this, the user only needs to fill out a simple form on his personal console.
Atomic swaps have great potential to improve the cryptocurrency [[ecosystem]], but this has to be tested on a larger scale.
Atomic swaps have great potential to improve the cryptocurrency ecosystem, but this has to be tested on a larger scale.
</div>
<span id="zakljuchenie"></span>
= Conclusion =
<div class="level1">
Atomic swaps are still not fully developed for mass use, but this technology leads to significant changes in terms of the interoperability of blockchains and the possibility of cross-chain trading. Thus, this method has great potential for the growth of the cryptocurrency industry, opens up new opportunities for decentralization and peer-to-peer money transfers. Most likely, in the near future, the popularity of atomic swaps will only increase.


== Conclusion ==
Atomic swaps are still not fully developed for mass use, but this technology leads to significant changes in terms of the interoperability of blockchains and the possibility of cross-chain trading. Thus, this method has great potential for the growth of the cryptocurrency industry, opens up new opportunities for [[decentralization]] and [[P2P|peer-to-peer]] money transfers. Most likely, in the near future, the popularity of atomic swaps will only increase.


</div>
[[Category:Commoninfo]]
<div style="clear:both">
 
 
</div>
</div>
[[Category:Commoninfo]]

Latest revision as of 12:06, 7 February 2024

Atomic swap is a method of rapid exchange between two cryptocurrencies operating on different blockchains, without an intermediary representing some exchange. This process (known as atomic cross-chain trading) is based on smart contracts and allows users to trade coins directly from their wallet to store cryptocurrency. As a result, control over the transaction is carried out exclusively by the parties involved in it.

Atomic swaps can be carried out both on—chain, that is, directly between blockchains of different cryptocurrencies, and off-chain — outside the blockchain.

The first such exchange was made on September 19, 2017 between the cryptocurrencies Decred and Litecoin.

How does atomic swap work?

Mary has 100 ETH, and she wants to exchange them for an equivalent amount of DEL. The traditional mechanism assumes that Mary should go to the exchange, replenish her account and issues an order to sell her ETH coins. In the case of atomic swap, Mary can directly exchange her ETH for DEL, the right amount of which John has.

First, Mary makes a deposit in ETH to the address of the contract, it acts as a guarantor. When the latter is created, Mary generates a key to access it. She then shares the cryptographic hash of this key with John. Please note that John cannot access Mary’s ETH yet because he only has the hash of the key (the keyhole), and not the key itself.

John then uses the hash provided by Mary to create another secure contract address where his DEL will be stored. To get DEL from John’s «safe», Mary has to use the same key, thus providing her currency to John (due to a special function called hash lock). This means that as soon as Mary demands ETH, John, in turn, will request DEL, and therefore the currency exchange will be completed.

«Atomic swap» structures the transaction in such a way that the parties depend on each other to ensure the successful completion of the exchange. Transactions are created so that if for some reason the transaction is terminated, all funds are returned to their owners after a certain period of time set by each party.

How does it work technically?

When performing atomic swaps, hash timer contract (HTLC) is used. As the name implies, HTLC is a temporary smart contract that includes the generation of a cryptographic hash function that can be verified by the exchange participants. In other words, HTLC requires the recipient of the payment to confirm receipt of funds by generating a cryptographic confirmation of the payment before the deadline. Otherwise, the transaction is invalidated and the funds are returned to the sender.

Issues of atomic swaps

For the successful implementation of atomic swaps in their original form, the user needs to download the blockchains of both currencies. For an average user, this process is extremely inconvenient, but a solution to this problem has already been found in whole or in part.

The Decimal team is actively working on the practical implementation of the concept of atomic swaps and has already offered its users a cross-chain exchange from the DecimalChain blockchain to the Ethereum blockchain for convenient access to the market of decentralized finance built on ERC-20 tokens. To do this, the user only needs to fill out a simple form on his personal console.

Atomic swaps have great potential to improve the cryptocurrency ecosystem, but this has to be tested on a larger scale.

Conclusion

Atomic swaps are still not fully developed for mass use, but this technology leads to significant changes in terms of the interoperability of blockchains and the possibility of cross-chain trading. Thus, this method has great potential for the growth of the cryptocurrency industry, opens up new opportunities for decentralization and peer-to-peer money transfers. Most likely, in the near future, the popularity of atomic swaps will only increase.