Gas Fee Settings & Calculations under EIP 1559

LuckyHash
CoinLucky
Published in
4 min readFeb 14, 2022

EIP1559 has adjusted the gas fee collection mechanism, the new mechanism is a bit more complicated. However, in order to pay less gas fees (especially for those who make transactions a lot), it is very worthwhile to take a deeper look into it.

Max priority fee and Max fee

Compare to its previous plan, EIP 1559 divided gasPrice into Max priority fee and Max fee. In order to understand why it’s done this way, we have to first learn the new gas fee collect mechanisms under EIP 1559.

Before deployment of EIP 1559, miners not only received rewards for mining new block, but also all the transaction fee in the block. The gasPrice * gasUsed specified by the user for an exchange will all be given to the miner as an additional reward.

After EIP 1559, Ethereum brought out the concept of Base fee, all transactions will burn ETH which equals the amount of Base fee * gasUsed. Only Max priority fee * gas Used will be rewarded to miners. If a user specified Max fee > Base fee + Max priority fee, then the excessive part will be returned to user. If Max fee > Base fee but Max fee < Base fee + Max priority fee, miners may also package transactions to get part of the priority fee reward.

That’s why when you need to take Base fee and Max priority fee into consideration when selecting Max fee.

Base fee

Before EIP 1559, gas fee was determined by the entire group of miners. They could choose to only package transactions with high gasPrice so that users had to pay more. Things are different after EIP 1559 — the gas fee on blockchain is completely determined by the Ethereum system, and the price determined by the Ethereum system is the Base fee.

There is only one factor that affects the Base Fee on the Ethereum, that is, whether the gas limit packaged in the previous block is used more than half. If it exceeds half, the Base Fee of the next block will be increased by a maximum of 12.5%; if it is not more than half, the Base Fee of the next block will be reduced by a maximum of 12.5%.

It can be seen that under the rules of EIP1559, miners lose their pricing power on gas fees: if they only pack a small amount of high gas transactions and the block capacity is less than half, the Ethereum system will reduce the Base fee and reduce user usage. cost. (Doing this under the EIP1559 rule is not beneficial for miners)

Miners’ choice under EIP1559

For some users, it’s not about how much the gas fee is, but how to trade faster than their opponents. Let me introduce how to do that.

For miners, it doesn’t really matter how much Max fee the transaction sets, because miners don’t get benefits from it directly. The important thing is how much he can get from this transaction: Min(Max fee — Base fee, Max priority fee). For example:

The base fee for the next block is 30; In an opponent’s transaction, the Max fee is 32, the Max priority fee is 2, your transaction Max fee is 35, and the Max priority fee is 1. can your transaction be packaged by miners first? While it looks like your transaction pays more gas, in reality miners will prefer the that of your opponent. Because the miner can gain the value of Min(32–30, 2) = 2 in the opponent’s transaction, and can only extract the value of Min(35–30, 1) = 1 from your transaction.

The current gas limit of the block under EIP 1559 is 30 million. In a special case, even if your transaction gas limit is high (for example, 10 million), while the value that the miner can extract remains low, the miner will still choose other transactions with high extractable value. So a low gas limit is an advantage itself.

Feel free to leave a supplementary comment.
— — — — — — — — — — — — — — — — — — — — — — — — — — — —

About LuckyHash

LuckyHash is the world’s leading one-stop crypto asset management platform. It provides pledge-free mining hashrate leasing and waranteed cryptocurrency interest-generating plans.
Website | Twitter | Facebook | Telegram | LinkedIn | Reddit | YouTube

👉Cryptocurrency investment👈

Create a LuckyHash account under this link to receive 10 TRX

--

--

LuckyHash
CoinLucky

LuckyHash is a professional cryptocurrency service provider, trusted by over 200,000 users worldwide. Register here: t.ly/APCu