EIP-1559

I like EIP-1559. I don't like when people spread misinformation by calling it manipulation with the only goal to deflate the supply to pump the bags of major holders while screwing over the miners in the process.

I'll be honest: in this post I bring no new information, all the points mentioned here were already laid out years ago in the original proposal which you can read for yourself. I just want to try my best to make the following points slightly more accessible for anyone who has a limited understanding of Ethereum's fee market:

https://twitter.com/domothy/status/1468276976607805441
https://twitter.com/domothy/status/1468276976607805441

Gas as a valuable resource

First we need to clarify some key things:

  • The amount of gas used represents how much computation your transaction requires. A transaction that uses twice as much gas as another can be thought of as being "twice as expensive" to run in terms of "real world resources" like computation, storage, bandwidth.
  • Not all transactions are equal, some require more gas than others
  • There is a limited amount of gas made available every block
  • You need gas to settle transactions onto the blockchain. Things like moving money, depositing tokens into a vault, minting NFTs, etc.

Therefore, each unit of gas has "value" as far as things can have value due to supply and demand:

Limited supply of gas + High demand for gas = High cost of gas.

And each unit of gas can be thought of as being a tiny "step of computation", so its associated cost is very small, currently on the order of 0.0000001 ETH per gas, or more commonly written out as simply "100 gwei" (1 ETH = 1 billion gwei). It's when a lot of gas is used at once that a transaction can get expensive, especially when the network is congested. As a quick example, a swap on mainnet can use around 150,000 units of gas:

150,000 gas × 100 gwei/gas × 0.000000001 ETH/gwei × 5,000 USD/ETH = $75

As you can see, the total fee in U.S. dollars depends on the amount of gas used, current cost of gas in gwei/gas, and the price of Ether.

The actual mechanism

Before EIP-1559

Before EIP-1559 arrived on mainnet on that fateful 12,965,000th block, the fee market mechanism was much easier to grasp: People posted a bid of any amount, and miners would pick the highest bidder and prioritize the inclusion of their transaction in the block they're mining. However, as soon as demand for blockspace exceeded supply, we ran into problems related to market efficiencies.

Consider the following scenario: a block 100% full of transactions that all have the same bid for gas at 50 gwei/gas. Clearly, this means the value of gas at that particular point in time, as decided by the market, is 50 gwei. This means that someone willing to pay 50 gwei should be able to get their transaction confirmed in that block. But if the block is going to be full, that's impossible. You now have to up your bid to 51 gwei and bump someone else off the block in the process. Or 55, or 60, if you want to play it safe because you know other people are thinking the same way and fighting over the same limited resource.

So even though the value of gas was 50 gwei, there was market inefficiency on two accounts:

  • You paid more than the fair market value of gas
  • Someone who paid the fair market value didn't get their transaction included in the block

In a more efficient system, these two things wouldn't happen.

After EIP-1559

How does EIP-1559 fixes the market inefficiency problem? Essentially by making block size more elastic. There is now 30 million units of gas available in every block, but 15 million is still the desired target. The mechanism auto-adjusts to keep the average gas used per block at 15 million.

This means that in our example, the block would now be 50% full of transactions bidding 50 gwei, which means there is space for an extra transaction, which will also be priced at 50 gwei. Everybody pays the fair market value of gas!

The interesting part is the introducing the "base fee" parameter that is calculated by a predictable mathematical formula:

  • If the block is less than half full, the next block will have a lower base fee (up to 12.5% lower)
  • If the block is more than half full, the next block will have a higher base fee (up to 12.5% higher)

The base fee parameter is the part of the fees that gets burned. At a base fee of 50 gwei, a block containing 15 million gas would burn this much Ether:

50 gwei/gas × 15 million gas × 0.000000001 ETH/gwei = 0.75 ETH

The reason for burning is simple: Whoever creates a block decides how many transactions it will include. If the base fee went to the miners/stakers, they could fill up blocks with dummy transactions from themselves to themselves, and pay the base fee to themselves and everybody else would have to pay up an arbitrarily high price. By burning the base fee, everyone pays for using blockspace. The miners/stakers can still collude to keep it high, but it's gonna cost them.

The bullet points

Hopefully the explanation above is clear enough that we can jump into the actual bullet points of my tweet one by one.

Gives a refund to overbids

Remember how previously, you would have to overbid to speed up the inclusion of your transaction in a block? If the market cost was 50 gwei, your 65 gwei bid would be accepted and you effectively overpaid by 15 gwei by playing it safe.

Now, thanks to EIP-1559, you don't set "a bid of 65 gwei per gas". Instead, you set a "max fee per gas of 65 gwei", effectively telling the network you're willing to pay up to 65 gwei, and not a gwei more.

If the block that includes your transaction has a base fee of 50 gwei, then 50 gwei is what you pay, and you get the 15 extra gwei back. You can overbid by as much as you want now, but you will get the difference back. No more overpaying!

Tells you exactly how much next-block inclusion costs

So remember the bit about the predictable math formula? If the previous block had a base fee of 100 gwei, then you know with 100% certainty that the next block will have a base fee either 12.5% lower or 12.5% higher. This way, you can bid 100 × 1.125 = 112.5 gwei and have a high degree of confidence that the next block will include your transaction.

Of course, during times of high surge in demand for gas, the max limit of 30M gas per block may be hit, which would leave no room for your transaction. So what you can do is calculate two blocks ahead and set a max fee per gas of 100 × 1.125 × 1.125 = 126.6 gwei and have a high degree of confidence that your transaction will be included within the next two blocks. You can keep going for as many blocks as you want. Remember: you're not gonna overpay when your bid is higher than the actual cost of gas.

Before EIP-1559, you couldn't know for sure that you bid would make it into the next block, or the one after that. Gas could arbitrarily surge 300% at once and then everyone else would follow by outbidding each other and suddenly your transaction had to wait several minutes when it could have taken 2 blocks with EIP-1559.

This bit is especially important for rollups (Layer 2) who need to settle transactions on Layer 1 to reach finality of their aggregated transactions. Unexpected delays for such finality would be inconvenient as it would delay every other changes of state that the rollup needs to commit to Layer 1.

Mitigates the social cost of transactions

This is where it gets a bit abstract and the benefit is not immediately apparent, but it's a very important point nonetheless. The most controversial aspect of EIP-1559 is that the base fee, that used to go to miners, now goes... nowhere. It gets burned. The lost income for miners sparked a lot of outrage.

But I think it's important to look at it from another perspective: Miners aren't the only ones doing the work. Every single node computes and stores every single transaction. Every single transaction makes the whole blockchain a tiny bit more heavy and difficult to verify for nodes. It's very marginal, but this social cost is still non-zero.

Imagine a world where EIP-1559 was implemented from the start and someone proposed to switch to a first priced auction system where miners get all the fees. The community would ask: Why should all transaction fees go to the one lucky miner or mining pool that happened to win the hash lottery?

By burning the base fee, you're essentially paying the network itself for using its scarce product: secure blockspace. Whoever pays X dollars' worth of blockspace is essentially getting "value" in return for their dollars, since they wouldn't initiate the transaction if it incurred them a loss.

In some sense, part of the value generated by the blockspace flows back into the ecosystem as a whole, and every holder of ETH benefits proportionally. Instead of the previous system, where the value was extracted by the miner and sold to pay for hardware and electricity. It's not a direct payment to all nodes by any means, but now every node can benefit from holding ETH and get some value back for the service they provide to the network via storage, computation, bandwidth, etc. even if they're not mining or staking.

Thanks to EIP-1559, a good chunk of the value stays in the ecosystem – it mitigates the social cost of transactions – which will directly contribute to the economic security of the blockchain after the switch to Proof of Stake.

Prevents the economic abstraction of Ether

Economic abstraction of Ether was a hot topic of debate among the community before EIP-1559 came and solved it. It was in theory possible to sign a transaction and only broadcast it to a specific miner or mining pool with a bid of 0 gwei with a payment to the miner through back channels. And it did happen, mostly by MEV flashbots who wanted to front run specific transactions. This MEV stuff is a whole different subject, but the point is, if you could bypass having to pay Ether for blockspace, this was a problem for Ether the asset, and thus a problem for the network as a whole, since Ether is what keeps it secure – a high value Ether incentivizes miners to keep the network secure, and later on the capital at stake will keep everyone honest under Proof of Stake.

By burning the base fee and having the base fee be denominated in Ether, EIP-1559 solidified Ether as the currency used to pay for blockspace.

MEV flashbots are no longer able to bid 0 gwei and pay a mining pool some dollars to extract value from the network for themselves and the miner. MEV is still a problem, but at least now they have to pay the base fee and, again, part of the value they would have otherwise extracted flows back into Ether which is good for anyone who has a stake in the health of the system.

Makes the security model more sustainable

This one requires some more context than the previous points.

Security budget

A blockchain needs to spend some amount on security, since it is secured via real-world resources. Most models involve minting new coins and handing it out as a reward to miners/validators. If there's more coins being printed than fees collected, then the blockchain is running at a loss: Minting new coins dilutes the value of the existing supply. So even if the users enjoy low fees, they're still paying for the chain's security budget when the value of their holdings is diluted to cover it.

Unless the price of the coin keeps pumping forever, running at a loss involves minting more coins than before to pay the same amount to miners/validators in dollar terms. Which further dilutes the supply, which requires further inflation. You get the picture.

It's always a fun exercise to go on tokenterminal.com and look up how much fees a blockchain collects and compare it to how much it pays its validators by doing quick math on stakingrewards.com. You'll see that a vast majority of these low-fee chains are running at a loss by a huge margin. Good for users short term, but bad for the chain itself long term. In a bull market, these chains look good because validators get more in dollar terms as the price of the coin rises. But what happens to them in a bear market? You'll have you answer by looking at the "ETH killers" of 2017-2018.

Fee-driven security budget

But clearly, Ethereum doesn't have that problem: Its fees are so high that you could just give those to the miners and have 0 inflation, no? This paper lays out the math with simulations, but it is a bit heavy. The gist of is that if the block producer's income relies entirely on volatile/unpredictable fees, the best move isn't to put up with low-fee transactions during low demand: it's to outright steal the high-fee transactions.

Imagine there are 0 minted ETH and 100% of the income comes from fees: Consider a lucky miner who got the timing just right to include a whole bunch of transactions totaling 10 ETH in block #1000. The next miner however, only sees enough transactions sitting in the mempool to fill block #1001 with a total of 5 ETH in fees.

The available options are:

  1. Work on mining block #1001 on top of block #1000 and earn 5 ETH
  2. Fork the chain at block #999 and work on mining an alternate block #1000 that includes the transactions from the original block #1000, to earn 10 ETH

Option 2 (the "selfish strategy") results in a fork where miner #2 stole high-fee transactions from miner #1. The incentive for each miner is to keep mining on top of their respective fork to try to seal their right to those high-fee transactions by having the longest fork. Instead of both miners adding up their computational in a single chain and maximizing security, the security is now split in two. Add in more selfish miners that each steal high-fees transactions and you got even more forks with their own set of miners/pools competing for the transactions with the highest fees. Meanwhile users have to wait more and more blocks to be sure that the chain's history won't change because of this selfish mining strategy.

As a blockchain, you want stability, and forking the chain is the opposite of that (each fork is individually easier to attack than if all the mining is done on the same fork). But as a miner, you want to maximize income. By having the fees be the majority of mining income, the interests are misaligned. When the majority of mining income is from a fixed block reward, there's no need to fork and steal the reward from block #1000 since you'll still get the same reward for mining block #1001.

EIP-1559 solves this by having the best of both worlds: chain stability via perpetual issuance while offsetting inflation with the fee burn mechanism. After the merge, there is a good chance that the reduction in issuance will be largely outpaced by the fee burn for decades until the rate of issuance meets the rate of burning.

No hard cap

There's no hard supply cap in Ethereum's long-term model. Instead, the same result will be achieved with an equilibrium that will eventually be reached where supply inflation is close to 0% year over year. Sometimes deflation, sometimes inflation, depending on external variables over which Ethereum has no control (price of Ether, total amount of Ether staked, demand for blockspace) but can react automatically without any human input. This is why I like to say that Ethereum will reach homeostasis whereas Bitcoin will keep ossifying.

To me, that is much more elegant than the alternatives:

  • Have endless supply inflation while hoping that the price of the coin will keep rising enough to make up for it
  • Have a hard supply cap while hoping:
    • that the fees will be enough to cover the security budget long-term
    • that miners will play nice with each other despite strong economic incentives to do otherwise

Some archeology

Subscribe to domothy
Receive the latest updates directly to your inbox.
Verification
This entry has been permanently stored onchain and signed by its creator.