L2 fee
This document outlines the calculation process for transaction fees on Titan, emphasizing their lower cost compared to Ethereum.
Titan's transaction fees are determined by adding two components together:
L2 execution fee
L1 security fee
L2 execution fee
tx.gasPrice * l2GasUsedThe L2 execution fee refers to the fee incurred when a user's transaction is processed within the Titan layer2 network. It follows a calculation method shown above, identical to the standard Ethereum transaction fee computation. However, the distinction lies in the fact that the gas price on Titan is significantly lower compared to Ethereum.
L1 security fee
l1_base_fee * (tx_data_gas + overhaed) * scalarThe L1 security fee is an essential fee required in the context of Optimistic Rollup. With Optimistic Rollup, all L2 transactions are uploaded to L1 to ensure data availability.
To transmit these rollup transactions to L1, a portion of the L2 transaction fee is used for the L1 transaction fee. While the rollup transaction includes the
calldataof all L2 transactions, it's important to note that L2 transactions are not directly executed in L1.Consequently, only the intrinsic gas generated when incorporating the L2 transaction
calldatainto the rollup transaction is calculated. The termtx_data_gasmentioned earlier refers to this, and its calculation is as follows.
tx_data_gas = count_zero_bytes(tx_data) * 4 + count_non_zero_bytes(tx_data) * 16The
l1_base_feerepresents the base fee of L1, which is the amount of ETH required for the rollup transaction.Titan continuously monitors the Ethereum base fee fluctuations; whenever there is a substantial change, a new
l1_base_feeis stored in the L2OVM_GasPriceOraclecontract.The
overheadis calculated in gas units and is assigned a relatively small value.scalaris the weight multiplied for the L1 security fee.
Last updated
