Skip to main content

Overview

The IReceiver interface defines the entry point for receiving cross-chain messages on the destination domain. It validates message signatures and attestations before forwarding the message to the appropriate message handler for processing.

Interface Definition

IReceiver (V1)

Source: src/interfaces/IReceiver.sol:22

IReceiverV2

V2 maintains the same interface but adds support for finality-aware message handling:
Source: src/interfaces/v2/IReceiverV2.sol:27

Functions

receiveMessage

Receives an incoming cross-chain message, validates the signature/attestation, and forwards it to the message handler. Parameters:
  • message - The complete message bytes containing header and body
  • signature - The attestation signature proving the message was validated
Returns:
  • success - True if the message was received and processed successfully
Message Validation:
  1. Verifies the message format and structure
  2. Validates the attestation signature against trusted attesters
  3. Checks that the message hasn’t been used before (nonce uniqueness)
  4. Verifies the destination domain matches the current chain
  5. Forwards to the appropriate message handler

How Receivers Work with CCTP

Message Flow

Message Structure

The message parameter contains:

Signature Validation

The receiver validates signatures from Circle’s attestation service:
  1. Message hash is computed from the message bytes
  2. Signature is verified against trusted attester public keys
  3. Attestation proves the message was observed on the source chain
  4. Multiple attesters provide redundancy and security

Implementation in CCTP

The MessageTransmitter contract implements IReceiver:

Destination Caller Restriction

Messages can optionally specify a destinationCaller:
Use Cases:
  • Restrict message delivery to specific relayers
  • Implement custom relaying logic
  • Prevent front-running of message delivery
  • Control who can trigger message execution

V2 Hook Execution Pattern

Version 2 introduces enhanced receiver hooks with finality awareness:

Finality-Based Routing

IReceiverV2 routes messages to different handlers based on finality:

Receiver Hook Integration

V2 enables end-user contracts to implement receiver hooks:

Finality-Aware Hooks

Applications can implement different behavior based on finality:

Security Considerations

Nonce Management

  • Each message has a unique nonce to prevent replay attacks
  • Nonces are marked as used after successful processing
  • Cannot reuse the same message on the destination chain

Attestation Validation

  • Only signatures from registered attesters are accepted
  • Attesters are managed by Circle and rotated as needed
  • Multiple attesters provide redundancy

Destination Validation

  • Messages must be intended for the current domain
  • Prevents messages from being replayed on wrong chains

Handler Security

  • Message handlers should validate the caller is the registered receiver
  • Handlers should validate message format and content
  • Handlers should implement proper access controls

Integration Example

Relayer Integration

Handler Integration