Introduction
A gas fee is something all users must pay in order to perform any function on the Ethereum blockchain. If spending $5 to receive $20 at an ATM can be frustrating, imagine spending $100 to send $500 or receive a PNG of a penguin.
While it might seem a steep example, that can sometimes be the case in order to send a transaction or perform a function on Ethereum’s network. And unlike the case with ATM fees, there’s no way the Ethereum network will refund you for your gas fees at the end of the month.
What is Gas?
Gas is the term for the amount of ether – the native cryptocurrency of Ethereum – required by the network for a user to interact with the network. These fees are used to compensate validators for the energy required to verify a transaction and for providing a layer of security to the Ethereum network by making it too expensive for malicious users to spam the network.
Even though they are an effective means of incentivizing network participants to keep verifying transactions and maintain network security, gas fees are nonetheless every user’s most hated part about Ethereum. People hate gas fees not only for a general disdain toward fees, but because they can be absurdly expensive when the network is congested.
So, let’s dive into what can make gas fees so expensive and what simple steps you can take to save money when interacting with Ethereum’s ecosystem.
How are Gas Fees Calculated?
In order to get an understanding of why gas fees cost so much and how you can save on them, it’s important to understand how they are calculated.
Because fees on Ethereum are usually much less than 1 ETH, Ethereum employs a metric system of denominated units called “wei,” where 1 ETH is equal to 1 quintillion wei. One of the most common wei denominations, and the one used to represent gas fees, is gigawei (gwei), or 1 billion wei. Therefore, when you check on a gas tracker and see that the average gas for a transaction is 100 gwei, that means you should expect to pay a base fee of 0.0000001 ETH for a given transaction.
Following the readjusted gas fee structures brought in by Ethereum’s London upgrade, the total fee is now calculated as:
Total Fee = Gas unit (limits) * (Base fee + Tip)
Let's break down each component:
- Gas units (limits): This refers to the maximum amount of gas you are willing to spend on a transaction. While you are able to adjust how much gas your transaction will cost, it’s important to do so carefully. That is because different types of interactions with the Ethereum blockchain will require different amounts of gas to complete.
- Base fee: This refers to the minimum amount of gas required to include a transaction on the Ethereum blockchain. The amount of gas required for a base fee is determined by the demand for a transaction to be included, regardless of what type of transaction it is. Because base fees are a factor of demand, they are dynamically adjusted based on the number of users interacting with the network at any given time.
- Tips: Also known as a priority fee, tips are an additional fee made to have your transaction completed faster. This fee provides an economic incentive for validators to confirm your transaction before others.
It’s important to note that if you set your gas unit limit below the amount of gas needed to complete your interaction, your transaction will be reverted but you wouldn’t receive your gas fee back.
To illustrate the total fee formula, let’s say that I am looking to send you 1 ETH and the average amount of gas required to transfer ETH is 23,000 units. I would set that as my gas limit. The base fee at the time is 150 gwei, but I want it to get to you faster so I add a tip of 20 gwei. The calculation would be:
Total Fee = 23,000 * (150 gwei + 20 gwei) = 3,910,000 gwei, or 0.00391 ETH
Why Gas Fees Cost So Much
With an understanding of how total gas fees are calculated, we can get a better idea on why gas fees cost so much. Mainly, the two biggest factors are the denomination in gwei and the variable total fee formula.
Gas Fees Cost More Because ETH Costs More
The first major reason why gas fees are costing more is simply that the price of ETH is higher. Recall that gas fees are denominated in gwei, which is a fractional unit of ETH. The main catalyst for this rising demand is the booming decentralized finance (DeFi) and NFT sectors, which continue to attract new users to Ethereum’s ecosystem.
Gas Fees Cost More Because Base Fees Cost More
Also, gas fees cost so much now because Ethereum’s total fee formula is dynamic. Base fees are adjusted by the demand for transaction inclusion. As a result, base fees have consistently increased as a result of increasing demand for the Ethereum blockchain.
There are thousands of decentralized applications (dapps) running on Ethereum, all competing to have their transactions included. This widespread adoption has not only led to higher base fees but also has made them much more volatile.
The shift to Ethereum 2.0, which transitions the network from proof-of-work (PoW) to proof-of-stake (PoS), promises to significantly improve transaction-processing capabilities and reduce fees.
How to Spend Less on Gas
While it is impossible to avoid paying for gas when using the Ethereum blockchain, there are at least some ways to make them less burdensome.
Pick the Right Time and Be Patient
To reduce the cost of your total gas fee through a lower base fee, you could make your transaction on the network at a time when fewer people are using the blockchain. Gas fees are higher when more work is required to interact with the Ethereum network. Weekends are usually the best time for that.
Another method is by reducing your tip. If your transaction isn’t time-sensitive and you are willing to be patient, reducing your priority fee can be an additional way to spend less on gas.
Set a Max Fee Limit on Your Transaction
Setting a max fee for gas is a way of telling the Ethereum blockchain the maximum amount you are willing to spend. Once the transaction is completed, the network will refund the remainder of the max fee that wasn’t used. This can provide peace of mind that you will not be paying more than you need to.
👉 View real-time gas fee tools
Layer 2 Scaling Solutions
Finally, you can spend less on gas by interacting with the Ethereum blockchain via a layer 2 scaling solution. These are extensions of the Ethereum network that aim to increase transaction speed and throughput. Some popular examples include Arbitrum, Optimism, and Polygon.
Layer 2 solutions handle transactions off-chain before submitting a summary to the main Ethereum chain. This reduces the number of gas units required to complete a transaction and eases network congestion, leading to an overall lower base fee for all users.
Frequently Asked Questions
What exactly is a gas fee?
A gas fee is a payment users make to execute operations on the Ethereum blockchain. It compensates network participants for the computational resources required to process and validate transactions, ensuring the network remains secure and operational.
Why do Ethereum gas fees fluctuate so much?
Gas fees are highly dynamic and primarily fluctuate based on network demand. When many users are trying to transact simultaneously, the competition for block space increases, driving up the base fee. This is similar to surge pricing on ride-sharing platforms.
Can I get a gas fee refund if my transaction fails?
No, you cannot get a refund. If a transaction fails because the gas limit was set too low, the fee is still paid to the validators for the computational work they performed in attempting to process it. This is why setting appropriate gas limits is crucial.
What is the difference between gas limit and gas price?
The gas limit is the maximum amount of computational work you are willing to pay for a transaction. The gas price (often in gwei) is the amount of ETH you are willing to pay per unit of gas. The total fee is the gas limit multiplied by the gas price.
How does Ethereum 2.0 aim to reduce gas fees?
Ethereum's upgrade to a proof-of-stake consensus mechanism, along with the implementation of sharding, is designed to dramatically increase the network's transaction capacity. This increased throughput should alleviate congestion and, consequently, lead to lower base fees for users.