Gas and fees
Gas is essential to the Ethereum network. It is the fuel that allows it to operate, in the same way that a car needs gasoline to run.
Prerequisites
To better understand this page, we recommend you first read up on transactions and the EVM.
What is Gas?
Gas refers to the unit that measures the amount of computational effort required to execute specific operations on the Ethereum network.
Since each Ethereum transaction requires computational resources to execute, each transaction requires a fee. Gas refers to the fee required to successfully conduct a transaction on Ethereum.
Diagram adapted from Ethereum EVM illustrated
In essence, gas fees are paid in Ethereum's native currency, ether (ETH). Gas prices are denoted in Gwei, which itself is a denomination of ETH - each Gwei is equal to 0.000000001 ETH (10-9 ETH). For example, instead of saying that your gas costs 0.000000001 Ether, you can say your gas costs 1 Gwei.
This video offers a concise overview of gas and why it exists:
Why do gas fees exist?
In short, gas fees help keep the Ethereum network secure. By requiring a fee for every computation executed on the network, we prevent actors from spamming the network. In order to prevent accidental or hostile infinite loops or other computational wastage in code, each transaction is required to set a limit to how many computational steps of code execution it can use. The fundamental unit of computation is "gas".
Although a transation includes a limit, any gas not used in a transaction is returned to the user.
Diagram adapted from Ethereum EVM illustrated
Further Reading
Related Tools
- ETH Gas Station Consumer oriented metrics for the Ethereum gas market
- Etherscan Gas Tracker Transaction gas price estimator
- Bloxy Gas Analytics Ethereum network gas stats
Related Topics
Help us with this page
If you're an expert on the topic and want to contribute, edit this page and sprinkle it with your wisdom.
You'll be credited and you'll be helping the Ethereum community!
Use this flexible documentation template
Questions? Ask us in the #content channel on our Discord server
Edit page