Skip to main content

Overview

HyperProver processes proof messages from Hyperlane’s mailbox and records proven intents. It extends MessageBridgeProver to provide Hyperlane-specific messaging functionality. Contract: contracts/prover/HyperProver.sol Inheritance: IMessageRecipient, MessageBridgeProver, Semver Proof Type: "Hyperlane"
Domain ID vs Chain ID: Hyperlane uses domain IDs that may differ from chain IDs. Always consult Hyperlane’s documentation to determine the correct domain ID for your target chain.

Constructor

Initializes the HyperProver contract.
address
required
Address of the local Hyperlane mailbox contract
address
required
Address of the Portal contract
bytes32[]
required
Array of trusted prover addresses (as bytes32 for cross-VM compatibility)
Errors:
  • MessengerContractCannotBeZeroAddress(): Mailbox address is zero
  • ZeroPortal(): Portal address is zero
Location: contracts/prover/HyperProver.sol:55

State Variables

MAILBOX

Address of the local Hyperlane mailbox contract.

PROOF_TYPE

Constant indicating this contract uses Hyperlane for proving.

Core Functions

prove

Inherited from MessageBridgeProver. Initiates proving process by dispatching a message via Hyperlane.
address
required
Address that initiated the proving request (receives refund if overpaid)
uint64
required
Hyperlane domain ID of the source chain (where the intent was created). NOT the chain ID.
bytes
required
Encoded (intentHash, claimant) pairs. Format: [intentHash1][claimant1][intentHash2][claimant2]...
bytes
required
ABI-encoded UnpackedData struct containing:
  • sourceChainProver (bytes32): Address of prover on source chain
  • metadata (bytes): Metadata for Hyperlane message
  • hookAddr (address): Address of post-dispatch hook (zero for default)
Behavior:
  1. Calculates required fee via fetchFee
  2. Validates msg.value covers fee
  3. Dispatches message via Hyperlane mailbox
  4. Refunds excess payment to sender
Errors:
  • InsufficientFee(uint256 required): msg.value is less than required fee
  • DomainIdTooLarge(uint64 domainID): Domain ID exceeds uint32.max
Location: Inherited from MessageBridgeProver.sol:112

handle

Handles incoming Hyperlane messages containing proof data. Called by the Hyperlane mailbox.
uint32
required
Origin domain ID from the source chain. Cannot be zero.
bytes32
required
Address that dispatched the message on source chain (as bytes32). Cannot be zero.
bytes
required
Encoded message with format: [chainId (8 bytes)][intentHash1][claimant1][intentHash2][claimant2]...
Behavior:
  1. Validates origin is not zero
  2. Validates sender is whitelisted
  3. Extracts chain ID from first 8 bytes of messageBody
  4. Processes intent proofs using _processIntentProofs
Errors:
  • MessageOriginChainDomainIDCannotBeZero(): Origin is zero
  • MessageSenderCannotBeZeroAddress(): Sender is zero
  • UnauthorizedIncomingProof(bytes32 sender): Sender not whitelisted
Access Control: Only callable by MAILBOX Location: contracts/prover/HyperProver.sol:71

fetchFee

Calculates the fee required for Hyperlane message dispatch.
uint64
required
Hyperlane domain ID of the source chain
bytes
required
Encoded (intentHash, claimant) pairs
bytes
required
ABI-encoded UnpackedData struct
Returns: Fee amount in native tokens required for message dispatch Location: contracts/prover/HyperProver.sol:130

getProofType

Returns: "Hyperlane"

Internal Functions

_dispatchMessage

Implementation of message dispatch for Hyperlane. Called by base prove() function after validations. Behavior:
  1. Unpacks data into structured format
  2. Formats Hyperlane message parameters
  3. Calls IMailbox(MAILBOX).dispatch with fee
Location: contracts/prover/HyperProver.sol:93

_formatHyperlaneMessage

Formats data for Hyperlane message dispatch. Returns: DispatchParams struct with:
  • destinationDomain (uint32): Hyperlane domain ID
  • recipientAddress (bytes32): Source chain prover address
  • messageBody (bytes): Encoded proofs
  • metadata (bytes): Message metadata
  • hook (IPostDispatchHook): Post-dispatch hook (defaults to mailbox’s default hook)
Location: contracts/prover/HyperProver.sol:201

Data Structures

UnpackedData

Contains fields decoded from the data parameter in prove() and fetchFee().

DispatchParams

Consolidates message dispatch parameters to reduce stack usage.

Domain ID Mapping

Hyperlane domain IDs are NOT chain IDs. You must use Hyperlane-specific domain IDs.Examples:
  • Ethereum Mainnet: Domain 1 (Chain ID 1)
  • Optimism: Domain 10 (Chain ID 10)
  • Arbitrum: Domain 42161 (Chain ID 42161)
Check Hyperlane’s domain registry for the complete mapping.

Usage Example