Hilf mit, diese Seite zu ΓΌbersetzen

🌏

Du siehst diese Seite auf Englisch, weil wir sie noch nicht ΓΌbersetzt haben. Hilf mit, die Inhalte zu ΓΌbersetzen.

Development of smart contracts and creating tokens on Ethereum, buying and selling ETH, other consulting.
This page is incomplete and we'd love your help. Edit this page and add anything that you think might be useful to others.

Gas and fees

Sam Richards
Last edit: @samajammin, 15. Januar 2021
Edit page

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.

A diagram showing where gas is needed in EVM operations 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 transaction includes a limit, any gas not used in a transaction is returned to the user.

Diagram showing how unused gas is refunded Diagram adapted from Ethereum EVM illustrated

Further Reading

β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–„β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–„β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–Œβ–’β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–„β–€β–’β–Œβ–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–Œβ–’β–’β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–„β–€β–’β–’β–’β–β–‘β–‘β–‘ ░░░░░░░▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐░░░ β–‘β–‘β–‘β–‘β–‘β–„β–„β–€β–’β–‘β–’β–’β–’β–’β–’β–’β–’β–’β–’β–ˆβ–’β–’β–„β–ˆβ–’β–β–‘β–‘β–‘ β–‘β–‘β–‘β–„β–€β–’β–’β–’β–‘β–‘β–‘β–’β–’β–’β–‘β–‘β–‘β–’β–’β–’β–€β–ˆβ–ˆβ–€β–’β–Œβ–‘β–‘β–‘ β–‘β–‘β–β–’β–’β–’β–„β–„β–’β–’β–’β–’β–‘β–‘β–‘β–’β–’β–’β–’β–’β–’β–’β–€β–„β–’β–’β–Œβ–‘β–‘ β–‘β–‘β–Œβ–‘β–‘β–Œβ–ˆβ–€β–’β–’β–’β–’β–’β–„β–€β–ˆβ–„β–’β–’β–’β–’β–’β–’β–’β–ˆβ–’β–β–‘β–‘ β–‘β–β–‘β–‘β–‘β–’β–’β–’β–’β–’β–’β–’β–’β–Œβ–ˆβ–ˆβ–€β–’β–’β–‘β–‘β–‘β–’β–’β–’β–€β–„β–Œβ–‘ β–‘β–Œβ–‘β–’β–„β–ˆβ–ˆβ–„β–’β–’β–’β–’β–’β–’β–’β–’β–’β–‘β–‘β–‘β–‘β–‘β–‘β–’β–’β–’β–’β–Œβ–‘ β–€β–’β–€β–β–„β–ˆβ–„β–ˆβ–Œβ–„β–‘β–€β–’β–’β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–’β–’β–’β–β–‘ β–β–’β–’β–β–€β–β–€β–’β–‘β–„β–„β–’β–„β–’β–’β–’β–’β–’β–’β–‘β–’β–‘β–’β–‘β–’β–’β–’β–’β–Œ ▐▒▒▒▀▀▄▄▒▒▒▄▒▒▒▒▒▒▒▒░▒░▒░▒▒▐░ β–‘β–Œβ–’β–’β–’β–’β–’β–’β–€β–€β–€β–’β–’β–’β–’β–’β–’β–‘β–’β–‘β–’β–‘β–’β–‘β–’β–’β–’β–Œβ–‘ ░▐▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▒▄▒▒▐░░ β–‘β–‘β–€β–„β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–‘β–’β–‘β–’β–‘β–’β–„β–’β–’β–’β–’β–Œβ–‘β–‘ β–‘β–‘β–‘β–‘β–€β–„β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–„β–„β–„β–€β–’β–’β–’β–’β–„β–€β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–€β–„β–„β–„β–„β–„β–„β–€β–€β–€β–’β–’β–’β–’β–’β–„β–„β–€β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–€β–€β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘

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