Skip to content

Polkadot SDK

Hyperbridge is built on a cross-chain interoperability protocol referred to as the Interoperable State Machine Protocol. This protocol implementation lives in the Hyperbridge Monorepo. This protocol dictates the rules for Polkadot-SDK chains (parachains or solochains) to be connected to Hyperbridge and consequently all of Hyperbridge's connected networks.

The connection between Hyperbridge and Polkadot-SDK chains is mediated by a few modules that we will introduce below.

Pallet ISMP

This is the core module of the Interoperable state machine protocol for Polkadot-SDK chains. It exposes APIs and calls that allow the runtime to send and receive ISMP messages respectively. You can add the pallet-ismp to your runtime like so

cargo add pallet-ismp

Pallet ISMP Runtime API

This ISMP runtime API exposes necessary storage items to the client subsystems, specifically in this case the RPC subsystem. But you can also build custom client subsytems that leverage this runtime API. You can add the pallet-ismp-runtime-api to your runtime like so

cargo add pallet-ismp-runtime-api

Pallet ISMP RPC

The Pallet ISMP RPC module exposes the necessary RPC APIs that are required by the tesseract relayer and other alternative relayer implementations. This is required for any kind of offchain relayer process. You can add the pallet-ismp-rpc to your runtime like so

cargo add pallet-ismp-rpc

Parachain Consensus Client

For parachain runtimes that want to connect to Hyperbridge, They will do so by means of the parachain consensus client. Which is leverages the relay chain as the source of truth for finalized sibling parachain state commitments. You can add the ismp-parachain to your runtime like so

cargo add ismp-parachain

Parachain Inherent

The parachain inherent greatly simplifies the infrastructure required for parachains to exchange messages with Hyperbridge by turning collators into consensus relayers. Specifically this inherent will automatically include sibling parachain headers and their proofs into every block keeping the parachain up to date with the latest finalized state of Hyperbridge and any other sibling parachain that is configured. Without this, a seperate consensus relayer will need to be run offchain. You can add the ismp-parachain-inherent to your runtime like so

cargo add ismp-parachain-inherent

Parachain Runtime API

The Parachain inherent provider requires some runtime APIs to access which parachains are configured by the runtime to be included in the inherent. You can add the ismp-parachain-runtime-api to your runtime like so

cargo add ismp-parachain-runtime-api

GRANDPA Consensus Client

Solochains that want to connect to Hyperbridge will do so by means of the GRANDPA consensus client. This consensus client is capable of verifying GRANDPA consensus proofs of standalone chains as well as relay chains. You can add the ismp-grandpa to your runtime like so

cargo add ismp-grandpa

Pallet Hyperbridge

The Pallet Hyperbridge provides an implementation of the IsmpDispatcher which collects the Hyperbridge protocol fees, as well as an IsmpModule for processing cross-chain messages from Hyperbridge. These cross-chain messages may either be withdrawal requests may be for either relayer fees, or protocol fees. The IsmpModule may also receive cross-chain messages from Hyperbridge to adjust it's protocol fees as decided by governance. This module is optional and is only needed if Polkadot-SDK chains opt to pay Hyperbridge protocol fees onchain, they may also do so offchain by running their own relayers and paying Hyperbridge it's native token when they relay messages to Hyperbridge. You can add the pallet-hyperbridge to your runtime like so

cargo add pallet-hyperbridge

Pallet Token Gateway

The Pallet Token Gateway is an application-layer module that leverages Hyperbridge for token bridging. It works with any implementation of the fungibles::* traits eg. pallet-assets and orml-tokens. Allowing runtimes to send and receive assets from any of Hyperbridge's connected chains even EVM ones. You can add the pallet-token-gateway to your runtime like so

cargo add pallet-token-gateway

Versioning

The versioning of these crates track the LTS releases of Polkadot SDK and are only updated when new LTS versions are released. For instance the stable2407 version is available for all crates as v1.15.x. Subsequent LTS releases will see a minor version bump. eg stable2409 will be supported by v1.16.x and so on.