Atomic swap: Difference between revisions

From Decimal Wiki
Jump to navigation Jump to search
[checked revision][checked revision]
No edit summary
m (CryptoUser moved page Commoninfo:atomicswap to Atomic swap)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#seo:
{{#seo:
                     |title= Атомарный своп
                     |title= Atomic swap — Decimal Wiki
                     |titlemode= append  
                     |titlemode= append  
                     |keywords= Атомарный своп
                     |keywords= Atomic Swap
                     |description= Атомарный своп
                     |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.


<div class="mikio-tags">
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 [[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.
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|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>
== Issues of atomic swaps ==
<span id="atomarnyj_svop"></span>
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.
= Атомарный своп =
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]].
Atomic swaps have great potential to improve the cryptocurrency [[ecosystem]], but this has to be tested on a larger scale.


<div class="level1">
== 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.


'''Атомарный своп''' (atomic swap) — это метод быстрого обмена между двумя криптовалютами, работающими на разных блокчейнах, без посредника в лице биржи или обменной платформы. Такой процесс (известен как атомарная кросс-цепная торговля) основан на смарт-контрактах и позволяет пользователям торговать монетами непосредственно из своего кошелька для хранения криптовалюты. В результате контроль над сделкой осуществляют исключительно участвующие в ней стороны. Атомарные свопы могут осуществляться как ончейн, то есть напрямую между блокчейнами разных криптовалют, так и офчейн — за пределами блокчейна.
[[Category:Commoninfo]]
 
Первый такой обмен совершили 19 сентября 2017 года между криптовалютами Decred и Litecoin.
 
 
</div>
<span id="kak_rabotaet_atomarnyj_svop"></span>
= Как работает атомарный своп? =
 
<div class="level1">
 
Маша имеет 100 ETH, которые она хочет обменять на эквивалентное количество DEL. Традиционный механизм предполагает, что Маша отправляется на биржу, пополняет свой счёт и выставляет ордер на продажу своих монет ETH. В случае с атомарным свопом Маша может напрямую обменять свои ETH на DEL, нужное количество которых есть у Ивана.
 
Сначала Маша вносит депозит в ETH на адрес контракта, который выступает в качестве сейфа. Когда последний создан, Маша генерирует ключ для доступа к нему. Затем она делится криптографическим хешем этого ключа с Иваном. Обратите внимание на то, что Иван пока не может получить доступ к ETH Маши, потому что у него есть только хеш ключа (замочная скважина), а не сам ключ.
 
Затем Иван использует хеш, предоставленный Машей для создания другого безопасного адреса контракта, на котором будет храниться его DEL. Чтобы получить DEL из «сейфа» Ивана, Маша должна использовать тот же ключ, таким образом предоставляя свою валюту Ивану (благодаря специальной функции, которая называется хеш-лок). Это означает, что, как только Маша потребует ETH, Иван, в свою очередь, запросит DEL, после чего обмен валютой будет завершён.
 
'''Атомарный своп''' структурирует транзакцию таким образом, что для обеспечения успешного завершения обмена стороны зависят друг от друга. Транзакции создаются так, что в случае, если по каким-то причинам сделка прекращена, все средства возвращаются их владельцам через определённый период времени, установленный каждой стороной.
 
 
</div>
<span id="kak_texnicheski_ehto_rabotaet"></span>
= Как технически это работает? =
 
<div class="level1">
 
При осуществлении атомарных свопов используется [[commoninfo:hashtimercontracts|контракт с хеш-таймером (HTLC)]] . Как следует из названия, HTLC представляет собой временной смарт-контракт, включающий в себя генерирование криптографической хеш-функции, которая может быть верифицирована участниками обмена. Иными словами, HTLC требует, чтобы получатель платежа до истечения установленного срока подтвердил получение средств путём генерирования криптографического подтверждения платежа. В противном случае транзакция признаётся недействительной, а средства возвращаются отправителю.
 
 
</div>
<span id="problemy_atomarnyx_svopov"></span>
= Проблемы атомарных свопов =
 
<div class="level1">
 
Для успешного осуществления атомарных свопов в их первоначальном виде пользователю необходимо скачать блокчейны обеих валют. Для среднестатистического пользователя этот процесс крайне неудобен, но решение этой проблемы уже найдено полностью или частично.
 
Команда Decimal активно работает над практической реализацией концепции атомарных свопов и уже предложила своим пользователям кроссчейн-обмен из блокчейна DecimalChain в блокчейн Ethereum для удобного выхода на рынок децентрализованных финансов, построенных на токенах формата ERC-20. Для этого пользователю нужно лишь заполнить простую форму в своей персональной консоли.
 
Атомарные свопы имеют большой потенциал для улучшения экосистемы криптовалюты, но это предстоит протестировать в более широком масштабе.
 
 
</div>
<span id="zakljuchenie"></span>
= Заключение =
 
<div class="level1">
 
Атомарные свопы всё ещё остаются не до конца доработанными для массового использования, но эта технология приводит к значительным изменениям в отношении функциональной совместимости блокчейнов и возможности кросс-цепной торговли. Таким образом, этот метод обладает большим потенциалом для роста индустрии криптовалют, открывает новые возможности для децентрализации и одноранговых денежных переводов. Вероятнее всего, в ближайшем будущем популярность атомарных свопов будет только возрастать.
 
 
 
</div>
<div style="clear:both">
 
 
 
</div>
 
</div>
[[commoninfo:hashtimercontracts|контракт с хеш-таймером (HTLC)]]
[[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.