Hyperbridge Documentation

repository·main·Indexed 42 days ago

https://github.com/polytope-labs/hyperbridge

A decentralized, hyper-scalable coprocessor for verifiable cross-chain interoperability. Hyperbridge enables permissionless messaging and consensus across blockchain networks using interoperability proofs, featuring the IntentGatewayV2 module architecture and ISMP contract deployments for EVM and TRON networks.

Tokens
535.4K
Snippets
1.3K
Records
2.2K
Agent score
52%

What's inside Hyperbridge

  1. Overview of Hyperbridge SDK packages

    main

    The Hyperbridge SDK is a monorepo providing tools for building on the Hyperbridge cross-chain interoperability protocol. It is divided into several specialized packages:

    • @hyperbridge/core: The Solidity SDK used for dispatching and receiving cross-chain messages on-chain.
    • @hyperbridge/sdk: The JavaScript/TypeScript SDK used for querying and monitoring cross-chain messages off-chain.
    • @hyperbridge/subql-indexer: A SubQuery-based indexer designed for tracking cross-chain messages.
    • @hyperbridge/simplex: Simplex, an automated market maker (AMM) specifically for cross-chain intents.
  2. Overview of Pallet ISMP

    main

    The ISMP (Interoperable State Machine Protocol) pallet is an implementation for Substrate-based chains that enables secure cross-chain interoperability. It provides three core capabilities:

    1. Tracking Remote State: Uses consensus proofs to track the finalized state (state commitment) of a remote blockchain.
    2. Executing Messages: Verifies and executes incoming ISMP-compliant messages from connected chains using state proofs verified against known finalized state commitments.
    3. Dispatching Messages: Sends ISMP requests and responses to connected chains.

    Key concepts include:

    • State Commitment: A cryptographic commitment (state root) of an entire blockchain state.
    • Consensus Client: An algorithm that verifies consensus proofs for a specific consensus mechanism.
    • Challenge Period: A configurable window during which state commitments can be challenged before they are used to verify incoming messages.
  3. Overview of the Intent Gateway protocol

    main

    The Intent Gateway protocol enables intent-based token swaps across EVM chains connected by Hyperbridge. Users escrow input tokens and declare desired outputs; solvers (fillers) compete to fill these orders via an auction mechanism.

    How the Auction Works

    1. Order Placement: Users escrow tokens and declare their intent.
    2. Bidding: Solvers compete by signing UserOperations (gas-abstracted meta-transactions) and posting them to the Hyperbridge blockchain.
    3. Selection: The user reviews all bids and selects the UserOperation that provides the most assets.
    4. Execution: The user executes the chosen bid on-chain.

    Key Actors

    • User: Places orders, escrows tokens, and selects the best solver bid.
    • Solver (filler): Bids on orders, provides output tokens to the user, and claims escrowed inputs.
    • Hyperbridge: Hosts the auction, manages parameter updates, and delivers cross-chain settlement messages via ISMP.
    • Relayer: Submits cross-chain proofs for settlement messages and storage queries.
  4. Overview of the ISMP Rust implementation

    main

    This repository provides a Rust implementation of the Interoperable State Machine Protocol (ISMP) components as defined in the ISMP specifications. It serves as a foundational library for building interoperable state machine communication layers.

    Key components provided include:

    • Message Definitions: The data structures used for cross-chain communication.
    • Message Handlers: Logic for processing incoming ISMP messages.
    • Clients: Definitions for ConsensusClient and StateMachineClient to verify state and consensus.
    • Host & Routing: Definitions for IsmpHost and IsmpRouter to manage protocol execution and message direction.
    • Dispatching: IsmpDispatcher definitions for managing message flow.
  5. Overview of Hyperbridge

    main
    Hyperbridge is a hyper-scalable coprocessor designed for verifiable, cross-chain interoperability. It is a fully permissionless and decentralized protocol that uses interoperability proofs to enable secure communication between different blockchain networks.
  6. Overview of sync-committee-rs

    main

    The sync-committee-rs is a Rust-based Ethereum Beacon Chain Light Client SDK. It provides the necessary components to implement an Ethereum light client prover and verifier, based on research from Polytope Labs.

    It is divided into three main functional areas:

    1. Primitives: Core types, structs, and utility functions defined by the Ethereum light client specification.
    2. Prover: Logic for generating proofs for various Ethereum beacon chain structures, including:
      • Execution payloads
      • Finalized headers
      • Block roots
      • Sync committee updates
    3. Verifier: A single exported function used to verify Ethereum sync committee attestations.

    ⚠️ Note: This is currently Beta software.

  7. Overview of @hyperbridge/lz-endpoint

    main

    The @hyperbridge/lz-endpoint package provides a LayerZero V2 endpoint adapter that routes messages through Hyperbridge's ISMP protocol. It implements the full ILayerZeroEndpointV2 interface, allowing existing LayerZero OApps (including OFTs, OFT Adapters, and custom ILayerZeroReceiver implementations) to use Hyperbridge for cross-chain transport without code changes.

    Key Characteristics:

    • Implementation: Uses ISMP under the hood instead of LayerZero's DVN/executor infrastructure.
    • Deployment Model: Each deployment should be unique per OApp, per chain. Each instance is configured with its own host, local eid, and chain mappings.
    • Compatibility: Supports all LayerZero V2 OApps, including those using the SEND_AND_CALL (compose) pattern.
  8. Overview of the Pallet Intents Coprocessor

    main
    The Pallet Intents Coprocessor is a Substrate pallet that acts as the Hyperbridge component for the Intent Gateway protocol. It serves as the Substrate-based counterpart to the IntentGatewayV2.sol EVM contract. Its primary purpose is to facilitate intent-based transactions by providing infrastructure for bid management, cross-chain governance of gateway instances, and oracle management across multiple chains.
  9. Core Hyperbridge Interfaces for EVM

    main

    Hyperbridge provides a set of core interfaces that serve as the building blocks for cross-chain applications. Developers interact with these interfaces to manage state, dispatch messages, and handle incoming cross-chain communication.

    Key Interfaces

    • IHost: The central contract on every chain that manages the ISMP (Inter-blockchain Standard Module Protocol) state.
    • IDispatcher: The interface used by applications to dispatch outgoing cross-chain messages.
    • IHandlerV2: Responsible for verifying and processing incoming ISMP messages, including message delivery and timeout processing. It supports batchCall for processing multiple calls at once.
    • IConsensusV2: The interface implemented by consensus clients to verify Hyperbridge's finality.
    • IApp: The interface that all cross-chain applications must implement to receive messages.
    • HyperApp: An abstract base contract that extends IApp. It is highly recommended to extend HyperApp rather than implementing IApp directly, as it provides built-in utilities and simplified fee handling.
  10. Use the IConsensusV2 interface to verify Hyperbridge finality

    main

    The IConsensusV2 interface is used by consensus clients to verify Hyperbridge's finality. These clients are responsible for verifying consensus proofs, validating authority set transitions, confirming finalized state commitments, and extracting intermediate states for parachains or rollups.

    Available Implementations

    • EcdsaBeefy: Uses secp256k1 signature verification.
    • SP1Beefy: Uses ZK proofs (via SP1 zkVM) for more gas-efficient verification of large authority sets.
    • ConsensusRouter: A router that directs proofs to either EcdsaBeefy or SP1Beefy.
    interface IConsensusV2
  11. What is the Interoperable State Machine Protocol (ISMP)?

    main

    The Interoperable State Machine Protocol (ISMP) is a lightweight, unopinionated messaging protocol for building cryptographically secure cross-chain applications. It uses consensus and state proofs to authorize the execution of cross-chain requests, ensuring security levels equivalent to the connected blockchains.

    Key characteristics include:

    • Minimal API surface: Designed to be economically feasible in high-cost environments like Ethereum.
    • Modular design: Easily supports new consensus mechanisms and state machines.
    • HTTP-like semantics: Uses a familiar message-passing mechanism that mimics the HTTP protocol.