#substrate-polkadot #substrate #polkadot #interop #ismp

no-std pallet-hyperbridge

Pallet hyperbridge mediates the connection between hyperbridge and substrate-based chains

9 stable releases (4 major)

new 2503.0.0 May 28, 2025
2412.0.0 May 14, 2025
16.0.0 Feb 3, 2025
15.0.0 Jan 10, 2025
1.6.2 May 10, 2024

#2 in #ismp

Download history 267/week @ 2025-02-05 200/week @ 2025-02-12 58/week @ 2025-02-19 114/week @ 2025-02-26 39/week @ 2025-03-05 112/week @ 2025-03-12 131/week @ 2025-03-19 72/week @ 2025-03-26 78/week @ 2025-04-02 178/week @ 2025-04-09 246/week @ 2025-04-16 215/week @ 2025-04-23 30/week @ 2025-04-30 88/week @ 2025-05-07 216/week @ 2025-05-14 160/week @ 2025-05-21

522 downloads per month
Used in pallet-token-gateway

Apache-2.0 and maybe GPL-3.0-only

320KB
3.5K SLoC

Pallet Hyperbridge

Pallet hyperbridge mediates the connection between hyperbridge and substrate-based chains. This pallet provides:

  • An IsmpDispatcher implementation which collects protocol fees and commits the reciepts for these fees to child storage. Hyperbridge only accepts messages that have been paid for using this module.
  • An IsmpModule which recieves and processes requests from hyperbridge. These requests are dispatched by hyperbridge governance and may adjust fees or request payouts for both relayers and protocol revenue.

This pallet contains no calls and dispatches no requests. Substrate based chains should use this to dispatch requests that should be processed by hyperbridge.

Usage

This module must be configured as an IsmpModule in your IsmpRouter implementation so that it may receive important messages from hyperbridge such as paramter updates or relayer fee withdrawals.

use ismp::Error;
use ismp::module::IsmpModule;
use ismp::router::IsmpRouter;
use pallet_hyperbridge::PALLET_HYPERBRIDGE_ID;

#[derive(Default)]
struct ModuleRouter;

impl IsmpRouter for ModuleRouter {
    fn module_for_id(&self, id: Vec<u8>) -> Result<Box<dyn IsmpModule>, Error> {
        return match id.as_slice() {
            PALLET_HYPERBRIDGE_ID => Ok(Box::new(pallet_hyperbridge::Pallet::<Runtime>::default())),
            _ => Err(Error::ModuleNotFound(id)),
        };
    }
}

License

This library is licensed under the Apache 2.0 License, Copyright (c) 2025 Polytope Labs.

Dependencies

~23–81MB
~1.5M SLoC