entekhab.netentekhab.nettrilingual encyclopedia

Gas Fee

ENGLISHGas Feereference
فارسیکارمزد گسRecommended equivalent
کوردیکرێی گازRecommended equivalent
Category
Blockchain
Level
Professional

Simple definition

What you pay a blockchain to run your transaction. It depends on how much work the transaction asks for and how busy the network is, not on how much value you are sending.

Professional definition

On Ethereum, the gas a transaction consumes multiplied by the price paid per unit of gas. Under the current fee market that price is a protocol base fee, which adjusts with how full recent blocks were and is burned, plus a priority fee paid to the block proposer.

Technical definition

Gas meters computation, storage and data rather than elapsed time, so identical transfers cost the same while contract calls vary with execution path. The base fee moves by a bounded step each block toward a target gas usage, which smooths prices but cannot clear a sustained demand spike. A sender's gas limit caps spend and unused gas is returned, yet a transaction that reverts still pays for the work done. On rollups the dominant term is the cost of posting data to the base layer.

Academic definition

The price paid for consuming a blockchain's metered execution resources, determined jointly by the resource units a transaction consumes and a per-unit price set by protocol rule and prevailing congestion.

Mechanism

Two things are being priced at once: how much of the block a transaction occupies, and how much everyone else wants the same space. The protocol fixes the first with a published cost table and lets the second float, so the base fee rises automatically when blocks run full and decays when they do not. Users bid only on the priority component.

In practice

Who uses it
Anyone sending an on-chain transaction, wallet developers writing fee estimators, and contract authors optimising for execution cost.
Why it matters
It is the direct cost of using a chain, and on congested networks it can exceed the economic value of the action being taken.
Limitations
Estimators forecast the next blocks' base fee and can be wrong. Rollup fees include a base-layer data component the user cannot influence.

Common mistakes

  • Expecting the fee to scale with the amount being sent.
  • Assuming a failed transaction costs nothing.
  • Setting a gas limit so low that the call reverts and the fee is still paid.

Examples

numeric

A plain transfer consumes 21,000 gas. With an illustrative base fee of 20 gwei and a priority fee of 2 gwei, the sender pays 21,000 times 22 gwei, which is 0.000462 ETH.

Given
  • gas used = 21,000 (Ethereum's fixed cost for a simple value transfer)
  • base fee = 20 gwei per gas (illustrative)
  • priority fee = 2 gwei per gas (illustrative)
Steps
  1. price per gas = 20 + 2 = 22 gwei
  2. fee = 21,000 x 22 = 462,000 gwei
  3. 462,000 gwei = 0.000462 ETH
0.000462 ETH, of which the base-fee portion is burned

Gas used is a protocol constant for this operation; the gwei prices are illustrative and move block to block.

everyday

Gas behaves like a metered taxi. You pay for distance covered, at a rate that rises in rush hour, and a journey that breaks down halfway is still charged for the distance already driven.

Mathematical foundation

F = G_{used} \times (f_{base} + f_{prio})

Variables

FTotal fee paid for the transactionETH
G_{used}Gas units actually consumed by executiongas
f_{base}Protocol base fee per unit of gas; this portion is burnedgwei per gas
f_{prio}Priority fee per unit of gas, paid to the block proposergwei per gas

Procedure

Estimate the gas the call will consume, from the protocol's cost table or a simulation. Add the current base fee to the priority fee you are willing to pay. Multiply. Set a gas limit above the estimate: unused gas is refunded, but running out reverts the call and the work done is still charged.

Worked example

Given
  • G_used = 21,000
  • f_base = 20 gwei per gas
  • f_prio = 2 gwei per gas
Steps
  1. f_base + f_prio = 22 gwei per gas
  2. F = 21,000 x 22 = 462,000 gwei
  3. 462,000 gwei / 1,000,000,000 = 0.000462 ETH
F = 0.000462 ETH

Interpretation

The result is a cost of execution, independent of the value moved. It rises with the complexity of the call and with congestion, so the same action can cost very different amounts at different times.

Assumptions

  • The formula describes Ethereum's current base-fee market. Before that reform the fee was gas used times a single gas price, all of it to the miner.
  • Gas used is known exactly only after execution; before sending it is an estimate from the cost table or a simulation.
  • The 21,000 gas figure applies to a plain value transfer only; contract calls depend on the code path taken.
Limits of the formula
  • It prices execution, not value transferred, so it is regressive for small payments.
  • On rollups a further component covers posting data to the base layer, and that term is outside the sender's control.
  • Other chains meter resources differently, so the identity does not transfer unchanged.

Related terminology

related
Mempool Layer 2 Blockchain Smart Contract Proof of Stake Slippage
Commonly confused with

Slippage

A gas fee is paid to the network for executing a transaction at all. Slippage is the difference between the price expected and the price received. A swap can succeed on gas and still lose on slippage.

Sources

Blocks
Ethereum Foundation Developer Docs · block gas target, gas limit and base fee adjustment
https://ethereum.org/developers/docs/blocks/ URL verified
Ethereum Glossary
Ethereum Foundation · entries for gas, gwei, base fee and priority fee
https://ethereum.org/glossary/ URL verified

Editorial status

Draftconsensusv1.02026-11-03

Written, not yet reviewed.

Everything here is Ethereum-specific: the 21,000 gas transfer cost, the burned base fee and the priority component are that protocol's rules, and chains that use the word gas differently are not described. Gwei prices in all examples are illustrative, never observed. Fee-market parameters have changed before and may change again, so the mechanism rather than any number is the durable part.