Cross-chain cryptocurrency tokens — How do they work?
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.
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:
- Lock the 100Ta tokens, into an address that only the smart contract has control.
- Mint 100Tb tokens, on Blockchain B.
The reverse, going from Blockchain B, back to Blockchain A would be:
- Burn n amount of tokens Tb on Blockchain B
- Provide proof of burn to the smart contract on Blockchain A
- The smart contract will unlock n tokens Ta to the provider of the proof of burned tokens.
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.
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
An ultimate guide to Leveraged Token [Bull Token]
Leveraged tokens are ERC20 tokens with leveraged exposure without taking care of the margin, requirements, management…
Best Crypto Exchange | Top 10 Cryptocurrency Exchanges 2022 | CoinCodeCap
which is the best crypto exchange? In this article, we will list the top 10 cryptocurrency exchanges based on multiple…
Best Crypto Swap Platforms In 2022 | CoinCodeCap
With time most of us will be shifting to DeXs for better security and privacy. Hence. here we'll be talking about the…
Best Crypto And Bitcoin Casinos (US Approved, Deposit Bonus) 2022 | CoinCodeCap
RECEIVE, PAY AND EARN IN CRYPTOCURRENCY||With a wide variety of best online casinos to choose from, it is possible that…
Best Crypto Lending Platform in 2021 | Top 6 Bitcoin Lending Platforms
Get the best lending interest rates for Bitcoin and other cryptocurrencies