Ethereum Gas Price Markets with EIP-1559
EDCON 2020 · 10 Aug 2020 · 15:51
Nethermind founder Tomasz Kajetan Stańczak explains EIP-1559’s proposed changes to Ethereum’s gas-price market at EDCON 2020. The organizer’s recap highlights an on-chain observable base fee, reduced miner influence over pricing and the goal of more predictable fees.
Speakers
Topics
From EDCON 2020, hosted by EDCON.
Transcript
[Music] hello everyone welcome to the ethereum gas price markets with vip one five five nine my name is thomas steintech i work on another mind detune client project and i just wanted to show you this new improvement proposal for ethereum gas price that many people are discussing many people are excited about and waiting for so let's have a look what it means for all of us maybe before i talk about eip1559 i will do a quick recap of the current gas prices in interior mainnet so whenever you create a transaction you
have to set the gas price on the transaction first and if you set it too high the transaction will just make you overspend if you set it too low you may end up waiting for a long long time before the transaction is included in the block because what miners do they would just collect all the transactions created by you and other users in the network and it will put them into memple and then they'll sort them by the gas price from the highest gas price to the lowest and they will create a block and include the transactions as long as there is enough space within the block gas limit it'll be obviously including the transactions from the highest price to the lowest because all the transaction fees are being paid
to the minor account so they're just naturally incentivized to pick the transactions with the highest gas price and this mechanism is called the first price auction which means that you practically blindly keep bidding without knowing what the final price will be and at the end of the auction you just learn how much you paid whether you won or not you either not paying at all because you didn't win the auction or you end up paying the price that you beat and there are some problems with price price auctions in particular the price that you pay very often is just too high and there's another problem with the
current gas price market when you think about it um maybe it's a bit less clear but it's really hard to tell what the real gas price on the market is and why is it still mainly because the miners are allowed to include transactions in the blocks which are their own transactions there's really no way to forbid that from happening and the thing is whenever they include those transactions very often they'll include them at zero price or if they want they may include them at arbitrarily high price which means that if you ever try to rely on the gas prices from the block you may simply have it all confused because of the minor transactions and whoever tries to set the gas prices for the transactions they create
very often will choose some kind of average from the previous blocks which again might be distorted by the transactions from the miners and since the transactions that they create the signers of the transactions are not priced properly everyone else is like misled by those hints from others and everyone is either over bidding or getting not enough making those mistakes and hence we simply cannot tell what the real gas price on the market is so here comes the ip1559 and it tries to solve the problem by introducing a set of parameters probably the most important one is the
base feeders added to the block header this is something that fluctuates in between blocks and as uh calculated by protocol and apart from base fee which is a minimum gas price that has to be paid for all the transactions are included in block we have a gas premium which signers of the transactions add to the transactions themselves so they they work very similar to what the current gas prices do so so they work as a tip to the miners if the more you pay as gas premium the more likely the miner will prefer your transaction over others and then there is also fee cap so this is like the second part of the current gas price model which is uh limiting how much you will pay for the
transaction so fee cap just says uh whenever the space fee plus gas premium is above the fee cap i'm not i'm not really approving to pay that much so i'm just not approving that base fee and even like if you don't set gas gas premium then if the price fee is above your fee cap you will just not accept the transaction to be included in a given block and he'll wait for the better times the block gas limit itself remains voted on by the miners however we change slightly that meaning of the vote so we no longer vote about the absolute limit of the bloc we vote for the target and the target means that we can create blocks that are up to two times the size
of the target as for the base fee adjustment mechanism it's all based on the how big blocks are being created on the mainnet so if the blocks created are the perfect size in a way so they match the target gas limit of the block let's say 10 million and then the base view will remain stable if the box created or bigger up to two times bigger then the base field will be rising it means that we actually want less people to post transactions and less transactions to be included in blocks so we just raise the base we until we get to the desired block gas limit again
and if the blocks are created on the tr on the network which are empty or simply below the target then the base fee will fall and it will encourage more users to post transactions now because there is some extra capacity we are below the target we want the blocks to be bigger one important property of eip1559 which many people are excited about is that we're burning the transaction fees so what is defined by base fee will be burned will not go to the miner and that's super important from the perspective of what i mentioned before which is preventing the ability of the miners to manipulate the
base feed price the gas price so they no longer compost any transaction with any gas price they want because the fee will simply not go back to them it will be burned and it would be at severe loss um this burning is exciting people because it's simply meaning that there will be less inflationary pressure on ethereum last ethereum would be created net of rewards because some of the ether will be burned as part of the transaction execution as for for the fees themselves let's analyze a few scenarios um when for example fee cap is greater than base v plus
premium what happens then so fika practically has no meaning in such a situation you simply say that as a sign of transaction you find to tip miner a bit and that you pay whatever base fee the header has and in such situation you see that transaction is paying everything is paid by signer premium and base fee but majority of that value will be burned and uh just the tip and the premium will be paid to the miner i'm really i'm saying majority but really the basically can be really low and your premium can be very high so in such situation miner would still earn majority of the fee
and only some part of it would be burnt but it really depends on how busy the blocks will be created in the cases when the blocks are more or less empty you won't have that much of the burning because the base will be very low then we have another scenario when actually the fee cap while it's bigger than base fee it's still lower than the base fee plus premium which means that you decided to limit your the size of the gas price that you're paying below the current state of the network so the base fee is so high that you cannot really approve covering the premium that you promised before so some of this premium have to be forgone by the miner
and the transaction can still be accepted by the miner if they want but the premium will be cut by the by the fee cup level so still everything is paid by signer and still very similarly we burn base fee and miner gets some part of the premium limited by day fee cup and the last scenario really is it's very interesting actually it's a subsidized transaction so you set the fee cap solo that it's below the current base fee on on the market which means that if the miners decide to include your transaction they can still do that but it will have to uh cover the remaining fee that you didn't cover so you say like
okay the base fee is 10 way and my fee cap was nine grades and the miner says that's all right i'll subsidize the remaining one way for you and everything will get burned which means that the part that miner paid was burned they subsidized it they lost it and we can try an example calculation of eip1559 so let's say the target gas used for a block voted by miners is 10 million which means that the the gas limit really on the block can be up to two times bigger than that the target and we have a very important parameter it's called base feedback change denominator and it defines how volatile the
base fee will be how quickly it will adjust itself if there are big variations in the block sizes so let's work with an example where we have a gas used 7.82 million on a block which is below the target we set the target for 10 million and the gas used as 7.82 so we want the next block to be bigger and to encourage that behavior will be lowering the base fee the basic in this particular block for our example is one way we calculate the delta from the gas used on the on the parent block that we created and the target gas used and in our case it's a negative delta and delta can be positive if the block is above the target
and that would change our calculation obviously in other direction and the base feed that we calculate is a parent base fee plus the part of the parent base phase that is multiplied by first of all the delta so the difference and the like ratio of the delta to the target and then limited by this base v max change denominator so we just limit how quickly we move towards the target and here as an example we have 090 0.97 way gas price calculated for base fee and we can have an example of the calculation with
full blocks happening on the network so whenever a full block is happening our delta calculation will be really equal to target gas used and in such cases we'll be using the entire current base fee in the second part of our equation i will be moving by the denominator at every single block so 1 8 of the parent and base feed change every single time so we see here after eight blocks we reach the level of 2.28 waves starting with one way um let's see the opposite scenario so the blocks created are empty the delta in such case will be negative
and negative at the level of target gaseous which creates which makes the second part of the equation uh just negative one multiplied by the max denominator so the max move max adjustment and again we'll see after eight blocks we reach the 0.34 grade so it's around 60 below the starting point of one way uh now we see the last possible scenario that is interesting to look at the blocks are actually at the desired size so all the blocks are created as in our case at 10 million and it means that practically we don't want to change anything so the base will
be stable will not move every single block will be at one way now why i think that eip1559 is particularly exciting for the gas price markets so most important thing for me is that the base field will be observable on chain so something that you really don't have access to at the moment from the perspective of the virtual machine will be available for any smart contracts and we started working on a product that is creating some kind of hedging scenarios
that are based on the observable base fee so you can take into account the gas price that can no longer be manipulated by the miners so in the past if you would like to post information about the gas price to the smart contract uh it might have been just totally manipulated if you build any product uh on chain that would try to react to the gas prices anyone would be able to trade against it and manipulate the market if they were sorry any miner would be able to manipulate the behavior of that smart contract this is no longer possible and this is super exciting so obviously just um just the basic just the basic
uh goal of the introduction of eip1559 happens as well so we should see much less volatility of gas prices much more predictability uh people be able to know what exactly the direction of the gas prices is recently and use the wallet suggested wallets uis to to have a bit more of a more likely have their transactions included around the actual gas price as it is on the market thank you so much for listening for staying with me and there are plenty of links available online that can give you much more details about the ip1559 so have a look at the ip itself
about the discussion around the inefficiency of first press auctions the controls here is a behavior of the systems as you would like to have a system that auto adjusts the gas price uh look at your magicians and research for all the discussions happening there around eip1559 look at the previous implementers calls where multiple ideas were discussed discarded or actually accepted into eip the fantastic stimulator simulations from some of the teams that are analyzing the behavior of the miners and market participants in different scenarios also some alternative solutions like gas escalator
and if you're interested in any links for the images used they are here thank you so much thank you thank you thank you