Understanding Gas Fees on Ethereum and Layer 2s
Why transactions cost what they cost, and what actually goes into the number.
Ethereum measures computational effort in units of gas. Each operation in a transaction — a transfer, a contract call, a storage write — has a fixed gas cost. The total fee a user pays is the gas used multiplied by a per-unit price.
The per-unit price splits into a base fee, which is set by the protocol based on recent demand and burned, and a priority fee, which goes to the block proposer as a tip. When the network is busy the base fee rises; when it is quiet the base fee falls.
On Layer 2 rollups, the fee model has two components: the cost of executing the transaction on the L2 itself, and the cost of eventually posting data back to Ethereum. The second component moves with L1 conditions, which is why L2 fees drift up when mainnet is congested.
Wallets estimate all of this for you, but the estimates are just that. Reviewing the fee before signing — and understanding whether you're paying L1 or L2 rates — is a good habit for anyone transacting regularly.