Back to Course

2. Intermediate Course

0% Complete
0/0 Steps
  1. 1. Ethereum 2.0 - What is it? 
  2. 2. What is cryptocurrency burning?
  3. 3. How to create your own cryptocurrency? 
  4. 4. Blockchain Oracle - what are oracles? 
  5. 5. How to make money with NFT?
  6. 6. What is an ERC20 token and how is it created?
  7. 7. The Metaverse – a new virtual world
  8. 8. Metaverse – TOP 15 virtual reality projects
  9. 9. Technical analysis – is it worth using?
  10. 10. What are DeFi liquidity pools?
  11. 11. Second layer (layer 2) - what is it? 
  12. 12. What are wrapped tokens 
  13. 13. What is the Lightning Network, and how does it work?
  14. 14. What are security tokens?
  15. 15. What is play-to-earn (P2E) and how does it work?
  16. 16. What are Social Tokens? 
  17. 17. Examples of the use of WEB3 on the blockchain
  18. 18. What is Web5? 
  19. 19. Ethereum London Hard Fork - what is it ? 
  20. 20. Segregated Witness - what is Segwit Bitcoin all about?
  21. 21. Polkadot - Decentralized blockchain and DOT cryptocurrency
  22. 22. Polkadot Parachain - Next-generation blockchain
  23. 23. Set up of Stop Loss and Take Profit orders
  24. 24. Trading order types: stop loss, trailing stop loss, LIMIT
  25. 25. What are Decentralized Cryptocurrency DEX Exchanges?
  26. 26. What is Curve Finance?
  27. 27. What is GameFi and how does it work?
  28. 28. Non-fungible tokens and NFT exchanges
  29. 29. Cryptocurrency steps - What is move to earn M2E?
  30. 30. What is Proof of Reserves (PoR)? How does it work?
  31. 31. Interoperability in the world of cryptocurrencies and blockchain
  32. 32. Blockchain and its layers - What is layer three in Blockchain (L3)?
  33. 33. What is Layer 0 in Blockchain technology?
  34. 34. What is layer 1 in Blockchain?
  35. 35. What is MakerDAO and DAI Stablecoin?
  36. 38. What is the SubDAO protocol, and how does it work?
  37. 39. The main differences between static NFT and dynamic NFT
  38. 40. Liquidity Provider Tokens (LPs). What are they, and why are they so important?
  39. 41. What is KnowOrigin NFT, and how does it work?
  40. 42. What is decentralized social media?
  41. 43. What is the Ethereum Name Service (ENS) and how does it work?
  42. 44. Arbitrum: Ethereum scaling solution - everything you need to know
  43. 45. Ethereum ERC-4337 - what is it and how does this standard work?
  44. 46. Sustainable Blockchain - Proof of Useful Work & Flux
  45. 47. Ethereum Proof-of-Stake (PoS) - what should you know?
  46. 48. Atomic Swap: What is an atomic swap, and how does it work with cryptocurrencies?
  47. 49. What Is Cryptocurrency Vesting? What Are Its Advantages?
  48. 50. What Is the Metaplex Candy Machine Protocol? How Does It Work?
  49. 51. What Is the BNB Greenfield Ecosystem?
  50. 52. Real Yield in DeFi - what is this trend? What does it consist of?
  51. 53. Polygon 2.0 - the value layer for the Internet
  52. 54. What Is Slashing in Cryptocurrencies?
  53. 55. How to Create Your Own Decentralized Autonomous Organization (DAO)?
  54. 56. The ERC-721X VS ERC-721 Standard – Key Differences!
  55. 57. Royalties – What Are They? How Does This Type of Licensing Fee Work?
  56. 58. Polygon 2.0 - the value layer for the Internet
  57. 59. ERC-6551 - the new NFT standard. What does it bring to the non-exchangeable token sector?
  58. 60. What is TradFi? The importance for cryptocurrencies!
  59. 61. What is the Real World Asset (RWA) trend in cryptocurrencies? Explanation and examples!
  60. 62. Pyth Network: a powerful oracle harnessing the power of Solana!
  61. 63. NFT Gas Fee - what is it? How can you reduce your gas fee?
  62. 64. MINA Protocol: the lightest blockchain in the world!
  63. 65. Market Cap versus Fully Diluted Market Cap - the most important differences you should know!
Lesson 46 of 63
In Progress

48. Atomic Swap: What is an atomic swap, and how does it work with cryptocurrencies?

Atomic swaps are also known as cross-chain atomic swaps. It is nothing more than a swap of cryptocurrencies from separate blockchains. The rotation is carried out between two separate blockchains without third parties being involved. The basic idea of this process is to eliminate centralized intermediaries such as exchanges and give owners complete control over their tokens.

The term ‘atomic swaps’ itself is derived from the words ‘atomic state’. It refers to a state where there is no substrate – whether it happens or not. The analogy is a cryptocurrency transaction – either it happens or it does not.

It probably will not surprise you that most cryptocurrency wallets or blockchains that support atomic swaps use smart contracts to do this. Contracts are programs within blockchains that are executed when certain conditions are met. What conditions do we have in the case of atomic swaps? Each party agrees to a certain transaction before a certain timer expires. Smart contracts in this case also prevent cryptocurrencies from being stolen by one of the parties.

Atomic Swaps: a definition?

Every cryptocurrency is backed by a particular blockchain. It is designed to accept transactions in specific tokens or cryptocurrencies. For example, we cannot transfer Bitcoin (BTC) directly to the Ethereum blockchain (ETH). We first have to make a conversion to one fiat currency, buy another and make many more conversions. As a result, we get the desired cryptocurrency. However, the whole process is time-consuming and tedious. Atomic Swaps allow us to exchange cryptocurrencies from different blockchains in a single transaction.

For example, decentralized exchanges (DEXs) can perform such a swap for us. DEXs are platforms where we trade without the involvement of a third party. For such exchanges, we can also use cross-swaps, where we transfer digital assets to another wallet, perform the exchange there and then transfer the assets back.

How do Atomic Swaps work?

The process itself is very interesting. Two token holders agree to swap their tokens for an amount they agree between themselves. The smart contract responsible for this swap sees this and performs the transaction for them. This exchange is recorded in the blockchain and approved by the nodes of the respective network. A new block is then opened for the next transaction.

What is very important in this case – this transaction cannot be undone. Both parties must agree to a new swap if they want to exchange tokens again or have them back.

Atomic swaps use so-called Hash Timelock Contracts (HTLC) in the way they work. This automates the exchange of digital assets. HTLC is a time-limited smart contract that generates a single, cryptographic hash at each end of the page. In addition, participants in the transaction must confirm receipt of the funds within a certain time frame. If one party does not confirm the transaction, it is declared invalid and the funds are returned. This eliminates the risk of one of the parties misappropriating the funds in question.

Example. Kasia wants to swap her 0.5 BTC with Peter for an equivalent number of XRP. So, she orders such a transaction via a wallet that supports atomic swap. The cryptographic function automatically generates a haxadecimal number with which the transaction is encrypted. The whole process is repeated on Piotrek’s side.

Kasia and Piotr then release their funds using their encrypted numbers. This must be done within a certain time frame, otherwise the transaction is invalid.

Why are atomic swaps so important to the digital asset ecosystem?

Atomic swaps solve one of the fundamental problems. We are talking about the inefficiency of exchanging cryptocurrencies via centralized finance (CeFi). For example, anyone who wants to exchange BTC for LTC via CEX has to:

  • Set up an account on a platform that supports the BTC/LTC pair.
  • Send BTC to the exchange.
  • Convert BTC to LTC and pay an additional transaction fee.
  • Then send LTC to your wallet and pay another transaction fee in addition.
  • Next, you have to wait for the exchange to process the transaction. Again, you do not get beyond the transaction fees.

Therefore, you can see how time-consuming and expensive this process is. In addition, CEXs often have a security problem regarding the funds stored. And why? Because our assets are stored in so-called custody wallets, and the private keys of these wallets belong to the exchange. As a user, you do not have ful control over your assets. In the event of a cyber-attack, your cryptocurrencies stored on this wallet could be at risk.

Eliminating such a middleman eliminates costs and many other potential risks for digital asset users. Hence, the idea of atomic swaps. They are equally important for the growth of DeFi.

Advantages of Atomic Swaps

Significantly greater interoperability. Swaps open up the possibility of connecting different blockchains.

They are fully decentralized. They are based on three fundamental principles: programability, immutability and autonomy. With smart contracts and blockchains, users have full control over their wallet, their private keys and the cryptocurrencies stored in them.

They are cheaper than traditional transactions. And it’s all thanks to the fact that there are no middlemen. With some blockchains, fees are as low as a few cents.

Disadvantages of atomic swaps

They are a novelty in the cryptocurrency sector. Therefore, they are somewhat speculative. Their mechanisms are still in their infancy, so to speak, which means that the smart contracts or dApps that propose this solution have not been properly tested.

Their structure is very complex, so they are slow to catch on. The whole process needs to be more accessible and welcoming to the user. Developers still have a long way to go.

There are still a limited number of cryptocurrency pairs. Depending on what digital assets we want to swap, it may be easier for us to do it on a centralized exchange.

With Atomic Swaps, we do not have fiat currency trading. As they only exist on the blockchain, fiat-crypto and crypto-fiat swaps are not possible.


Atomic swaps are a good route to achieve high security, immutability and decentralization. With the development of Web3, swaps will become more accessible and encourage more and more interactions between chains.

It is also a great solution for efficient and decentralized transactions to develop and promote blockchain interoperability.