Photo by Artem Beliaikin on Unsplash

A Tale of Two Pricing Schemes

Micah Zoltu
Published in
8 min readNov 7, 2020

--

TL;DR

  • If you over-estimate the block base fee, you will still only pay the base fee for the block you are included in, no matter how much you overestimate by.
  • This rather small and subtle change in Ethereum gas pricing makes it so one of the most common points of frustration for new Ethereum users almost entirely goes away.

A User Story

Imagine you are a novice Ethereum user. You just installed the Coinbase wallet and you submit your first Uniswap trade transaction. Coinbase wallet tells you that your transaction should confirm within a few minutes and you patiently wait. After several minutes go by and nothing happens, you think that there must have been an error so you shut everything down and try again, but you run into a similar problem, your transaction just sits waiting.

Frustrated, you think it must be a problem with the application you are using so you go over to another Ethereum application and try to send a transaction. Unfortunately, this results in the same problem. You then have the great idea to test if the problem is with Coinbase wallet or not by sending some ETH to yourself, but alas this gets stuck as well.

Finally you are at the end of your rope so you go looking for support. You first try to reach out to Coinbase, but they have a pretty long turn around time on their support responses so you instead decide to go to the Discord server of the app you were originally trying to use. After describing your problem and sharing your Ethereum address with someone, they explain to you that you have a half dozen pending transactions and none of them will go through until the first one goes through. They tell you this is a solvable problem, and ask what wallet you are using.

Upon telling the support rep that you are using Coinbase wallet, they respond with a 😢 and tell you that unfortunately Coinbase wallet doesn’t provide the necessary tools to rectify this situation yourself and your only option is to wait and hope that gas prices come down or switch to using another more advanced wallet like MetaMask. This is the first you have heard of “gas prices” and you ask what those are which leads to a 10 minute conversation you don’t really understand.

You then go and install MetaMask and it asks you for your recovery words. The support representative told you to put the recovery words from your Coinbase wallet in, but Coinbase wallet gave you very clear instructions to never give your recovery words to anyone! You reach out to your trust network and after a few hours are able to verify that MetaMask is legitimate and putting your recovery words into MetaMask is reasonably safe, but you should probably create a new wallet once this whole thing is over.

After setting up MetaMask you then are told to send 0 ETH to yourself and to go into the advanced gas settings (a term you still don’t really understand) and set it to 70. The support person sends you a link to a website that shows some numbers that change every 15 seconds or so and they tell you to set the gas price in MetaMask to the first number on the website just before you submit your transaction.

You follow these instructions diligently and your transaction goes through! You then look at your account balance to see if everything is good and you see that you are short quite a bit more ETH than you expect, and you also notice that none of the stuff you wanted to do has actually happened. The support representative patiently explains that upon clearing the blockage, all of your other transactions went through immediately after, but the particular transactions that you were trying to execute all had time expirations which long passed. They tell you that each of those transactions that failed cost you some gas (again, that term you don’t really understand!) and that is why your ETH balance is down.

You are informed that your account is now working properly and you can try your transaction again, but apparently you are supposed to watch this website and set the “gas price” to match the number it shows anytime you want to do anything.

Just a One Off?

Unfortunately, the above is a very common scenario for users and while it is easy to blame Coinbase, the same class of problems occurs for users of pretty much every wallet including advanced ones like MetaMask. The problem is most common during times of increasing congestion (when the wallet estimates gas prices wrong), though similar problems occur during non-congested times as well due to bugs or oddities in gas price estimation software.

A Happy Ending

Now imagine we live in a world where tools don’t need to be experts at predicting future Ethereum blockspace demand. The user only needs to set the maximum they are willing to pay to get a transaction included without having to worry about overpaying. Instead of the user stumbling and falling down this endless pit of despair that is pending transactions, they merely indicate the max they are willing to pay for inclusion and they can trust that they will never pay more than that. No need to negotiate. No need to estimate. No need to understand/predict the gas price market.

This is what EIP-1559 offers. It makes it so Coinbase Wallet can reliably ensure that all of its user’s transactions are included into the blockchain without their customers overpaying on fees or having to develop an advanced trading and prediction algorithm just to estimate fees accurately.

It makes it so MetaMask can let users specify a max fee they are willing to pay, rather than asking them to predict the future.

It makes it so users no longer get into a situation that requires a specialist to get out of.

It makes it so users don’t end up wasting huge amounts of money on excessive gas costs.

It makes it so user interfaces no longer need to have a field where a simple typo can burn all of their money.

Note: From here down things get a bit technical, this is a good place to stop if you just want the feels portion.

What went wrong?

In the user story above, Coinbase tries to shield gas prices from users because it is a very complicated topic that the vast majority of users don’t understand. Instead, they estimate gas on behalf of the user and most of the time this works out well. However, when gas prices are highly volatile their algorithm sometimes guesses wrong (through no fault of theirs) at which point the user now has a stuck transaction. Once a transaction is stuck, it will block all future transactions until it goes through, no matter what the gas price of those future transactions are. This is what leads to the user effectively digging themselves into a deeper and deeper hole by trying to fix the problem on their own.

Unfortunately, once the hole is dug there is no magic bullet to getting out. You can use an advanced tool with custom nonces like MetaMask (assuming your wallet supports recovery words) to clear that one transaction, but then all of your other transactions (which likely includes duplicates, expired transactions, etc.) will flood through burning gas needlessly. You can instead go through and cancel all transactions in reverse order, but that is a very complicated process for end users and requires a dedicated support person to sit with you for 10–15 minutes to walk you through the whole process. Even in this case, you still burn gas, just less than if you would have cleared the clog before cancelling everything else.

Past Performance Is No Guarantee of Future Results

The root of the problem here is that gas price estimation is really hard. There are many tools that try to manage it, but ultimately it is a problem that cannot trivially be solved because future gas prices are a function of block space demand, and block space demand changes from moment to moment as thousands of humans all go about their day doing their things. There are some events that one can predict increased demand during, such as ICO launches, new popular project launches, oracle price feed updates, etc. but it is nearly impossible to keep track of all of this and even if you did it is impossible to have strong guarantees about the volume of demand any given event will bring with it.

In the end, gas price estimators generally resort to just looking at history and making a guess of future gas prices based on that. This works reasonably well some of the time, but anytime gas prices are on the rise or on the decline this doesn’t work. To make matters worse, you always pay the full amount of gas price that you estimate, even if you over-estimate! This means there is a strong desire for everyone to try to low-ball their gas price in hopes of getting a deal. Even if you don’t want to low-ball, you often want to at least not overpay by a large amount so you choose a middle-of-the-road number that you suspect will get you included in a block relatively quickly.

What is the solution?

EIP-1559. Most people know of this EIP because of the ETH supply reduction since that memes very well, but IMO the true value of 1559 is in the Ethereum usability improvement. In a world where Ethereum includes EIP-1559 this whole class of problem will go away almost entirely. While it is still possible to get yourself into such a hole, it becomes far easier for wallets to help you avoid getting into the hole in the first place.

With EIP-1559, rather than Coinbase and other wallets needing to accurately guess future Ethereum demand with a great degree of accuracy, and causing the user to pay unnecessary fees in the case where they guess incorrectly, they instead can include a fixed miner bribe (likely on the order of 1 nanoeth) that is accepted by the majority of miners and set the fee cap that is 2 times the current base fee plus the miner bribe. With these settings, the only way the user’s transaction won’t be included within the next 6 blocks is if the demand for block space doubles from what it currently is for all 6 of the next blocks!

The big win from EIP-1559 here is subtle, and people often miss it, but it is critical. If you over-estimate the block base fee, you will still only pay the base fee for the block you are included in, no matter how much you overestimate by! This means that if you set a fee cap to 1000 and the miner bribe to 1, but you are included in a block where the base fee is 10, you will only pay 11 per gas. This is in quite the contrast to Ethereum today where if you set a gas price of 1000 you will pay 1000 per gas, even if 11 would have gotten you included in the block!

The other piece to the usability puzzle is that on average, blocks will be half full, meaning there is almost always space in a block for any transaction that pays the base fee. This means that there is very little competition on block space, and in theory even the pending pool should be empty most of the time.

What this means is that wallets that wish to abstract away gas prices from end users (a valiant goal) can do so without having to be experts at guessing gas prices (something that even the most skilled Ethereum experts fail at from time to time). This rather small and subtle change in Ethereum gas pricing makes it so one of the most common points of frustration for new Ethereum users almost entirely goes away. We can finally live the dream of an Ethereum where end users don’t need to worry about or think about gas prices.

--

--