UNDERSTAND BEFORE USING
Gas fees: calculation, gwei and failed transactions
THE SHORT ANSWER
On Ethereum, execution fees equal gas used multiplied by the effective gas price. Gas is a quantity of resources; gwei is a small unit of ETH used to express its price. Cost depends on the operation and network conditions.
Two people send the same amount of ETH but pay different fees. The amount transferred is not the only factor: the operation performed and the resource price at inclusion also matter.
Gas is not a currency
Gas counts execution resources. Gwei expresses an ETH price: 1 gwei equals 0.000000001 ETH. Distinguish a quantity of gas from a price per unit.
A simple operation uses fewer resources than a complex contract swap. These concepts concern Ethereum and networks using a comparable model; Bitcoin fees are calculated differently.
A calculation using hypothetical numbers
Suppose an operation uses 21,000 units at an effective price of 10 gwei per unit. The fee is 21,000 × 10 = 210,000 gwei, or 0.00021 ETH.
These numbers illustrate the calculation, not a current quote. A more complex operation, programmable account or different network may consume a different amount. Converting to euros also requires the ETH exchange rate at the relevant time.
Price, tip and limit are different
For an EIP-1559 Ethereum transaction, the effective price combines the block’s base fee and a priority fee, within the accepted maximum. The base fee is burned; the priority fee goes to the block proposer.
The gas limit bounds the amount of gas allowed. The maximum price per unit is not necessarily the amount actually paid. A wallet shows an estimate; the transaction receipt records gas used and the effective price.
Why pay for a failed operation?
A transaction included and then reverted during execution has already used resources. State changes can be reversed while fees for work performed remain payable.
A request rejected in the wallet or before inclusion is a different case. Check the status on the correct explorer, not only the interface’s message.
Compare total cost
A swap can add protocol fees and incur slippage. A platform withdrawal can add provider charges. A layer 2 can charge for execution and for publishing data to Ethereum.
- Read the total amount and minimum received before signing.
- Separate network fees from service charges and spread.
- Keep the required fee asset on the network used, unless a third party explicitly covers fees.
- Do not switch networks solely on a quoted price: examine risks, bridges and the cost of returning.
Sources and further reading
- Ethereum.org — Gas and fees · in English
- EIP-1559 — Fee market · in English
- Ethereum.org — Transactions · in English
- Ethereum.org — Optimistic rollups · in English
Page updated on
Documentation checked on · WhyTheBlockchain · Editorial approach