Gas fees are the payments individuals make to complete a transaction on a blockchain. These fees are used to compensate blockchain miners for the computing power they have to use to verify blockchain transactions. They are typically paid in the blockchain’s native cryptocurrency. While the act of paying for gas is a given (you can’t perform blockchain transactions without it), the price of gas itself is highly volatile and dependent on a multitude of factors.
The two main factors for each blockchain are block time (the time required for the respective blockchain to generate new blocks) and transaction throughput (how many transactions a single block can process). Generally speaking, the faster blocks are generated and the more transactions they can hold, the less block-space competition there will be. This results in cheaper transaction fees for all network users.
Let’s compare the block time and size of Bitcoin, Ethereum, and Solana.
Bitcoin’s block time is around 10 minutes and with a maximum block size of 1 MB, each block can process anywhere from 500 to 4,000+ transactions depending on the transaction size.
Solana has a block size of .4 seconds and a throughput of 20,000 transactions resulting in extremely low gas fees.
Meanwhile, Ethereum has a block time of 13 seconds and a block size of around 70 transactions. Despite Solana’s gas fees being close to $.000025 per transaction (nearly 60,000 times less expensive than Ethereum), Ethereum is still by far and away from the most popular blockchain for NFTs, DeFi, and other Web3 activity. With this small of a block size and such high network usage, it’s easy to see why Ethereum’s gas fees have gotten out of hand.
How are Ethereum gas fees calculated?
To understand how Ethereum gas is calculated, we must first understand the concept of gwei. Gwei is a very small denomination of Ether (1 gwei = 0.000000001 ETH) that is used to measure the cost of gas. For example, a gas fee of 30 gwei would be equivalent to 0.000000030 ETH.
Since Ethereum’s London hard fork in August 2021, Ethereum gas fees follow a simple calculation:
Total Gas Fee = Gas units (limit) x (Base fee + Tip)
Let’s break this down a bit further.
A gas limit is the maximum amount of gas (or energy) that a cryptocurrency user is willing to pay when completing a transaction on the blockchain. For standard Ethereum transactions, most wallets and exchanges set the gas limit at 21,000 gwei, but give users the ability to manually edit this number whenever they please. In gas wars, where many users are competing over transaction priority in the next block, users often raise their gas limits significantly.
That said, Ethereum will only use the exact amount of gas needed to process the transaction. Any difference between your gas limit and the actual amount of gwei needed is refunded to your wallet. Meanwhile, setting your gas limit too low will likely cause your transaction to fail, resulting in wasted gas fees that you can never recoup.
Next up is the base fee. Also introduced as part of the London upgrade, each block has a base fee that is dependent on network congestion. As a deflationary mechanism to offset the issuance of new ETH, each base fee is burned, or discarded from Ethereum’s supply circulation. So to compensate miners for the fee that they would’ve once received, users are encouraged and expected to include a priority fee (tip) with each transaction. The higher the priority fee, the quicker the transaction will process. In wallets like MetaMask, users are able to adjust all three values (the gas limit, max priority fee, and max fee).
So with all that in mind, here is an example of a basic gas fee calculation. Let’s say that James wants to mint an NFT for 1 ETH.
1. The gas limit is 21,000 units, the base fee is 50 gwei, and James includes a tip of 15 gwei.
2. The gas calculation formula is: 21,000 (gas limit) x (50 (base fee) + 15 (Tip)), or 21,000 x (50 + 15). This returns a total gas fee of 1,365,000 gwei or 0.001365 ETH.
3. When James mints the NFT, 1.001365 ETH will be charged from his wallet. The wallet associated with the NFT project will receive 1 ETH, the miner will receive the tip of 0.000315 ETH, and the base fee of 0.00105 ETH will be burned.
Users can also set a maximum fee for the transaction, which gives them full control over the absolute maximum they’d like to pay with the base fee and priority fee included.
But still, while this model makes fees more predictable, it doesn’t solve the issue of congestion-based pricing. That’s why Vitalik Buterin and the Ethereum team are working diligently on a new, scalable version of Ethereum.