Gas Fee
What you pay for computation on a gas-metered chain, priced per unit of work.
Basically
A gas fee is what you pay to send tokens or run a smart contract on Ethereum and similar blockchains. Gas measures the computing work, so more complex actions cost more.
Key Takeaways
- A gas fee is the cost users pay to execute operations on Ethereum and similar blockchains. It is calculated as gas units used multiplied by the price per gas unit, denominated in gwei, a subunit of ETH.
- Since EIP-1559, Ethereum splits gas fees into a burned base fee and a priority tip paid to validators. The base fee adjusts algorithmically based on block utilisation, while Layer 2 rollups reduce costs by 90-99%.
- Bitcoin uses a fundamentally different fee model based on transaction data size in virtual bytes rather than computational complexity. Its simpler UTXO model avoids gas mechanics entirely.
What Is a Gas Fee?
A gas fee is the cost of performing any operation on the Ethereum blockchain, from sending ETH to executing complex smart contract logic. Every computation on the Ethereum Virtual Machine (EVM) consumes a measurable amount of "gas", and you must pay for that gas so validators process your transaction.
The idea is similar to fuel: a car needs petrol to run, and Ethereum needs gas to execute code. More complex operations, such as deploying a contract or swapping tokens on a DEX, consume more gas than simple ones like transferring ETH. The mechanism prevents spam and infinite loops by giving every computation a cost, and it compensates validators for the resources they use.
Gas is priced in small units of ETH called gwei, short for giga-wei. One gwei equals 0.000000001 ETH (10⁻⁹), and a standard ETH transfer always costs exactly 21,000 gas units. The price per gas unit changes with network demand.
How It Works
The total cost of an Ethereum transaction follows a straightforward formula. You multiply the gas units used by the price per gas unit.
Each EVM opcode has a fixed gas cost defined in the Ethereum Yellow Paper. An ADD operation costs 3 gas, a SSTORE operation for writing to storage costs 20,000 gas, and a CREATE operation for deploying a contract costs 32,000 gas. The total gas consumed is the sum of all opcodes executed while the transaction is processed.
You set two parameters when submitting a transaction: a max fee per gas, which is the absolute ceiling you will pay, and a max priority fee, which is the tip for validators. Any difference between the max fee and the actual cost is refunded.
EIP-1559: Base Fee and Priority Fee
EIP-1559 arrived in August 2021 through the London hard fork and fundamentally changed how Ethereum prices gas. Before EIP-1559, users submitted blind bids in a first-price auction, which led to overpayment and unpredictable fees. The new mechanism splits the fee into two components: a burned base fee and a priority tip paid to validators.
The design makes fees more predictable because wallets can read the current base fee and add a small tip instead of guessing what other users will bid. The base fee adjusts algorithmically based on block utilisation, and burning it creates deflationary pressure on ETH supply during periods of heavy network usage.
Gas Costs by Operation
Different operations consume vastly different amounts of gas depending on their computational complexity. Simple transfers use less gas than actions such as deploying contracts or swapping tokens.
These costs scale linearly with the gas price, so at 10 gwei you multiply each cost by 10. During peak congestion in May 2021, average gas prices exceeded 400 gwei, making a simple Uniswap swap cost over $100.
How Bitcoin Fees Differ
Bitcoin uses a fundamentally different fee model. Instead of pricing computation, Bitcoin fees are based on transaction data size measured in virtual bytes (vBytes).
Bitcoin's UTXO model handles simple value transfers rather than arbitrary computation, so there is no concept of "gas" or variable execution costs. A transaction sending 0.001 BTC costs the same in fees as one sending 1,000 BTC if their input and output structures are identical, because the number of inputs and outputs determines data size rather than the amount transferred. For a deeper comparison of how these models affect fee markets, see the Bitcoin fee market dynamics research article.
Layer 2s and Gas Reduction
High gas fees on Ethereum mainnet drove the development of rollup-based Layer 2 networks that execute transactions off-chain and post compressed data back to Ethereum. These L2s reduce transaction costs by 90-99% compared to mainnet.
The March 2024 Dencun upgrade (EIP-4844) further reduced L2 costs by introducing "blob" transactions, a new data type purpose-built for rollup data with its own fee market separate from regular gas. Each blob holds 128 KiB of data and is stored on the consensus layer for approximately 18 days before being pruned. L2 data posting costs dropped by roughly 60% immediately after Dencun, with some rollups seeing fees fall to fractions of a cent.
The Pectra upgrade in May 2025 doubled the blob target from 3 to 6 per block and increased the maximum from 6 to 9, further driving down L2 data costs to near zero. By early 2026, a typical transaction on optimistic rollups like Arbitrum or Base costs $0.003-0.01, while ZK rollups like zkSync Era cost $0.008-0.015.
Bitcoin-native Layer 2 solutions like Spark take a different approach entirely. Rather than paying gas fees for computation, Spark uses a UTXO-based model inherited from Bitcoin, avoiding the gas complexity and MEV risks that come with account-model blockchains.
Use Cases
Gas fees serve several key functions within the Ethereum ecosystem. They pay for computation, compensate validators, and prevent spam and infinite loops by giving every operation a cost.
Why It Matters
Gas fees are the primary user experience bottleneck for Ethereum-based applications. During periods of high demand, fees can make small transactions uneconomical: paying $50 in gas to swap $100 of tokens defeats the purpose. That dynamic has pushed DeFi activity to Layer 2s and alternative chains, reshaped application design through batching operations and lazy execution, and driven innovations like account abstraction that allow contracts to sponsor gas on behalf of users.
Developers choosing which blockchain to build on must treat the gas model as a fundamental design consideration. The UTXO model vs. account model comparison directly influences fee structures, MEV exposure, and scalability trade-offs. Bitcoin-based systems like Spark sidestep gas complexity entirely, offering predictable, size-based fees through the UTXO model.
Fee Volatility
Gas prices can spike dramatically within minutes during high-demand events such as NFT drops, token launches, DeFi liquidation cascades, or memecoin frenzies. In May 2021, average gas prices exceeded 400 gwei, making even simple transactions cost $50+. Setting gas limits too low during spikes can leave your transactions stuck in the mempool for hours or days.
Failed Transactions Still Cost Gas
A transaction that runs out of gas or encounters a revert during execution still costs you the gas consumed up to the failure point. Interacting with buggy contracts or setting gas limits too low can therefore result in lost fees with nothing to show for it. A failed Uniswap swap might consume 50,000+ gas units before reverting.
MEV and Priority Fee Games
The gas fee mechanism creates opportunities for maximal extractable value (MEV): validators and searchers can reorder, insert, or censor transactions within a block for profit. Sandwich attacks use bots to place transactions before and after your swap, exploiting gas price dynamics to extract value. You end up paying more than necessary while receiving worse execution prices.
Complexity for New Users
Gas limits, base fees, priority tips, and max fees per gas create a steep learning curve for newcomers. Setting parameters incorrectly can result in overpaying, stuck transactions, or outright failure. Bitcoin's simpler fee model stands in contrast, with fee estimation tools suggesting a single sat/vB rate based on current mempool conditions.
The glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.