NEW

Chainlink Data Streams have officially launched on mainnet. Sign up for early access.

Back

CCIP Billing

The CCIP billing model uses the feeToken specified in the message to pay a single fee on the source blockchain. CCIP uses a gas-locked fee payment mechanism, referred to as Smart Execution, to help ensure the reliable execution of cross-chain transactions regardless of destination blockchain gas spikes. For developers, this means you can simply pay on the source blockchain and CCIP will take care of execution on the destination blockchain.

CCIP supports fee payments in LINK and in alternative assets, which currently includes blockchain-native gas tokens and their ERC-20 wrapped versions. The payment model for CCIP is designed to significantly reduce friction for users and quickly scale CCIP to more blockchains by supporting fee payments that originate across a multitude of blockchains over time.

Aside from billing, remember to carefully estimate the gasLimit that you set for your destination contract so CCIP can have enough gas to execute ccipReceive(), if applicable. Any unspent gas from this user-set limit is not refunded.

Billing mechanism

The fee is calculated by the following formula:

fee = message fee + network fee

Where:

  • fee: The total fee for processing a CCIP message. Note: Users can call the getFee function to estimate the fee.
  • message fee: This represents an estimation of the gas cost the node operators will pay to deliver the CCIP message to the destination blockchain.
  • network fee: Premium paid to CCIP service providers, including node operators running the Decentralized Oracle Network and Risk Management Network.

Message fee

The message fee is calculated by the following formula:

message fee = execution cost + data availability cost

Execution cost

The execution cost is directly correlated with the estimated gas usage to execute the transaction on the destination blockchain:

execution cost = gas price * gas usage * gas multiplier

Where:

  • gas price: The destination gas price. CCIP maintains a cache of destination gas prices on each source blockchain, denominated in each feeToken.

  • gas multiplier: Scaling factor for Smart Execution. This multiplier ensures the reliable execution of transactions regardless of destination blockchain gas spikes.

  • gas usage:

    gas usage = gas limit + destination gas overhead + destination gas per payload + gas for token transfers`
    

    Where:

    • gas limit: This specifies the maximum amount of gas CCIP can consume to execute ccipReceive() on the receiver contract located on the destination blockchain. Users set the gas limit in the extra argument field of the CCIP message. Note: Remember to carefully estimate the gasLimit that you set for your destination contract so CCIP can have enough gas to execute ccipReceive(). Any unspent gas from this user-set limit is not refunded.
    • destination gas overhead: This is the fixed gas cost incurred on the destination blockchain by CCIP (Committing DON + Executing DON) and Risk Management Network.
    • destination gas per payload: This variable gas depends on the length of the data field in the CCIP message. If there is no payload (CCIP only transfers tokens), the value is 0.
    • gas for token transfers: This variable gas cost is for transferring tokens onto the destination blockchain. If there are no token transfers, the value is 0.

Data availability cost

This cost is only relevant if the destination blockchain is a L2 layer. Some L2s charge fees for data availability. For instance, optimistic rollups process the transactions offchain then post the transaction data to Ethereum as calldata, which costs additional gas.

Network fee

The premium paid to CCIP service providers, including node operators running the Decentralized Oracle Network and Risk Management Network is calculated as follows:

  • For token transfers or programmable transfers (token + data), the fee uses a percentage-based premium. For each token, the premium is calculated using the following expression:

    tokenAmount * price * percentage
    

    Where:

    • tokenAmount: The amount of tokens.
    • price: Initially denominated in USD and translated into the feeToken.
    • percentage: The values are listed in the table below.
  • For messaging (only data): The fee is a static amount. The values denominated in USD are listed in the table below.

Service Lanes Fee Token
(Wrapped) Gas Token LINK
Token Transfers with/without messaging All lanes 0.07 % 0.063 %
Messaging Ethereum 0.50 USD 0.45 USD
Non-Ethereum 0.10 USD 0.09 USD

Stay updated on the latest Chainlink news