Ethereum gas prices soared in the span of just a few months. Ethereum gas is a fee you must pay to complete a transaction on the Ethereum network. The Gas fee has been increasing since the beginning of the year and is expected to continue along this trend. Before explaining the reason for this, let’s take a look at how gas works on the Ethereum network.
Ethereum, as many other cryptocurrencies, uses the same basic mechanism to prioritize transactions. First, users attach a fee to each transaction. Then, miners choose the highest paying transactions to include in the blocks. Upon inclusion, the users pay the fee that was attached to their transaction.
Ethereum 2.0 is expected to address some of the problems associated with rising gas prices since Ethereum 2.0 moves from a proof-of-work (PoW) consensus algorithm to a proof-of-stake (PoS) algorithm
In PoW, the miners solve cryptographically hard puzzles by using their computational resources. In PoS, the miners become validators who lock some of their tokens (Ether) as a stake in the ecosystem. The validator that creates the next block is based on the volume of the tokens they have staked. When the block gets added, the validators get a block reward in proportion to their stake.
Ethereum Fee Model
You have to pay gas fees to complete the transaction on the Ethereum blockchain. Gas charges are used to pay for the processing power required to complete the transaction. It rewards Ethereum miners for the work required to secure transactions on the network. Gs has several other uses as well. Some of these include smart contract execution, DApp execution, and blockchain data storage.
Gas prices are measured in Ether, the currency used on the Ethereum network. Nonetheless, for accounting purposes, lesser units are represented by a part of the Ether called Gwei with each representing 0.000000001 Ether.
1 Ether = 1018 Wei = 1,000,000,000,000,000,000 Wei
1 Gwei = 109 Wei = 0.000000001 Ether
Before we continue, let’s make sure the terminology is clear:
- Ethereum: Blockchain protocol, permissionless, non-hierarchical network of computers.
- Ether (ETH): Cryptocurrency generated and used by Ethereum. Ether is listed on exchanges under the ticker symbol ETH.
- Wei: The smallest subunit of ETH equal to 10-18 ETH (denoted as a Wei).
The gas consists of two components: gas limit and gas price.
The gas limit is the maximum amount of gas you want to pay for a transaction. A little gas is required for all operations in the transaction. The amount of gas you need will depend on the complexity of the transaction, i.e. the number of instructions to follow.
Gas prices can be set by users. If you set the gas price too low, your transaction will be initially executed, but once gas runs out, the miners will stop performing work on your transaction. The blockchain will record the transaction as “Failed”, and your ETH will still be in your wallet, since there was insufficient gas to fully execute the transfer. The gas used for the failed transaction will be kept by the miners for their work and you will not get it back.
Gas is a payment paid by the Ethereum network in exchange for using the platform’s computing power. Fees are paid in the platform’s currency, Ether (ETH). A single transfer can consume up to 21,000 units of gas, while more complex transactions (e.g. transactions used for smart contracts) can consume over 1,000,000 units of gas.
Each gas unit has a price that is simply called the „gas price“. The gas price is equivalent to 1 ETH = 1 * 109 (1,000,000,000). If the Gwei price is 5, a transaction of 21,000 units of gas will require 21,000 * 5 = 105,000 Gwei (0.000105 ETH). A term used on the Ethereum platform, it refers to the unit of measure of computational effort when performing smart transactions or contracts or executing DApps on the Ethereum network. This is the „fuel“ of the Ethereum network.
You can use ETH Gas Station to estimate gas costs. Unfortunately, the lower the price, the longer it takes to process the transaction. This is because miners prioritize higher-cost transactions.
To make it easier to understand, let’s look at an example of moving money between existing bank accounts. James transfers $500,000 from his account to Susan’s account and pays a fee of $1. In an ETH-based network, the standard amount for James‘ account is the total ETH involved in the transaction, and $1 is the gas charged to process the transaction.
Dynamic Gas Price
The amount of gas required for a particular transaction remains constant, but gas prices are dynamic. When the user sends a transaction, he sets the gas price (often done automatically by the wallet application) and the transaction is sent to 5 pools for Ethereum miners to be included in the next block. Miners are rewarded in the form of transaction fees within the block, so they are encouraged to prioritize higher-cost gas transactions.
This structure leads to an auction market where consumers raise gas prices, allowing miners to receive transactions and be motivated to settle them quickly.
If everything works as normal:
- When the ETH price rises, the average gas price falls and vice versa.
- When the demand for Ethereum transactions increases, the average price increases, and vice versa.
These two market conditions are what drive the dynamics of gas prices we observe today.
The limits specified depend on the complexity of the operations you want to run on the blockchain or the speed at which you want to perform transactions. Since the ETH-based platform is a huge ecosystem, transactions have often increased. Therefore, miners using the protocol tend to prioritize transactions with high gas limits.
However, if the trader sets a higher gas limit and does not use the entire quantity for processing, the surplus is returned to the consumer’s account. The complexity of the transaction is determined by the service used.
One of the benefits of using the gas limit feature is to prevent the wrong code from being charged more than necessary for the transaction, especially in smart contracts.
In the real world, gas can be compared to automobile fuel, and the gas limit is the automobile fuel tank.
In the analogy above, the driver must carefully estimate the amount required for a given trip to avoid inconveniences such as interference. Similarly, Ethereum users must provide adequate gas limits to ensure that transactions are not interrupted and registered as „failed“ on the blockchain. Unfortunately, if the transaction fails, the gas already in use will not be returned. ETH wallets like MetaMask allow you to set gas limits.
Now, you may be wondering why there is a gas price limit. Unlike Bitcoin, where the block size is limited by the byte size, Ethereum blocks are limited by the amount of transaction gas used in the block.
Ethereum blocks are mined roughly every 15 seconds. Each Ethereum block has a maximum size, which limits the amount of data that can be included. The current maximum block size is set at 12.5M gas and was last increased in July 2020. Since the maximum block size is denominated in gas and different transactions have different gas usages based on complexity, there isn’t a consistent maximum number of transactions that can be included in a block. But on average, about 160-200 transactions are included per block.
If the block gas limit was 10,000,000, then each block (mined roughly every 15 seconds) could include a maximum of 476 transactions assuming each transaction used 21,000 gas. Of course, each transaction consumes a different amount of gas in real life.
Gas block limits lead to very high gas prices, which has been seen in the past. When demand for Ethereum is high, consumers raise gas prices in the hope that their transaction will be included in the next block.
How to Calculate the ETH Gas Price
To calculate the total transaction cost, multiply the gas limit by the gas price. For example, suppose you set the gas limit to 40,000 units and the gas price to 20 Gwei. In this instance, the total amount you want to spend to execute the transaction is 40,000 * 20 = 800,000 Gwei or 0.0008 ETH.
While limits are fairly consistent, gas prices may vary. We recommend looking at ETH Gas Station to check the current gas price recommendations. Another thing that can happen when you set the gas price too low is your gas may expire before the transaction is completed. This means that the transaction is canceled and you lose the gas fee.
Cryptocurrency Sales Increase
In March, panic buying resulted in a market sell-off, showing sales in the stock market. This could be due to the uncertainty caused by the global COVID-19 pandemic and the price war between Russia and Saudi Arabia. Along with this, cryptocurrencies have also been sold because of the need to run towards safer investments and less risk.
Market sales were also activated by the liquidation of DeFi’s loaning position. If you are unfamiliar with DeFi, it is an abbreviation for decentralized finance. It’s basically a cryptocurrency re-generation of traditional financial products on a decentralized platform like Ethereum. DeFi’s products include decentralized exchanges, loaning and lending markets, forecast/betting markets, payment networks, and more.
DApps give users access to loans using cryptocurrency as collateral. However, the price of the cryptocurrency used as collateral may fall below a certain level. If this occurs, through the use of smart contracts, these positions are automatically settled.
As a practical recap, if you can choose when to send your transaction, it is a good idea to check these resources to see when the gas fee could be lower and decide accordingly: