Moonbeam: A developer's multi-chain textbook

To understand Polkadot’s technical architecture, you only need to master 3 key words:

  1. Relay Chain (relay chain) : Polkadot regards itself as a multi-core computer, carrying the radiation center of the underlying security architecture of the blockchain.
  2. Parachain (parallel chain) : On the "Layer 0" architecture, specialized independent blockchains with different functions can run freely and become a parachain (Layer 1). These parachains have the network security provided by Layer 0, and are compatible with the development platform functions of ordinary blockchains.
  3. XCM : In order to realize the communication between chains, Polkadot proposes the cross-consensus information format XCM to improve the liquidity between different chains, expand business scenarios and user experience.

Why choose Moombeam?

Simply put, Moonbeam is a parachain compatible with Ethereum smart contracts developed based on the Polkadot Substrate framework.

Faced with a variety of public chain architectures, Moonbeam chose to build an Ethereum development environment in the Polkadot ecosystem from the perspective of chain structure security, in order to lower the technical threshold for mainstream developers to enter the Polkadot ecosystem.

Through the Substrate framework, Moonbeam incorporates the Ethereum Virtual Machine (EVM). In addition, various Web3 RPC support tools have been added to create a seamless ETH JSON RPC integration experience, including HardHat, Foundry, MetaMask or Ether.js commonly used by Solisidty developers.

In order to optimize the development experience, Moonbeam has also added some mature developer tool libraries , such as Gnosis Safe, Etherscan, Chainlink, etc., which are similar to the Polkadot sub-network on the Ethereum mainnet, and you can find functions available on Ethereum.

In addition, Moonbeam has also designed a unified account . Using the H160 format on-chain account can simultaneously realize Polkadot’s characteristic governance/staking functions and on-chain interaction within the EVM development environment.

To allow developers to feel the advantages of interacting with Polkadot while using EVM compatibility, Moonbeam has specially launched various precompiled libraries , which can freely call the Ethereum API and obtain the functions of the Substrate layer. For example, directly interact with the XCM of the Polkadot ecosystem through smart contracts, or package multiple transactions, saving end users the trouble of multiple authorizations and payment of Gas fees.

Cross-chain information transfer

In the context of a multi-chain world, consensus also becomes very important.

We all know that the premise of harmonious family life is a consensus on certain principles, and similar scenarios in the blockchain also exist, but it is more complicated. The consensus on the chain is performed by a group of validators who do not know each other, whether it is PoS or PoW, they jointly maintain the block production and stability of the public chain.

It should be noted that the consensus layers of different public chains are independent. If you want to communicate between chains, you need more auxiliary external forces, such as the native cross-chain concept we are familiar with -  General Messaging Passing Protocols (GMP) . GMP can safely and accurately transfer the information on the A chain to the B chain. Once the information is transmitted to the B chain, the consensus layer located in the B chain will confirm the received cross-chain information, and make corresponding approval and confirmation on the chain. Of course, the cross-chain information format is not limited to double-chain intercrossing. In the future, it is expected to realize multi-chain intercrossing in a short period of time, thereby improving the interaction efficiency and user experience on the chain.

In the Polkadot ecosystem, cross-chain will become easier. After all, the premise of mutual trust has been established between parallel chains, and these parallel chains are verified under the same consensus system (shared source of security). The characteristic transmission method in Polkadot is XCM!

XCM can be simply understood as a letter format, including greetings, body text and signature at the end, which is a letter format that everyone can understand. The standards and formats of XCM can be flexibly applied to different cross-chain scenarios, such as:

  • The cross-chain execution of remote instructions transmits the instructions of the A chain to the B chain for execution through the XCM format.
  • Transfer the native Token of Chain A to Chain B to build more application scenarios for Token.

XCM Example: Remote Execution

Give an example so that everyone will have a better understanding of how XCM works.

Suppose Alice wants to transfer 10 tokens from chain A to chain B.

Step 1: 10 tokens are transferred from chain A to the sovereign account of chain A, and a notification message is sent in XCM format, preparing to transfer these 10 tokens to chain B.

Step 2: Link B receives this message in XCM format and accepts the instruction for cross-chain transfer of 10 tokens.

Step 3: Once Chain A learns that Chain B has confirmed the instruction for cross-chain transfer of 10 tokens, Chain A converts these 10 tokens into tokens with XC-format, and puts these converted tokens into a "Holding Register". This "Holding Register" is similar to a shopping cart and is used to link the token transportation between the two chains.

Step 4: In the process of transferring these 10 XC-tokens, a certain gas fee is required for each step. These fees will be directly deducted from the 10 XC-tokens, so the actual number of tokens obtained will be less than 10.

Step 5: Once the "Holding Register" transfers the 10 XCtokens to the B-chain, it will find the account address on the B-chain that receives the 10 XCtokens, and request to receive tokens from this address.

What is XC-Token?

In addition, XC-token can also be used for remote pledge token, remote cross-chain participation in governance, etc.

You may ask, what is XC-token? This is a unique token format of Moonbeam's cross-chain ecology, called XC-20. The XC-20 format is similar to the familiar ERC-20 format, which can interact with the Ethereum API and also interact with the Substrate API. To put it simply, tokens in the XC-20 format can be used directly on Polkadot’s EVM-compatible chain without reorganization of the token format.

The inter-crossing of multiple chains makes the project party and the public chain ecology closely dependent. The public chain provides development components to facilitate the project party to expand the product to multiple chains. This cross-chain method not only has low cost and high output, but also serves multiple purposes for developers.

Cross-chain means that users and liquidity on multiple chains can be quickly acquired. Publish native tokens to other public chains to attract more users to participate in the ecosystem and increase the usage and value of tokens. Cross-chain also allows project parties to occupy the ecological advantages of different public chains, establish brand image and user groups, and expand market share.

For the public chain, cross-chain expands the cross-border application scenarios of the public chain. Provide development components to attract project parties to expand their products to their own chains, increasing users and liquidity. The cooperation between the public chain and the project party is interdependent. The public chain provides technical support and ecological resources, and the project party optimizes product performance and user experience. Through technology integration, the public chain increases the ecological scale and influence, and enhances market competitiveness.

Multi-chain intercrossing brings opportunities and challenges to project parties and public chain ecology. Project parties expand market share and user groups through cross-chain, and public chains increase ecological scale and influence through cooperation. With the development of cross-chain technology, multi-chain intercrossing will become an important trend in the future development of blockchain.

Guess you like

Origin blog.csdn.net/Moonbuilder/article/details/132053595