Digital Assets

Concepts: Ethereum Gas Prices

Ethereum gas prices are in the news, but what is gas, why do you have to pay for it to use Ethereum, and why are gas prices so high right now?

Gunnar Jaerv   Gunnar Jaerv · Published on 16 March 2021
   

What is gas?

Gas is the cost of doing business on Ethereum. It’s a secondary currency, used inside Ethereum to cover the cost of using the distributed Ethereum Virtual Machine. Gas is denominated in small fractions of ETH, the core Ethereum cryptocurrency, called gwei. Each action in Ethereum costs some of the total available computational power; that cost is calculated in gas units and charged to users’ accounts in gwei.

Why gas?

Unlike traditional cloud computing, the Ethereum Virtual Machine (see below) doesn’t carry out calculations across the network: each node processes each computation. The whole network is involved every time, so every miner has to be paid. (This is one reason why gas fees are high and rising.) Usage fees were always going to be a part of the equation.

Why not use ETH for gas?

There’s a reason gwei is used rather than ETH. Digital assets are prone to price volatility. ETH prices rise and fall suddenly. If gas prices were charged in ETH, you might agree to pay $100 in ETH for a project, only to find that ETH doubled in price during the course of the work and you had been charged ETH worth double that.

You can use this price calculator to convert one Ethereum currency into the other.

Gas, Blocks and the Ethereum Virtual Machine

A blockchain that supports a digital asset can be thought of as a distributed ledger, and in fact it’s common to use the term “virtual ledger” as a synonym for blockchain. But Ethereum doesn’t just support ETH. It also supports smart contracts.

Smart contracts are self-executing contracts. When certain conditions are met, smart contracts perform actions, like triggering the release of funds to a certain wallet. In this way, each smart contract is like a program; the Ethereum Virtual Machine is like a distributed computer (technically, it’s “pseudo-Turing complete” and can’t do everything a computer can do).

If you’ve ever used a virtual machine or emulator on your desktop, you can think of Ethereum as a virtual machine running on servers all over the world; an internet of computation.

Trouble is, that costs to run; server fees, power fees, and the fees required to make hosting nodes and mining profitable all have to come from somewhere. And Ethereum might be distributed, but it’s not unlimited. (It has some of its own problems with scalability and complexity too.)

Computation is a relatively scarce resource with multiple competing demands on it, and it’s important to manage computation load to prevent the whole Virtual Machine crashing.

Like any other blockchain, Ethereum uses blocks. In older, single-function blockchains, each block has a prescribed size — Bitcoin blocks are 1MB, and they’re never going to get any larger or smaller. But Ethereum has no prescribed block size. Instead, block size is expressed as a block gas limit and determined by the network and miners collectively. Individual miners can bid the size of blocks up and down by around 0.1%, so the network can react to changes in demand by increasing block size. (On occasion, block size has tripled in a single day.)

Gas fees are the price you pay to have your transaction included in the next block, or the price you pay to be allocated the required amount of gas in that block.

Thus, there are three elastic properties: gas price, block size in gas, and gas limits.

What is gas limit and gas price?

  • Gas price: How much you pay per gas unit
  • Gas limit: How much work you’re requesting

A gas unit represents a certain amount of computational work, but it doesn’t have a monetary value. Tiny amounts of ETH, nicknamed gwei, are allocated to each gas unit. That’s the gas price.

Gas price isn’t set in stone. Think of it like an auction. When a lot of people are queuing up to access computational power on Ethereum, you can offer to pay miners more gwei per gas unit to do your work first. If you set your gas price to 0, you’ll sit at the back of the queue, maybe indefinitely. Miners manage Ethereum so as to maximize their profits, meaning they’ll allocate block space/gas only to high bidders.

How are ETH gas fees calculated?

Price isn’t the only factor. You don’t bid per gas unit. You bid on a bundle of gas units. This is the gas limit: you set an upper limit to the amount of computational power you’re bidding on, based on the actions you’re asking to perform. Estimating this accurately requires significant skill, so many apps set the gas limit for you. You lose some price efficiency, but get less friction. Some apps, like Ethstation, will let you set gas price and limit for a faster transaction or a cheaper one that takes place more slowly.

Gas limits are a bet. If you bid too low a gas limit, you might wind up needing more to complete your work. When this happens, you don’t go round again for a second round of bidding. Your work fails. If your gas limit bid is too high you get back the unused gwei/ETH that would have paid for the gas you didn’t use. The gas limit prevents you from spending unlimited ETH by establishing a guaranteed stopping point beyond which you won’t be charged more; it also protects the Ethereum Virtual Machine’s scarce computing power by ensuring that projects don’t start small, grow to be huge, and permanently retain first place in the queue.

Why are Ethereum gas fees so high?

Ethereum gas fees are higher than ever before, because the market inside Ethereum is hot. There’s been a huge groundswell in demand for block space, pushing up the per-gas-unit cost. But where is all this additional interest coming from?

Ethereum is increasingly home to DeFi — Decentralized Finance — projects, with many focusing on yield farming and radically increasing the number of transactions taking place on Ethereum, tightening the supply of gas still further in the process. Complex financial instruments making huge transactions have driven out many smaller investors, because economies of scale mean larger players can better absorb the higher fees.

While there are DeFi projects that have real value, there have also been a lot of low-quality projects that have nevertheless filled up Ethereum blocks and clogged up the network, driving real transaction fees on Ethereum up into the hundreds of dollars and erasing the potential for profit for smaller investors.

Disclaimer


This publication is general in nature and is not intended to constitute any professional advice or an offer or solicitation to buy or sell any financial or investment products. You should seek separate professional advice before taking any action in relation to the matters dealt with in this publication. Please note our full disclaimer here.