Back to Course

2. Intermediate Course

0% Complete
0/0 Steps
  1. 1. What is Layer 0 in Blockchain technology?
  2. 2. What is layer 1 in Blockchain?
  3. 3. Second layer (layer 2) - what is it? 
  4. 4. Blockchain and its layers - What is layer three in Blockchain (L3)?
  5. 5. Ethereum 2.0 - What is it? 
  6. 6. Ethereum Proof-of-Stake (PoS) - what should you know?
  7. 7. Ethereum London Hard Fork - what is it ? 
  8. 8. What is the Ethereum Name Service (ENS) and how does it work?
  9. 9. Arbitrum: Ethereum scaling solution - everything you need to know
  10. 10. Polygon 2.0 - the value layer for the Internet
  11. 11. Ethereum ERC-4337 - what is it and how does this standard work?
  12. 12. What is an ERC20 token and how is it created?
  13. 13. The ERC-721X VS ERC-721 Standard – Key Differences!
  14. 14. What is cryptocurrency burning?
  15. 15. Examples of the use of WEB3 on the blockchain
  16. 16. What is Web5? 
  17. 17. Blockchain Oracle - what are oracles? 
  18. 18. Polkadot - Decentralized blockchain and DOT cryptocurrency
  19. 19. Polkadot Parachain - Next-generation blockchain
  20. 20. Interoperability in the world of cryptocurrencies and blockchain
  21. 21. What is Blockchain sharding?
  22. 22. Mainnet versus Testnet on the Blockchain. The complete guide!
  23. 23. MINA Protocol: the lightest blockchain in the world!
  24. 24. Sustainable Blockchain - Proof of Useful Work & Flux
  25. 25. Cosmos SDK: Building the Blockchain Ecosystem
  26. 26. What is cross-chain interoperability in Blockchain technology?
  27. 27. Blockchain trilemma - explanation of the problem. What is the impact on cryptocurrency payments?
  28. 28. Non-fungible tokens and NFT exchanges
  29. 29. How to make money with NFT?
  30. 30. What is the NFT licence fee?
  31. 31. NFT Gas Fee - what is it? How can you reduce your gas fee?
  32. 32. The main differences between static NFT and dynamic NFT
  33. 33. What is minting an NFT?
  34. 34. What are NFT Ordinals? A guide to Bitcoin NFT.
  35. 35. What is KnowOrigin NFT, and how does it work?
  36. 36. ERC-6551 - the new NFT standard. What does it bring to the non-exchangeable token sector?
  37. 37. What is NFT Lending all about? An innovative solution in the world of cryptocurrencies!
  38. 38. The Metaverse – a new virtual world
  39. 39. Metaverse – TOP 15 virtual reality projects
  40. 40. Technical analysis – is it worth using?
  41. 41. Trading order types: stop loss, trailing stop loss, LIMIT
  42. 42. Market Cap versus Fully Diluted Market Cap - the most important differences you should know!
  43. 43. Set up of Stop Loss and Take Profit orders
  44. 44. What are DeFi liquidity pools?
  45. 45. Real Yield in DeFi - what is this trend? What does it consist of?
  46. 46. Vampire Attacks in Decentralized Finance (DeFi): Explanation and Examples
  47. 47. What are wrapped tokens 
  48. 48. What are security tokens?
  49. 49. What are Social Tokens? 
  50. 50. Liquidity Provider Tokens (LPs). What are they, and why are they so important?
  51. 51. What is the Lightning Network, and how does it work?
  52. 52. What is Play-to-Earn (P2E) and how does it work?
  53. 53. Cryptocurrency steps - What is move to earn M2E?
  54. 54. Segregated Witness - what is Segwit Bitcoin all about?
  55. 55. What are Decentralized Cryptocurrency DEX Exchanges?
  56. 56. What is Curve Finance?
  57. 57. What is GameFi and how does it work?
  58. 58. What is Proof of Reserves (PoR)? How does it work?
  59. 59. DAO Investment: A revolution in the world of finance and investment
  60. 60. What is MakerDAO and DAI Stablecoin?
  61. 61. What is the SubDAO protocol, and how does it work?
  62. 62. How to Create Your Own Decentralized Autonomous Organization (DAO)?
  63. 63. Atomic Swap: What is an atomic swap, and how does it work with cryptocurrencies?
  64. 64. What Is Cryptocurrency Vesting? What Are Its Advantages?
  65. 65. What Is the Metaplex Candy Machine Protocol? How Does It Work?
  66. 66. What Is the BNB Greenfield Ecosystem?
  67. 67. What Is Slashing in Cryptocurrencies?
  68. 68. Royalties – What Are They? How Does This Type of Licensing Fee Work?
  69. 69. What is TradFi? The importance for cryptocurrencies!
  70. 70. What is the Real World Asset (RWA) trend in cryptocurrencies? Explanation and examples!
  71. 71. Pyth Network: a powerful oracle harnessing the power of Solana!
  72. 72. What are stables in the world of cryptocurrencies?
  73. 73. What Is Binance Oracle?
  74. 74. Shibarium: A new era in the Shiba Inu ecosystem?
  75. 75. What is an ETF? How will an exchange-traded fund on bitcoin work?
  76. 76. Symmetric and asymmetric encryption - key cryptography techniques!
  77. 77. Hedging in cryptocurrencies - great portfolio protection against risk!
  78. 78. How to create your own cryptocurrency? 
  79. 79. What is a Dusting Attack in cryptocurrencies? How to protect against it?
  80. 80. What is a Black Swan?
Lesson 63 of 80
In Progress

63. 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 hexadecimal 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 full 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: programmability, 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.