The final standard can be found here: https://eips.ethereum.org/EIPS/eip-1559
Motivation
Provide a concrete proposal for implementing the fee market proposed in https://ethresear.ch/t/draft-position-paper-on-resource-pricing/2838 on the current 1.0 chain.
See zcash/zcash#3473 for more detailed arguments for why this is a good idea.
Parameters
FORK_BLKNUM: TBD
MINFEE_MAX_CHANGE_DENOMINATOR: 8
TARGET_GASUSED: 8000000
Proposal
For all blocks where block.number >= FORK_BLKNUM:
- Impose a hard in-protocol gas limit of 16 million, used instead of the gas limit calculated using the previously existing formulas
- Replace the
GASLIMIT field in the block header with a MINFEE field (the same field can be used)
- Let
PARENT_MINFEE be the parent block's MINFEE (or 1 billion wei if block.number == FORK_BLKNUM). A valid MINFEE is one such that abs(MINFEE - PARENT_MINFEE) <= max(1, PARENT_MINFEE // MINFEE_MAX_CHANGE_DENOMINATOR)
- Redefine the way the
tx.gasprice field is used: define tx.fee_premium = tx.gasprice // 2**128 and tx.fee_cap = tx.gasprice % 2**128
- During transaction execution, we calculate the cost to the
tx.origin and the gain to the block.coinbase as follows:
- Let
gasprice = min(MINFEE + tx.fee_premium, tx.cap). The tx.origin initially pays gasprice * tx.gas, and gets refunded gasprice * (tx.gas - gasused).
- The
block.coinbase gains (gasprice - MINFEE) * gasused.
As a default strategy, miners set MINFEE as follows. Let delta = block.gas_used - TARGET_GASUSED (possibly negative). Set MINFEE = PARENT_MINFEE + PARENT_MINFEE * delta // TARGET_GASUSED // MINFEE_MAX_CHANGE_DENOMINATOR, clamping this result inside of the allowable bounds if needed (with the parameter setting above clamping will not be required).
Further explanation
There is a MINFEE value in protocol, which can move up or down by a maximum of 1/8 in each block; initially, miners adjust this value to target an average gas usage of 8 million, increasing MINFEE if usage is higher and decreasing it if usage is lower. Transaction senders specify their fees by providing two values:
- A "premium" gasprice which gets added onto the MINFEE gasprice, which can either be set to a fairly low value (eg. 1 gwei) to compensate miners for uncle rate risk or to a high value to compete during sudden bursts of activity. The MINFEE gets burned, the premium is given to the miner.
- A "cap" which represents the maximum total that the transaction sender would be willing to pay to get included.
Ultra-short-term volatility in transaction demand or block times will now translate mostly into ultra-short-term volatility in block sizes instead of volatility in transaction fees. During normal conditions, fee estimation becomes extremely simple: just set the premium to some specific value, eg. 1 gwei, and select a high cap. If a transaction sender highly values urgency during conditions of congestion, they are free to instead set a much higher premium and effectively bid in the traditional first-price-auction style.
The final standard can be found here: https://eips.ethereum.org/EIPS/eip-1559
Motivation
Provide a concrete proposal for implementing the fee market proposed in https://ethresear.ch/t/draft-position-paper-on-resource-pricing/2838 on the current 1.0 chain.
See zcash/zcash#3473 for more detailed arguments for why this is a good idea.
Parameters
FORK_BLKNUM: TBDMINFEE_MAX_CHANGE_DENOMINATOR: 8TARGET_GASUSED: 8000000Proposal
For all blocks where
block.number >= FORK_BLKNUM:GASLIMITfield in the block header with aMINFEEfield (the same field can be used)PARENT_MINFEEbe the parent block'sMINFEE(or 1 billion wei ifblock.number == FORK_BLKNUM). A validMINFEEis one such thatabs(MINFEE - PARENT_MINFEE) <= max(1, PARENT_MINFEE // MINFEE_MAX_CHANGE_DENOMINATOR)tx.gaspricefield is used: definetx.fee_premium = tx.gasprice // 2**128andtx.fee_cap = tx.gasprice % 2**128tx.originand the gain to theblock.coinbaseas follows:gasprice = min(MINFEE + tx.fee_premium, tx.cap). Thetx.origininitially paysgasprice * tx.gas, and gets refundedgasprice * (tx.gas - gasused).block.coinbasegains(gasprice - MINFEE) * gasused.As a default strategy, miners set
MINFEEas follows. Letdelta = block.gas_used - TARGET_GASUSED(possibly negative). SetMINFEE = PARENT_MINFEE + PARENT_MINFEE * delta // TARGET_GASUSED // MINFEE_MAX_CHANGE_DENOMINATOR, clamping this result inside of the allowable bounds if needed (with the parameter setting above clamping will not be required).Further explanation
There is a MINFEE value in protocol, which can move up or down by a maximum of 1/8 in each block; initially, miners adjust this value to target an average gas usage of 8 million, increasing MINFEE if usage is higher and decreasing it if usage is lower. Transaction senders specify their fees by providing two values:
Ultra-short-term volatility in transaction demand or block times will now translate mostly into ultra-short-term volatility in block sizes instead of volatility in transaction fees. During normal conditions, fee estimation becomes extremely simple: just set the premium to some specific value, eg. 1 gwei, and select a high cap. If a transaction sender highly values urgency during conditions of congestion, they are free to instead set a much higher premium and effectively bid in the traditional first-price-auction style.