Coin Metrics: Why is the gas fee of Ethereum so high?
拔丝地瓜
2021-03-24 12:56
本文约5695字,阅读全文需要约23分钟
Ethereum scalability solutions are on the way, which will be real long-term solutions to lower transaction fees.

Editor's Note: This article comes fromCrypto Valley Live (ID: cryptovalley)Editor's Note: This article comes from

Crypto Valley Live (ID: cryptovalley)

Crypto Valley Live (ID: cryptovalley)

The adoption of Ethereum is growing at an unprecedented rate. Decentralized finance (DeFi) continues its meteoric rise, stablecoins are adopted globally, and NFTs are becoming an everyday topic.

The use of Ethereum is a very good signal for the long-term prospects of the network. But in the short term, it caused some growing pains. In early 2021, Ethereum transaction fees have soared to new highs.

For context, at the peak of the 2017/2018 bull market, the average Ethereum transaction fee hit $5.70. Since January 18, 2021, the average Ethereum transaction fee has exceeded $5.70 every day. The median transaction fee has been above $10 for most of the year.

image description

Part of the reason for the increase in transaction fees is the huge increase in the price of Ethereum. As Ethereum becomes more valuable, transaction fees will also become more expensive in U.S. dollar terms. But this is also due to the sharp increase in Gas fees caused by network congestion.

To further complicate matters, ethereum's fee structure will change this July, now that ethereum improvement proposal EIP 1559 is formalized for inclusion in the upcoming London hard fork.

In this report, we'll first look at Ethereum's current fee mechanism, and what drives high fees. Then we'll look at EIP-1559, and how it will change Ethereum's fees going forward.

secondary title

Overview of Ethereum GAS

Gas Cost

To send transactions or interact with Ethereum decentralized applications (dapps), users pay fees. Ethereum fees are often referred to as Gas. Similar to a car needs gas to run, Ethereum applications need Gas to execute.

"Gas limit "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 single token transfers, require less Gas. Ultimately, Gas is just another way of measuring transaction fees. Gas fees are paid in Ethereum and denominated in GWEI. GWEI is just a smaller denomination of Ethereum, similar to how a penny is a smaller denomination of a dollar. 1 GWEI is worth 0.000000001 Ethereum.

Different Ethereum transactions require different amounts of computation. Simple transactions like token transfers require 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 21,000 Gas. But executing a transaction on a decentralized exchange may require 100,000 Gas or more.

It refers to the maximum amount of Gas that a user is willing to use in a single transaction. Ethereum users can specify their desired gas limit when sending transactions. However, changing the gas limiti does not change the actual amount of gas required to perform the operation. The gas limit is just a safeguard to protect users from dapps that might try to use large amounts 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 trades will not be executed, but they will still be charged.

Gas price

Gas per transaction has been trending down since January 2020. This suggests that increased transaction complexity is not the reason for high transaction fees.

image description

Source: Coin Metrics Network Data Chart

Gas price only determines the amount that users need to pay for each unit of Gas used, and does not change the amount of Gas required to execute a transaction. Therefore, the exact same smart contract interaction executed at different times may have very different Gas costs depending on the Gas price used. This tends to lead to confusion, especially for new users.

Gas prices also tend to fluctuate and depend on demand for block space. Average gas prices soared to all-time highs in the summer of 2020 due to the rise (and fall) of DeFi. The growth of decentralized exchanges, on-chain arbitrage, yield farming, and the launch of new tokens has all contributed to a sharp rise in competition for transaction priority, resulting in rising Gas prices.

On September 17, 2020, after Uniswap's unexpected UNI Token airdrop, the average price reached a peak of more than 500GWEI. In 2021, as DeFi continued to soar, Gas prices soared again, and the sharp rise in Ethereum prices also brought new traders and speculators.

image description

Source: Coin Metrics Network Data Chart

Gas auction

So, since users can choose to pay the lowest gas fee, why should they choose to pay high gas fee? In short, higher gas fees lead to faster transaction confirmations.

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

Unfortunately, waiting in line at a bus stop doesn't necessarily give you an advantage. If someone keeps showing up willing to pay more than you, they'll keep getting prioritized, even if you're waiting there longer.

This is a slightly simplified version of how the Ethereum Gas auction works. Ethereum blocks are mined roughly 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, and the last increase was in July 2020. Since the maximum block size is in units of Gas, and different transactions have different Gas consumptions according to their complexity, there is no consistent maximum number of transactions that can be included in a block. But on average, each block contains about 160-200 transactions.

image description

Source: Coin Metrics Network Data Chart

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

Sending a transaction with a relatively high gas fee makes it more likely for miners to include it in the next block, since they have an incentive to include the transaction 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 a later block.

This is even more troublesome when blocks are consistently full. Full blocks escalate the intensity of gas auctions, as transaction senders are bidding for scarce space. Since the rise of DeFi in the summer of 2020, blocks have remained around 95% full or more. In March 2021, the average block full rate is 97%-98%.

Source: Coin Metrics Network Data Chart

Over the years, the block gas limit has been raised occasionally, which has resulted in a slight increase in the number of transactions per block. But there are some trade-offs that prevent it from increasing too often. The larger the Gas block limit, the faster the state of the Ethereum blockchain will grow. Larger blockchains require more node operator resources, which favors larger-scale operations and hurts network decentralization.

To further complicate matters, the Ethereum Gas price fluctuates greatly from block to block. There are services like ETH Gas Station, which will recommend what gas fee to set according to the required confirmation speed. But estimating the gas fee for the current block can be difficult, especially if there is a sudden or unexpected escalation in block space requirements.

secondary title

UNI Airdrop and Rising Demand

Ethereum’s gas fee rise corresponds to the rise of DeFi, which is still likely to be the largest contributor to high gas fees. For example, Uniswap’s UNI airdrop provides a small case study of what happens when demand for block space suddenly increases.

At 00:13 UTC on September 17th (08:13 EST on September 16th), Uniswap announced an airdrop of their new UNI Token. Suddenly, thousands of people rushed to Uniswap to start trading UNI.

Uniswap is the largest decentralized exchange (DEX) on Ethereum, and all their transactions are executed on-chain, which means that every time a transaction occurs, a transaction is sent to the Ethereum blockchain. This is in stark contrast to centralized exchanges like Coinbase and Binance, where transactions happen off-chain and are only sent when users need to deposit or withdraw funds.

The figure below shows the gas fee per block before and after the UNI airdrop. Each point represents the average Gas price of a single block, denominated in GWEI. The color of each dot represents the median transaction fee per block, in USD. As gas fees soared, the median transaction fee was temporarily above $12.

When UNI Token was launched, traders flocked to Uniswap to start trading. This caused a sudden spike in gas fees as traders competed for block space. In the chart below you can see that shortly after midnight UTC (00:00), the price of Gas suddenly went vertical and continued to increase for the next 24 hours.

image description

Source: Coin Metrics Network Data Pro

While airdrop events on the scale of UNI are relatively rare, the adoption and use of DeFi contributes to high gas fees in many other ways. One particularly big reason for this is the on-chain arbitrage between different DEXs, often executed by bots. On-chain arbitrage can lead to higher gas prices as bots compete against each other to be the first to execute a trade before the opportunity is gone.

secondary title

EIP-1559 & Ethereum's New Gas Mechanism

After much debate, Ethereum Improvement Proposal (EIP) 1559 has been approved and will be included in Ethereum's upcoming London hard fork this summer. EIP-1559 will fundamentally change Ethereum's gas mechanism. Ethereum transactions will have an algorithmically calculated base fee instead of a user-specified gas price. It will also introduce a new block target size mechanism, the purpose of which is to allow blocks to continuously reach 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 the block capacity at 50%. According to EIP-1559, the maximum block size will be doubled from 12.5MGas to 25MGas. But the target block size will remain at 12.5M.

The block size mechanism will maintain a 50% full block rate by adjusting the base fee, as detailed below:

basic cost

EIP-1559 will introduce an algorithmically calculated price (per unit of Gas) called a base fee. Transaction senders must pay a base fee to have their transactions included in a block.

The base fee will effectively automate the gas price bidding system. Base fees will be calculated by the protocol itself rather than relying on recommended gas prices based on current gas price estimates.

Also, the base fee will not be paid to miners, but burned. The burned portion will permanently remove it 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 inflation of Ethereum. It even has the potential to make Ethereum deflationary if fees become high enough.

The chart below shows the current supply of Ethereum compared to the supply if all transaction fees were burned, which is about 3M ETH in total. This is an oversimplification of what happened after EIP-1559 was enacted, as only base fees would be burned, not tips. But it offers an idea of ​​how supply inflation will slow down after EIP-1559 rolls out.

image description

Source: Coin Metrics Network Data Chart

But it has also been opposed by some miners because it could reduce their overall revenue, at least in the short term. After intense debate, most major mining pools have endorsed the transition to EIP-1559, albeit reluctantly.

This base fee target block size mechanism will hopefully keep blocks below the maximum capacity in the long term and prevent the Ethereum blockchain from clogging up as it currently does. But if the demand is high enough or suddenly escalates, there may still be a situation where most blocks end up almost full (at least for a short period of time), similar to the current Gas mechanism.

tips

In addition to the base fee, transaction senders can also choose to add a tip. Tips are paid directly to miners, similar to current transaction fees. Paying a high tip will incentivize miners to prioritize transactions when blocks are close to capacity.

When sending a transaction, users set a fee cap. A fee cap is the most a sender is willing to pay, including base 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 fee, the difference is sent as a tip to the miner of the block.

If the block continues to be full, the function of the tip may be similar to the current Gas mechanism, and miners will be motivated to include transactions with high Gas prices. However, the target block size mechanism of EIP-1559 will hopefully prevent blocks from reaching their maximum capacity in the long run.

Will EIP-1559 reduce gas fees?

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

However, to truly reduce transaction fees in the long-term, Layer 2 scaling solutions, and eventually Ethereum 2.0, will be required. By all means, scalability solutions will increase the amount of transactions that can be processed per block, which will help alleviate congestion that leads to high fees.

in conclusion

There has been a lot of progress on L2 solutions, including Optimism, Loopring, and Immutable X, to name a few. Due to the debate surrounding 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 incorporate scalability solutions into the entire network.

拔丝地瓜
作者文库