What is Ethereum Gas Fee and How it Works?

Jennifer Brown
@jenniferimaddi1

Being an integral part of Ethereum blockchain, gas fee becomes a matter of concern for its users. Amid Ethereum’s struggling position, the recent average gas fee drop has surprised the users. It fell down, the lowest level in the last five years, to $0.05 per transaction, sitting at 0.808 gwei.
Users have to pay fees while transferring funds, swapping tokens, using decentralized apps, or running smart contracts. Blockchain fees go to miners and validators who process transactions and keep the network secure.
Most blockchain networks such as Binance Smart Chain, Solana, and Avalanche have their own fee system. The fee tends to change based on various factors. The cost varies based on network traffic, transaction type, and current demand.
In this article, we will understand Ethereum gas fee, how gas fee works and the factors that affect it. Also, learn how it is calculated using different formulas.
What is Ethereum Gas Fee?
It is the transaction fee that users pay to conduct transactions and execute smart contracts. Ethereum’s native coin is Ether (ETH), and all the transaction fees are paid using ETH.
Because running the Ethereum network requires resources like processing power, the gas fees must be paid. The fees are paid to the users, who by Ethereum staking lock them up so that they can’t trade or sell ETH. In return, they are rewarded with transaction fees generated on the network.
Gwei, short of gigawei, is the unit of measurement in the Ethereum blockchain. Gwei is a denomination of the cryptocurrency ether, the digital coin used on the Ethereum network. 1 Gwei is equivalent to one billionth of an Ether.
Factors Affecting Gas Fee
There are various factors that affect gas fee on the Ethereum network. They are:
Transaction Complexity
This refers to the complexity of operations that determine their gas fees. Transactions involving extensive computations or interactions and complex smart contracts, consume more gas, resulting in higher gas fees.
Base Fee
The base fee is a mandatory component of the gas fee, dynamically adjusted based on network congestion. It is the reserve price below which a transaction cannot be processed.
Priority Fee
This is a voluntary incentive to speed up transaction processing. The base cost and optional tip are added together, and the total is multiplied by the quantity of gas consumed to calculate total Ethereum gas fees.
Network Congestion
It often plays a key role in gas price hike as more people want to send transactions than Ethereum’s capability at a time. This leads users to pay higher priority fees for quicker transaction execution.
How does ETH Gas Fee Work?
Let’s say you wish to purchase Ethereum for your cryptocurrency wallet. Below given is a detailed procedure that demonstrates the working of ETH gas fee.
Step 1: Start Transaction
Start with a transaction from your wallet. You would need to enter the amount you want to send to another wallet address. You can use the Metamask wallet to initiate the Ethereum transaction.
Step 2: Approve Estimated Gas Fee
After filling the transaction details, you can get an estimate of the gas fees. In order to recommend a gas tax that strikes a balance between cost and transaction speed, the wallet will automatically assess the current gas fees and network demand. You can submit the transaction for processing if the projected gas fee is acceptable.
Step 3: Ethereum Receives Transaction
Now, the Ethereum network receives your ETH transaction. There is a cap on the total amount of gas fee you are willing to spend. It is based on the information in the purchase order.
Step 4: New Block by Proof-of-Stake Validator
By choosing which transactions to verify, Ethereum network validators create new blocks for the Ethereum blockchain. Since they are lucrative for validators, transactions with the highest gas fees are usually chosen first. Once your transaction is incorporated into a block, and the block is added to the blockchain, it is typically regarded as completion of process.
Step 5: Balance Updated in Wallet
Once your transaction has been broadcasted to the blockchain, the gas fee is deducted. You can now check your updated Ethereum balance.
How Gas Fee is Calculated?
After the London upgrade, which took effect in August 2021, the gas pricing formula was changed significantly. Users were forced to estimate their petrol price prior to the London update based on network congestion. In an attempt to get their transactions approved first, the users may outbid each other.
Formula used to determine petrol fee before the London update:
Gas Fee = Gas Units (Limit) \* Gas Price Per Unit
The minimum gas unit required for any Ethereum transaction is 21,000 by default.
Scenario 1
Assuming Alice is sending Bob 5 ETH and decides to pay 300 gwei per unit of gas, which is 21,000 by default.
As per the formula, Alice would have to pay 21,000*300 gwei for gas. And 6,300,000 gwei is equivalent to 0.006 ETH.
Thus, 5.006 ETH will be taken out of Alice’s cryptocurrency wallet. Total 5 ETH will be given to Bob, and 0.006 ETH will be used to complete the transaction.
Calculating Gas Fee after London Upgrade
In order to address network congestion, the London upgrade incorporated EIP-1559, which suggested a new method of calculating gas fee with a set per-block base fee and configurable block size.
Removing the unpredictability of gas fee on network traffic was the aim of this development. By making gas fees more predictable, users could better estimate the cost of transactions and avoid unexpected high fees.
As per the new formula:
Gas Fee = Gas Units (Limit) \* (Base Fee + Priority Fee)
Calculating Gas Fee after London Upgrade
Scenario 2
Let us assume that Bob wishes to send Alice 5 ETH. In this case, the block charge is 30 gwei, the gas limit is 21,000, and Bob adds 10 gwei priority fee to expedite the validation of his transaction.
Bob would, therefore, have to pay 21,000 * (30+10) = 840,000 gwei, or 0.000839 ETH, for gas.
In this case, the network burns the base cost, which is 21,000 _ 30 gwei, and the validator that adds the transaction to the chain receives the priority fee, which is 21,000 _ 10 gwei.
When completing the transaction, you can access advanced settings to change the figures, even though the majority of Bitcoin wallets automatically determine demand and set the gas limit and priority fee on their own.
Calculating Gas Fee Post-Dencun Upgrade
The Dencun upgrade was activated in March 2024, with the goal of reducing gas fee for the use of Layer 2 (L2) networks that exist within Ethereum. This change was intended to introduce solutions that effectively speed up data processing by using temporary storage at a lower cost.
While the fundamental formula for calculating gas fee remains same:
Gas Fee = Gas Units (Limit) \* (Base Fee + Priority Fee
The Dencun upgrade impacts the base fee element, with emphasis on L2 transactions in particular. By storing data segments collectively, L2-based solutions can greatly reduce the cost of data storage in the Ethereum Mainnet, making the base fee considerably lower for these transactions.
The main reason for the reduction is lowering down the data storage cost as a result of the use of ‘blobs’. It enables L2s to post their transaction data more efficiently on the Ethereum mainnet.
Conclusion
Ethereum gas fees are the transaction costs required to process and validate operations on the Ethereum blockchain. These fees fluctuate based on network demand and the complexity of the transaction. The higher the demand and traffic, the higher the fees. Similarly, the lower the demand and traffic, the lower the fees.
You pay the validators for their electricity and computational power to execute the transaction faster. Users are given small payments as a reward to stake their ETH.