Hyperlane Integration
Hyperlane is a permissionless interoperability protocol. Key distinction from Axelar and LayerZero: anyone can deploy Hyperlane on any chain without protocol permission. This makes it suitable for new L2/L3, appchains, and custom environments where other protocols aren't yet present.
Architecture
Hyperlane consists of:
- Mailbox — smart contract on each chain through which messages are sent and received
- Interchain Security Module (ISM) — customizable message verification. Can use multisig validators, optimistic security, ZK proofs
- Relayers — off-chain agents transmitting messages between chains
- Validators — sign Mailbox state checkpoints
ISM — Custom Security
Hyperlane's uniqueness: each recipient contract defines its own ISM. You decide how to verify incoming messages.
ISM options:
- Multisig ISM — M-of-N signatures from validators (default)
- Aggregation ISM — combination of multiple ISM (AND/OR logic)
- Routing ISM — different ISM for different source chains
- Optimistic ISM — optimistic verification with fraud proof period
- ZK ISM — verification via zero-knowledge proofs (in development)
Sending Messages
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {IMailbox} from "@hyperlane-xyz/core/contracts/interfaces/IMailbox.sol";
contract HyperlaneMessageSender {
IMailbox public mailbox;
constructor(address _mailbox) {
mailbox = IMailbox(_mailbox);
}
function sendMessage(
uint32 destinationDomain,
bytes32 recipientAddress,
bytes calldata messageBody
) external payable {
uint256 fee = mailbox.quoteDispatch(destinationDomain, recipientAddress, messageBody);
require(msg.value >= fee, "Insufficient gas payment");
bytes32 messageId = mailbox.dispatch{value: fee}(
destinationDomain,
recipientAddress,
messageBody
);
emit MessageSent(messageId, destinationDomain);
}
}
Receiving Messages
import {IMessageRecipient} from "@hyperlane-xyz/core/contracts/interfaces/IMessageRecipient.sol";
contract HyperlaneMessageReceiver is IMessageRecipient {
mapping(uint32 => bytes32) public enrolledSenders;
function handle(
uint32 origin,
bytes32 sender,
bytes calldata message
) external payable override {
require(msg.sender == address(mailbox), "Only mailbox");
require(enrolledSenders[origin] == sender, "Unknown sender");
(address recipient, uint256 amount) = abi.decode(message, (address, uint256));
_processMessage(origin, recipient, amount);
}
}
Domain IDs
| Chain | Domain ID |
|---|---|
| Ethereum | 1 |
| Polygon | 137 |
| Arbitrum | 42161 |
| Optimism | 10 |
| Base | 8453 |
| BSC | 56 |
Hyperlane integration — 2-3 weeks for basic GMP. Especially valuable for custom L2/L3 and appchains needing fast integration.







