Academy Author ◦ 17 Oct 2023 ◦ 12 min read

How to Avoid Losing Your Crypto in Cross-Chain Swaps: a Detailed Guide

How to Avoid Losing Your Crypto in Cross-Chain Swaps: a Detailed Guide

As you must know, there are many types of cryptocurrency operating on different networks and using different protocols. Although bitcoin still dominates the cryptocurrency market, this dominance has been declining in the past few years amid growing interest in DeFi cryptocurrencies and as this happens, the demand for Bitcoin's interaction with DeFi is also growing.

The growth of numerous independent blockchain ecosystems with different specifics and geographical niches has led to the fact that the world is becoming more and more multi-blockchain. The ability to freely use the advantages of each of these blockchains and their unique assets within a single application would cause a powerful wave of development of new cross-chain smart contracts — as with the spread of DeFi, NFT, and on-chain gaming economies when decentralized oracle services for obtaining real data and secure computing outside the blockchain appeared.

We could compare the exchange of DeFi and Bitcoin with the exchange of one fiat currency for another, but an analogy would be more accurate, in which one group of people uses Coca-Cola caps for calculations, and the other uses shells, — that's how much the principles of their work differ.

What Do Different Blockchain Networks Mean?

To understand this difference, we need to touch on the question of how does blockchain work. Blockchain is a continuous chain of blocks that contains all records of transactions. 

The chain of blocks is unbreakable since each block contains a link to the previous one. As a result, it is impossible to forge a registry with data on the owners of assets in the blockchain.

The addition of new blocks is artificially restricted. If this is not done, the blocks will be added randomly and a reliable sequential chain will not work. For the appearance of a new block to become possible, it must be checked — this is what the miners are doing.

First, there was the Bitcoin network, with which the cryptocurrency revolution began. ERC-20 (Ethereum) network was the next truly big development in this sphere, from which DeFi technology and the use of smart contracts originate. Then other networks using different algorithms appeared.

Ethereum uses one blockchain, and Bitcoin uses another, and they are not interconnected. You can't just send tokens between networks. Therefore, to exchange within this exchange pair, you will need other tools and methods

Today, there are already dozens or even hundreds of first- and second-level blockchains. Each blockchain is unique in its way and has its advantages and disadvantages. If the world of cryptocurrencies, in which there was only Bitcoin, can be compared with the city where the railway was built, then today there are many types of transport in this city: from bicycles and helicopters to personal cars, trams, and boats. 

Each of them has its advantages for the user. At the same time, the user is not obliged to use only a bicycle or a car during the day and has the opportunity to "transfer" between them when he wants. But how?

ERC-20 Standard Tokens

Before the advent of Ethereum, each token had a separate intelligent contract, and, as a result, there were many compliance problems. As a solution for it, a standard protocol ERC-20 (or Ethereum Request For Comments) was created. 

The peculiarity of the ERC-20 standard is in several requirements that need to be met to accept a token and its network interaction with other tokens. Assets in the blockchain can be valuable, they can be received and sent, like all cryptocurrencies.

The ERC-20 standard is technically easy to apply. This allows specialists to easily develop new tokens. There are a large number of ERC-20 compatible tokens. For example, Maker (MKR), Tether(USB), Fantom (FTM), Dai (DAI), and others.

Since any ERC-20 token can be stored in any ETH-compatible wallet, we can switch from one ERC-20 token to another without much risk and difficulty.

When transferring Ethereum's assets to an EVM-incompatible chain such as Solana, the bridge connecting the two networks uses two different wallet addresses and token standards. This means that users need to connect a wallet compatible with Ethereum and Solana, such as Meta Mask and Phantom.

Other Token Standards

There are other technical standards of tokens that serve different purposes: the best-known ones among them are BEP-20, OMNI, and TRC-20, which you will find in the I/O section on a variety of cryptocurrency exchanges.

If you transfer an ERC-20 token to the wallet of one of these networks, you will lose it, because when you send it, you will specify a similar address, existing on another network, - as if you came to visit your friend on a street with the same name, but in a different city.

Luckily, there are crypto sites that support multiple blockchains, such as Binance or Coinbase. When you deposit or withdraw any of the different blockchain coins, you will be asked to choose the type of network. After entering the wallet address or the recipient's address for withdrawal, Binance will automatically select the network based on the entered address.

How to Cross-Chain

There are 2 ways to cross-chain exchange:

On a Centralized Exchange,

like Binance which we've already mentioned, where you can simply exchange bitcoin for ether, Solana for Near, etc. Here large internal pools and algorithms of centralized exchanges are responsible for exchanges. The exchange's developers control these processes, and all this happens nominally on the exchange's wallets, and not in the blockchain itself. 

Platforms that provide cross-chain services do not work for free. It is necessary to pay the cost of the operation for the deposit and withdrawal of funds, which is sometimes quite high.

In addition, most centralized exchanges (CEX) require KYC procedures (providing copies of documents, and photos/videos of the user), which does not always satisfy users. 

Decentralized Trading Platforms,

such as UniSwap, do not collect personal data about their users, nor do they require complex registration/login procedures. On decentralized platforms, special smart contracts are used to achieve a high level of trust. They allow interaction between different networks and, in case of compliance with the terms of the contract specified by users, to perform automatic exchange (conversion) of assets. However, you need to be prepared for the fact that the exchange pair you need may not be on DEX. When choosing an exchange, it is important to take into account the number of trading pairs. The more of them, the higher the opportunities for trading and investing.

To begin with, you need to decide on the choice of an exchange. Then carefully approach the study of trading pairs. It is necessary to work on large platforms with liquid pairs in order to reduce risks. There are also aggregators like SwapSpace, which is designed to make choosing a bit easier by gathering offers from different exchanges in one place.

There’s also using blockchain bridges. If we go beyond centralized exchanges into the world of decentralized finance, then, in fact, we go into the blockchain itself. And only bridges will allow you to make a cross whose new exchange is in the blockchain itself.

Cross-Chain Bridges

Cross-chain solutions, cross-chain bridges, compatibility, or interoperability solutions are a technology that allows you to transfer tokens from one blockchain to another.

Blockchains, like islands or individual states, exist in their ecosystems according to their own rules, and initially, the developers did not bother with the standardization and compatibility of networks. With the growing number of projects in the decentralized space, this issue has become acute.

The bridge most often refers to the use of managing smart contracts and an oracle service that monitors transactions and listens for events in the managing smart contract. The bridge can be one-way, receiving information via other communication channels. The most important thing is that the bridge is a cryptographic verification of the authenticity of the information. Cross-chain solutions can transfer assets within the same network — from L1 to L2, for example.

But bridges do not transfer tokens in the classical sense, — bridges have certain pools of liquidity for pairs of assets. Tokens are blocked in one network and minted again in another

For example, to transfer tokens from blockchain A to blockchain B, the bridge temporarily freezes assets in blockchain A (the sender's funds). Then the required tokens are unblocked (minting) in blockchain B (the recipient has access to funds in the addressee blockchain). If the user decides to get his funds back, the reverse process is performed: blockchain B tokens are burned, and access to blockchain A tokens is unlocked.

You can use various cross-chain bridges. they are built based on burning algorithms (mint-and-burn) or using the process of freezing and reissuing synthetic tokens. It is implied that when a token leaves its blockchain, it is frozen, and at the same time, a synthetic version of this token is released on another platform. Often (but not always) the process is based on the presence of intermediaries (oracles) in the systems to transfer information from one blockchain to another. The burning protocol, as the name suggests, does not freeze, but burns tokens.

Cross-chain solutions can be centralized (requiring full trust), federated (federated), and trustless. These characteristics can vary to varying degrees — it all depends on the level of decentralization.

Centralized bridges imply full control by any institution/team/company/project. Users transfer their information/funds to the management of the central authority that controls the operation of the blockchain. There is no decentralization, but such solutions are easily and quickly implemented. At the same time, no one guarantees the safety of funds, therefore, this technology does not differ in security.

The federated bridge works by analogy with a private blockchain. Nodes must comply with a number of strict rules to become part of the management network and gain control over the movement of tokens. Specialized nodes are called keepers. There are such, for example, in a cross-chain solution between Ethereum and Wanchain. Custodians block tokens in Ethereum and issue tokens in Wanchain. If the user needs to transfer tokens back, he submits a request to the keepers, who send part of the secret key. When a full key is generated, it removes the lock from the tokens. There may be various options for voting mechanisms with partial control.

Trustless-bridge is a full-fledged decentralized system that any network participant can join to perform the functions of an agent or validator. He verifies the validity of transactions and receives a commission for it. The Syscoin bridge works according to this algorithm. Nodes here can challenge the work of other agents and report a violation. If the check is successful, then 3 ETH is withdrawn from the violator, but in the opposite case, 3 ETH is lost by the person who reported the violation. Another vivid example of such a bridge is Wormhole, which connects the Solana network and Ethereum. It allows you to convert ERC-20 tokens into native SPL tokens of the Solana blockchain.

Examples of cross-chain bridges can be projects such as AnySwapBTC Relay, POLKADOT, BLOCKNET, AION, WANCHAIN, etc

Advantages of Cross-Chain Bridges

Bridges can accelerate the transfer of digital assets in a trustless environment. Interoperability can also contribute to high confidentiality, for example, data is recorded in sidechains accessible only to the parties involved in each specific transaction.

Bridges can also provide greater speed and scalability using sharding (segmentation). Individual operations can be recorded in a network segment, while the result of processing a group of operations is recorded in the main registry. Bridges reduce network traffic by distributing between less loaded blockchains, which also contributes to greater scalability.

Disadvantages of Cross-Chain Bridges

This is still an experimental technology that needs to be honed for mass use. Cross-chain solutions have not yet become sufficiently universal and so far act as a kind of crutches, another add-on, or a level above blockchains, which makes the entire system more cumbersome.

Errors and obstacles between the work of various networks are not excluded, because these are complex distributed registries, and not every computer can process such an amount of information. That is, cross-chain bridges are quite resource-intensive, in the sense that they require a lot of human resources and time.

There are also questions about security. The more bridges an asset passes, the riskier it becomes, moving further away from the original asset. Since new tokens with new tickers are minted every time they pass through the bridge, this creates inconvenience for users.

Now it is necessary to look for a unique approach to each case and each pair of blockchains, and this requires time, money, and serious efforts of developers.