Photo by Executium on Unsplash

What is Gwei? Ethereum gas explained

Eric Lastname
Geek Culture
Published in
4 min readJul 16, 2021

--

As Ethereum moves more mainstream, its important to understand a bit more of how it works under the hood. Lets explore tokens, Gwei, and Ethereum!

Put simply. 1 Gwei is 0.000000001 Ether (1 billionth of an Ether) that is used to measure the cost of transactions on the Ethereum network.

What are transaction costs?

Gwei here is a unit of Ether to measure the cost of what is called “gas”. Tokens thought of as “gas” tokens are those that are spent to take action on the network. They are the gas that makes the network function. Lets say you are executing a smart contract on the Ethereum network, that involves a good amount of processing power. You need miners around the world to spend time and electricity validating your contract and its operations. To facilitate this process, you will pay a bit of Ether or “gas” to the miner who mints your transaction into a block. Here you paid a bit extra to get your transaction processed.

Transaction prices for the Ethereum network vary over time as miners join and leave and as the price of Ether moves up and down. Its key to note here that the miners themselves take the price that you pay, incentivizing them to pre-select for transactions that promise a high payment.

Why have gas?

Gas is a key feature that guarantees security of the network and removes bad actors. Since every transaction on the notwork has a real cost, not simply a line of code but a real economic cost of execution measured in Gwei, the ability of bad actors to spam the network or abuse it is largely reduced. Doing so would need large amounts of capital to eat up the gas fee. In addition, the gas fee is not set by some Ethereum gods (see later the London update), but rather set by market forces.

How to compute gas fees?

The fee you will pay for your contract’s execution is not a simple fixed value as discussed before. Just as the market can adjust the price of gas as market demands change how much capacity the network is running at and thus prices, contracts themselves can contain various complexities. A simple contract will take vastly less computational power compared to a more complex contract and this is factored into the overarching gas…

--

--

Eric Lastname
Geek Culture

Software Developer, AWS. Natural Language Processing and Crypto.