What is Gas?
Gas is a unit to measure the amount of computational effort required to execute an operation on the Ethereum Network. Like Transfer, swaps, minting, staking, yield farming etc.
Gas limit is the maximum gas users are willing to pay for executing a transaction. Gwei is a small unit of Ether (ETH). A Gwei or Gigawei is defined as 1,000,000,000 Wei, the smallest base unit of Ether. One gwei equals 0.000000001 or 10^-9 ETH. Conversely, 1 ETH represents 1 billion gwei!
Why is it called Gas?
Gas powers transactions for block space. It is necessary for security as well as to incentivise miners for facilitating transactions. Gas also acts as a security firewall to prevent spam and other attacks by bad actors which bloat the network with zero value transactions. In the same way, Gasoline is used to power vehicles, GAS is used to propel transactions through the network.
How to compute gas fees?
Gas fees you pay for your transactions are variable and it depends on the network demand and also on the price tag of the desired action. Hence, not all transactions consume the same computing power, Smart Contracts themselves can contain various complexities. A simple transaction(p2p) will take less computational power compared to a more complex contract execution such as NFT minting, Let’s just do a simple calculation for an ERC20 token transfer.1 unit of gas costs 100 Gwei. ETH transfer costs 21000 gas limit, thus it costs
100 Gwei * 21000 = 2,100,000 Gwei.
2,100,000 / 1,000,000,000 ETH = 0.0021 ETH.
that roughly equates to $ 7.4529 (at the time of writing)
Below you can see Ethereum’s yellow paper explaining various operations and unit relations.
Previously, the Fee mechanism was structured like an auction and people were competing for block space. Gas can spike up as the block size was fixed and the no. of transactions that can be included in the block were prioritised for higher bidders. After EIP 1559, the system was upgraded to smooth out fluctuations with a base fee and a miner tip, with a refund if overpaid. But EIP 1559 upgrade didn't promise to reduce gas fees significantly, but it pulled back gwei much faster than previously possible and of course, the burn which we all celebrated check out our article on EIP1559. Another major advantage of EIP 1559 implementation is lowering the number of transaction failures.
After EIP-1559 has been implemented, a transaction will only be valid if the Max Fee is greater than the Base Fee plus the Priority Fee. Any excess amount is refunded back to the user. We saw an explosion of NFT space last month, which was the main contributing factor for gas fees going to astronomical levels as ERC721 token transfers as well as contract interactions are gas heavy by design compared to normal ERC20 transactions.
(Statistical) causal evidence NFTs are strongly moving the needle. Case study: 9/2.— takenstheorem (@takenstheorem) September 8, 2021
OpenSea/subset NFTs time T
Base fee at T + 1
Granger-causality test (on deltas): p < .003
Accounts for 42% of variation in base fee!#Ethereum #fees
cc: @sassal0x @ChainLinkGod @korpi87 pic.twitter.com/bCnptZqBWz
Check out the video below too.
Future is 3D Scaling
Layer 2 solutions send batch transactions called rollups which send blockchain state to Layer 1 (Ethereum). Hence in case of emergency, Users can withdraw their assets directly from Layer 2. Layer 2 scaling solutions are being at a rapid pace, we saw projects such as Optimism and Arbitrum launching their mainnet.
Side chains and child chains with Polygon have seen some DeFi Activity in the past. Layer 2 takes 90% data and 99% computation off chain which scales the main chain by a factor of 100 or even 1000s depending on the type of technology and transaction limits L2s choose.
GAS fees in Layer 2 Solutions
Gas fees on some Beta launches don't reflect the actual range as it is capped with transaction limits, mainly on optimism and Arbitrum. We expect those fees to go down significantly in the future.
Currently, ZK Snarks and Optimistic rollups are leading the way with Validium and Plasma catching up.
Vitalik recently tweeted about the future of NFTs in a Cross chain rollup bridging, as gas wars for NFTs were gravity defying.
2,097.7667 $ETH burned 🔥🔥🔥🔥 last hour.— ETH Burn 🔥 Bot 🦇🔊 (@ethburnbot) September 7, 2021
Issuance: 576.7500 ETH
Net Change: -1,521.0167 ETH
Annualized: -11.39% 📉
2021-09-07 19:00-20:00 UTC
Last Block: 13180671
Cumulative 🔥: 231,973.4763 ETH
Despite all excitement for L2s, all of them failed to gather any real crowd as most are in Beta infancy and major Dapps are yet to migrate with full functionality. Arbitrum has seen incredible growth since its mainnet launch in terms of TVL, But that doesn't tell the whole story of user adoption. We will wait until ETH2.0 merge to see the real impact in terms of a GAS fee reduction.