{"id":6614,"date":"2022-11-02T13:15:02","date_gmt":"2022-11-02T11:15:02","guid":{"rendered":"https:\/\/godex.io\/blog\/?p=6614"},"modified":"2022-11-02T13:15:02","modified_gmt":"2022-11-02T11:15:02","slug":"what-is-an-atomic-swap","status":"publish","type":"post","link":"https:\/\/godex.io\/blog\/what-is-an-atomic-swap","title":{"rendered":"What is an Atomic Swap?"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_25_1 counter-hierarchy counter-decimal ez-toc-grey\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" style=\"display: none;\"><label for=\"item\" aria-label=\"Table of Content\"><i class=\"ez-toc-glyphicon ez-toc-icon-toggle\"><\/i><\/label><input type=\"checkbox\" id=\"item\"><\/a><\/span><\/div>\n<nav><ul class=\"ez-toc-list ez-toc-list-level-1\"><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/godex.io\/blog\/what-is-an-atomic-swap\/#how_do_atomic_swaps_work\" title=\"How Do Atomic Swaps Work?\">How Do Atomic Swaps Work?<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/godex.io\/blog\/what-is-an-atomic-swap\/#an_example_of_using_atomic_swaps\" title=\"An example of using atomic swaps\">An example of using atomic swaps<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/godex.io\/blog\/what-is-an-atomic-swap\/#why_do_i_need_to_use_atomic_swaps\" title=\"Why Do I Need to Use Atomic Swaps?\">Why Do I Need to Use Atomic Swaps?<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/godex.io\/blog\/what-is-an-atomic-swap\/#how_do_you_do_an_atomic_swap\" title=\"How Do You Do an Atomic Swap?\">How Do You Do an Atomic Swap?<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/godex.io\/blog\/what-is-an-atomic-swap\/#which_crypto_uses_atomic_swaps\" title=\"Which Crypto Uses Atomic Swaps?\">Which Crypto Uses Atomic Swaps?<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/godex.io\/blog\/what-is-an-atomic-swap\/#advantages_of_atomic_swaps\" title=\"Advantages of Atomic Swaps\">Advantages of Atomic Swaps<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/godex.io\/blog\/what-is-an-atomic-swap\/#final_word\" title=\"Final Word\">Final Word<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/godex.io\/blog\/what-is-an-atomic-swap\/#faq\" title=\"FAQ\">FAQ<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/godex.io\/blog\/what-is-an-atomic-swap\/#is_an_atomic_swap_expensive\" title=\"Is an Atomic Swap Expensive?\">Is an Atomic Swap Expensive?<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/godex.io\/blog\/what-is-an-atomic-swap\/#are_atomic_swaps_taxable\" title=\"Are Atomic swaps taxable?\">Are Atomic swaps taxable?<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/godex.io\/blog\/what-is-an-atomic-swap\/#how_will_atomic_swaps_impact_the_market\" title=\"How will Atomic Swaps impact the market?\">How will Atomic Swaps impact the market?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<p><span style=\"font-weight: 400;\">Atomic swap or atomic cross-chain swap (ACCS) is a technology that makes it possible to trade cryptocurrencies across different blockchains without the need for middlemen in a single transaction.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Since each crypto is backed by a certain blockchain, which is applicable only to transactions with particular digital currencies, it is not possible to exchange some tokens in one trade. This applies, for instance, to the exchange of such currencies as BTC and ETH. BTC cannot be converted directly into ETH, or vice versa, since they belong to different blockchains. To exchange them, one will need to either first convert one of the cryptocurrencies into fiat money, in order to then buy the desired crypto for it, or get it through multiple conversions between coins using various exchanges. Atomic cross-chain swaps enable exchange of digital currencies from different blockchains in one go.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Although the idea of P2P transactions was brainstormed almost 10 years ago, it is still an innovation and is in the process of growth and refinement. This means that by no means all blockchains have applied this technology yet, and special wallets or exchangers are required for those who want to carry out an atomic swap.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"how_do_atomic_swaps_work\"><\/span><span style=\"font-weight: 400;\">How Do Atomic Swaps Work?<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\"><a target=\"_blank\" rel=\u201dnofollow,noopener\u201d href=\"https:\/\/academy.binance.com\/en\/glossary\/atomic-swap\">Atomic Swap<\/a> technology is very similar to Lightning Network technology, and some resources call them kindred spirits. They are united by the similarity of algorithms, which we will now deal with.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Like the Lightning network, ACCS uses a tool called Hashed TimeLock Contracts (HTLC), which has two essential features: hashlock and timelock. They ensure the reliability of atomic transactions by requiring the participants in the swap to comply with all conditions in order for the transaction to be carried out.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">So, for example, the hashlock function converts data such as transaction details and wallet address into a number that a swap participant needs to know in order to receive their tokens.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Another security solution is timelock, which limits the time within which a trade must be completed. Swap participants determine the time period within which it is necessary to complete a set of actions necessary for the successful completion of the transaction.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">All prerequisites for the possibility of an atomic swap are written in a smart contract that monitors their implementation. In case of non-compliance with them, the entire transfer is revoked and the tokens are returned to their holders. This reduces the risk of a counterparty or that one participant, having received their coins, refuses to send theirs.<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"an_example_of_using_atomic_swaps\"><\/span><span style=\"font-weight: 400;\">An example of using atomic swaps<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Let&#8217;s take a look at atomic swaps in action with the following example. Suppose Bella wants to exchange her Bitcoins (BTC) for Jacob&#8217;s <a target=\"_blank\" rel=\u201dnofollow,noopener\u201d href=\"https:\/\/godex.io\/coin\/ltc\">Litecoins (LTC)<\/a>. These are the next steps they should take as part of an atomic exchange:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">1) Bella deposits her coins to a new address on the BTC blockchain, which acts as a safe, after which access keys to it are also generated.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">2) She shares the hash of this key with Jacob, who does not yet have access to BTC, since he owns not the key itself, but the hash. The hashed password or key is proof that Bella has locked her BTC coins for further exchange.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">3) Jacob uses the hashed key provided by Bella to create another secure address on the LTC blockchain to which he deposits his coins.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">4) To receive LTC coins, Bella uses the same key, which she also shows Jacob using the hashlock function.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">5) As soon as Bella receives LTC, Jacob gets access to BTC coins and the crypto bargain is completed.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Atomic exchange technology can be implemented both on-chain, that is, directly across the blockchains of various cryptos, and off-chain &#8211; outside the blockchain. The essence of an off-chain transaction differs from a blockchain one in its simplicity. If in on-chain a transaction becomes valid after changing the blockchain that reflects the exchange operation, and is verified and certified by the necessary number of participants who certify it, then in off-chain the exchange takes place outside the blockchain, and as a result, only the result is recorded in the system.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In the simplest off-chain cases, the parties exchange secret keys from wallets containing a fixed amount of crypto. In this case, digital coins do not change addresses, but change their owners.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"why_do_i_need_to_use_atomic_swaps\"><\/span><span style=\"font-weight: 400;\">Why Do I Need to Use Atomic Swaps?<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Atomic cross-chain swap is especially the best option for traders who need to quickly and smoothly exchange cryptocurrencies. Since this method of exchange does not require the involvement of centralized mediators such as exchanges, the transaction can be completed faster, cheaper and more securely.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Since all transactions are carried out directly from the personal crypto wallets of the exchange participants, their assets are under greater control. In addition, with the advent of atomic swapping technology, it became possible to trade from various blockchains in one go. And due to the fact that the transaction does not occur if all conditions are not met by all participants, the risk of the counterparty is reduced.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"how_do_you_do_an_atomic_swap\"><\/span><span style=\"font-weight: 400;\">How Do You Do an Atomic Swap?<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">To perform a P2P token swap using innovative technology, you need an atomic swap-enabled wallet and Hash Timelock Contracts (HTLC). Since the technology is still in the process of expansion, there are few wallets that support this method of exchange, as well as DEXs that are suitable for atomic swaps.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"which_crypto_uses_atomic_swaps\"><\/span><span style=\"font-weight: 400;\">Which Crypto Uses Atomic Swaps?<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">The first successful trades using atomic swap technology were between Litecoin and Decred, Vertcoin and Bitcoin. They may have attracted increased attention from the community, but the matter is not limited to these cryptocurrencies alone.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">It should be noted that for the successful implementation of atomic swaps in their initial implementation, the user needs to download the blockchains of both currencies. For the average user, this process is quite inconvenient from a practical and technical point of view.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">However, a solution to this problem has already been found, and it is likely that it will soon become available to a wide range of users. So, the Komodo project introduced its own decentralized exchange BarterDEX. In particular, its developers have successfully carried out an atomic swap using the Electrum server, which allows you to interact with cryptocurrency without having to download the entire blockchain.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Also noteworthy is the development of AtomicDEX, an application that combines a non-custodial wallet, a cross-chain bridge, and a cross-network decentralized exchange. Users can store and trade BTC, ETH, ERC-20, BNB, BEP-20, Polygon, PLG-20, KMD tokens and other digital assets from different blockchains.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Moreover, the Komodo team claims that after successfully linking the Bitcoin and Ethereum blockchains, as well as implementing support for ERC-20 tokens, their BarterDEX exchange now supports p2p exchanges between 95% of all existing coins and tokens.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Other well-known projects actively working on the practical implementation of the idea of atomic swaps are Blocknet, which aims to create an Internet of blockchains based on Xbridge technology, Altcoin.io, which is working on creating a decentralized exchange based on Plasma technology and a wallet with built-in atomic swap functions, and Atomic Wallet.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"advantages_of_atomic_swaps\"><\/span><span style=\"font-weight: 400;\">Advantages of Atomic Swaps<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Using atomic swaps wouldn&#8217;t make sense if they didn&#8217;t benefit a user. Here are the main advantages of an innovative exchange method:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">increase the security of transactions, as they exclude the influence of centralized exchanges;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">allow you to make transactions without paying commission to intermediaries;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">are completely safe for both parties;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">make operations with cryptocurrency completely decentralized;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">expand exchange reserves.<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"final_word\"><\/span><span style=\"font-weight: 400;\">Final Word<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Atomic swaps promise to completely eliminate counterparty risk and theft. However, although atomic swaps are highly decentralized and do not require intermediaries to facilitate transactions, transactions can remain limited due to liquidity. Without an exchange platform, it can be arduous to bring traders together. Nonetheless, as atomic swaps evolve, they are beginning to integrate into the DEX and gain more fans of the technology, which guarantees lower fees, higher autonomy, and comprehensive serviceability.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"faq\"><\/span><span style=\"font-weight: 400;\">FAQ<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"is_an_atomic_swap_expensive\"><\/span><span style=\"font-weight: 400;\">Is an Atomic Swap Expensive?<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Logically, since atomic swaps exclude the participation of go-betweens who could take their cut, trades using this technology should be cheaper than centralized services. Nonetheless, in reality, low fees are not guaranteed. During an atomic swap, you still need to pay transaction fees on the network, and these can be quite expensive. Off-chain swaps can solve this problem, but there are still other issues that ought to be addressed.<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"are_atomic_swaps_taxable\"><\/span><span style=\"font-weight: 400;\">Are Atomic swaps taxable?<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">The token exchange itself is not a taxable event. However, keeping a good record of the new coin base to calculate capital gains\/losses is recommended. Integrating the tax reporting API with crypto tax software can make this task easier.<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"how_will_atomic_swaps_impact_the_market\"><\/span><span style=\"font-weight: 400;\">How will Atomic Swaps impact the market?<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">The trump card of atomic swaps is improved conditions and opportunities for cross-chain trading. Thus, if a certain exchange or blockchain has a liquidity issue, it can be solved by liquidity compensation on another chain. The entire digital market benefits from increased liquidity, using technology that is not limited to one exchange.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">As more wallets become compatible with atomic swap technology, users will be able to make exchanges directly from them while maintaining full control over their funds. This will of course lead to more active crypto trading.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Table of Contents How Do Atomic Swaps Work?An example of using atomic swapsWhy Do I Need to Use Atomic Swaps?How Do You Do an Atomic Swap?Which Crypto Uses Atomic Swaps?Advantages of Atomic SwapsFinal WordFAQIs an Atomic Swap Expensive?Are Atomic swaps taxable?How will Atomic Swaps impact the market? Atomic swap or atomic cross-chain swap (ACCS) is [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":6615,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[133,131],"tags":[1946,1947],"yst_prominent_words":[],"class_list":["post-6614","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-crypto-talks","category-crypto-tips","tag-atomic-swap","tag-crypto-guides"],"lang":"en","translations":{"en":6614},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/godex.io\/blog\/wp-json\/wp\/v2\/posts\/6614","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/godex.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/godex.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/godex.io\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/godex.io\/blog\/wp-json\/wp\/v2\/comments?post=6614"}],"version-history":[{"count":1,"href":"https:\/\/godex.io\/blog\/wp-json\/wp\/v2\/posts\/6614\/revisions"}],"predecessor-version":[{"id":6616,"href":"https:\/\/godex.io\/blog\/wp-json\/wp\/v2\/posts\/6614\/revisions\/6616"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/godex.io\/blog\/wp-json\/wp\/v2\/media\/6615"}],"wp:attachment":[{"href":"https:\/\/godex.io\/blog\/wp-json\/wp\/v2\/media?parent=6614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/godex.io\/blog\/wp-json\/wp\/v2\/categories?post=6614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/godex.io\/blog\/wp-json\/wp\/v2\/tags?post=6614"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/godex.io\/blog\/wp-json\/wp\/v2\/yst_prominent_words?post=6614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}