Gas Price
How are gas fees calculated and paid?
Gas fees are based on the fundamental economic concept of supply and demand.
In the case of a blockchain, supply is the total computing power of validators on the network and demand is the total computing power required to execute network users’ submitted transactions.
Prior to Ethereum’s London Upgrade in August 2021, gas was calculated based on two factors:
Gas price: The price a user elects to pay for each unit of gas. You can think of it as setting the price you’re willing to pay per unit of fuel.
Gas limit: This is set by the user and determines the maximum amount of gas that can be used to perform a particular function. You can think of this as the maximum number of gallons of fuel a driver is willing to purchase.
Multiplying these two components together, Gas price x Gas limit resulted in the maximum gas fee a user might pay to execute a transaction.
After the introduction of EIP-1559, which aims to make gas fees more predictable, gas fees are calculated based on a new formula:
Gas limit x (Base Fee + Priority Fee (Tip)).
Rather than users determining the cost of gas fees, the Ethereum network now implements a base fee that automatically adjusts per block depending on user demand, while also outlining the lowest possible price a user must pay to have their transactions processed.
Once a gas fee is paid, the base fee amount of ETH is permanently removed (burned) from circulation. The update also allows users to tip validators (attach a priority fee) at their discretion in order to have their transactions processed quicker.
In a scenario where a user sets the gas limit too high, the network will automatically refund them the difference after their transaction has been processed.
Last updated