August 9, 2022
Victoria Rudi

What Are Gas Fees?

You must pay a gas fee each time you complete a transaction on the blockchain. What’s that, you might be asking? Let’s answer this question by defining first what’s gas in the context of blockchain technology.

(Hint: No, it has nothing to do with the gasoline you put in your car.)

→ What’s gas?

Each blockchain computation, such as buying or selling, happens thanks to the miners’ work and the computer power they use to verify and execute the transactions. The gas fee is an incentive for miners, which motivates them to provide continued support to blockchain computations.

According to an Ethereum article:

“Gas refers to the unit that measures the amount of computational effort required to execute specific operations on the Ethereum network. Since each Ethereum transaction requires computational resources to execute, each transaction requires a fee. Gas refers to the fee required to conduct a transaction on Ethereum successfully.”

Also, the same article highlights that the gas fee helps secure the blockchain network. Having a fee for each computation prevents bad actors from spamming the network.

It’s worth noting that most blockchain networks require users to pay a fee for computational actions.

→ On what depends on the gas fee?

When making a transaction on the blockchain, you can choose between three confirmation speeds:

  • Fast: The transaction can be confirmed almost instantly.
  • Medium: It may take a few minutes to approve the transaction.
  • Slow: The transaction may take a few hours until completed.

The gas fee, across three speeds, may depend on how many people are making transactions at a certain time.

Just think about it: The miners must choose between a pool of transactions to process. Considering the incentives, they’ll obviously choose to process the transactions with a higher gas limit. In other words, those who pay a higher gas fee will have their transactions executed faster than those who submitted a lower gas limit.

The fee model is based on auction, as the users who want the miners to pick their transactions first will pay more in the gas fee.

The gas fee depends on the demand for resources on the network. In other words, the higher the number of users who want to execute a transaction, the higher the gas fee limit.

→ How gas fee is calculated?

To answer this question, let’s take Ethereum as an example. On Ethereum, gas is calculated in Gwei.

Gwei is a small denomination of Ether, similar to Satoshi, a small denomination of Bitcoin.

1 Gwei = 0.0000000001 ETH

To calculate the gas fee, we need to know the following elements:

  • The gas cost: This number doesn’t change. Each type of computation costs a certain amount of gas. For example, on Ethereum, a transaction costs 21,000 gas.
  • The gas price: The higher it is, the faster the transaction will be executed. For the sake of the example, the gas price is 100 Gwei.
  • The price of Ethereum at the moment of the transaction: Ethereum is currently at $1,669. Take into account that this number changes all the time.

The gas fee is calculated using the following formula:

21,000 gas (the gas cost) X 100 Gwei (the price of gas) → 21,000 x 0,000000100 ETH = 0.0021 ETH

Next, we have to convert the 0.0021 ETH into USD.

At the moment of this calculation, (considering the price of Ethereum) 0.0021 ETH equals $3,5.

In other words, for a transaction, you’ll have to pay $3.5.

If you’re curious about the current gas price, check the ETH Gas Station website.

To keep your gas fees low while getting your computations executed fast, make sure to transact when there’s less demand on the blockchain. Usually, this happens very early in the morning or late at night.