CCIP v2.0.0 ICrossChainVerifierV1 API Reference
ICrossChainVerifierV1 defines the lifecycle interface for Cross-Chain Verifier (CCV) implementations.
It standardizes:
- source-side verifier data generation (
forwardToVerifier) - destination-side message validation (
verifyMessage) - verification fee calculation (
getFee)
All CCV implementations must follow this interface to ensure consistent cross-chain validation behavior.
This interface defines functions implemented by protocol contracts and is not typically used directly by applications.
Usage Boundary
You do not call this interface directly.
- OnRamp components call
forwardToVerifierduring message submission. - OffRamp components call
verifyMessageduring message validation. - Routing components call
getFeeto calculate verification cost. - You implement this interface when building custom verifier logic.
Contract
interfaces/ICrossChainVerifierV1.sol
Import
import {ICrossChainVerifierV1} from "chainlink-ccip/interfaces/ICrossChainVerifierV1.sol";
If you have not installed the package:
npm install @chainlink/contracts-ccip@2.0.0
Inheritance
IERC165
External API
verifyMessage
function verifyMessage(
MessageV1Codec.MessageV1 memory message,
bytes32 messageId,
bytes memory verifierResults
) external
Validates a message on the destination chain using verifier-specific data.
- Reverts if validation fails.
| Parameter | Type | Description |
|---|---|---|
message | MessageV1Codec.MessageV1 memory | Message being validated. |
messageId | bytes32 | Canonical identifier for the message. |
verifierResults | bytes memory | Verifier-specific data produced on the source chain. |
getFee
function getFee(
uint64 destChainSelector,
Client.EVM2AnyMessage memory message,
bytes memory extraArgs,
bytes4 requestedFinalityConfig
) external view returns (
uint16 feeUSDCents,
uint32 gasForVerification,
uint32 payloadSizeBytes
)
Returns the verification fee and resource requirements for processing a message.
| Parameter | Type | Description |
|---|---|---|
destChainSelector | uint64 | Destination chain identifier. |
message | Client.EVM2AnyMessage memory | Message being evaluated. |
extraArgs | bytes memory | Additional verifier-specific arguments. |
requestedFinalityConfig | bytes4 | Desired finality configuration for verification. |
Returns:
| Type | Description |
|---|---|
uint16 | Verification fee in USD cents. |
uint32 | Gas required for verification. |
uint32 | Payload size used in verification. |
forwardToVerifier
function forwardToVerifier(
MessageV1Codec.MessageV1 calldata message,
bytes32 messageId,
address feeToken,
uint256 feeTokenAmount,
bytes calldata verifierArgs
) external returns (bytes memory verifierData)
Produces verifier-specific data on the source chain for later destination-side validation.
- Output is passed to the destination chain and consumed by
verifyMessage.
| Parameter | Type | Description |
|---|---|---|
message | MessageV1Codec.MessageV1 calldata | Message being processed. |
messageId | bytes32 | Canonical identifier for the message. |
feeToken | address | Token used for fees. |
feeTokenAmount | uint256 | Fee amount. |
verifierArgs | bytes calldata | Verifier-specific arguments. |
Returns:
| Type | Description |
|---|---|
bytes memory | Encoded verifier data used for validation. |
getStorageLocations
function getStorageLocations() external view returns (string[] memory)
Returns off-chain storage locations used by the verifier implementation.
Returns:
| Type | Description |
|---|---|
string[] memory | Storage location identifiers. |
Notes
verifyMessagemust be called with verifier data produced byforwardToVerifier.- Message data and verifier results must match exactly between source and destination chains.
messageIdis the canonical identifier passed through the verifier interface. Implementations may also derive or validate a message hash internally.- For a given message and verifier configuration,
forwardToVerifiershould produce deterministic verifier data. getFeeshould be called with the same message parameters that will be used for verifier execution.- Verification will revert if verifier data is invalid, mismatched, or incomplete.
- Verifiers act as execution gates: messages are processed only if validation succeeds.