// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.13; /// @title IVerifier /// @author The Warp Team /// @notice Interface for a cross-chain message verifier. /// @dev The verifier is responsible for verifying the authenticity of a /// message. It contains any necessary logic and state to authenticate /// messages. The Verifier is called by the Inbox contract before /// delivering a message to the handler. The address of the Verifier is /// passed to the Handler with the message. The handler may then check /// that the Verifier is trusted before processing messages. interface IVerifier { /// @notice A statement that has been verified by a Verifier. Contains a /// message field that SHOULD contain a serialized `Message`. /// @dev The fields are as follows: /// - emitterChainId - The ID of the chain that emitted the statement. /// - emitterAddress - The address that emitted the statement. /// - message - The body of the statement, which SHOULD contain a /// serialized message. struct VerifiedStatement { uint16 emitterChainId; bytes32 emitterAddress; bytes message; } /// @notice Verify a witnessed statement, returning the statement it /// contains if the witness is valid, and contains a validly /// formatted statement, and reverting otherwise. /// @dev This function may unpack the statement according to any /// arbitrary logic and/or state. Application developers must /// evaluate the safety and trustworthiness of a particular /// verifier. /// @dev MUST revert if statement is not valid. /// @param witnessedStatement - The statement to verify. /// @return statement The statement contained in the witnessed statement. function verify(bytes memory witnessedStatement) external view returns (VerifiedStatement memory statement); }