Fees

Gas fees on Frame

Frame

Background

Before explaining how L2 gas fees work, it's important to understand how gas fees are derived on Ethereum mainnet (L1). Gas fees are calculated by multiplying the total gas units used by the cost per unit of gas.

The number of gas units required is determined by the amount of computation and storage a transaction uses. Additionally, every transaction on mainnet incurs a minimum overhead cost of 21,000 gas units (opens in a new tab).

The price per unit of gas is broken down into two parts: a base fee and a priority fee. The base fee is calculated based on the current blockspace demand - the more demand, the higher the base fee. This portion of the fee is burned by the network. The priority fee is the amount that users are willing to pay block proposers to get their transaction included in the current block. This portion of the fee is given to the block proposer (validator) after the transaction is executed.

Here's the formula for calculating the total gas required for an L1 transaction:

gas_paid = gas_units * gas_price

Which can be expanded out to:

gas_paid = (21_000 + execution_cost) * (base_fee + priority_fee)

A full breakdown of Ethereum mainnet gas costs can be found here (opens in a new tab).

How L2 gas fees work

L2 gas fees are computed in a different manner from L1 gas fees. L2 gas fees are broken down into two parts: L2 execution and L1 data posting.

L2 execution gas is very similar to L1 execution gas. This value is determined based on the amount of compute and storage used in a transaction. The amount of gas units consumed per transaction is similar to Ethereum mainnet because Frame is EVM-compatible. Unlike L1 however, the L2 portion of the gas fees are retained by the sequencer instead of being burned.

The formula for computing the L2 execution gas costs looks like this:

L2_execution = L2_gas_units * L2_gas_price

The L1 gas portion is used to cover the cost of posting transaction data back to Ethereum mainnet (which is Frame's data availability layer). Transaction data is posted to mainnet to determine the final ordering of transactions and so nodes can compute the correct state of the rollup at any point. Transacting on mainnet is expensive, so Frame will compress the L2 transaction data to reduce costs. Additionally, transactions will be batched together to amortize the overhead transaction costs (21,000 gas) of posting to Ethereum over an entire batch. Compressing and batching the data leads to much cheaper gas prices for users compared to executing the same transactions on L1.

L1_gas ~= L1_base_fee * txn_size (bytes)

The total gas fees a user pays for a txn on Frame can be roughly represented by this formula:

txn_fee = L2_execution + L1_gas

What transactions are cheaper on Frame?

Frame is an EVM-compatible rollup, but there are a couple of NFT-specific operations that make it different from other EVM chains. The costs of interacting with specific functions in specific contracts have been made cheaper to enable new NFT paradigms.

The following flows have been modified with cheaper gas fees:

  1. Wallet delegation
  2. ERC6551 wallet overhead

These overrides have been made at the execution client level - no changes to the Solidity compiler are needed to run contracts on Frame. You will notice that the gas limits from eth_estimateGas are higher than the actual gas used for these modified flows - this is expected behavior.

Where do fees go on Frame?

On rollups, L2 execution gas is retained by the sequencer instead of being burned. For Frame, a portion of these sequencing fees will be allocated for the Creator's Fund.