Technology

Ethereum Gas

JavaScript frameworks make development easy with extensive features and functionalities. Here are our top 10 to use in 2022.
Written by
spydraadmin
Published on
January 1, 1970

To prevent people from spamming the network with endless transactions, every cryptocurrency requires a small fee to send coins along its blockchain. These fees also help provide an incentives for people to mine crypto, as the fees are typically paid to miners who validate transactions.

While sending ETH from one Ethereum wallet to another also requires fees. The Ethereum network allows applications to run on its blockchain, giving an ETH transaction fee an added type of utility. Because ETH fees power applications that run on Ethereum, these fees are sometimes referred to as Gas.

What Is ETH Gas?

On Ethereum, the term “Gas” is used to describe a unit of measurement for the amount of computational power needed for executing specific operations on the network. Because every Ethereum transaction consumes computational resources, transactions come with a cost. Gas is the fee needed to conduct an Ethereum transaction.

Ethereum fees can only be paid in Ether (ETH), the native currency of Ethereum. ETH Gas prices are denominated in a unit known as gwei, which is a term used to refer to an amount of ETH equal to 0.000000001 ETH.

How Does Ethereum Gas Work?

Ethereum underwent an upgrade in August 2021 known as the London Upgrade, which altered the way that ETH Gas fees are calculated.

Pre London Upgrade

Before the London Upgrade, ETH Gas worked like this:

  1. Assume Alice wants to pay Bob 1 ETH. The Gas limit is 21,000 units while the Gas price is 200 gwei.
  2. The total fee is calculated as: (Gas units (limit) x Gas price per unit). In this example, that would equate to: 21,000 x 200 = 4,200,000 gwei or 0.0042 ETH.
  3. When Alice sends the ETH, 1.0042 ETH is taken from her wallet. Bob receives 1.0000 ETH. An Ethereum miner receives 0.0042 ETH.

Post London Upgrade

The London Upgrade was introduced to make Ethereum’s fees more predictable for users. It also introduced a burn mechanism into Ethereum, which is intended to offset the issuance of new ETH (there is no limit to how many ETH can be minted).

As of this upgrade, each block has a base fee, which is calculated by the network based on the current demand for block space. This base fee gets burnt (destroyed), so users are now expected to include a tip or priority fee with each transaction — the higher the tip, the hope is, the more the transaction will be prioritized. This tip provides compensation to miners and the expectation is that most crypto wallets will integrate a feature that sets the tip fee automatically.

After the London Upgrade, Gas works like this:

  1. Assume Alice wants to send Bob 1 ETH. The Gas limit is 21,000 units, the base fee is 100 gwei, and Alice includes a tip of 10 gwei.
  2. The new formula is: Gas units (limit) x (Base fee + Tip). This can be calculated as 21,000 x (100 + 10) = 2,310,000 gwei or 0.00231 ETH.
  3. When Alice sends the ETH, 1.00231 ETH will be subtracted from her wallet. Bob will receive 1.0000 ETH. A miner will receive the tip of 0.00021 ETH. 0.0021 ETH will be burned.

Alice also can set a max fee for the transaction.

The difference between the max fee and the actual fee will be refunded. This allows users to set a maximum amount to pay for transactions without having to worry about overpaying. This makes things more predictable, as, under the old transaction fee model, fees could wind up being higher than anticipated during times of extreme network congestion.

Average ETH Gas Prices

According to ycharts.com, the average Ethereum Gas price is about 131.87 gwei at the time of writing in late October 2021. Over the course of the past 12 months, this price has gone as high as 373.80 gwei and as low as 15.80.

From late 2018 through mid-2020, Gas prices tended to be within a range of 15-30 units. In July 2020, prices spiked as high as 709.71.

Gas1.png
Gas2.png

How Do Ethereum Gas Fees Relate to Transactions?

The way Ethereum Gas fees relate to transactions is pretty simple: Each transaction requires a fee to be paid to miners as an incentive for processing the transaction. The general concept is not unlike that of other cryptocurrencies.

The only difference with ETH Gas is that because the Ethereum Virtual Machine (EVM) is also a state machine, additional Gas fees are required for more complex transactions, such as those involving smart contracts.

What Is the Ethereum Gas Limit?

The standard limit on an Ethereum Gas fee is 21,000 units. The Ether Gas limit refers to the maximum amount of Gas a user can consume to conduct a transaction. Transactions involving smart contracts are more complicated, requiring more computational power to execute. So these transactions need a higher Gas limit than simpler transactions like sending payments.

Setting a Gas limit too high is fine — the EVM will refund what doesn’t get used. But setting a Gas limit too low could result in a user losing some ETH and having their transaction declined.

If a user were to place an Ether Gas limit of 50,000 for an ETH transfer, for example, the EVM would consume 21,000 and refund the remaining 29,000. But if someone were to set a Gas limit of 20,000, and the transaction was to require 21,000 units, the EVM could consume 20,000 Gas units as it tries to fulfill the transaction, but the transaction won’t complete. In this case, the user would hold on to the ETH they tried to send, but their 20,000 Gas units would be lost because the EVM consumed it trying to complete the failed transaction.

What Is the Benefit of a Gas Fee?

The benefit of an ETH Gas fee post-London Upgrade is that users can better anticipate what their total transaction cost will be. They can also send higher tips to miners to prioritize their transactions. This can be useful when someone wants to send money right away and doesn’t want to wait too long for the transaction to confirm.

Another benefit of an adequate ETH Gas fee is that it ensures a transaction will be accepted by the network. Too low of a fee can result in a transaction being rejected, in which case a user could lose the Gas they spent and not have their transaction go through.

Reducing ETH Gas Costs

Developers hoped that the London Upgrade might reduce Gas costs, but so far the data doesn’t support this.
Individual users have little to no control over their Gas costs, as the fee is determined by the current state of the network. Because block space is limited, the more transactions that are taking place at any given time, the more competition there will be for transactions in each block. This results in higher fees as users compete to have their transactions confirmed, bidding Gas prices upward.

That said, there are some ways individuals can try to reduce Gas fees.

• Stick to weekend transactions: Typically, gas prices are higher during weekdays and lower on weekends.

• Initiate transactions at off times: Those who follow gas prices carefully have noticed that the least busy time is between midnight to 4 AM EST.

Conclusion

Depending on the purpose of the transaction, Gas can be used toward smart contract functionality or simply sending ETH or ERC-20 tokens over the Ethereum network. Gas fees vary according to how much activity is on the network at any given time, and thanks to the London Upgrade, users can add more generous tips to help prioritize their transactions.

Latest posts

Subscribe to Our Newsletter

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.