Interface
The security interface for Hyperlane
ISMs must implement the IInterchainSecurityModel()
interface. This interface consists of two functions.
Verify
The primary function that ISMs must implement is verify()
. The Mailbox will call IInterchainSecurityModule.verify()
before delivering a message to its recipient. If verify()
reverts or returns false
, the message will not be delivered.
The verify()
function takes two parameters.
The first, _metadata
, consists of arbitrary bytes provided by Relayers. Typically, these bytes are specific to the ISM. For example, for a Multisig ISM, _metadata
must include validator signatures.
The second, _message
, consists of the Hyperlane message being verified. ISMs can use this to inspect details about the message being verified. For example, a Multisig ISM could change validator sets based on the origin chain of the message.
See the Message.sol
library for more information on the format of the Hyperlane message passed to verify()
Module type
The secondary function that ISMs must implement is moduleType()
. This is used to signal to Relayerswhat to include in _metadata
. ISMs must return one of the supported module types.
Sequence diagram
The following shows a simplified sequence diagram of an interchain message being verified and delivered on the destination chain.
If the recipient does not implement ISpecifiesInterchainSecurityModule
or recipient.interchainSecurityModule()
returns address(0)
, the default ISM configured on the Mailbox will be used to verify the message.
This is omitted from the sequence diagram for clarity.
Last updated