Skip to main content

Multisig Module

使用验证器签名验证消息

MultisigISM是最常用的ISM类型之一。这些ISM验证n个验证器中的 m 个已经证明了特定链间消息的有效性。

接口

MultisigISMs必须实现IMultisigIsm接口。

// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;

import {IInterchainSecurityModule} from "../IInterchainSecurityModule.sol";

interface IMultisigIsm is IInterchainSecurityModule {
/**
* @notice Returns the set of validators responsible for verifying _message
* and the number of signatures required
* @dev Can change based on the content of _message
* @param _message Hyperlane formatted interchain message
* @return validators The array of validator addresses
* @return threshold The number of validator signatures needed
*/
function validatorsAndThreshold(
bytes calldata _message
) external view returns (address[] memory validators, uint8 threshold);
}

配置

hyperlane-monorepo包含MultisigISM implementations(包括通过工厂部署的 legacy版本和更省燃料的versions 应用程序开发人员可以部署现成的配置,指定他们所需的配置。

开发人员可以为每个源链配置一组n个验证器,以及验证消息所需的验证器签名(m)的数量。

验证器签名并非特定于ISM。换句话说,开发人员可以将他们的MultisigISM配置为使用在Hyperlane上运行的任何验证器,它将“正常工作”。

自定义

hyperlane-monorepo 包含一个抽象的MultisigISM实现,应用程序开发人员可以将其分叉。

开发人员只需实现validatorsAndThreshold()函数即可。

通过创建自定义实施,应用程序开发人员可以根据其应用程序的需要定制MultisigISM提供的安全性。

例如,自定义实现可以根据要验证的消息的内容改变所需签名的数量。