Skip to content
Basis Desk
Tech & Protocols · 6 min read Last reviewed October 1, 2026

What Is Gas? Transaction Fees on Ethereum and Beyond

Gas is the fundamental pricing mechanism for computing power on the Ethereum blockchain. Understanding how gas limits, base fees, and priority fees work is essential for navigating on-chain transactions and managing costs.

Editorial oversight: Julian Mercer, Chief Editor
Neutral

Key points

  • Gas measures the computational work required to run transactions and smart contracts on Ethereum, preventing network spam.
  • EIP-1559 split fees into a base fee (which is algorithmically set and burned) and an optional priority fee paid to validators.
  • The gas limit is the maximum computational budget set by the user; unused gas is refunded, but insufficient gas causes transactions to fail while still costing fees.
  • Layer 2 networks bundle transactions off-chain and utilize temporary storage blobs (EIP-4844) to drastically lower fees for users.

Gas is the unit of measurement used to quantify the computational effort required to execute specific operations on the Ethereum network. Because every transaction on a smart contract platform requires decentralized computers to allocate processing power, memory, and storage, gas acts as the metering system that prevents spam and allocates limited network capacity. Users must pay for this computational work in the network's native cryptocurrency, Ether ($ETH), converting a fraction of the asset into gas to complete their transactions.

To understand this mechanism, it helps to view Ethereum as a shared global computer. Unlike a traditional cloud server owned by a single entity, Ethereum relies on thousands of independent nodes to verify and run code. If computational resources were free, a malicious actor could easily halt the entire network by executing an infinite loop or flooding the system with complex, useless calculations. Gas solves this vulnerability by assigning a direct cost to every computational step, ensuring that users pay proportionally for the network resources they consume.

How Gas Limits Prevent Network Abuse

Every transaction on Ethereum must specify a gas limit, which is the maximum amount of computational work the user is willing to pay for. Simple actions, such as transferring ETH from one wallet to another, require a fixed and predictable amount of work. This baseline transaction always consumes exactly 21,000 units of gas.

More complex interactions, such as interacting with decentralized exchanges or minting digital assets, require significantly more computational steps. These operations involve reading and writing to the blockchain's state, executing conditional logic, and interacting with external smart contracts. For these transactions, the exact amount of gas required cannot always be predicted with absolute certainty before execution.

If a user sets a gas limit that is too low, the transaction will run out of gas mid-execution. When this occurs, the Ethereum Virtual Machine (EVM) halts the transaction, reverts all changes made to the blockchain's state to prevent corruption, but still collects the fee. The network retains the fee because the decentralized validators still performed the computational work up to the point of failure. Conversely, if a user sets a gas limit higher than necessary, the network executes the transaction and automatically refunds the unused gas to the user's wallet.

The Anatomy of a Transaction Fee: EIP-1559

Prior to August 2021, Ethereum used a simple first-price auction model where users bid against each other to have their transactions processed. This system made fee estimation highly unpredictable and volatile. The network changed this dynamic by implementing Ethereum Improvement Proposal 1559, commonly known as EIP-1559.

Under the EIP-1559 framework, every transaction fee is split into two distinct components: a base fee and a priority fee.

  • Base Fee: This is the minimum price per unit of gas required for a transaction to be included in the next block. The base fee is determined algorithmically by the network based on the demand for block space in the previous block. If a block is more than 50% full, the base fee increases for the next block; if it is less than 50% full, the base fee decreases. Crucially, the entire base fee is permanently burned (destroyed) by the protocol, removing that ETH from the circulating supply.
  • Priority Fee: Also referred to as a tip, this is an optional additional payment made directly to the validator who packages the transaction into a block. While the base fee is mandatory and burned, the priority fee incentivizes validators to prioritize a transaction during times of high network congestion.

To calculate the total transaction fee, the formula is:

$$\text{Total Fee} = \text{Gas Used} \times (\text{Base Fee} + \text{Priority Fee})$$

Gas prices are denominated in Gwei, which stands for giga-wei. One Gwei is equal to one-billionth of an ETH (0.000000001 ETH).

A Worked Numeric Example

To see how this formula functions in practice, assume a user wants to interact with a decentralized financial application.

  1. Assumptions: The user estimates the transaction will require 100,000 units of gas. The current network base fee is 30 Gwei, and the user decides to include a priority fee (tip) of 2 Gwei to ensure prompt processing.
  2. Calculation: The cost per unit of gas is 32 Gwei (30 Gwei base fee + 2 Gwei priority fee).
  3. Total Cost in Gwei: 100,000 units of gas multiplied by 32 Gwei equals 3,200,000 Gwei.
  4. Conversion to ETH: Converting Gwei to ETH (dividing by one billion) results in a total transaction fee of 0.0032 ETH.

If the market price of ETH at the time of the transaction is $3,000, this specific transaction would cost the user $9.60 in fiat terms. Of this total, 0.003 ETH (worth $9.00) is burned by the protocol, and 0.0002 ETH (worth $0.60) is paid directly to the validator.

Scaling Solutions and Layer 2 Fee Structures

As demand for Ethereum grew, the limited capacity of the main network (often called Layer 1) frequently caused gas prices to spike to levels that made ordinary transactions prohibitively expensive. To resolve this, the ecosystem developed Layer 2 scaling networks, such as optimistic rollups and zero-knowledge rollups.

These secondary networks process transactions off the main Ethereum chain, bundling hundreds or thousands of individual transactions into a single batch. This batch is then written back to the Ethereum mainnet as a single transaction. This architecture drastically reduces costs because the expensive gas fees of Layer 1 are divided among all the users in the bundled batch.

In March 2024, Ethereum implemented the Dencun upgrade, which introduced EIP-4844 (also known as proto-danksharding). This upgrade created a dedicated storage space on Ethereum blocks called "blobs" specifically for Layer 2 transaction data. Instead of forcing Layer 2 networks to store their transaction data in expensive smart contract storage, they can write it to temporary blobs that automatically expire after approximately 18 days. This change reduced Layer 2 transaction fees by over 90%, making microtransactions viable on rollup networks.

Common Misconceptions About Gas

  • Misconception: High gas fees benefit the developers of Ethereum. No centralized entity or developer group receives gas fees. Under the current EIP-1559 rules, the base fee is burned, which benefits all ETH holders by reducing the overall supply of the asset. Only the optional priority fee goes to the decentralized validators who secure the network.
  • Misconception: Setting a higher gas limit makes a transaction process faster. The gas limit is simply the maximum budget you allocate for a transaction. Increasing the gas limit beyond what the transaction actually requires does not speed up processing times; it only increases your safety margin. To speed up a transaction, you must increase the priority fee (the tip per gas unit), which makes the transaction more attractive to validators.
  • Misconception: Gas fees are determined by the size of the transaction's monetary value. The cost of gas is entirely independent of the amount of cryptocurrency being sent. Sending $1,000,000 worth of ETH requires the exact same 21,000 units of gas as sending $1 worth of ETH. Gas fees are determined solely by the computational complexity of the smart contract code and the real-time demand for network space.

How Gas Dynamics Connect to the Market

Gas fees serve as a real-time barometer for on-chain economic activity. During bull markets or high-profile token launches, intense competition for block space drives gas prices up, making Ethereum mainnet highly profitable for validators but expensive for retail users. Conversely, during periods of low market activity, gas prices can drop significantly.

The burning mechanism introduced by EIP-1559 also directly links network utility to the supply dynamics of ETH. When network demand is high and gas prices rise, more ETH is burned than is created through block rewards, making the asset deflationary. When demand is low, the issuance of new ETH exceeds the amount burned, making the asset inflationary. This economic feedback loop means that the rate of on-chain activity directly influences the circulating supply of the asset.

Questions this story raises

What is the difference between gas and Gwei?
Gas is the unit that measures computational effort, which remains constant for specific operations. Gwei is the denomination of currency (one-billionth of an ETH) used to price each unit of gas. The total fee is calculated by multiplying the gas used by the gas price in Gwei.
Why did my transaction fail but I was still charged a fee?
If a transaction runs out of gas before completing, the network must revert all changes to prevent errors. However, because validators still used computational power to process the transaction up to the point it failed, they must be compensated, meaning the fee is still consumed.
How do Layer 2 networks make gas cheaper?
Layer 2 networks process transactions off the main Ethereum chain, bundle them together, and post them back to Ethereum in a single compressed batch. This allows hundreds of users to split the cost of a single mainnet transaction.

References

  1. [1] Gas and Fees — Ethereum Foundation
  2. [2] EIP-1559: Fee market change for ETH 1.0 chain — Ethereum Improvement Proposals
  3. [3] EIP-4844: Shard Blob Transactions — Ethereum Improvement Proposals

Evergreen explainer written by Basis Desk's system and checked by an independent model pass for factual errors and advice language. Figures, fees and rules change — the references above are where to verify current specifics. Market figures marked "at the time of writing" come from live exchange data. Report an error: corrections@basisdesk.news · corrections policy.

Not financial advice. Basis Desk publishes information, not recommendations. Crypto assets are volatile and you can lose what you invest.