What is Gas fee?

As the Ethereum network is a decentralized blockchain with no singular entity or authority overseeing its operation, a mechanism is put in place to avoid the network from being congested or spammed with transactions and that is by charging senders of transactions with a small fee called "gas fee" of which is then used to reward miners who validate transactions in the network.

This fee is in the form of Ether (ETH) which is also used in the Ethereum network to facilitate value transfers, mining payouts, and smart contract executions.

How gas fee works is similar to how gas/fuel works for our vehicle. In order to get from Point A to Point B, the vehicle needs to be filled up with a sufficient amount of fuel first.

Similarly, for a transaction in the Ethereum network to be successful, the sender must provide a reasonable amount of gas fee.


How To Provide Gas Fee For A Transaction?

The gas fee is deducted from the remaining ETH balance of your address and not from the amount of ETH or ERC tokens that you are sending. Also, the gas fee is deducted automatically concurrently with your transaction in a single event so you do not have to worry about forgetting to pay the gas fee.

For example, let say, you have 10 ETH in your address and you are looking to send 1 ETH to a friend of yours. The gas fee for the transaction is (for the sake of setting an example) 0.5 ETH. From such, your friend will get that 1 ETH while the gas fee of 0.5 ETH is deducted from your balance. Both the 1 ETH and 0.5 ETH will be deducted in one single transaction hash simultaneously. And once this transaction is successful, your address should have 8.5 ETH left.


How To Set/Calculate Gas Fee?

Depending on the wallet that you use, you may or may not be able to set the gas fee manually. However, in setting up the gas fee, there are two variables to it to mind.

Gas Price: As to how petroleum fuel is priced (price per litre, e.g.: $1/litre), gas price is the price of a unit of gas that we are willing to pay for the transaction. (Gas price is calculated in GWEI, 1 GWEI is 0.000000001 ETH)
Gas Limit: Moving along with the petroleum fuel comparison, the gas limit is how much gas that we are willing to allocate for the transaction.

In conclusion, Gas Fee = Gas Price x Gas Limit

As an example, let say, the price of petroleum fuel is $1 a litre and we are estimating that 10 litres of it would be enough for our trip, we will then allocate 10 litres of $1/litre fuel for the trip, which will amount to a total sum of $10 that we need to have prepared for fuel.

Similarly, if we set the gas price at **1 GWEI** and the _gas limit_ at **21,000**, in the end we will have to have at least **0.000021 ETH** (gas price x gas limit / 0.000000001 x 21000) inside of our wallet to pay for the transaction's gas fee.

Do take note that for a normal transaction, a gas limit of 21,000 is often enough. But for a transaction that involves interacting with a smart contract, 21,000 is not enough. If you are interacting with smart contracts, please set a higher gas limit.


How Much Is Enough?

As gas fee is ultimately used as an incentive for the miners in the Ethereum network, the answer to this question can never be one objective figure. This is because gas fee is subject to the congestion of the blockchain at any given time. In times of higher congestion, you would usually need to set a higher gas fee than times of normal congestion.

So, to tackle the subjectivity of gas fee, we have a feature called **Gas Tracker** which you can refer to [here](https://etherscan.io/gastracker) that analyses the traffic of the blockchain and suggests the most recommend gas price for a transaction at that time.


Out of Gas

If your transaction failed due to an 'Out Of Gas' error, kindly refer [here](https://etherscancom.freshdesk.com/support/solutions/articles/35000071618-transaction-marked-fail-why-).

 

**Always remember to have a little extra ETH than you need inside your address.**
Regardless of whether you are sending ETH or ERC tokens, please take note that the gas fee is always in the form of ETH and so it is always wise to keep a little extra ETH inside your address for gas purposes.


 

Still need some help? Contact Us