Why is the Gas fee in Ethereum so high?

in #ethereum3 years ago

The application of Ethereum is growing at an unprecedented speed. Decentralized finance (DeFi) continues to rise rapidly, stable currency is adopted all over the world, and NFT is becoming a daily topic.

The use of Ethereum is a good signal for the long-term prospect of the network. But in the short term, it caused some growing pains. At the beginning of 2021, the transaction cost of Ethereum has soared to a new high.

As background, in the peak period of bull market in 2017/2018, the average transaction fee of Ethereum reached 5.70 USD. Since January 18th, 2021, the average transaction fee of Ethereum has exceeded USD 5.70 every day. For most of this year, the median transaction fee was above $10.

图片.png

Source: Coin Metrics Network Data Chart

Part of the reason for the increase in transaction costs is the sharp increase in the price of Ethereum. As Ethereum becomes more and more valuable, the transaction cost will become more and more expensive in US dollars. However, this is also due to the sharp increase in Gas charges caused by network congestion.

Even more complicated, EIP 1559, an improved proposal for Ethereum, is now officially confirmed to be included in the upcoming London Hard Bifurcation, and the toll structure of Ethereum will change in July this year.

In this report, we will first look at the current charging mechanism of Ethereum and the reasons for promoting high charges. Then we will look at EIP-1559 and how it will change the future charges of Ethereum.

  • Overview of Ethereum gas

To send a transaction or interact with an Ethereum decentralized application (DAPP), users need to pay a fee.Ethereum costs are often referred to as gas.Similar to cars that need gasoline to run, Ethereum applications need gas to run.

Gas is essentially a measure of the computational effort required to perform an operation on Ethereum.More complex operations require more gas to run, while relatively simple transactions, such as a single token transfer, require less gas.In the end, gas is just another way to measure transaction costs.Gas fees are paid by Ethereum and priced in Gwei.Gwei is just a small denomination of Ethereum, similar to the smaller denomination of one dollar for a penny.One Gwei is worth 0.000000001 Ethereum.

At present, there are two factors determining the cost of each transaction: gas cost and gas price.

  • Gas Cost

Different Ethereum transactions require different amount of computation.A simple transaction like token transfer requires a relatively small amount of gas.But more complex transactions, such as transactions that require the interaction of multiple smart contracts, require more gas.For example, a simple Ethereum transfer requires 21000 gas.But it may take 100000 gas or more to execute a trade on a decentralized exchange.

"Gas limit" refers to the maximum amount of gas users are willing to use in a single transaction.Ethereum users can specify the gas limit they want when sending transactions.However, changing the gas limit does not change the actual amount of gas required to perform the operation.Gas limit is just a safeguard against dapps that may try to use a large amount of gas without their knowledge.Any unused gas below the gas limit is returned to the sender's wallet.However, if they are set too low, the transaction will not be executed, but they will still be charged a fee.

Since January 2020, gas per transaction has shown a downward trend.This shows that the increase in transaction complexity is not the reason for the high transaction costs.

图片.png

Source: Coin Metrics Network Data Chart

  • Gas price

The second gas price.People can specify any gas price they want, high or low.

Gas price only determines the amount of gas users need to pay for each unit of gas, and does not change the amount of gas required to execute the transaction.As a result, identical smart contract interactions performed at different times may have very different gas costs depending on the gas price used.This often leads to confusion, especially for new users.

Gas price also tends to fluctuate, depending on the demand for block space.With the rise (and fall) of defi, the average gas price soared to an all-time high in the summer of 2020.The growth of decentralized trading, on chain arbitrage, yield cultivation and the introduction of new token all promote the competition of transaction priority, which leads to the rising price of gas.

On September 17, 2020, after the unexpected airdrop of uni token by uniswap, the average price reached its peak, exceeding 500gwei.In 2021, with the continuous rise of defi, gas price will soar again, and the sharp rise of Ethereum price will bring new traders and speculators.

图片.png

Source: coin metrics network data chart

  • Gas auction

So, since users can choose to pay the lowest gas fee, why pay a high gas fee?In short, higher gas fees lead to faster trade confirmation.

Imagine a bus stop where thousands of people are waiting for the next bus.Every 15 minutes or so, a new bus comes, but each bus has only 50 seats.Seats on the bus were auctioned to the highest bidder.

If at least 50 people are willing to pay 1000 yuan to get on the bus, the ticket price is at least 1000 yuan.If people are willing to pay up to $10, the price will be $10 or less.But if you only have 10 yuan and hundreds of people are willing to pay 1000 yuan, you may have to wait a while before you can get on the bus.

Unfortunately, waiting in line at a bus stop doesn't necessarily give you an advantage.If people keep showing up willing to pay more than you do, they will continue to be given priority, even if you wait longer.

This is a slightly simplified version of the way Ethereum gas auctions work.The Ethereum block is mined approximately every 15 seconds.Each Ethereum block has a maximum size, which limits the amount of data that can be contained.The current maximum block size is set at 12.5m gas, the last increase was in July 2020.Since the maximum block size is in gas, and different transactions have different gas usage according to the complexity, there is no consistent maximum of the number of transactions that can be contained in a block.But on average, each block contains about 160-200 transactions.

图片.png

Source: Coin Metrics Network Data Chart

Ethereum gas fees are ultimately paid to Ethereum miners, who earn income through a combination of transaction fees and block rewards (i.e., the newly issued Ethereum).With the rapid increase of Ethereum costs, transaction costs have accounted for 50% of the income of Ethereum miners.

When mining a new block, the miner needs to specify which transactions to include.Due to the limitation of the maximum block size, each block can only contain a limited number of transactions.So miners will naturally give priority to the deals with the highest gas fees, because if they are included, they will make more money.

Sending a deal with a relatively high gas fee makes it more likely that miners will include it in the next block, as they have the incentive to include the deal with the highest gas fee.But there is no guarantee that it will be included.If a certain number of users are willing to pay a higher gas price, then the transaction will not be confirmed until later blocks.

This is even more troublesome when the block continues to be full.Full blocks will increase the strength of gas auctions, because transaction senders are bidding for scarce space.Since the rise of defi in the summer of 2020, the block has maintained about 95% full load or more.In March 2021, the average full load rate of the block is 97% - 98%.

图片.png

Source: Coin Metrics Network Data Chart

Over the years, block gas limits have occasionally been raised, which has resulted in a slight increase in transaction volume per block.But there are also trade-offs that prevent it from increasing too frequently.The larger the gas block limit, the faster the state growth of Ethereum blockchain.A larger blockchain requires more node operator resources, which is conducive to larger scale operations and will damage network decentralization.

What's more, Ethereum gas price fluctuates greatly from block to block.There are services like eth gas station, which recommend the gas fee based on the required confirmation speed.However, it may be difficult to estimate the gas fee of the current block, especially in the case of sudden or unexpected upgrade of block space demand.

图片.png

  • Uni airdrop and rising demand

The gas fee increase of Ethereum corresponds to the increase of defi, and defi may still be the biggest contributor of high gas fee.For example, uniswap's uni airdrop provides a small case study of what happens when the demand for block space suddenly increases.

At 00:00 UTC on September 17Uniswap announced the airdrop of their new uni token.Suddenly, thousands of people rushed to uniswap and started trading Uni.

Uniswap is the largest decentralized exchange (DEX) on Ethereum. All their transactions are executed on the chain, which means that every time a transaction occurs, a transaction is sent to the Ethereum blockchain.This is in sharp contrast to centralized exchanges such as coinbase and binance, where transactions take place outside the chain and are sent only when users need to deposit or withdraw funds.

There are many benefits to the on chain transactions used by uniswap and other DEX.However, there is a disadvantage that it will bring upward pressure on gas fees.Executing transactions faster than others often brings direct economic benefits, so many DEX users are willing to pay high gas fees.

The figure below shows the gas charge of each block before and after uni airdrop.Each point represents the average gas price of a single block, priced in Gwei.The color of each dot represents the median transaction fee per block, in U.S. dollars.As gas fees soared, the median transaction fees temporarily reached more than $12.

When uni token was launched, traders flocked to uniswap to start trading.This led to a sudden surge in gas fees as traders scrambled for block space.As can be seen in the figure below, shortly after midnight (00:00) at UTC, gas prices suddenly vertical and keep rising for the next 24 hours.

If you send a 200 Gwei gas price transaction before midnight, based on the average gas price over the past 12 hours, you expect it to be incorporated into a block more quickly.However, due to the sudden rise in gas prices, your 200 Gwei transactions may not be included in a block for a day or more, until demand weakens and gas prices eventually fall.

图片.png

Source: coin Metrics Network Data Professional Edition

Although airdrop events of the scale of uni are relatively rare, the application and use of defi cause high gas costs in many other ways.One of the reasons for this is the on chain arbitrage between different DEX, which is usually performed by robots.On chain arbitrage could lead to a rise in gas prices as robots compete with each other and become the first person to execute a trade before the opportunity disappears.

  • Eip-1559 & Ethereum's new gas mechanism

After a lot of debate, Ethereum improvement proposal (EIP) 1559 has been passed and will be included in Ethereum's London hard fork to be held this summer.Eip-1559 will change fundamentallyEthereumGas mechanism.Ethereum transactions will have an algorithm to calculate the base cost instead of the user specified gas price.It will also introduce a new block target size mechanism, which aims to keep blocks at their maximum capacity.

Target block size

Eip-1559 will introduce a target block size mechanism, rather than a fixed maximum block size, with the goal of keeping block capacity at 50%.According to eip-1559, the maximum block size will be doubled from 12.5mgas to 25mgas.However, the target block size will remain at 12.5m.

The block size mechanism will maintain a 50% full load rate of the block by adjusting the basic cost. The details are as follows:

Basic cost

Eip-1559 will introduce an algorithmic price (per unit gas) called base cost.A transaction sender must pay a basic fee to incorporate its transaction into a block.

The base cost will be a function of the previous block and will increase or decrease depending on the fullness of the block.If the previous block is larger than the size of the target block (i.e. more than 50% of the full quota), the base cost will increase.This continuously upgraded basic cost will eventually make the transaction cost of some users too high, reduce congestion and reduce the block fullness to 50%.On the contrary, if the block fullness is lower than the target of 50%, the basic cost will be reduced, making the cost of sending transactions lower.

The basic cost will effectively automate the gas price bidding system.The base cost will be calculated by the agreement itself, rather than relying on the recommended gas price based on current gas price estimates.

In addition, the foundation fee will not be paid to the miners, but will be destroyed.The destroyed parts will be permanently removed from the supply, effectively reducing the overall supply of Ethereum.This will benefit the supply economics of Ethereum, as it will effectively reduce the supply expansion of Ethereum.If the cost becomes high enough, it may even deflate Ethereum.

The figure below shows the current supply of Ethereum, which is about 3M Ethereum in total compared with the supply if all transaction costs are burned.This is an oversimplification of what happened after the promulgation of eip-1559, because only the basic fees will be burned, not tips.But it offers an idea of how supply inflation will slow down when eip-1559 is launched.

图片.png

Source: Coin Metrics Network Data Chart

But it has also been opposed by some miners because it could reduce their overall income, at least in the short term.After a heated debate, most of the major mines have approved the transition to eip-1559, though reluctantly.

This basic cost target block size mechanism is expected to keep the block below its maximum capacity for a long time and prevent the Ethereum blockchain from blocking as it is currently.However, if the demand is high enough or sudden upgrade, most blocks may eventually be almost full (at least in a short period of time), similar to the current gas mechanism.

Tips

In addition to the basic fee, the transaction sender can choose to increase the tip.Tips are paid directly to the miners, similar to the current transaction costs.Paying a high tip will encourage miners to trade first as the block approaches capacity.

When sending a transaction, the user sets a fee cap.The fee cap is the highest fee that the sender is willing to pay, including basic fees and tips.If the fee cap is lower than the base fee, the transaction will not be included in a block.If the fee cap is higher than the base charge, the difference will be given to the miners in the block as a tip.

If the block continues to be full, the function of tipping may be similar to the current gas mechanism, and miners will be encouraged to participate in high gas price transactions.However, the target block size mechanism of eip-1559 is expected to prevent the block from reaching its maximum capacity in the long term.

Will eip-1559 reduce gas fees?

Will eip-1559 solve today's high gas fees and greatly reduce Ethereum transaction costs?The short answer is probably not.

High transaction costs are fundamentally a scalability issue.If Ethereum can only process a few hundred transactions per block (on average), as long as DAPP usage continues to increase, there will continue to be high costs.As long as the competition in the block space is fierce, the gas Feig will continue to rise.

Although it may not be able to solve the problem of high charges, eip-1559 will help to improve the user experience of Ethereum and make the cost more predictable.Eip-1559 should help reduce differences in gas fees and give users a better understanding of the actual costs they need to pay.

However, in order to really reduce transaction costs in the long run, it will need the scalability solution of layer2 and the ultimate Ethereum 2.0.By various means, the scalability solution will increase the amount of transactions that can be processed per block, which will help ease congestion that leads to high costs.

A lot of progress has been made in L2 solutions, including optimism, loopring, immutable x, and so on.Due to the debate around eip-1559, Ethereum 2.0 may even arrive earlier than previously planned.But most solutions have a lot of complexity, and it will take time to integrate scalability solutions into the entire network.


Conclusion

Ethereum transaction costs are at the highest level in history.The usage of defi and high competition for block space lead to full blocks and congestion, which drives up gas fees.Eip-1559 will help to improve the transaction cost user experience of Ethereum, but it may not be able to solve the problem of high gas fees in the end.But Ethereum scalability solutions are on the way, which will be a real long-term solution to reduce transaction costs.

Sort:  

You've got a free upvote from witness fuli.
Peace & Love!

Coin Marketplace

STEEM 0.18
TRX 0.13
JST 0.028
BTC 57346.65
ETH 3107.45
USDT 1.00
SBD 2.40