MAPO Developer Docs
  • MAPO Developer Docs
  • Base
    • MAPO Introduction
    • MAPO token
    • Omnichain DAPP
    • Differences Between Omnichain Applications and Single or Multi-Chain Applications
    • Differences Between Third-Party Trusted Cross-Chain and Peer-to-Peer Cross-Chain Solutions
    • BTC layer2
      • brc-201
    • Oracle
      • Supra: Decentralized Oracle on MAP Protocol
    • Account
    • Transactions
    • block
    • MPT tree
    • RLP
    • Gas fee
    • Cross Chain Message
    • light client
      • MAPO light client
    • MOS
      • MOS interface and functions
      • deploy MOS
      • Messenger
    • map-relay-chain(atlas)
      • atlas architecture
        • atlas architecture
        • atlas genesis
          • genesis config
          • genesis contract
            • ABI
              • Accounts
              • Election
              • EpochRewards
              • LockedGold
              • Validators
            • address
            • deploy
        • precompile-contract
        • protocol
          • Proof of Stake
          • consensus
          • election
          • rewards
          • governance
      • deploy atlas
        • run atlas
        • run atlas(archive)
        • run atlas(bootnodes)
        • run atlas(validator)
        • run atlas(RPC)
      • Marker tool
        • Genesis
        • Validator
        • Vote
        • Common
      • make private network(atlas)
      • public service
        • public network
      • example
        • how-to-vote
        • how-to-withdraw
        • how-to-become-a-new-validator
        • how-to-become-a-new-validator(advanced)
    • Compass(maintainer,messenger)
      • Compass - arch and model
      • Compass - config
      • Compass - deploy
      • Compass secondary development - define your own routing service based on compass
  • MAPO Stack
    • stack
      • Connected Chains and Corresponding Addresses
    • Compatible-EVM
      • Smart Contracts Language
      • Smart Contracts Anatomy
      • Smart Contracts Libraries
      • Smart Contracts Compile
      • Smart Contracts Testing
      • Smart Contracts Deploy
      • Smart Contracts Composability
      • Smart Contracts Security
      • Formal-Verification
      • Frameworks
      • dev-network
    • MAPO Implement Cross-chain Interoperability
      • integration of MAP with EVM-Compatible Chains
        • light client verify
        • light client update state
        • MOS
      • integration of MAP with TON Network
      • integration of MAP with Non-EVM-Compatible Chains
        • light client verify
        • light client update state
        • MOS
    • How to develop cross-chain applications
    • light client address
    • SDK/API
      • MOS interface
      • Light client interface
      • Atlas RPC
        • json-rpc
          • atlas json rpc
          • atlas consensus rpc
        • javaScript sdk
        • go-sdk
      • Backend API
        • SCAN API
  • Zero-Knowledge Proof
    • zk proof
Powered by GitBook
On this page
  • How does it work
  • Prerequisites
  • How MOS completes cross-chain messages
  • On the source chain
  • On the MAP relay chain
  • On the destination chain
  • Process Architecture
  1. Base

MOS

PreviousMAPO light clientNextMOS interface and functions

Last updated 1 year ago

How does it work

MOS messages allow projects built on one chain to easily synchronize some project information to other chains, and also call contract methods on other connected chains.

MOS uses the MAP Protocol light client to verify cross-chain message transactions, ensuring cross-chain messages are verifiable on-chain.

With MOS, you can achieve interoperability with two chains:

  • Call contracts on Chain B from Chain A.

  • Package message changes on Chain A and write them to Chain B to synchronize messages.

Prerequisites

  • The application must be on one of the chains supported by the MAP Protocol. See for a list of chains that can deploy the MAPO light client. This list is updated as new chains are added. Cross-chain message executable contract permissions must be granted to the MOS contract on the corresponding chain.

  • Both Chain A and Chain B must deploy the MOS message contract (MOS messages for Near Chain are still under development).

How MOS completes cross-chain messages

On the source chain

  1. The user (dApp) organizes the messages to be cross-chained and organizes the callData for calling the target chain.

  2. The dApp calls the MOS transferOut method and pays the gas fee for cross-chaining

  3. MOS sends the cross-chain transaction and emits a cross-chain message log. You can view transaction details in the source chain browser.

On the MAP relay chain

  1. The messenger detects the message log on the source chain, builds proof data from the source chain, and calls the method transferIn to notify the MOS contract on the relay chain.

  2. The MOS relay contract (MOS contract on the MAP relay chain) confirms the message log on the source chain, verifies the authenticity of the source chain transaction through the light client, determines that it is going to another chain, sends a transaction, and continues to emit a cross-chain message log.

  3. If the MAP relay chain is the destination chain, execute the call method and emit an execution log.

On the destination chain

  1. The messenger detects the message log on the MAP relay chain, builds proof data from the relay chain, and calls the transferIn method to notify the MOS contract on the destination chain.

  2. The MOS contract verifies the authenticity of the MAPO message log through the light client.

  3. The destination chain emits an execution log to complete the cross-chain contract call message.

Process Architecture

lightClient
messageFlow