Finder is committed to editorial independence. While we receive compensation when you click links to partners, they do not influence our content.
What is gas in the Ethereum network and how does gas work?
If you want to understand how the Ethereum blockchain works, then you need to understand gas: the fuel that powers the EVM.
Like all decentralized blockchains, the Ethereum (ETH) network is upheld by a community of nodes, independent computers owned by the community and placed all across the world. Each of these nodes runs a platform called the Ethereum virtual machine (EVM), also known as the World Computer, that is similar to a cloud-based service. The EVM works by seeding mathematical problems, which are then sent to nodes to be solved. In doing so, nodes help secure the network. As a result, the EVM is then able to record successful transactions on the Ethereum blockchain.
Like all machines, the EVM needs fuel in order to be powered. We’ve previously covered the concept of mining, predominantly through the lens of bitcoin. We spoke about the idea of how confirming a transaction could become more or less difficult based on the computational power committed to the network versus the number of transactions attempting to be confirmed at any given time. The more difficult the confirmation, the greater the transaction fees as more effort needs to be put in by the miners.
How Ethereum differs from bitcoin
Ethereum uses a different metric for measuring this difficulty, called gas. Each operation that needs to be confirmed on the EVM costs a certain amount of gas to be completed. If this is a simple transfer, the amount of gas required is low. But if it is a complex smart contract, the amount required can be much higher. Effectively, gas is the fee charged by the network to make that change.
When you set about executing a change on the Ethereum network, you set the amount of gas you are willing to spend on getting it confirmed. In short, how much you are willing to reward Ethereum miners for solving the mathematical problem. This is referred to as the gas limit. Think of it like setting your highest bid price on eBay. The final price may not end up at that big amount, but you are willing to spend that much to get there.
Sadly, if you underestimate how much gas you need – as in, set the gas limit too low – the transaction will not be completed and the money you’ve spent on that gas will be lost. However, if you over-estimate you receive a refund of the remaining amount. The idea then of setting the gas limit at the time of a transaction is to establish your “fold” position, where you’re not comfortable throwing any more money on the table to get the job done.
Adding to what is already a confusing system, gas itself has no specific monetary value. It’s just a non-specific unit that shares a relationship to the number of units required to fill a block. However, you do nominate an ETH price in gwei (which is the term given to fractions of an ETH coin – think of it as cents to ETH’s dollar) that you are willing to pay for each unit of gas at the time of requesting the transaction. This gives the gas – your fee for the transaction – a value that can be passed on to the miner.
What impacts Ethereum gas price?
This gets us onto the second part of this equation; if we know that the units of gas represent the computational power required to solve the transaction, what then about the gas price? This is also set by the sender, and is effectively a bid you make in order to encourage miners to confirm the transaction. Set it too low, and you will be waiting a long time to find miners willing to add you to the blockchain. Set it high, and you can get it verified very quickly indeed.
Thankfully, the price of gas and the amount of gas required to trade in ETH – as opposed to using the network for a third-party dapp functionality – isn’t too volatile. There are multiple portals online that track the average price in the market so you can best predict what you need to do, and fees for a standard trade transaction as of the start of 2018 usually hover around the US$0.04 mark.
Token sale event’s during Initial Coin Offerings (ICOs) typically lead to higher gas requirements across the network. During these events, when participants in an ICO have the chance to purchase tokens by sending ETH to an address with a smart contract, the network becomes congested due to the large amount of traffic generated by users trying to rapidly purchase tokens before they run out. ICOs will generally stipulate a recommended gas limit to help users, although if this amount is high, users should be wary that despite setting a high gas limit, it is still possible that the transaction will not be confirmed, and the spent gas will be lost.
If you are wondering why this gas system is used at all, it’s to stop the riff-raff from bogging down the Ethereum network with ridiculously huge computational problems to solve. It creates a scenario where it’s in the best interest of a dapp creator to get the gas cost down, which in turn keeps the EVM running efficiently. This is a problem not faced by bitcoin given it deals with only financial transactions – relatively simple mathematical problems to solve – and not smart contracts.
Plus, since a transaction has a limit, and that limit relates to the maximum amount of transactions that can be stored on a block, hackers can’t set the network’s nodes into an infinite loop and crash the system by tendering unsolvable mathematical problems. As soon as the problem reaches a certain gas requirement, it becomes too big to be appended to the blockchain and can therefore be ignored.
More guides on Finder
What is DeFi? Beginner’s guide to decentralized finance
Confused about DeFi? Find out how it works in this easy-to-read guide.
How to buy and sell Algorand (ALGO)
Find out how to buy ALGO in Canada, which exchanges support it and how Algorand works.
How to buy, sell and trade Aeternity (AE)
Read our comprehensive guide to the Aeternity smart contract platform and how to buy Aeon (AE), Aeternity’s native currency.
A guide to Beam and where to buy it
Beam was the first Mimblewimble coin to go live. Find out how it works and where to buy it.
How to earn passive income with cryptocurrency
It’s possible to make money from cryptocurrency without just buying low and selling high. Here’s how.
What are security tokens?
Learn more about security tokens and why some experts consider them the next big thing in the cryptocurrency space.
How to buy and sell SingularityNET (AGI)
If you want to know how to buy SingularityNET’s AGI tokens, where to store them and what the SingularityNET project aims to do, you can find out here.
How to buy and sell High Performance Blockchain (HPB)
Want to know how to buy and sell High Performance Blockchain tokens (HPB)? Find out in this handy guide.
How to sell Ethereum (ETH)
If you want to sell Ethereum (ETH) for fiat currency or cryptocurrency but don’t know how, you’ll find the help you need in this handy guide.
How to buy and sell FANTOM (FTM)
What is the FANTOM blockchain protocol and how can you buy the platform’s native FTM tokens? Find out in this handy beginner’s guide.
Ask an Expert
You must be logged in to post a comment.