0Pricing
Web3 & DApp Development Fundamentals · Lektion

Gas-Limits und Gebühren

Grundlagen von EIP-1559

Gas-Limits und Gebühren ist eine kostenlose Web3 & DApp Development Fundamentals-Lektion auf CoddyKit. Dies ist Lektion 3 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des Web3 & DApp Development Fundamentals-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der Web3 & DApp Development Fundamentals-Kurs umfasst insgesamt 4 Lektionen.

Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.

Controlling What You Spend

You decide how much computation to allow and how much to pay. The two key controls are the gas limit and the fee parameters.

This lesson covers both, including the EIP-1559 fee model.

The Gas Limit

The gas limit is the maximum amount of gas you authorize a transaction to consume.

A simple ETH transfer needs 21000; complex contract calls need more. Setting it too low causes an out-of-gas revert.

simple transfer:  gasLimit = 21000
token transfer:   gasLimit ~ 65000
complex DeFi swap: gasLimit ~ 200000+

Out of Gas

If execution uses more gas than your limit, it stops and reverts all state changes.

Critically, you still pay for the gas already burned — running out of gas does not give you a refund.

Block Gas Limit

Each block also has a block gas limit — the total gas all its transactions may consume.

This caps how much computation fits in one block, keeping block processing fast across the network.

Before EIP-1559

Originally, fees worked as a blind auction: you bid a gas price and validators picked the highest bids.

This led to overpaying and unpredictable fees during congestion. EIP-1559 reformed this in 2021.

EIP-1559: Base Fee

EIP-1559 introduced a base fee — a per-block fee set automatically by the protocol based on network demand.

The base fee rises when blocks are full and falls when they are empty, making fees more predictable.

block full   -> base fee rises
block empty  -> base fee falls
target: blocks ~50% full

The Burned Base Fee

The base fee is burned — permanently destroyed rather than paid to validators.

This removes the incentive for validators to artificially inflate fees and makes ETH mildly deflationary under heavy use.

Priority Fee (Tip)

To incentivize validators, you add a priority fee, or tip, on top of the base fee.

A higher tip encourages validators to include your transaction sooner during congestion.

totalFee = base fee + priority fee
base fee  -> burned
priority fee (tip) -> validator

Max Fee per Gas

You set a maxFeePerGas — the most you will pay per gas unit total. You also set a maxPriorityFeePerGas for the tip.

If the base fee is below your max, you are refunded the difference. You never overpay beyond your cap.

maxFeePerGas          = 50 gwei
maxPriorityFeePerGas  = 2 gwei
actual base fee       = 30 gwei
paid = 30 + 2 = 32 gwei (refunded 18)

Estimating Gas

Wallets and tools call eth_estimateGas to predict how much gas a transaction needs.

Good estimates avoid out-of-gas failures while not over-reserving gas unnecessarily.

Putting It Together

The gas limit caps computation; EIP-1559 splits the price into a burned base fee plus a validator tip.

Your maxFeePerGas guards against overpaying while ensuring inclusion.

Quick Check

Test your EIP-1559 knowledge.

Recap: Gas Limits and Fees

You learned that:

  • The gas limit caps how much gas a transaction may use
  • Running out of gas reverts but still costs you
  • EIP-1559 uses a burned base fee plus a validator tip
  • maxFeePerGas caps your total cost per unit

Next: nonces and ordering.

Häufig gestellte Fragen

Ist die Lektion „Gas-Limits und Gebühren“ kostenlos?

Ja — der vollständige Text von „Gas-Limits und Gebühren“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des Web3 & DApp Development Fundamentals-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der Web3 & DApp Development Fundamentals-Kurs umfasst insgesamt 4 Lektionen.

Was lerne ich in „Gas-Limits und Gebühren“?

Grundlagen von EIP-1559 Du übst Web3 & DApp Development Fundamentals mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.

Brauche ich Erfahrung, um Web3 & DApp Development Fundamentals zu starten?

Keine Vorkenntnisse erforderlich. Web3 & DApp Development Fundamentals auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 3 von 4.

Wie lange dauert die Lektion „Gas-Limits und Gebühren“?

Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.

Kann ich in dieser Web3 & DApp Development Fundamentals-Lektion Code schreiben und ausführen?

Ja. Jede Web3 & DApp Development Fundamentals-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.

Alle Lektionen in diesem Kurs

  1. Was ist Gas?
  2. Transaktionslebenszyklus
  3. Gas-Limits und Gebühren
  4. Nonces und Reihenfolge
← Zurück zu Web3 & DApp Development Fundamentals