What is Gas Fee?

Gas Fee is the gas consumed by users to pay miners to perform specific actions (such as executing contracts or sending tokens) in blockchain verification. Every transaction on the blockchain consumes computing resources, and miners must bear these costs. Therefore, in order to reward miners, users need to pay a fee, which is the so-called Gas Fee.

Gas Fee usually consumes different tokens depending on the blockchain network used. For example, Ethereum consumes ETH, BNB chain consumes BNB... and so on.

Fees are charged by miners for conducting any transactions on the blockchain, executing smart contracts, launching DApps and paying for data storage. Miners confirm transactions and determine which transactions go into new blocks. Fees are calculated regardless of whether the transaction is successful or unsuccessful. This is because even if it fails, miners must verify and execute the transaction (verification), which will incur computational costs.

The role of Gas Fee

The payment of Gas Fee can ensure the operation of the blockchain network, giving miners incentives to perform calculations, and can also be used to prevent malicious transactions. However, this often results in high gas fees when the network is congested, causing trouble in use.

Why does Gas Fee fluctuate?

The amount of Gas Fee is determined for two reasons:

  • The complexity of the behavior (may produce multiple transactions at once)

  • network congestion

behavioral complexity

The complexity of the transaction or contract will affect the final Gas Fee. The more complex the behavior (such as multiple transactions during the contract process), the more likely it is to generate high Gas Fees.

network congestion

When the blockchain network is congested, there will be a large number of transactions waiting to be processed on the chain. At this time, the Gas Fee will rise because miners will tend to prioritize transactions that pay more Gas Fee to obtain more rewards.

How much is the gas fee?

Taking sending ETH on Metamask as an example, we can see the current estimated handling fee for the transaction in the transaction confirmation screen, and can choose whether to increase the transaction speed with a higher Gas Fee based on the preset options.

After the transaction is sent, we can use Etherscan to check the final gas fee generated by the transaction. Just enter the Transaction Hash of the transaction in the search bar to check.

Transaction fee (Tx Fee) = Gas Limit * Gas ​​Price

What is Gas Price?

Gas Price is how many tokens you are willing to pay for each unit of Gas. Taking Ethereum as an example, Gwei is generally used as the unit Gwei=0.000000001 ETH, so the Gas Price is set to 20 Gwei, which is equal to Gas Price=0.00000002 ETH.

If you want transactions to be verified and packaged by miners faster, the Gas Price needs to be adjusted as high as possible, but if you want to spend less, you can achieve this by lowering the amount you pay per unit of Gas. So the price paid per unit will increase or decrease the mining speed of the transaction.

MyEtherWallet officially teaches how to break through the Gas Price limit

What is Gas Limit?

Gas Limit is called Limit and is the maximum number of Gas units that are willing to be spent on a transaction. This avoids errors in the contract. However, if you don't want to spend too much on gas, lowering the Gas Limit won't help much. Traders must include enough Gas to cover the computing resources used, otherwise the transaction will fail with Out of Gas.

The handling fees consumed will also be deducted and used as rewards for miners. And if the transaction has been completed and the gas consumed has not reached the Gas Limit, only the gas actually consumed will be charged. In other words, the maximum handling fee charged for a transaction is Gas Limit * Gas ​​Price.

*The Gas Limit for general standard transactions is 21,000.

Transaction fee (Tx Fee) = Gas Limit * Gas ​​Price

Using a car's refueling as a simple analogy, Gas Limit refers to how many liters of oil a car requires. Gas Price, regarded as the price per liter of oil. If you need to drive from Taipei to Kaohsiung, it takes 21,000 liters. Each liter is 20 yuan, so the cost of gas is 21,000 liters * 20 yuan = 420,000 yuan.

The ETH transaction fee is 21,000 (Gas Limit) * 20 Gwei (Gas Price) = 420,000 Gwei. Therefore, the transaction fee Tx Fee = 420,000 * 0.000000001 ETH = 0.00042 ETH

Gas Fee Summary

This article briefly introduces the Gas, Gas Price and Gas Limit of the blockchain network, and how to calculate transaction fees. In summary, if the transaction is urgent, you can set the Gas Price higher, so that it can be verified before other transactions with lower Gas Pricer. If you are not in a hurry, you only need to set a sufficient Gas Price and you can start verifying the transaction.

 

This article What is Gas Fee? Let you know how to set and calculate Gas Fee. First appeared in Zombit.