Transferring Tokens Across Blockchains: The Definitive Guide to Bridges, Atomic Swaps, and Moreby@monkdi
4,561 reads
4,561 reads

Transferring Tokens Across Blockchains: The Definitive Guide to Bridges, Atomic Swaps, and More

by Dmytro Semonov, Tech JournalistSeptember 5th, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

There is a fast-emerging need in transferring tokens and coins across various blockchains. There are four usual ways to transfer tokens: exchanges, atomic swaps, synthesizing, and blockchain bridges. Each method has its own benefits, but usually, the blockchain bridge is the most efficient way to transfer methods.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail

Coins Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Transferring Tokens Across Blockchains: The Definitive Guide to Bridges, Atomic Swaps, and More
Dmytro Semonov, Tech Journalist HackerNoon profile picture

In the old movie "District 13" dystopian Paris was divided into isolated blocks with huge walls. Each quarter had its own course of life which was totally different from neighboring. In some way it reminds the current state of things in the blockchain industry: there are a lot of networks, each of them, like Ethereum, Solana, and Cardano could have different protocols, qualities, and dApps.

But each blockchain could have its own advantages which users of other blockchains would like to try to. So, there is a fast-emerging need in transferring tokens and coins across various blockchains. For example, you plan to invest in a liquidity pool on a different blockchain, move assets from a sidechain to the mainnet, or transfer crypto to a friend/seller who uses a different network. How to do this?

There are four usual ways to transfer tokens:

  1. Sell and buy.
  2. Synthetic acid asset.
  3. Atomic swap.
  4. Cross-chain token bridge.

Let's take a closer look at each method of token transfer.

1) Sell A and buy B on a crypto exchange

The simplest method that comes into mind is to use a crypto exchange. But it really takes a lot of time and effort. For example, we want to exchange ETH for MATIC. For this you have to:

  1. Deposit ETHs from an ERC-20 wallet to the crypto exchange.
  2. Buy MATIC, if there is a matching direct coin pair. If not – we will have to sell ETH for stable coins first, and after that – buy MATIC.
  3. Withdraw our MATICs to a wallet on Polygon.

Pros of using exchanges

  • It's the simplest method, the first which comes into mind.
  • If you use a trusted exchange, it's quite reliable.

Cons of using exchanges

  • KYC – often you have to provide personal data to use exchanges.
  • Takes a lot of time and action.
  • You can lose quite a sum on exchange commissions.
  • Sometimes it's hard to find the needed coin pair, especially for new tokens. You will have to conduct a double conversion.
  • The exchange could not support blockchain B, so there is a chance you will not be able to move the native token B. For example, now it's impossible to move MATIC from Binance to Polygon network.
  • Most exchanges require KYC.

2) Atomic swap – let's eradicate exchanges from the equation

What are Atomic Swaps?

Atomic swaps help to quickly exchange two separate coins running on different blockchains. It applies time-locked smart contracts to allow users to exchange currencies straight from their crypto wallets.

How does it work? Let's put it very simply and imagine that Rick wants to exchange a pizza for a burger, and be 100% sure that there will be no fraud. For this, he puts the pizza into transparent box A, and his friend Morty, who finally has agreed to share food, puts the burger into transparent box B. Both boxes are locked with the same cipher, issued by Rick. If he uses the cipher, it will become known to Morty.

The exchange has happened, each party has the needed box and can ensure that there is the food they expected. After that Rick uses his cipher to open box B, which automatically provides Morty the code to open his box A and enjoy the pizza.

If Rick and Morty wanted to explain how atomic swaps work, we think they would do such an infographic.

Of course, it's a very simplified explanation and the hard reality of atomic swaps is far more complicated (just kidding, atomic swaps make our life better). In the "blockchainian" language boxes are called HTLC – Hashed Timelock Contract, burgers and pizzas represent coins, and cipher is used for Preimage – the key that simultaneously unlocks the smart contract for both parties.

One of the main features of atomic swaps is that if one of the parties doesn't approve the transaction during a certain amount of time – the whole deal is canceled, so the risks are low. Actually, the term "atomic" is responsible for that – it means that the deal can be done only on defined terms or there is no deal at all. 0 or 1, nothing more.

Pros of atomic swaps

  • You have complete control over your pizza digital assets during a transaction.
  • The HashLock and TimeLock technologies in HTCL smart contracts provide reliable security and assurance to traders. Each side has the promise of receiving their assets back in case of delays or conflicts.
  • Low or even zero operating costs and fees compared to using centralized exchanges.
  • No need to engage with centralized intermediaries. Everything according to DeFi values 🙂

Cons of atomic swaps

  • Atomic swaps are only useful for swapping when both sides have already agreed on the assets and price. As a result, they have a relatively limited range of applications. Such a method cannot be used to create cross-chain collateralized derivatives, automated market-makers, and other similar products.
  • Both currencies that are being exchanged must have the same hash algorithm and support specific types of smart contracts.
  • Some technical skills are still needed to conduct an atomic swap.
  • Atomic swaps require significant time to work properly. Both parties could purposely act slowly, monitoring market conditions to see if the swap remains profitable. A market fluctuation could make the swap unattractive to one party, who may then cancel the swap.
  • Atomic swaps have more restrictive trade conditions than exchange platforms. They require parties to interact without direct communication. Platforms, for example, can perform trades with a click, while atomic swaps require the exchange of data and information.
  • Few wallets support atomic swaps.

3) Synthetic assets. Let's make a clone and freeze the original?

What is a synthetic asset?

Smart contracts allow the creation of digital assets which price is pegged to the price of another asset: a cryptocurrency, stock, or US Dollar. So, you will not have the original asset itself, but an analog that has the same value. Such assets are called synthesized.

In terms of transferring tokens, synthetic assets allow buying the representation of the native token of blockchain A on blockchain B, and its price will be the same as the original one. For example, you want to "transfer" Solana tokens to Ethereum. For this, you use a derivatives liquidity protocol to issue a synthesized SOL token on the Ethereum blockchain. The price of this token is tied to the price of SOL, but it could be freely used in the ERC-20 network.

And this infographic about synthesized assets is made by Crypto Hare. We don't know who he is but seems like quite a cool and smart guy.

Pros of synthetic assets

  • Anyone with access to open-source protocols can create blockchain-based synthetic assets.
  • Synthetic assets are blockchain assets like ERC-20 tokens; you can send and receive them between standard cryptocurrency wallets.
  • You can create synthetic representations not only of blockchain assets, but also equities, silver/gold, and other assets without having to hold them.

Cons of synthetic assets

  • For the most part, synthetic assets are developed on the Ethereum blockchain, so you can't issue them on most others.
  • You can't simply exchange a synthetic asset for the underlying. If you have synthetic BTC but desire real BTC, you must find a counter-party ready to execute that exchange with you. And one could still ask for a fee.
  • Synthetics are not able to interact with other chains. Unless paired with another interoperability solution, a synthetic that has been issued on one blockchain can only interact with contracts and assets of only this network.
  • During periods of high market volatility, liquidity mechanisms for synthetic assets could fail and it will be hard to sell them. This is dangerous because excessive market volatility is exactly when you want your assets to be the most stable.

4) Blockchain bridges – the future of interconnected blockchain world

What is a Blockchain Bridge?

If we use a metaphor from fantasy fiction, the blockchain bridge is kind of a portal between parallel worlds. It allows you to easily transfer tokens, coins, and NFTs from one blockchain to another. Both can have different rules, governance models, and protocols, but the bridge provides a dependable way for interoperation.

For now, the blockchain bridge is the best way found to solve the issue of interoperability between blockchains. It allows to seamlessly transfer tokens from one blockchain to another and make use of dApps hosted on other networks. Imagine that you have ETH, but you want to invest it into a new and very profitable DeFi service on Solana. You can't interact with Solana dApps using Ethereum tokens, but token bridges solve this problem.

In short, blockchain bridges allow users to access the benefits of other blockchains without sacrificing the advantages of the host chain.

How do blockchain bridges work? Actually, the assets are not transferred from blockchain "A" to blockchain "B", as you could think. Instead, it uses the "lock and mint" process. The bridge locks the assets in a smart contract on blockchain A and mints an equal amount of assets on blockchain B. When the user wants to redeem the tokens, the same amount of them are burned on blockchain B and the original tokens are unlocked. It prevents the assets from using on both chains at the same time. This infographic, we hope, is the simplest explanation of how blockchain bridges work.

Another way that a token can be transferred via the token bridge is by using liquidity pools.

  • User locks native X tokens on Polygon liquidity pool.
  • The user receives native X tokens on Solana, that are sent from the liquidity pool of X tokens on Solana.
  • It works like a usual swap, but pools are on different blockchains and the token is the same.

It could sound a bit complicated, but from a user's point of view, it's very simple. For example, helps to transfer both native and wrapped tokens just in a few minutes:

Using a blockchain bridge, like Allbridge takes only four steps on one website to transfer assets.

Pros of blockchain bridges

  • The cost of transferring tokens usually is very low.
  • The speed of transactions is as fast – transactions take as much time as a regular token transfer would take.
  • Bridges are very flexible and can be connected between lots of different blockchains.

Cons of blockchain bridges

  • Since you lock your assets in the contract, you must trust the creators of it. Even if the code is open source and the bridge is decentralized, there is always a chance of a hack.
  • When the market is volatile, there is a possibility, that the price of the original token and the wrapped token can differ.
  • If the blockchain, you are sending your tokens to, doesn't have a developed DeFi ecosystem, you may not be able to use it in dApps.

So, what method is the best to transfer tokens between blockchains?

Surely, everybody will choose his or her own way, depending on goals, time, and budget. However, the most accessible and modern way is to use our blockchain bridge. It combines the best from the transfer methods we mentioned above and allows you to access the advantages of other blockchains in a few clicks.