The Gas Fee Game
By: Bogdan Gheorghe
Tags: Cryptocurrency, Smart Contracts, Ethereum, Analytics, Blockchain

The hows and whys

Present

First of all — for all transactions the gas price was set equal to the value sent — except for the 2nd one, where the gas price was twice the value amount. Ex: for the 9th largest: value sent = 0.010000000000000002 ETH, and gas price = 0.010000000000000002 ETH. While the chances that all of this is due to human error are slim, the possibility of a sort of automation — like a trading bot — going awry is by far the most likely scenario.

Next — to get this out of the way — some speculation has been made that this could be a potential money laundering scheme, so let’s play devil’s advocate and imagine the following scenario: Since miners have the option to freely choose their transaction inclusion strategy — rational behavior, and the easiest to see profit maximizing strategy for miners is including transactions in descending order, based on the amount of fees they provide. This is the de facto strategy adopted by the majority of miners.

“…Transactors are free to specify any gasPrice that they wish, however miners are free to ignore transactions as they choose. A higher gas price on a transaction will therefore cost the sender more in terms of Ether and deliver a greater value to the miner and thus will more likely be selected for inclusion by more miners….” — Quoted from the yellow paper

Even the reference implementation of Geth, a popular Ethereum client software orders transactions by gas price by default.

But let’s say a miner, or mining pool administrator has a large amount of ETH it holds in some address somewhere, or is about to receive a large one-off pay for something — the sources of which are not exactly income tax self-assessment-worthy. One way to include these funds into the usual flows, the legal ones generated from mining activities, and essentially laundering them, is via the fee rewards miners collect.

However, the 5 transactions that started this discussion in the first place were mined by 3 different top mining pools and as such, neither one of them can be accused of anything else than capitalizing on a mistake.

Moreover, by taking the top 100 transactions with the largest amounts of ETH spent on fees, and seeing who mined the most, we could get a clue if/when/who might have ever done this. The results, however, don’t point at this ever happening. When ordered by the number of unusually large fee transactions they mined, the top miners simply match the top miners by hashrate — none of them registered numbers inconsistent with their hashrates at that time, which might have pointed to foul play.

Another interesting fact worth mentioning about these top 100 transactions, is that out of almost 400 million transactions that were included in the Ethereum blockchain so far — they account for almost 2% of the entire sum ever spent on fees (1.3% just from the top 10). Similarly, almost a third of the fees ever paid on the network, were paid on the top 1% of transactions.

Past

Looking back through the history of these kinds of events, and using the same top 100 as before as a sample, we can see a sort of pattern emerging, something aside from human error or poorly set up trading bots, that might explain a large chunk of them. 34 of them were sent towards DEXs (EtherDelta & Airswap) and token sales.

This is not at all unusual, especially around ICO’s, competitions or on-chain gambling games. The fear of missing out on something appears to be a good explanation as to why people overspend on gas —either on purpose or by necessity.

Another possible scenario where the fee market takes a hit is front-running on decentralized exchanges. A trader attempting to place an order in front of another will just pay a higher gas fee — validators will then pick this trade over others with lower fees and (unknowingly) support a front run.

In spite of the fact that we’re talking about what was the highest fee ever paid —and by some distance too — it wasn’t the biggest influence on the amount of ETH spent on fees. In the chart below we have 3 metrics on the Ethereum Blockchain, and how they influence each other.

Fig.3 — ETH spent on fees, average gas prices & number of txs

As we can see from the first chart, the biggest spike in the amount of ETH spent on fees wasn’t on Feb 19 (the one labelled 0x587E), it was on July 2nd, 2018. But let’s start from the beginning.

December 8th, 2016

The first actual peak in average gas prices (excluding the ones in 2015 when transaction volumes where under 5,000 per day) was caused by this transaction. If you scroll up, you’ll find it in the top 10 table shown earlier, as the #3 largest fee transaction. Why did this transaction influence average gas prices so much, more than 2 times what the biggest one did? The explanation is simple, and makes itself obvious when looking at transaction volume. Since we’re talking in averages about the gas price, and the number of transactions was 10 times smaller than it is today — this amount was enough to skew the average by 40x.

December, 2017

Dec 2nd, 2017, the birth of Genesis — the first and highest selling CryptoKitty. In just a month, the transaction throughput of the network doubled.

“The network started to become really clogged. All of the blockchain read activity caused our daily requests to explode from 2 Billion/day to over 4 Billion/day… overnight!” — Michael Wuehler, Infura

The huge increase in traffic caused the transaction queue to get backed up, and miners adjusted their gas price inclusion strategies accordingly. This forced people to pay higher fees for their transactions, to ensure they have a chance of being processed in a decent amount of time. However, the average gas prices didn’t go up insanely high, we can see it as a small hump on the gas price chart above. The sheer volume of transactions, combined with the 6–7x gas price increase translated in the third largest peak ever recorded in mined fees.

July — August, 2018

A seven fold increase in gas prices almost over night was due to a cryptocurrency exchange called Fcoin starting a competition for listing ERC-20 tokens. Every distinct address that made a token transaction to the exchange, counted as a vote for that token. This wouldn’t be apparent from the transactions chart above, however, the token transfers one shows the full story.

Fig.4 — Daily token transfers

Thousands and thousands of token transfers took place while the competition was ongoing as people scrambled to vote for their favorite token. We see the same pattern we saw for the CryptoKitties craze.

On July 14th, this contract, iFishYunYu received over 70,000 transactions. Somebody spent hundreds of ETH to spam this contract that is essentially a very basic ERC-20 token implementation, wanting to generate attention but succeeding in using up over a third of the network and causing congestion.

August 8th was no different, the spikes we see in the charts have to do with this contract receiving around 7,891 transactions that accounted for 592 ETH being spent on gas, and this one that received 73,516 transactions for a total of 917 ETH.

Future

The simplest way to see these kinds of events, in almost real time, is by checking the daily average gas prices. As we saw, these are usually pretty constant, and any anomaly of a certain magnitude — be it around transaction volume or transaction fees — would skew them instantly. For example, here’s the average gas price distribution in 2019, for a visual cue in how high fees paid on transactions reflect in the average gas price:

Fig.5 — Average daily gas prices in 2019 (up to Feb 25)

Alethio believes that providing accessible, real-time monitoring and analytics tools is crucial to ensuring transparency of Ethereum & helps solve an enduring problem around information asymmetry. By ensuring the community has the means to be notified in real-time of anomalous or suspicious activity (e.g., abnormal statistics, comparisons to relative past activity), users are empowered to act more intelligently on-chain.

Alethio’s API & Reporting and Monitoring tools are coming out soon. Keep an eye out for updates in the coming weeks & be sure to check out ethstats.io in the meantime! Let’s bring transparency to the blockchain together!