Cross-chain composabilitysteemCreated with Sketch.

in CryptoDog5 years ago

Polkadot is like a foundation. All blockchains built on this foundation can realize business exchanges and can connect to already established blockchains such as Bitcoin and Ethereum. So starting today, we will formally enter Polkadot's system learning. I will also tell you in plain and easy-to-understand language. Today we will talk about Polkadot's cross-chain composability.

1. The concept of cross-chain

How does Polkadot allow business exchanges between different blockchains? There is a professional name here. Many friends should know that for the communication and interoperability of data and assets between different blockchains, we consider It is called cross-chain.
Here are the key points. A true cross-chain must meet the following functions:

  • Data cross-chain
  • Asset cross-chain
  • Interoperability

For example, Bitcoin and Ethereum have achieved cross-chain through Polkadot.
So here: The transfer records on the Bitcoin chain can be transferred to Ethereum through Polkadot (data cross-chain)

The asset BTC on the Bitcoin chain can also be transferred to Ethereum via Polkadot (asset cross-chain)

Smart contracts on Ethereum can control the transfer of BTC through Polkadot (interoperability).

Some people have always thought that the so-called cross-chain is asset swap. For example, 1BTC is exchanged for 10ETH, so the assets on the chain are swapped, which is a big mistake! Brother Ya strongly refutes, what is the difference between this kind of "cross-chain" and trading on a centralized exchange? Even if you are trading on a decentralized exchange (DEX), this is not at all involved with cross-chain! Some markets claim to do cross-chain projects and advocate that asset swaps are cross-chains, which are actually exchanges. Don't confuse the concept.

2 Polkadot's cross-chain architecture

Polkadot is like a foundation, so Polkadot's main chain is like this foundation. Many blockchains can be added. We call Polkadot's main chain a relay chain, and the added blockchain is called a parachain.

In order to allow more blockchains to join, the relay chain will have a lot of slots on it. As mentioned above, the established blockchains like Bitcoin and Ethereum cannot be directly inserted into the slots. , Polkadot can only be connected by a bridge. We call this bridge a transit bridge. Let me draw a picture for you to demonstrate, and everyone should understand:

image.png

In the picture, the Polkadot relay chain is a big ring with many small holes as slots. Other blockchains can be inserted into the slots to become parachains. Bitcoin and Ethereum cannot be directly inserted into the slots. The way of bridging becomes a parallel chain.

3 how Polkadot realizes cross-chain

In the picture above, the Polkadot relay chain is like a plug-in strip. Different blockchains can be inserted into the slot to become its parachain. Then this plug-in strip has a function for data transmission. We call it the XCMP protocol.

It is precisely because of the XCMP protocol that it is as if a telephone line is connected between the parachains that the parachains inserted into the slots can send messages to each other, communicate with each other, and realize data cross-chain.

So how is Bitcoin transferred to Ethereum? Many people are as unthinkable as Brother Duck, how can assets be cross-chain only with data cross-chain? Here is an example:

A owns 1 BTC, and he wants to transfer this BTC to Ethereum to participate in Ethereum's decentralized financial activities. So first, he will transfer 1BTC to the BTC address of the transfer bridge, and the transfer bridge will be locked after receiving it. No one can move the BTC, and then submit an Ethereum address. Immediately afterwards, the transfer bridge will lock the BTC message, and the Ethereum address submitted by Lao Wang, through the Polkadot XCMP protocol, and tell the transfer bridge on the Ethereum.

"Is it an Ethereum transfer bridge? I have successfully locked the BTC, please answer when I receive the message! A's Ethereum address is xxxxx"

The transfer bridge of Ethereum received a message: "Knowing that BTC is locked, we have received A's Ethereum address here."

Everyone knows that the smart contract on Ethereum can issue coins, so after the transfer bridge on the Ethereum side receives the message, it immediately mints an XBTC Ethereum token through the smart contract and sends it to A's Ethereum address.

This XBTC token represents the BTC locked by the transfer bridge over there. Then users can transfer this XBTC token to the Ethereum ecosystem and participate in various decentralized financial activities. In this way, Bitcoin is transferred to Ethereum, realizing asset cross-chain. What if a user wants to redeem the BTC on his Bitcoin chain? In fact, it is also very easy to achieve. You only need to transfer XBTC tokens back to the transfer bridge of Ethereum and submit an address to receive bitcoin. After the transfer bridge receives XBTC, it will be destroyed through the smart contract immediately.

Similarly, through the Polkadot XCMP protocol, the message of the destruction is transmitted to the transfer bridge of Bitcoin, and the BTC is unlocked and released to the Bitcoin address provided by the user, so that the user gets the original BTC.

4 How to ensure the safety of the transit bridge

It can be seen that the asset cross-chain of Bitcoin and Ethereum mainly depends on the transfer bridge. Someone asked Brother Duck, what should I do if the transit bridge runs off or does not work?
In fact, the transfer bridge is not centralized. It is also a decentralized blockchain. The role of collector exists on this bridge chain. Each parachain has its own collector. These collectors collect parallel The message of the chain is passed to the relay chain for verification, and the situation of the parachain is monitored to prevent the occurrence of malicious incidents.

To become a collector, you need to pledge the tokens of the parachain. For example, as a collector of a Bitcoin transfer bridge, you need to pledge BTC. If the collector node goes offline or commits evil, the system will punish the pledged BTC. Of course If the collector performs well, the system will also have a reward as an incentive for the collector.

Therefore, in the transfer bridge of Bitcoin and Ethereum, the asset cross-chain is charged for handling fees, and these handling fees are used as a reward for the collector. For example, the user transfers to the transfer bridge to lock 1 BTC, and it is actually on the Ethereum transfer bridge. May only receive 0.99 XBTC tokens, and the 0.01 BTC deducted is used as a reward for the collector, so that the security of the transfer bridge can be guaranteed through a decentralized method.

5. summary

I wonder if you have discovered what is the core part of Polkadot’s entire cross-chain system. I think the core of Polkadot’s cross-chain system is the XCMP protocol. In fact, the so-called asset cross-chain is also due to data The inter-chain communication of data is used to operate the process of locking, unlocking, casting and burning of assets between two different blockchains.

Back to the title of this article-cross-chain composability, what does composability mean? In fact, Polkadot has a very wide range of parachains, including public chains, private chains, alliance chains, and not even a blockchain. As long as its technology is good enough to add new functions to the prosperity of Polkadot’s ecology, it can be added to In this huge cross-chain system of Polkadot. All the parallel chains under the Polkadot ecology can communicate with each other, transfer assets, and interoperate with each other.

As we defined Polkadot at the end of the article:

So what you say is Polkadot, it is nothing, but if there are more blockchains joining it, it will be everything.