Cross-chain cryptocurrency tokens — How do they work?

Christos Palaskas
Coinmonks
4 min readFeb 6, 2022

--

As more blockchain projects emerge, and more applications are being built on top of them, a necessity for migration sometimes emerges. Either because a new blockchain offers advantages over the one you started with, or the community seems more aligned to your personal ideology, you might find yourself wanting to convert your tokens. We’ve seen this with SingularityNET’s AGIX tokens, that can be converted from the Ethereum to the Cardano blockchain and back, on testnet at the moment. Another example is dcSpark’s Milkomeda, creating side chains between blockchains, where one can run smart-contracts that execute on both chains. They are focusing on Cardano with support for Solidity (the programming language most Ethereum smart contracts are written), Solana and other chains coming up. IOG, the company that launched Cardano is also working on a decentralized sidechain solution, Mamba.

In this article, I will explain how the first solution works, with a smart contract and why it is not the best approach.

Image 1 — Initial state

Let’s assume that on Blockchain A, someone has 100 tokens, Ta, someone else has 50Ta etc. The owner of the 100 Ta is tired of paying a lot of fees when sending tokens and wants to migrate to another Blockchain B, where fees are cheaper. The creator of Ta wants to give value to token T, by making it cross-platform, cross-chain, available on other blockchains. But the number of tokens T has to be constant, regardless on which chain it resides. The creator can run a smart contract on Blockchain A that would do the following:

  1. Lock the 100Ta tokens, into an address that only the smart contract has control.
  2. Mint 100Tb tokens, on Blockchain B.

The reverse, going from Blockchain B, back to Blockchain A would be:

  1. Burn n amount of tokens Tb on Blockchain B
  2. Provide proof of burn to the smart contract on Blockchain A
  3. The smart contract will unlock n tokens Ta to the provider of the proof of burned tokens.
Image 2 — A Smart Contract can facilitate the conversion of the tokens between blockchains

Let’s examine some use cases and shortcomings. The first case is simple, there were 150 tokens total before the conversion, there are 150 tokens after the conversion. The 100 Ta are locked into the smart contract, no one else has access to them.

Image 3 — Migrate 100 T from A to B

Now the owner of 100 Tb realized that they need 20 tokens back on Blockchain A. They will burn 20Tb, and provide the proof that exactly the same tokens with the same policy ID from the minting were burnt. The smart contract will unlock 20 of the 100Ta tokens and send them to the original owner.

The total supply has not changed, it is still 150 tokens, Ta and Tb.

This approach is very simple, easy to implement, but there are some trust issues:

  • The UI (user interface), which would probably be hosted on a centralized server, would be controlled by the creator of the token. It can be compromised, and a user would send the tokens to a hacker’s address instead of the smart contract address. Most people use the UI not the command line interface to type in exactly the commands. This is a very generic issue with cryptocurrencies, not specific for our use case.
  • The smart contract itself could have malicious content hidden, say create extra tokens at the mint stage. This could be caught with an audit.
  • Authenticity of the new token. Who says that someone else doesn’t create another smart contract that does the same thing, but mints Tb2 tokens on Blockchain B. Even if the number of tokens T is still constant, which tokens do the exchange platforms recognize? Ta, Tb, Tb2? Worse scenario, the other smart contract mints on Blockchain B twice the number of tokens it locks on Blockchain A.

The summary is that for converting tokens between chains, a more decentralized, trustless solution is necessary.

If you find this article useful, consider delegating some ADA to our Cardano pool. Staking with small pools helps the decentralization of the network. We also donate 10% of our profits to an NTUA student with the best research on Cardano protocols:
ADA Skepsis — ASKP
https://skepsispool.com
https://www.youtube.com/CryptoSkepsis

Join Coinmonks Telegram Channel and Youtube Channel learn about crypto trading and investing

Also Read

--

--

Christos Palaskas
Coinmonks

Software Developer Engineer in Test, Blockchain Technologies. Cryptocurrency enthousiast, Cardano Staking Pool Operator. Former monk. Author.