All-in-one about XCM
XCM Definition
Cross Consensus Messaging is a generic method of communicating between different consensus systems. In other words, it is the format of the messages or the “common language” spoken between the different protocols.
It is worth noting that XCM is not responsible for sending messages between blockchains.
XCM's 4A
- Asynchronous: No way to assume that the sender will be blocking on its completion
- Absolute: Guarantees delivery and interpretation
- Asymmetric: There is no direct confirmation of message receipt
- Agnostic: Makes no assumptions about the destination consensus system
XCMP Definition
Cross Consensus Messaging Protocol or Cross Consensus Messaging Passing is the protocol that allows messages to be sent between different consensus systems. It can also be referred to as the communication channels between blockchains.
An analogy used by Gavin Wood, during the Polkadot Decoded 2022, is that XCMP would be a “telephone” and XCM the language spoken during the call. XCMP carries the bytes that the XCM represents.
VMP Definition
Vertical Messaging Passing is the communication between the Relay Chain and parachains. It can be divided into two formats:
- UMP (Upward Message Passing): Message from the parachain to the Relay Chain.
- DMP (Downward Message Passing): Message from the Relay Chain to a parachain.
HRMP definition
Horizontal Relay-routed Message Passing is a temporary format of unilateral communication, which means that it is necessary for one parachain to send a request to another parachain to open the HRMP channel so that message sending can be initiated.
XCM V3
The XCM V3 has improved the protocol that facilitates he splitting of applications across different sharded protocols, parachains, and more.
- Multichain Decomposition Tools
- Expectations and Branchings
- Asset and NFT Transfer
- Safe Dispatches
The goal of XCM V3 is to decompose the Polkadot Relay Chain into “system chains functionally” — with the primary functions of the Relay Chain to provide security and interoperability.
The key is to create a common good parachain for each function (governance, staking, auctions, assets). This is the competitive advantage of the Polkadot architecture over other ecosystems.
The problem that XCM does not solve
Asset transfer and direct message sending are one of the innovations of XCM. However, a third party is involved in the process, a new tool called SPREE is needed to solve the problem — a topic for future articles.
As an example, if an Astar user wants to send AUSD (reserved in Acala) to Moonbeam, the following steps are required:
- Astar calls Acala — to request/authorize the transfer
- Acala calls Moonbeam — to transfer assets
- Astar calls Moonbeam — to execute the contract
The question raised is whether Acala could call Moonbeam directly to request the execution of the contract that the Astar user desires and transfer the assets.
We conclude that it is not possible for Acala to call Moonbeam because Moonbeam trusts only Astar to authorize the Astar user to request transactions. That's the main reason we need the SPREE (under development) tool to solve it.
XCM V4 coming soon
According to Gavin Wood, at Polkadot Decoded 2022, it is noted that XCM V4 is in development and addresses issues such as:
- Dynamic fee discovery
- Checkpoints
- Instant version negotiation
- Smart contracts
Conclusion
XCM represents one of the functions only Polkadot can perform due to its interoperability design between parachains connected via the Polkadot Relay chain. As such, it is considered one of the core competitive advantages of the Polkadot protocol in the cryptographic space.