Beyond being the single most viewed and discussed Ethereum improvement proposal (EIP) in the chainâs history, EIP-1559 is a fundamental change to the way that Ethereum gas fees are set and paid. In this post weâll sort through what it will solve, what it may not, and how you can prepare.
Note that weâll be covering the developer perspective here. If you want to learn more about the EIP as an end user, miner, or investor, there are plenty of great posts out there already!
The TL;DR
Thereâs a lot to cover regarding EIP-1559, and I encourage you to read on for an in depth intro to the upgrade and how to prepare, but hereâs a quick summary to make sure youâre prepared:
- Why should you care? EIP-1559 will introduce a more efficient system around Ethereum gas prices, which will introduce much more predictable gas prices and mining times
- EIP-1559 introduces a new fixed âbase feeâ and âinclusion feeâ to replace the current blind auction system for determining gas price
- EIP-1559 will go live with Ethereumâs London hardfork at block 12,965,000 - expected on August 4th
- The upgrade will be fully backwards compatible, so legacy transactions will continue to work without issue (but wonât take advantage of the benefits EIP-1559 introduces)
- The âgasPriceâ parameter currently set for transactions will be replaced by two new values (note: both come with reasonable defaults!):
maxFeePerGas: a cap on base_fee + priority_fee, in other words the total amount youâre willing to pay per gas
maxPriorityFeePerGas: a cap on the priority_fee specifically - eth_gasPrice will behave exactly as it does now, to maintain backwards compatibility
- eth_maxPriorityFeePerGas is a new endpoint added to get the estimated priority fee required for the next block
- The base fee for the next block will be accessible as a new base_fee parameter on the latest mined block
- EIP-1559 is not intended to lower overall gas fees - if thatâs what youâre looking for, check out Alchemyâs recently released support for the most popular layer 2 networks: Arbitrum, Optimism, and Polygon (with more to come!)
- Most importantly, reach out to us if you have any questions or issues getting prepared, and weâre more than happy to help!
A Quick Primer On Gas
To understand EIP-1559, we first need to understand how gas fees work on Ethereum at the moment. If youâre already familiar with the current model of paying Ethereum gas fees and its pain points, feel free to skip this section.
Currently, the amount a user pays to get their transaction included in a new block is the product of two values: gas and gas price.Â
Total cost = gas * gas_price
Gas is simply a measure of how many resources a transaction uses, and is determined automatically by Ethereum nodes. The more intensive the transaction, the more gas it consumes and the more expensive it will be. (Note: this is unchanged by EIP-1559)
Gas price on the other hand, represents the amount a user is willing to pay, per gas, to have their transaction mined and is chosen explicitly by the user. The âcorrectâ gas price is currently determined by a blind auction - each user chooses the amount they are willing to pay, a miner selects the transactions with the highest gas price, and each user included in the block pays the amount they bid.Â
As almost anyone whoâs used Ethereum can tell you, this model for picking gas price has two key problems. The first is that the gas price needed to be included in the next block can be extremely volatile, making it very difficult for a user to predict what price theyâll need to choose.Â
Take for example this series of blocks from June 2020, where the average gas price per block increases by 1000% for a single block:
Unfortunately this kind of swing in gas price is far from rare, and far from the most dramatic Ethereum has seen. Even more frustrating, when the price suddenly increases for an extended period of time, users can end up in a state where their transaction remains unmined for hours despite having a reasonable gas price at the point in time it was sent.
The second key problem with the current model for choosing gas price is that blind auctions are widely known to be inefficient, and frequently lead to users overpaying. There are plenty of more in depth resources on this for the curious, but consider this simple example:
- User A submits a transaction with a 1000 gwei gas priceÂ
- All other users submit transactions with 10 gwei gas prices
- A miner selects User Aâs transaction, and fills the rest of the block with 10 gwei transactions
In this case, User A paid 1000 gwei as a gas price, despite the fact that 11 gwei (or even 10.00001 gwei) would have been plenty to guarantee their transaction was mined. Purely because of the auction mechanics at play gas price, User A overpaid by a staggering 989 gwei per gas. Given the amount of gas consumed by a single transaction, this could easily mean that User A overpaid by tens to hundreds of dollars!
Clearly there is room for improvement. Enter EIP-1559.
How EIP-1559 Changes the GameÂ
EIP-1559 replaces the old, blind auction mechanism behind Ethereum gas price with a new fixed fee model.
Instead of guessing at a volatile gas price, users will be given a set âbase feeâ needed to be included in the next block. All users will be responsible for paying this base fee, no more and no less.Â
With each new block, the network will automatically adjust the base fee based on demand. For example, if a block is 100% full, the fee will increase by 12.5% for the next block. If a block is completely empty, the fee will decrease by 12.5% for the next block. If a block is 50% filled, the fee will remain the same.
Notice that the most the gas price can change from block to block is 12.5% - a dramatic improvement from the 1000% in the example above. This means not only is the gas price for the current block deterministic, gas prices for blocks in the near future will be much more predictable.
One significant difference between the new base fee and the current Ethereum gas price is that the base fee is burned, rather than given to the miner. This is to prevent miners from manipulating the base fee by artificially filling blocks to drive up their own profits. Because of this, EIP-1559 also introduces the concept of an âinclusion feeâ (also called a âpriority feeâ) which will be paid to a miner for prioritizing a user's transaction. This also addresses situations where too many transactions are submitted with a sufficient base fee. If a particular block is over-filled by these transactions, miners will select transactions with the highest inclusion fee to maximize their returns. Â
A side note on Uncle Risk Â
Many sources talking about EIP-1559 describe the inclusion fee as an optional âtipâ to miners, but this is actually misleading. It takes computation, and importantly, time for miners to include any individual transaction in a block. Every time a miner decides to include a transaction, delaying the broadcasting of their mined block, they incur some risk (called âUncle Riskâ that another miner will swoop in and mine the current block before they do. This means their block would be uncled and they would lose the mining reward (currently ~2.6 Eth). This means that a miner should never include a transaction with a 0 gwei inclusion fee, since it puts their mining reward at risk without any compensation.
One final difference that makes EIP-1559 interesting is that block sizes will have more elasticity after the change. Currently, blocks are limited to roughly 15 million total gas, no matter how many transactions are waiting to be mined. With EIP-1559 the block size can increase based on demand to roughly 2x that size, up to 30 million gas, meaning more transactions will be included. Over time itâs expected that the base fee will adjust such that blocks still typically have only 15 million total gas, but this elasticity gives miners and the network a new way to handle large, sudden increases in activity.
How to Prepare
EIP-1559 is already live on all major testnets, and will officially go live with Ethereumâs London hardfork at block 12,965,000 - expected on August 4th. If youâre an Alchemy user, this upgrade will happen for you automatically, and youâll be able to start using EIP-1559 by changing one or two lines of code. (if youâre not using Alchemy, make sure you prepare for the fork regardless of EIP-1559, or you may experience outages!)
Fortunately, the upgrade to EIP-1559 will be 100% backwards compatible, so August 4th is not a hard deadline for adapting to the new system. All legacy transactions will continue to work as they do now, they just wonât take advantage of any of the changes the EIP introduces.
That said, updating applications to make the most of EIP-1559 is super straightforward, so weâd encourage anyone with the bandwidth to make a couple quick updates to do so. To start using EIP-1559 all you need to do is make two changes to the transactions youâre sending:
- Remove gasPrice: because of the switch to the base fee model, this wonât be needed anymore!
- Add two new parameters:
maxPriorityFeePerGas: a cap on the priority_fee specifically
maxFeePerGas: a cap on base_fee + priority_fee, in other words the total amount your willing to pay per gas
In reality, step 2 isnât even strictly necessary, since Alchemy and Ethereum nodes both support reasonable defaults for each value:
- maxPriorityFeePerGas: eth_gasPrice - base_fee
- maxFeePerGas: maxPriorityFeePerGas + 2 * base_fee
With that in mind though, power users will likely want to adjust these values based on the priority of their specific transactions, and desire to save on gas fees. When choosing your own values, youâll need two values to do so: the expected inclusion fee required and base fee for the next block.
To get the expected inclusion fee, there is a brand new endpoint called eth_maxPriorityFeePerGas. Note that this endpoint is the spiritual successor to the legacy eth_gasPrice, which will continue to behave as it does now to maintain backwards compatibility.
To get the base fee for the coming block, you can simply fetch the latest mined block and look at the âbase_feeâ value included.Â
A Final Note on 1559
EIP-1559 promises a number of meaningful benefits to developers and end users alike, including more predictable gas prices and mining times. That being said, there is one notable effect 1559 will not have: lower overall gas fees.
The high fees that Ethereum users have become so familiar with are a function of the limited capacity of the Ethereum network itself, and the overwhelming demand for submitting transactions. Unfortunately nothing about EIP-1559 will change these factors - but it was never intended to! That is where layer 2s and ETH 2.0 come into the picture.Â
So, if lower overall fees are what youâre looking for, definitely check out Alchemyâs recently released support for the most popular layer 2 networks: Arbitrum, Optimism, and Polygon (with more to come!).
In the meantime though, EIP-1559 will help make fees quite a bit more predictable and life quite a bit better for Ethereum developers and end users alike.Â