Mrig P also contributed to this article
When it comes to decentralized applications (dApps), there is one clear blockchain leader: Ethereum.
As the world's first, largest, and most widely used blockchain for DeFi, it hosts thousands of dApps that attract millions of users who conduct billions of dollars worth of daily transactions.
While these transactions differ in size, form, and nature, they all have one thing in common: they require users to pay gas fees. But what are gas fees and why are they necessary?
This article explains what Ethereum gas fees are, why they can be expensive, and how you can pay lower fees.
What are Ethereum gas fees?
Ethereum gas fees are the transaction fees users pay on the Ethereum blockchain to conduct transactions and execute smart contracts. Users pay this fee in Ether (ETH), while the network nodes earn a fraction of fees for validating transactions via Ethereum's Proof of Stake (PoS) consensus mechanism.
How are gas fees calculated?
To best understand how gas fees are calculated, we'll first need to clearly define a few terms.
1. Gas: Gas is the unit that measures computational power required to conduct a transaction, which varies depending on the complexity of the transaction. The computation and gas units needed for a simple token swap, for example, will be much lower than for minting an NFT or publishing a smart contract.
2. Gas price: The gas price is the price per unit of gas, and it is measured in gwei, a smaller unit of ETH that equals 0.000000001 ETH (10-9 ETH). (Conversely, 1 ETH equals 1 billion gwei).
3. Gas fees: Gas fees are the final fees paid by users to complete a transaction.
Now, let's see where these terms fit into the gas fee calculation formula.
Gas fee calculation before the London upgrade
The formula to calculate gas fees has changed since the London upgrade, which was implemented in August 2021.
Before the London upgrade, users had to make an assumption about their gas price based on network congestion, or how busy the network is at any given time. In doing so, every user tried to outbid as many other users as possible to try and get their transactions validated first.
The formula to calculate the gas fees before the London upgrade was:
Gas fee = Gas units (limit) * Gas price per unit
By default, the minimum gas unit you must spend on any Ethereum transaction is 21,000.
So, let's suppose Alice is sending 5 ETH to Bob. The gas unit is 21,000 by default and Alice chooses to pay 300 gwei per unit based on the current network conditions.
Going by the above formula, Alice would pay a gas fee of 21,000 * 100 gwei. Or 2,100,000 gwei, which equals 0.002093 ETH.
5.002093 ETH will therefore be withdrawn from Alice's crypto wallet. Bob will receive 5 ETH and the rest goes toward making the transaction successful.
Gas fee calculation after the London upgrade
The London upgrade implemented EIP-1559, which proposed a new mechanism to calculate gas fees with a fixed per-block base fee and flexible block size to tackle network congestion.
The goal of this upgrade was to remove the unpredictability of gas fees based on network traffic. The lack of surety forced users to try and outbid the gas prices of other users, consequently taking the gas prices even higher.
With a pre-defined base fee for every block, the guesswork is no more in the equation and the new formula is:
Gas fee = Gas units (limit) * (base fee + priority fee)
Now, let's suppose Bob wants to send 5 ETH to Alice. The gas limit is 21,000, the block fee at that instance is 30 gwei, and Bob adds a priority fee of 10 gwei for his transaction to be validated faster.
So, Bob would pay a gas fee equal to 21,000 * (30+10) = 840,000 gwei or 0.000839 ETH.
Here, the network burns the base fee, i.e. 21,000*30 gwei while the priority fee — 21,000*10 gwei — goes to the validator that adds the transaction to the chain.
While most cryptocurrency wallets automatically detect the demand and set the priority fee and gas limit by themselves, you can usually go to advanced settings to alter the numbers when finalizing a transaction.
Below is an example from MetaMask, one of the most common Ethereum wallets. In the screenshot, you can see the base price is 16 gwei and the wallet recommends a priority fee of 0.5 to 7 gwei. Further, the wallet also shows the estimated times for respective transaction fees, should you be willing to pay more for faster transactions.
It's important to note though that the London upgrade was not created to directly reduce gas costs on Ethereum. Instead, the aim was to limit the waste of gas due to uncertainty. This is but one of many examples of Ethereum upgrades designed to increase the efficiency of the network.
Why are ETH gas fees high?
It has not been rare for people to pay hundreds of dollars to execute simple swapping or buying transactions on Ethereum. That is especially the case when the demand is high, such as during the 2021 bull market.
But why?
While every blockchain strives to maintain three core attributes - security, scalability, and decentralization - it is only practical to maximize on two of these while compromising with the third one.
Ethereum co-founder Vitalik Buterin called this the blockchain trilemma.
Considering Ethereum's key features are decentralization and security, the network compromises with scalability. As a result, Ethereum can only process between 20 and 30 transactions per second, even after the Ethereum Merge. This has paved the way for Ethereum competitors like Solana to emerge, offering faster transaction speeds with lower gas prices.
You might be thinking, for a blockchain where users transact billions worth of value every day, that's an alarmingly slow transaction speed.
Now, when the network is busier than usual, there could be hundreds of transactions sent every second to the mempool — a waiting area for transactions. However, as we know, Ethereum validators can only validate 20-30 per second.
Naturally, validators prefer to select transactions with higher gas prices, to earn a higher commission for their work. Due to this, users keep trying to outbid other transaction requests to get their transaction included in a block first.
You can think of this as a blind auction, where users will make bids (in the form of gwei) to incentivize miners to pick up their transactions. Just like a traditional auction, the highest bids will be chosen. As a result, gas prices keep rising until the transaction volume drops.
Since the London upgrade, however (as we saw in the Gas Price Calculation section), the blind auction analogy is no longer valid. Now, the network defines a fixed base fee for every new block depending on the demand for transactions in the previous block.
While the base fee is enough for a transaction to go through, the users can still add a tip (priority fee) for validators to make their transactions go faster.
Note: During a popular NFT mint or other high network congestion activities, gas prices can still be exorbitant.
How does the Ethereum Merge affect gas fees?
For most of its existence, Ethereum relied on a Proof of Work (PoW) consensus algorithm to validate transactions and add them to the Ethereum blockchain.
In September 2022, however, the Ethereum mainnet merged with the Beacon chain, marking the event popularly called The Merge. With this, Ethereum transitioned from the Proof of Work consensus to Proof of Stake (PoS)
Contrary to popular belief, The Merge itself didn't actually aim to lower gas costs. And that is why it has so far had little impact on the gas fees Ethereum users pay.
However, Ethereum's switch to PoS was crucial for deploying sharding — a mechanism in which multiple side chains are deployed to offload transactions from the mainnet.
Ethereum will have 64 shard chains that will help significantly increase its scalability and transaction speed. According to Ethereum co-founder Vitalik Buterin, Ethereum will be able to process 100,000 transactions per second, though proto-danksharding and full danksharding may take years to be complete.
Higher scalability would mean potentially much lower network congestion. In theory, this means transactions will go through without any problem even during times of high volume.
Want to see live Ethereum price and market metrics? View our Ethereum Price page.
Frequently asked questions about ETH gas fees (FAQs)
What happens if you don’t pay enough gas fees?
Setting the gas price or gas limit lower than a certain required amount may result in failed transactions. If this occurs, the amount of gas would still get deducted from your wallet but the transaction wouldn't go through.
It may be a good idea to first check the minimum gas price at any given time across various Ethereum calculators to ensure your transactions don't fail.
How can I choose the correct gas price?
Ethereum's London upgrade has removed uncertainty from gas price calculations.
Now, whenever you conduct a transaction, there is always a base fee attached to it that the network decides and you cannot change. However, you can add a priority fee as a tip to validators and expect them to pick your transaction sooner.
The gas unit (and thus the gas fee) needed for different kinds of transactions is different. For instance, you will need to pay considerably more for complex transactions such as executing a smart contract.
Are there gas fees when buying Ethereum?
Depending where you buy Ethereum, you'll need to factor in gas fees when completing your purchase.
MoonPay Balances is a cheaper and faster way to purchase Ethereum (ETH) with higher approval rates. To get started, just top up your wallet in euros, pounds, or dollars and use your MoonPay Balance to purchase crypto like ETH. Plus, enjoy zero-fee withdrawals directly to your bank account when you decide to cash out.
How can I pay lower gas fees?
Even with fixed base fees, there's no certainty that the ETH gas fees will be low. It all depends on network congestion.
To avoid paying high gas prices, you can do any (or all) of these three things:
1. Plan ahead
Schedule your transactions for times with less network congestion. Try not to transact during popular NFT mints, as the network may get congested.
You can check future NFT drops on NFT rarity sites like Rarity Sniper and rarity.tools.
2. Adjust transaction fees in your wallet
Most Ethereum wallets like MetaMask will allow you to preview the estimated gas price and transaction costs that you'll pay. You can generally alter these numbers in the advanced gas settings within the wallet.
3. Use an external calculator
Several tools can show you what current gas prices look like. Some of these include:
To learn more about Etherscan and Ethereum block explorers, see our article What is Etherscan and how do you use it?
Buy Ethereum via MoonPay
Now that you understand how gas fees work on Ethereum, you may feel comfortable enough to experiment with the cryptocurrency yourself.
You can buy Ethereum (ETH) via MoonPay or through any of our partner wallet applications like MetaMask with a credit card, bank transfer, Apple Pay, Google Pay, and many other payment methods.
Sell Ethereum via MoonPay
MoonPay also makes it easy to sell Ethereum when you decide it's time to cash out. Simply enter the amount of ETH you'd like to sell and enter the details where you want to receive your funds.
Swap Ethereum for more crypto
Want to exchange Ethereum for other cryptocurrencies like Bitcoin? MoonPay allows you to swap crypto cross-chain with competitive rates, directly from your non-custodial wallet.