MAPO Developer Docs
LearnDevelopRunWhitePaperBRC-201
English
English
  • Overview
  • Learn
    • About MAP Protocol
      • Background
      • Introduction of MAP Protocol
      • History of MAP Protocol
    • Comparison with other cross-chain models
      • MAP Protocol vs Cosmos & Polkadot
      • MAP vs other cross-chain solutions without relay chain
    • Technical Mechanism
      • MAP Protocol's Technical Mechanism
      • Three-layer Architecture
      • MAP Protocol Layer
        • Concept
        • Isomorphism with All Chains
        • Verification & Maintenance Network
      • MAP Omnichain Service (MOS) Layer
      • MAPO Application Layer
      • Peer-to-Peer Cross-chain Technology with ZK-enabled Light Clients
      • Interact with Bitcoin
    • Gas Fee Model
    • DAO
    • Construction of MAP Protocol
      • Developers
      • Validators
      • Maintainers
      • Messengers
      • Liquidity providers
      • End users
    • Tokenomics
    • Purchase $MAP
  • Develop
    • MAP Relay Chain
      • Getting Started
        • Build
        • Make Private Chain
        • How To Vote
        • How To Withdraw
        • Integrate an Exchange
        • Integrate MAP Relay Chain with EVM-Compatible Chains
      • Consensus
        • Overview
        • Proof-of-Stake
        • Validator
          • Validator
          • Locked MAP
        • Election
        • Rewards
        • Aggregated Seal
      • Contracts
        • Precompiled Contracts
        • Genesis Contracts
          • ABI
            • AccountsABI
            • ElectionABI
            • EpochRewardsABI
            • LockedGoldABI
            • ValidatorsABI
          • Deploy
      • Marker
        • Genesis
        • Validator
        • Vote
        • ContractOwner
        • Common
      • Account-Abstraction
    • Light Client
      • Verification based on Light Client
      • MAPO Light Client
        • EVM Chains
        • Near
      • Light Clients
        • Client Manager
        • BNB Smart Chain
        • Near Protocol
        • Polygon(Matic)
        • Ethereum 2.0
        • Klaytn
        • Conflux)
      • Maintainer
    • MAP Omnichain Service (MOS)
      • MOS Message Guides
        • How It Works
        • How To Use
        • EVM Chains Contract
      • MCS Guides
        • How It Works
        • How To Use
          • How To On Evm Chains
          • How To On Near Protocol
        • Relay Chain Contract
        • EVM Chains Contract
        • Near Protocol Contract
      • Messenger
      • API
    • OmniChain Examples
      • OmniApp
      • OmniDictionary
    • API & SDK
      • Butter SDK
      • Atlas JSON RPC
      • Atlas Consensus API
      • MAP Scan API
    • Connected Chains and Corresponding Addresses
  • Run
    • How To Become A New Validator
    • How To Become A New Validator[advanced]
    • Withdraw
Powered by GitBook
On this page

Was this helpful?

  1. Learn
  2. Technical Mechanism

Peer-to-Peer Cross-chain Technology with ZK-enabled Light Clients

PreviousMAPO Application LayerNextInteract with Bitcoin

Last updated 1 year ago

Was this helpful?

Light clients in MAP Protocol are constructed as smart contracts on MAP Relay Chain and all connected blockchains. While transparency and decentralization are well preserved with on-chain smart contracts, gas consumption is non-negligible; With the recent development of zkSNARK, the foundation of MAP Protocol, light client construction and cross-chain proof verification can be optimized; Correctness of light client’s state transition is vital to MAP Protocol as it determines the validation of cryptographic proof for cross-chain messages.

Checking the validity of cross-chain messaging involves two main verifications:

  1. the validity of the block header;

  2. the validity of the given Merkle proof.

According to current engineering experiences in zero-knowledge proofs, due to factors such as the variability of the MPT’s (Merkle Patricia Tree) height, using zkSNARK technology for generating validity proofs of MPT tree's Merkle proofs can lead to high engineering complexity and significant operational expenses. However, for the currently mainstream PoS+BFT type blockchains, employing zero-knowledge proof technology can optimize verification for block header validity.

The construction of the light client in MAP Relay Chain

When not utilizing zero-knowledge proof technology, the light client needs to store the public keys of all current validators along with their respective weights. When verifying the validity of a block, it requires accessing all the public keys of the validator set and aggregating the public keys of the validators participating in block signing (MAP relay chain uses aggregated BLS signatures). In contrast, when employing zero-knowledge proofs, the aforementioned process can be expressed through arithmetic circuits, generating the corresponding zero-knowledge proofs.

In this design, the light client no longer needs to store the public keys and weights of all validators in the current validator set. Instead, it only stores the commitment value (hashed values of the industrial and weight information of all validators encoded) of the public keys and weights of the current validator set. The calculations for aggregating public keys and verifying the validity of the aggregated BLS signature are both expressed through arithmetic circuits and computed using the Groth16 protocol to generate zero-knowledge proofs.

In this approach, the zkSNARK proof demonstrates that the current block header, under the validator set corresponding to the commitment value stored within the light client, is a legitimate block header. This means that the verification of the block header's validity for the light client, involving a series of operations such as accessing all public keys and weights, calculating aggregated public keys, and verifying signature validity, simplifies into verifying the legitimacy of a constant-sized zkSNARK proof.