Hyperlane - Cosmos SDK Module
The Hyperlane Cosmos SDK module enables seamless interchain communication by integrating Hyperlane directly into Cosmos SDK-based chains. This module provides a permissionless way for Cosmos chains to communicate with external ecosystems, including EVM and other blockchains where Hyperlane is deployed.
While Hyperlane already supports Cosmos chains via CosmWasm, this module expands accessibility by enabling Cosmos SDK chains—regardless of CosmWasm support—to leverage Hyperlane’s interoperability capabilities.
Key Features
- Hyperlane Compatibility: This module fully implements the Hyperlane messaging protocol, enabling seamless cross-chain functionality across all Hyperlane-compatible chains.
- Warp Routes: Leveraging the core functionality, tokens can be created and transferred across all Hyperlane-compatible chains.
- End-to-End Interop Solution: Implements messaging, transport, and security modules of the Hyperlane cross-chain interoperability framework for Cosmos SDK-based chains.
- Permissionless & Open-Source: Anyone can deploy and configure the module to fit their needs without relying on intermediaries.
- Built by KYVE: Developed by the KYVE team to extend Cosmos interoperability beyond IBC.
Module Overview
x/core
The core
module is intended to implement the fundamental functionalities of the Hyperlane protocol to dispatch and process messages, which can then be used by applications like warp
. It includes mailboxes and registers hooks that are implemented in the submodules.
Mailbox
- Responsible for dispatching and processing messages
- Ensures replay protection
- Specifies
default
orrequired
hooks likeIGP
orMerkleTreeHook
- Calls registered
PostDispatch
hooks - Important methods:
dispatch()
process()
Submodules
Interchain Security and Post Dispatch are submodules with dedicated keepers and restricted access to the core keeper. This architecture was designed to facilitate extensibility, allowing developers to integrate their own implementations seamlessly.
01_interchain_security
This submodule implements the ISM logic and is responsible for verifying that interchain messages being delivered on the destination chain were actually sent on the origin chain. The modular design allows developers to easily add custom ISM implementations. Currently, three ISM types are available: MessageIdMultisig
, MerkleRootMultisig
, and Noop
.
type InterchainSecurityModule interface {
Verify(ctx context.Context, ismId HexAddress, metadata []byte, message HyperlaneMessage) (bool, error)
}
MultisigIsm
- Verifies that
m
ofn
validators have signed the validity of a message MessageIdMultisig
→ censorship-friendly, minimizes gasMerkleRootMultisig
→ censorship resistance guarantee- Important methods:
verify()
02_post_dispatch
This submodule implements the PostDispatch interface and the hook instances like the InterchainGasPaymaster
or MerkleTreeHook
. The modular design allows developers to easily add custom PostDispatch hook implementations.
type PostDispatchHook interface {
HookType() uint8
SupportsMetadata(metadata any) bool
PostDispatch(ctx sdk.Context, metadata util.StandardHookMetadata, message util.HyperlaneMessage, maxFee sdk.Coins) (sdk.Coins, error)
QuoteDispatch(ctx context.Context, hookId HexAddress, metadata util.StandardHookMetadata, message HyperlaneMessage) (sdk.Coins, error)
}
InterchainGasPaymaster
- Allows message sender to pay fees to the relayer to deliver a message on the destination chain
DestinationGasConfig
is used to determine the correctInterchainGasPayment
- Important methods:
postDispatch()
payForGas()
claim()
MerkleTreeHook
- Inserts dispatched messages into an on-chain Merkle tree
- Required for
MessageIdMultisig
andMerkleRootMultisig
ISMs - Important methods:
postDispatch()
InsertedIntoTree()
(event)
x/warp
warp
builds on-top of the core functionality by enabling token creation and cross-chain transfers between chains already connected via Hyperlane. These tokens leverage modular security through specific ISMs.
- Currently, two token types are available:
- Collateral: Locks tokens as collateral on the source chain for cross-chain transfers.
- Synthetic: Mints new tokens on the destination chain to represent the original tokens.
- Important methods:
createToken()
remoteTransfer()
enrollRemoteRouter()
Warp Route - Remote Transfer Lifecycle
Dispatch()
Process()
EVM / Cosmos SDK Differences
EVM ≠ Cosmos SDK
- Instances instead of Contracts
- IDs instead of Contract addresses
- Tokens: There are no native tokens, this has implications to the IGP where a
denom
for gas payments has to be specified. Similarly, there there is noNativeCollateralToken
.
Tool integration
Support for the native Cosmos SDK module is under development for Hyperlane agents and CLI. Deploying a Warp Route requires manually setting up all necessary components (Mailbox, ISM, IGP, Token, etc.) with the correct transactions.