18 Feb 2025

light mode

What are atomic swaps and who uses them

What are atomic swaps and who uses them

Atomic swaps are mechanisms that enable a secure P2P exchange of cryptocurrencies. They are based on bilateral smart contracts, removing third-party involvement in the transaction.

On this page

Atomic (i.e. “indivisible”) swap is one of the few DEX techniques for exchanging cryptocurrencies on different blockchains. It is an inter-network trade based on the philosophy of direct interaction between network users. Token holders can exchange their coins, without using the services of crypto exchanges.

How do atomic swaps work?

Smart contracts for swapping are created in the L2 payment channel of the Lightning Network, with a commission of 1 satoshi per transaction.

The whole swap procedure can be divided into the following steps:

1. Two people agree to swap their coins at a rate beneficial to both parties. Imagine that user John offers his BTC in exchange for Michael's BCH.

2. John deposits bitcoin to the contract address, which acts as a temporary vault.

3. When coins are deposited into this vault, the smart contract automatically generates a Hashlock Key to access the BTC. 

4. John sends the private key to Michael, thereby confirming the fulfillment of his side of the deal.

5. Michael uses the given key to create his contract and sends BCH.

6. Once the transfer is made, Michael gets his Hashlock Key and sends it to John.

7. Bitcoin Cash and Bitcoin are locked in “vaults”, and both parties confirm that they have fulfilled their part of the commitments.

8. John and Michael swap the original (public) keys to the temporary vaults and get access to the money.

Atomic Swap Scheme. Source: Github

Atomic Swap Scheme. Source: Github

The parties may agree in advance on the Timelock Key. It can be used when the parties are not sure of the quick fulfillment of the contract. An activated Timelock Key will monitor the action timing. If one of the parties does not create a cryptographic proof of payment within the agreed period, the deposited funds will be returned to the owner.

The specific feature of an atomic swap is that the contract is executed only after the swap is fully completed. If any of the parties fail to send funds or send them in an amount that differs from the declared amount, all the coins will be returned to the owners. This reduces the risk of fraud.

Who can benefit from an atomic swap?

Atomic swaps are used by those who want no third party to participate in the transaction.

These include:

1. Traders who, for whatever reason, do not trust the centralized exchanges. 

2. Token holders unwilling to pass KYC procedures on controlled platforms. However, the cloud providers ensure only relative anonymity. 

3. Altcoin owners who do not want to (or cannot) use stablecoins or fiat as an intermediate coin for conversion.

All transactions between blockchains are made using personal wallets with no intermediaries or supervisors. There is no need to trust each other because all risks are eliminated during the execution of the contract.

Swap transactions are faster than exchange transactions while fees are kept low.

The major disadvantages of atomic swaps include: 

1. Only cryptocurrencies with the same encryption algorithm can be swapped. For example, you can swap Zcash for Comodo, because they have the same Equihash algorithm. But you can't swap Litecoin (Scrypt) for Monero (CryptoNight). Though developers are actively testing solutions to expand possible swapping pairs.

2. This kind of swap requires peers to run full blockchain nodes on their hardware. Yet this problem can be solved by using cloud services for running nodes.

Atomic swaps can be performed on DEX platforms (Uniswap, Atomic DEX, Sushi Swap), using cloud services (e.g. Atomic Papas), or through a Ledger hardware wallet.

The content on The Coinomist is for informational purposes only and should not be interpreted as financial advice. While we strive to provide accurate and up-to-date information, we do not guarantee the accuracy, completeness, or reliability of any content. Neither we accept liability for any errors or omissions in the information provided or for any financial losses incurred as a result of relying on this information. Actions based on this content are at your own risk. Always do your own research and consult a professional. See our Terms, Privacy Policy, and Disclaimers for more details.

Articles by this author
Lawmaker Attacks Trump’s Meme Coin, Musk’s DOGE

Lawmaker Attacks Trump’s Meme Coin, Musk’s DOGE

Democratic Congresswoman Ayanna Pressley has criticized the DOGE agency and Trump’s meme coin, arguing they represent a dangerous shift in financial oversight.

Anton Kryshtal
LIBRA Meme Coin Mystery—Is There a MELANIA Connection?

LIBRA Meme Coin Mystery—Is There a MELANIA Connection?

LIBRA’s sudden launch has left the crypto world divided. Was it just another meme coin stunt, or is there a real connection to Javier Milei? And what’s this about MELANIA? The plot thickens.

The Coinomist
Scammers Tricked Investors with a Fake Saudi Meme Coin

Scammers Tricked Investors with a Fake Saudi Meme Coin

Scammers impersonating Saudi Crown Prince Mohammed bin Salman on X claimed to launch an “official” KSA meme coin. Spoiler alert: It was a total scam.

Anton Kryshtal
Italy Moves to Rein In Crypto as EU, U.S. Rules Diverge

Italy Moves to Rein In Crypto as EU, U.S. Rules Diverge

The Bank of Italy, together with the Italian securities regulator Consob, met with industry leaders to discuss the evolving rules for digital assets.

Anton Kryshtal
Weekly Analysis of BTC, ETH, and the Stock Market (Feb 10, 2025)

Weekly Analysis of BTC, ETH, and the Stock Market (Feb 10, 2025)

An overview of BTC, ETH, XAUT, and S&P500 charts, and the current cryptocurrency market dynamics.

Artem Khomenko
Weekly Analysis of BTC, ETH, and the Stock Market (Feb 3, 2025)

Weekly Analysis of BTC, ETH, and the Stock Market (Feb 3, 2025)

An overview of BTC, ETH, XAUT, and S&P500 charts, and the current cryptocurrency market dynamics.

Artem Khomenko
Weekly Analysis of BTC, ETH, and the Stock Market (Jan 27, 2025)

Weekly Analysis of BTC, ETH, and the Stock Market (Jan 27, 2025)

An overview of BTC, ETH, XAUT, and S&P500 charts, and the current cryptocurrency market dynamics.

Artem Khomenko
How to Bump a Transaction in the Bitcoin Network

How to Bump a Transaction in the Bitcoin Network

Sometimes, Bitcoin transactions can get “stuck,” especially if a low fee was set. In such cases, you might wonder: Why is my Bitcoin transaction stuck?

bitOn
Inside Cryptocurrency Farms: How Digital Coins Are Mined

Inside Cryptocurrency Farms: How Digital Coins Are Mined

Cryptocurrency farms and mining have evolved significantly since Bitcoin launched in 2009. To understand their growth, it helps to look at the broader history of resource extraction.

The Coinomist
From Bulls to Ballers — Why Celebrities Are Flocking to Crypto

From Bulls to Ballers — Why Celebrities Are Flocking to Crypto

Trump’s meme coin isn’t an outlier—it’s part of a broader trend. Back in 2021, celebrities were minting NFTs, and by 2024, they had moved on to personal token launches. The connection between fame and crypto has been growing for years, even if many failed to see it.

Vlad Vovk
Which Macroeconomic Factors Make Crypto Rise or Fall? 

Which Macroeconomic Factors Make Crypto Rise or Fall? 

It happens when you check the market and crypto prices are up or down for no obvious reason. Then you do some research and find out that there are actually reasons outside the crypto space.

Anahit Avetisyan
How Blockchain Helps Combat Disinformation

How Blockchain Helps Combat Disinformation

Fake news has become a global issue, shaping public opinion, fueling social tensions, and even influencing political decisions. With the rise of social media, the spread of misinformation has accelerated, making it increasingly difficult to regulate. However, blockchain technology offers a promising solution in the fight against fake news.

Daryna Nesterenko
Trading Psychology: How to Avoid Falling Victim to Your Own Biases

Trading Psychology: How to Avoid Falling Victim to Your Own Biases

The most successful traders aren’t always the smartest. More often, those who excel are the ones who understand psychological traps, manage their emotions, and maintain rationality under pressure.

Vlad Vovk
The Bitcoin Kid’s 2011 Prediction – How Right Was He? 

The Bitcoin Kid’s 2011 Prediction – How Right Was He? 

In May 2011, an unusual video surfaced on YouTube. A 12-year-old boy explained Bitcoin – how it works and what its future might hold.

Anahit Avetisyan
SBF’s Prosecutor Quits – What It Means for Crypto Crime

SBF’s Prosecutor Quits – What It Means for Crypto Crime

Danielle Sassoon, Acting U.S. Attorney for the Southern District of New York, has resigned, making headlines this week. And you’ve definitely heard of one of her biggest “client” names.

Anahit Avetisyan
MORE
«Mass Adoption Isn’t About Tech – It’s About Perception». Bitmedia Founder Matvii Diadkov – About RWA, Web3, And Marketing

«Mass Adoption Isn’t About Tech – It’s About Perception». Bitmedia Founder Matvii Diadkov – About RWA, Web3, And Marketing

Matvii Diadkov, founder of Bitmedia, shared with us in an exclusive interview his expert insights on Web3 adoption, impact of GameFi and community-centering tendencies in the market.

The Coinomist
“Satoshi is CIA”: Swedish crypto bro opens up about his Bitcoin journey

“Satoshi is CIA”: Swedish crypto bro opens up about his Bitcoin journey

The first crypto craze took place almost a decade ago. Overnight, many people found out about Bitcoin and its underlying technology, blockchain.

Lesia Dubenko
MORE