Chainlink CCIP Integration
Chainlink’s Cross-Chain Interoperability Protocol (CCIP) provides a decentralized, secure method for relaying intent fulfillment proofs between blockchains. TheCCIPProver leverages Chainlink’s oracle network for reliable cross-chain messaging.
Overview
CCIP offers several advantages for cross-chain proving:- Decentralized Security: Multi-oracle verification with Risk Management Network
- Reliability: Guaranteed message delivery with automatic retries
- Wide Network Support: Available on 15+ EVM chains
- Message Tracking: Built-in explorer for monitoring cross-chain transactions
- Active-Active Architecture: No single point of failure
Contract Architecture
contracts/prover/CCIPProver.sol
Constructor Parameters
The CCIP Router contract address for the current chain. Find addresses in CCIP documentation.
The Portal contract address on this chain.
Array of whitelisted prover addresses on other chains. Use bytes32 format for cross-VM compatibility.
Minimum gas limit for cross-chain execution. Pass 0 to use the default 200,000 gas.
Proving Flow
Fulfill intent on destination chain
A solver fulfills an intent on the destination chain via the Portal contract.
Call prove() on CCIPProver
The prover or solver calls
prove() on the destination chain’s CCIPProver with payment for CCIP fees.CCIP delivers message
Chainlink’s oracle network validates and delivers the message to the source chain.
ccipReceive processes proof
The source chain’s CCIPProver receives the message via
ccipReceive() and creates a proof record.Chain Selectors vs Chain IDs
Common Chain Selectors
| Network | Chain ID | CCIP Chain Selector |
|---|---|---|
| Ethereum Mainnet | 1 | 5009297550715157269 |
| Ethereum Sepolia | 11155111 | 16015286601757825753 |
| Polygon Mainnet | 137 | 4051577828743386545 |
| Polygon Amoy | 80002 | 16281711391670634445 |
| Arbitrum One | 42161 | 4949039107694359620 |
| Arbitrum Sepolia | 421614 | 3478487238524512106 |
| Optimism Mainnet | 10 | 3734403246176062136 |
| Optimism Sepolia | 11155420 | 5224473277236331295 |
| Base Mainnet | 8453 | 15971525489660198786 |
| Base Sepolia | 84532 | 10344971235874465080 |
| Avalanche C-Chain | 43114 | 6433500567565415381 |
| Avalanche Fuji | 43113 | 14767482510784806043 |
Always verify selectors in the official CCIP documentation as they may change.
Data Parameter Structure
Thedata parameter encodes information needed for cross-chain message delivery:
The CCIPProver contract address on the source chain where the proof will be delivered.
Gas limit for proof processing on the source chain. Automatically enforced to be at least
MIN_GAS_LIMIT. Maximum is 3,000,000 gas.Fee Calculation
CCIP fees depend on:- Destination chain: Different chains have different costs
- Gas limit: Higher execution limits cost more
- Message size: Larger proofs (up to 30KB) increase fees
- Network congestion: Dynamic pricing based on demand
Message Limits
- Maximum payload size: 30 KB (30,720 bytes)
- Maximum gas limit: 3,000,000 gas
- Minimum gas limit: 200,000 gas (configurable via
minGasLimit)
CCIP Router Addresses
Each chain has its own CCIP Router contract. Here are key mainnet addresses:| Chain | Router Address |
|---|---|
| Ethereum | 0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D |
| Polygon | 0x849c5ED5a80F5B408Dd4969b78c2C8fdf0565Bfe |
| Arbitrum | 0x141fa059441E0ca23ce184B6A78bafD2A517DdE8 |
| Optimism | 0x261c05aFb2f581bC4119aee23A8E67947EaaC7c0 |
| Base | 0x881e3A65B4d4a04dD529061dd0071cf975F58bCD |
| Avalanche | 0xF4c7E640EdA248ef95972845a62bdC74237805dB |
Testnet router addresses are different. Check the CCIP documentation for current addresses.
Deployment Example
Monitoring and Debugging
CCIP Explorer
Track your cross-chain messages using the CCIP Explorer:- Copy the transaction hash from your
prove()call - Enter it in the CCIP Explorer
- View message status: Pending, Success, or Failed
- See execution details and any error messages
Common Issues
Insufficient fee paid
Insufficient fee paid
Cause: Gas prices increased between fee calculation and transaction execution.Solution: Always add a 5-10% buffer to the calculated fee.
Message execution failed
Message execution failed
Cause: Gas limit too low or invalid proof data.Solution: Increase gas limit in the
data parameter or verify proof encoding.Sender not whitelisted
Sender not whitelisted
Cause: The destination chain prover is not in the source chain’s whitelist.Solution: Add the prover address to the whitelist via contract upgrade or constructor.
Invalid chain selector
Invalid chain selector
Cause: Using chain ID instead of CCIP chain selector.Solution: Verify you’re using the correct CCIP chain selector from the table above.
Security Considerations
- Decentralized Oracles: CCIP uses multiple independent oracles for message verification
- Risk Management Network: Additional security layer monitors for anomalies
- Whitelist Enforcement: Only approved provers can submit proofs
- Router Authorization: Only the CCIP Router can call
ccipReceive() - Gas Limit Validation: Enforces minimum gas to prevent execution failures
Best Practices
- Fee Estimation: Always query fees with
fetchFee()before proving - Fee Buffer: Add 5-10% buffer for gas price volatility
- Batch Proofs: Combine multiple proofs to save on fixed CCIP costs
- Monitor Status: Use CCIP Explorer to track message delivery
- Test First: Verify on testnets before mainnet deployment
- Whitelist Management: Keep prover whitelists synchronized across chains
Integration Example
Complete example of integrating CCIP proving into your solver:Related Documentation
- CCIPProver API Reference - Complete contract documentation
- Portal Contract - Intent fulfillment and proving
- Inbox Contract - Destination chain operations