Gas, on the Ethereum network, measures the amount of computational effort required to perform transactions through the network.

Think of Gas similar to how fuel allows a car to drive. Gas fuels any type of transaction on the Ethereum blockchain.

What's the math?

For example, sending Ethereum from one wallet to another wallet costs 21,000 Gas. But the 21,000 Gas doesn’t tell us how much a transaction is going to cost. We need to multiply the cost of a particular transaction by Gigawei (GWEI).

The gas cost is measured in gwei.

1GWEI = 0.000000001 ETH

If you want to execute a transaction in which your wallet estimates the gwei to be 100, in order to process your transaction fairly quickly, you need to do the simple math below:

21,000 x 100 gwei = 21 million gwei which equals 0.0021 ETH.

Multiply 0.0021 by the current price of ETH, which is currently $3,900 USD and you get $8.19 USD. That is the total cost of the transaction.

Fast, medium, and slow transaction speeds

Wallets typically let you know how much a transaction is going to cost in real-time. You can choose between fast, medium, and slow transaction speeds. The faster you’d like the transaction to be processed, the higher the Gas fee.

Custom Tx Speed.png

Mempool

All transactions are sent to the “Mempool” (short for memory pool). The Mempool is where pending transactions are waiting for miners to execute them. Miners are incentivized to pick the pending transactions with the highest gas price first. Essentially, people are bidding higher gas fees in order for their transactions to be processed first.

You can visit https://etherscan.io/ to check what the live medium (average) gas rate is, so you can execute your transaction as quickly as possible.

Thanks to Wassim Kanaan for writing this article!

Thanks to Glou for editing it!

External resources: