Why Polkadot’s Cross-Chain Message Passing (XCMP) Protocol is Needed?

PolkaWorld
10 min readDec 28, 2021

--

What is the significance of Cross-Chain Message Passing (XCMP) to Polkadot and to the entire blockchain industry?

In this episode of the PolkaWorld topic discussion, we found 6 Polkadot ecosystem builders to talk about their views on XCMP. Although it is a discussion mostly among developers, they have used many analogies so that people with no technical background can easily understand the meaning of Cross-Chain Message Passing. So we recommend everyone who cares about the development of Polkadot, cross-chain, and blockchain to read this article.

XCMP enables the blockchains in the Polkadot ecosystem to interact safely and efficiently

Chen Xiliang, Laminar CTO:

A not very accurate analogy:

The Bitcoin network is like a large server with very complete (and expensive) security. Only one program is allowed to run on top of it, that is a ledger. The speed is limited and the functions are limited, but as the only server in the world that is so ubiquitous and safe, everyone is willing to use it.

Ethereum has rebuilt a large server, which also has perfect security. But unlike Bitcoin, the server runs software uploaded by developers to support a variety of different applications. Different applications can directly call each other, building a rich ecosystem. But as a server, it’s performance is limited, and different applications also need to compete for the right to execute, which has various drawbacks.

So what to do with that? If one server has insufficient performance, then just set up a few more. But building a decentralized server is very expensive and very difficult. So Polkadot provided a solution: I built a computer room with 100 servers at the beginning. You can rent one of them with a small rent, and I will help you with all the security. This is Polkadot’s shared security, allowing parachain projects to share the security of Polkadot’s network at a low cost.

But simply having a server is actually not enough. For example, if you want to develop a game chain, you need to give users a recharge function. The user’s ledger may be placed on another server, so a cross-chain protocol is required to recharge. If the ledger server and the game server are not in the same computer room, then all interactions have to cross the security barrier, and there are many difficulties. But the interaction between Polkadot’s parachain and Polkadot relay chain is much simpler, because their servers are all in the same computer room, and they can have internal cables directly connected to each other, so the interaction does not need to cross the security barrier. This allows projects between Polkadot ecosystems to interact efficiently and safely across chains, and this protocol is XCMP.

From “a loose collection of blockchains” to “an interactive ecosystem”

John, Polkadot Technical Ambassador:

We know that the Polkadot ecosystem is composed of 2 relay chains and many parallel chains (including parathreads). I have always compared Polkadot’s entire architecture to a super-upgraded version of Ethereum: smart contracts in the Ethereum ecosystem are application chains that exist in the form of parachains in the Polkadot ecosystem.

Everyone knows that Ethereum contracts can interact with each other. For example, you can take the DAI generated by MakerDAO to Uniswap for trading. This is because the calling language between all smart contracts in Ethereum is unified, which means that one smart contract can understand the information sent by another smart contract.

Since Polkadot is an upgraded version of Ethereum and contracts can interact with each other, application chains must also be able to interact with each other. XCMP stipulates the mutual interaction specifications between these application chains and relay chains. The application chains can also understand each other’s information, so Polkadot is no longer a loose collection of isolated blockchains, but has become a huge ecosystem that stay connected. On the basis of the Substrate development framework, it is because of the existence of XCMP that Polkadot has become the leader of heterogeneous sharding, and it can be said that it is the next generation of Ethereum in terms of design architecture.

XCMP is the TCP/IP protocol in the blockchain world

Zhang Xiao, Founder of Ice Chain Technology, Polkadot Ambassador, Expert Committee Member of Ethereum Community Fund

Judging from the current development of blockchain technology, the future blockchain network must coexist with multiple blockchain structures. Because different use cases have different requirements for blockchain design, for example, some blockchains need to be efficient, some need to protect privacy, some need to support specific hardware, and some need to be compliant in a certain country… Therefore, the idea of ​​ “designing a blockchain to rull it all and satisfy all use cases” is unrealistic and impossible to achieve. From the perspective of computer engineering, there is no best design, everything is a trade-off (the trade-offs of design indicators).

Since the future must be the coexistence of multiple blockchains, the interoperability and communication between chains are very important, otherwise, we will return to the era of information islands and data chimneys. The biggest design advantage of Polkadot’s cross-chain is that it can realize the interconnection of value and information between chains. To make a simple analogy, you can think of each blockchain as a country. Value interoperability is equivalent to building an international finance and trade market, allowing capital and goods to flow across borders. The communication of information is equivalent to the construction of an international Internet, allowing information to be shared across countries. In this way, all countries in the world have entered an era of globally division of labor and a great development from a state of shutting down and pursuing their own affairs. The role of this in promoting human civilization is self-evident.

The role and significance of the Cross-Chain Message Passing (XCMP) protocol for Polkadot are equivalent to the TCP/IP protocol in the Internet world. Parachains with different structures and different functions are connected through a unified XCMP protocol. Each chain can focuse on doing what it is good at (a smile from Unix philosophy), and then through elaborate structure and network effects, unexpected application innovation can be created. For example, we are now demonstrating the design of a public chain of data assets, which may use functions related to data storage, deposit confirmation, DeFi stable coins, Tokenization, and privacy calculations. Each function is provided by the corresponding parachain, and when combined, a data asset market public chain full of sense of science fiction can be realized.

It is worth mentioning that there are not a few public chains that use cross-chain as the slogan. However, this kind of “cross-chain” is not the same with Polkadot’s. The XCMP protocol can be implemented on the Polkadot blockchain, and it is inseparable from the excellent design of Polkadot’s infrustructure layer, especially the shared securiry model. The opposite is the bridge model.

Let’s use the country-to-country scenario above as an example. If country A informs country B, Alice from country A makes a transfer to Bob from country B, and country B gives the money to Bob. After Bob takes the money, country A tells country B our bank’s accountants are all interns, and they have miscalculated the accounts. If the transfer just now becomes invalid, then country B will be dumbfounded? According to the barrel theory, the capacity of the barrel depends on the shortest wooden board. Therefore, under the bridging model, the collective security of interconnected blockchains depends on the chain with the worst security. In other words, the cross-chain under the bridge model is trust-based, not trustless. Using the shared security model of the Polkadot blockchain, all parachains can share the highest level of security provided by the validator nodes on the Polkadot relay chain. The concern that other parachains may break a promise through forks no longer exists, so that trustless cross-chain intercommunication can be realized between parachains.

I recently read the API design of XCMP, and I have abstracted a very concise interface for developers, which is more convenient to use. We are also looking forward to follow-up testing and launch news.

Let the blockchains interact with each other like DAPPs do, but not compete for resources like DAPPs do

Acala Network CTO Wang Jianjiang:

Over the years, the powerful ecosystem of DAPPs on Ethereum is the envy of other public chains.

On Ethereum, some of the DAPPs you have thought of and those that have not been thought of may have been realized, and these DAPPs are complementary and interconnected. For example, the DeFi that we are familiar with is a business unit that aggregates many DAPPs such as over-collateralized lending stablecoins, decentralized exchanges, and peer-to-peer lending.

Based on the consistent operating environment and interfaces provided by Ethereum, DAPPs can freely transmit information and interoperate with each other. The Ethereum ecosystem seems to be a symbiont that continuously diverges and self-circulates. However, the design of the underlying layer determines the inherent insufficiency and extreme fragility of this symbiont. All DAPPs are using the same underlying resources. Normally, when the network pressure is not high, it seems to operate well. But when there is a situation such as a price collapse, The Ethereum network usually starts to become congested, the operation of some DAPPs has almost stagnated, and users have suffered huge losses.

We can’t help thinking, how does the poor performance of Ethereum itself bear the demand for decentralized commercial applications?

First of all, the need to transmit information between DAPPs does not mean that all its businesses need to communicate across DAPPs, nor does it mean that all DAPPs must communicate with each other. The blockchain industry needs to come up with a better solution to achieve both high-performance and low-cost information transmission.

Polkadot’s XCMP allows DAPPs to choose to run on a parachain of independent computing resources, with high TPS to process business, and information transfer between parachains, and the entire process is subject to consensus. Independent resources can communicate with each other at the same time, and the normal state of competition between DAPPs for underlying resources will no longer exist. This life experience composed of parachains and relay chains is more robust and has more commercial possibilities. This is also an important reason why Acala chose Polkadot. If the decentralized business model has been proved to be feasible on Ethereum, then Polkadot will be the land where decentralized business really grow on.

Network effects and efficiency improvements

Marvin, co-founder of Phala Network:

It is recognized in the industry that the difficulty of cross-chain is to achieve true interoperability under the premise of maintaining security and performance: the difficulty of this part is the need to realize cross-chain data communication, because there are actually many available solutions for asset cross-chain. Therefore, if Polkadot’s cross-chain capabilities cannot be fully utilized, it is meaningless to just become a parachain. When a parachain is connected to Polkadot, it means that it has the ability to communicate between the parachains. The XCMP protocol realizes the communication between chains, and Polkadot’s consensus algorithm mainly serves it.

Parachain can send messages to another chain, and XCMP ensures that messages are delivered to the destination in order and accurately. The chain which has received messages can interprete them by any logic. Polkadot creatively realized the “shared security” between chains, not only ensuring the production and validation of parachain blocks, but more importantly, maintaining the consistency of the entire network state. On a network without shared security, any operation requires a lot of block confirmation time (just like what a centralized exchange do). The certainty of the network is the key to the implementation of XCMP. Let me talk about it from two angles:

The first is the network effect. At present, we see two ways to implement cross-chain:

-The first is an independent bridge, such as the ETH-BTC bridge, which is generally used to connect two independent chains. A typical example is RSK. It is implemented in an alliance and has created a multi-signature wallet on BTC, which is held by multiple institutions. These institutions will issue corresponding cross-chain assets on the RSK chain when they observe receipts, and vice versa. Both ends of the bridge support smart contracts, and a more decentralized protocol can be realized.

-The second is a bridge on a Polkadot parachain. What Polkadot actually provides is the communication capability between parachains, but if the chain under Polkadot is to communicate with the chain outside the Polkadot ecosystem, it needs to use a bridge. One or more bridges can be implemented on parachains, just like the independent bridge I mentioned, and a variety of technologies can be used. But because Polkadot provides communication between parachains, a bridge implemented on a parachain can not only serve itself, but also other parachains. This creates a network effect.

The second is the efficiency improvement based on shared security.

If you have followed Polkadot officials, you will find that they have been repeatedly mentioning the concept of “shared security”, which is a very, very important feature. It can be said that without shared security, the significance of cross-chain will be greatly reduced.

Polkadot allows mutual calls between parachains. For example, the token issued on my chain can be used by another DEX chain. Everyone has used the exchange, the deposit and withdraw of coins need to wait for a few block confirmations, this is to ensure the security of the transfer. If you do not wait and the transaction has not yet been settled, the exchange will lose money once the chain has problems such as rollback. Polkadot’s design solves this problem. Transactions on all chains are executed simultaneously and verified by Polkadot validators.

This secure cross-chain capability is the main reason why we chose Polkadot.

XCMP is a very low-level infrastructure. Directly using XCMP to implement application layer cross-chain is still very heavy work, because XCMP is only responsible for sending messages, but it does not define how the recipient responds. The solution proposed by Polkadot is called SPREE (Shared Security Zone): SPREE allows a security zone independent of the parachain to be opened on each parachain, in which recognized safe code is executed to ensure that this code will not be affected by the parachain. This can solve the problem of the receiver’s untrustworthiness. Using SPREE can realize very efficient cross-chain asset transfer. This part is very similar to the TEE idea, of course we also appreciate it~

The more chains connected, the more use cases are enabled

Astar CTO Watanabe Sota

Polkadot is the foundation of the next generation of innovation. From my understanding, this means that we can create joint use cases. For example, if we assume that the Astar network and the Acala network are connected to each other, then we can make a scalable and instant stable coin payment system. This is just a simple use case. The more blockchains are connected, the more use cases we can make. This is a game changer.

About PolkaWorld

PolkaWorld is a Polkadot global community founded in 2019. We have gathered more than 40,000 Polkadot enthusiasts, and have always been committed to popularizing Polkadot knowledge, training Substrate developers, and supporting the Polkadot/Kusama ecosystem.

Follow us on Twitter: @polkaworld_org.

Follow us on Youtube: https://www.youtube.com/c/PolkaWorld

--

--