# Chainlink CCIP vs LayerZero — Cross-Chain Messaging Compared
Cross-chain messaging lets contracts on different blockchains communicate. Two protocols dominate.
Chainlink CCIP
Uses Chainlink oracles plus an independent Risk Management Network:
import {IRouterClient} from "@chainlink/contracts-ccip/src/v0.8/ccip/interfaces/IRouterClient.sol";
import {Client} from "@chainlink/contracts-ccip/src/v0.8/ccip/libraries/Client.sol";
function sendMessage(uint64 destChain, address receiver, bytes calldata data) external payable {
Client.EVM2AnyMessage memory msg = Client.EVM2AnyMessage({
receiver: abi.encode(receiver),
data: data,
tokenAmounts: new Client.EVMTokenAmount[](0),
feeToken: address(0),
extraArgs: ""
});
IRouterClient(router).ccipSend{value: msg.value}(destChain, msg);
}
LayerZero
Ultra-light node architecture with configurable security:
import {OApp} from "@layerzerolabs/oapp-evm/contracts/oapp/OApp.sol";
contract MyOApp is OApp {
function send(uint32 dstEid, bytes calldata payload) external payable {
_lzSend(dstEid, payload, _options, MessagingFee(msg.value, 0), payable(msg.sender));
}
}
Comparison
| Feature | CCIP | LayerZero |
|---------|------|-----------|
| Security | Oracle + Risk Mgmt | Configurable DVNs |
| Chains | ~12 | 50+ |
| Speed | 15-20 min | 1-5 min |
| Cost | Higher | Lower |
Choose CCIP for maximum security on high-value transfers. Choose LayerZero for broad chain coverage and speed.