Stay away from cross-chain bridges, Vitalik advocates for atomic swaps: but are they really useful?
Written by: Ignas, DeFi Research
Compiled by: Baize Research Institute
How do you convert BTC to ETH? Or convert BTC to ATOM?
Like many people, I usually deposit ETH into a centralized exchange (CEX), trade it for BTC, and then transfer the BTC to an on-chain wallet.
This puts me in a rather ironic position: while advocating for the use of DeFi, I myself am using CEX for these so-called "cross-chain trades."
In fact, Ethereum co-founder Vitalik Buterin has repeatedly emphasized "keeping assets on their originating chain and using atomic swaps to transfer value across different chains."
It sounds simple, but the reality is far from straightforward.
What exactly is an atomic swap? How do they work, and can they really replace centralized exchanges?
Let’s explore this in the article.
Atomic Swaps: From Idea to Execution
The idea of atomic swaps was first proposed by Tier Nolan in a Bitcointalk forum post in 2013. However, it wasn't until 2017 that the first atomic swap was successfully completed. At that time, Litecoin founder Charlie Lee shared on Twitter: "Completed a cross-chain atomic swap of LTC/BTC!" (By the way, it was a nice trade: he made a 330% profit on this transaction.)
How do atomic swaps work? We can understand it simply as follows:
Atomic swaps occur between two cryptocurrency wallets without any intermediaries facilitating the transaction. They are "atomic," just like atoms are indivisible; either the transaction is successfully completed and each trader receives the other's funds, or nothing happens, and both traders retain their funds prior to the trade.
The atomic swap mechanism relies on Hash Time-Locked Contracts (HTLC), which can be understood as a virtual safe with two special guarantees: "HashLock" and "TimeLock":
- HashLock: Ensures that funds are locked in the contract until the initiating party sends the key to unlock the HTLC contract to the other party.
- TimeLock: If the transaction is not completed within a specified time frame, the cryptocurrency involved in the transaction is returned to the trader.
Once both parties submit the contract keys, the transaction is complete.
If either party fails to submit within the specified time, the transaction is canceled, ensuring that no one suffers a loss.
Atomic Swaps vs Cross-Chain Bridges
Of course, the technology behind atomic swaps is far more complex than explained and is still evolving, offering benefits such as:
- Trustless: No trusted third parties involved
- Mitigates counterparty risk: If one party fails to meet the transaction requirements, the other party does not lose assets
- Ownership control: You maintain control of the assets until the transaction is completed
- Privacy: Transactions are private, known only to the parties involved.
Although many tech leaders experimented with atomic swaps in the early days, they never seemed to gain real traction.
This is a tweet from Vitalik three years ago: We should allocate resources to a proper (trustless, serverless, maximally similar to Uniswap user experience) ETH <-> BTC decentralized exchange. The embarrassing thing is that we still cannot easily transfer value between the two largest crypto ecosystems trustlessly.
Three years later, the situation is different. I’m not referring to atomic swaps, but to cross-chain bridges.
During these three years, cross-chain bridges that aggregate user assets and issue pegged tokens (or wrapped tokens, such as wETH on Fantom) have become increasingly popular.
According to data from DefiLlama, the total assets of 14 cross-chain bridges reached $4.8 billion in the past 7 days!
Vitalik is very critical of the design of cross-chain bridges. A year ago, he shared his reasons for being pessimistic about cross-chain bridges on Reddit. Here are the key points:
- While multi-chain ecosystems offer diversity advantages, cross-chain bridges pose security issues due to contract vulnerabilities.
- Even under a 51% attack, a blockchain can maintain its rules, keep user balances unchanged, and ensure transaction consistency.
- However, during a 51% attack, if the smart contract of a cross-chain bridge loses control, the cross-chain assets may depreciate.
- Therefore, keeping native assets on their original chains is safer than moving them across chains.
- Cross-chain activity exhibits a "reverse network effect": the more it is used, the greater the risk, especially when cross-chain bridges hold large amounts of assets.
As I write this, the risk of the "reverse network effect" has become very real, with rumors that the Multichain development team holding multi-signature keys has been arrested.
Just a reminder, Multichain's cross-chain bridge uses an asset pool model to issue pegged tokens on supported chains.
For example, BTC on Fantom is actually wBTC that has been "wrapped" and then re-"wrapped" by Multichain.
On-chain analyst An Ape Prologue studied Multichain. He found that 40% of Fantom's assets, excluding the native token FTM, are issued by Multichain. These pegged assets amount to $650 million, indicating Fantom's high dependence on cross-chain bridges.
Unfortunately, Multichain is neither the first nor the last cross-chain bridge to encounter trouble. The five largest cross-chain bridge hacks have resulted in losses of $1.9 billion.
As Vitalik said: "Keep assets on their originating chain and use atomic swap protocols to transfer value across different chains."
Despite the risks of cross-chain bridges, atomic swap protocols are currently rare, mainly due to these five obstacles:
- Different languages: Different blockchains use different languages, making direct atomic swaps difficult.
- Limited functionality: Bitcoin's language lacks the smart contract capabilities of Ethereum's Solidity, complicating the implementation of certain atomic swap conditions.
- Different consensus mechanisms: Bitcoin uses proof of work, while Ethereum has transitioned to proof of stake. This difference complicates the atomic swap mechanism.
- Complexity and risk: Atomic swaps require multiple steps, and if executed improperly, there is a risk of losing funds.
- Liquidity requirements: Effective atomic swaps require sufficient liquidity on both chains; otherwise, exchange rate fluctuations may occur during the transaction.
Attempts at "Atomic Swaps"
So, can we really use "atomic swap" protocols?
Currently, there are at least 15 related protocols using different swapping mechanisms.
However, what truly matters to me is the ability to swap native assets between chains, especially when it involves swapping between native BTC and ETH, which I see as the holy grail.
Thorchain's Thorswap
Thorswap may be the most well-known multi-chain asset trading protocol. It facilitates the exchange of ETH, BTC, and other native tokens across 9 chains.
In the image below, I took 9 minutes to swap ETH for BTC, incurring a fee of $37 (most of which was on the Bitcoin network).
At the core of the THOR system is a liquidity pool, with each pool containing 50% of the THORChain native token RUNE and 50% of other assets like BTC or ETH.
When you want to swap ETH for BTC, the protocol exchanges your ETH for RUNE from the ETH-RUNE pool, and then swaps that RUNE for BTC from the BTC-RUNE pool.
Thus, THORChain still relies on liquidity pools, which may become targets for hackers, meaning it is not a true atomic swap.
In fact, I contacted the THORSwap team to explain why they abandoned the use of atomic swaps. Here’s what their operations manager paperX said:
Due to limited liquidity, THORChain had to abandon atomic swaps. Because if we want to provide a decentralized cross-chain trading protocol that can replace CEX, we must offer competitive trading quotes. As early as 2018/2019, THORChain had already researched atomic swaps as a technical option but ultimately shifted to building a decentralized cross-chain liquidity protocol that uses the Tendermint consensus engine, Cosmos-SDK state machine, and GG20 threshold signature scheme (TSS). It does not peg or "wrap" assets; it directly manages funds in an on-chain treasury.
Komodo (AtomicDEX)
Komodo is one of the pioneers in the field of atomic swaps.
Their decentralized exchange AtomicDEX utilizes atomic swap technology to provide a "secure and trustless multi-chain trading" environment. Komodo proudly states, "We cannot freeze funds or stop trading."
Unfortunately, the platform is not very user-friendly on both mobile and desktop. Currently, it does not support Metamask or Keplr, only allowing connections via mnemonic phrases or hardware wallets.
Additionally, the exchange limit for BTC is 2 ETH, and the offered exchange rate is 7% lower than that of centralized exchanges (CEX).
This may be the trade-off users need to consider when choosing between using cross-chain bridges and true atomic swap protocols.
Conclusion
Achieving atomic swaps between BTC<->ETH is challenging.
If using decentralized applications is not an issue, and you want to conduct cross-chain trading, you can also try using SWFT AllChain Bridge or the Maya protocol (a branch of THORChain).
In addition, there are three next-generation cross-chain protocols worth trying:
- InterSwap - A full-chain AMM with unified liquidity.
- Orion Protocol - Users can trade between major CEX/DEX using DeFi wallets. No KYC required.
- Chainflip - Enables cross-chain swaps with very low slippage to replace centralized exchanges.
(Note: The above represents the author's personal views and does not constitute investment advice. DYOR)
In any case, I wonder which protocols Vitalik is optimistic about when suggesting to steer clear of cross-chain bridges and use atomic swaps.
However, it is evident that true atomic swaps seem far from achieving widespread adoption.