CCIPProver
TheCCIPProver contract implements cross-chain intent verification using Chainlink’s Cross-Chain Interoperability Protocol (CCIP). It extends MessageBridgeProver to provide reliable message delivery with built-in security features.
Location: contracts/prover/CCIPProver.sol:22
Overview
CCIPProver uses Chainlink’s decentralized oracle network to relay intent fulfillment proofs between chains. CCIP provides:- Security: Decentralized oracle verification with Risk Management Network
- Reliability: Guaranteed message delivery with retry mechanisms
- Flexibility: Support for multiple EVM chains with active/active routing
- Monitoring: Built-in transaction tracking and status updates
Inheritance
State Variables
The Chainlink CCIP Router contract address. Immutable value set at deployment.
Returns
"CCIP" as the proof type identifier.Minimum gas limit for cross-chain message execution (inherited from MessageBridgeProver). Defaults to 200,000 gas if not specified.
Constructor
The CCIP Router contract address for the current chain. Must not be zero address.
The Portal contract address on this chain.
Array of whitelisted prover addresses (as bytes32 for cross-VM compatibility).
Minimum gas limit for cross-chain messages. Pass 0 to use the default 200,000 gas.
Functions
prove
The hash of the intent being proven.
The CCIP chain selector for the source chain. Important: This is CCIP’s chain selector, NOT the standard chain ID.
ABI-encoded proof data containing intent hashes and claimants.
ABI-encoded
UnpackedData struct: (address sourceChainProver, uint256 gasLimit)ccipReceive
The CCIP message containing:
sourceChainSelector: The source chain selectorsender: The sender address (ABI-encoded)data: The proof data payloadtokenAmounts: Token transfers (unused, always empty)
fetchFee
The destination chain selector (CCIP chain selector).
The proof data that will be sent.
Additional data containing source chain prover and gas configuration.
The fee amount in native tokens required to send the message.
supportsInterface
IAny2EVMMessageReceiver.
Data Structures
UnpackedData
The address of the prover contract on the source chain.
The gas limit for message execution on the destination chain. Automatically enforced to be at least
MIN_GAS_LIMIT.CCIP Chain Selectors
CCIP uses chain selectors instead of standard chain IDs. Common mappings:| Network | Chain ID | CCIP Chain Selector |
|---|---|---|
| Ethereum Mainnet | 1 | 5009297550715157269 |
| Ethereum Sepolia | 11155111 | 16015286601757825753 |
| Polygon Mainnet | 137 | 4051577828743386545 |
| Arbitrum One | 42161 | 4949039107694359620 |
| Optimism Mainnet | 10 | 3734403246176062136 |
| Base Mainnet | 8453 | 15971525489660198786 |
| Avalanche C-Chain | 43114 | 6433500567565415381 |
Usage Example
Security Considerations
- Whitelist Verification: Only whitelisted provers can submit proofs
- Router Authorization: Only the CCIP Router can call
ccipReceive() - Gas Limits: Minimum gas limit enforced to prevent underfunded execution
- Zero Address Checks: Validates router, sender, and chain selector are non-zero
- Out-of-Order Execution: Enabled by default for optimal performance
Integration Notes
- Router Addresses: Different on each chain - verify before deployment
- Fee Payment: Fees paid in native token (ETH, MATIC, etc.)
- Message Tracking: Use CCIP Explorer to monitor cross-chain messages
- Retry Mechanism: CCIP handles retries automatically if execution fails
Related Contracts
- BaseProver - Core proving functionality
- MessageBridgeProver - Message bridge abstraction
- Inbox - Intent fulfillment and proving