> For the complete documentation index, see [llms.txt](https://www.ankitavirani.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.ankitavirani.com/experience/protocols/ercs-and-eips/eip-1559.md).

# EIP-1559

## **EIP-1559: Ethereum's Fee Market Revolution**

### Introduction

EIP-1559 (Ethereum Improvement Proposal 1559) is a significant upgrade to Ethereum's fee mechanism, implemented in August 2021 as part of the London Hard Fork. It fundamentally changed how transaction fees are calculated and processed on the Ethereum network.

### Key Concepts

* **Base Fee:** A dynamically adjusted fee that all users must pay for their transactions
* **Priority Fee (Tip):** An optional tip to incentivize miners/validators to process transactions faster
* **Fee Burning:** The base fee is burned (destroyed) rather than paid to miners
* **Block Size Flexibility:** Blocks can be up to 2x the target size to handle demand spikes

### How EIP-1559 Works

<figure><img src="/files/IGoqGfCpukNNbOsQpDTk" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/S4CyphEQMWaAEJM3ROPT" alt=""><figcaption></figcaption></figure>

### Technical Implementation

```solidity
// Example of sending a transaction with EIP-1559
const transaction = {
    to: receiverAddress,
    value: ethers.utils.parseEther("1.0"),
    maxFeePerGas: ethers.utils.parseUnits("50", "gwei"),     // Maximum fee willing to pay
    maxPriorityFeePerGas: ethers.utils.parseUnits("2", "gwei") // Tip for validators
};
```

### Benefits and Impact

* **Predictable Fees:** More reliable fee estimation and reduced price volatility
* **Improved User Experience:** Simpler fee market and reduced overpayment
* **Deflationary Mechanism:** Base fee burning reduces ETH supply over time
* **Network Security:** Better protection against spam attacks

### Before vs After EIP-1559

| **Aspect**         | **Before EIP-1559** | **After EIP-1559**                 |
| ------------------ | ------------------- | ---------------------------------- |
| Fee Structure      | Single gas price    | Base fee + priority fee            |
| Fee Recipient      | All to miners       | Base fee burned, tip to validators |
| Block Size         | Fixed               | Dynamic (up to 2x)                 |
| Fee Predictability | Highly volatile     | More predictable                   |

### Common Use Cases

* **DeFi Transactions:** More reliable fee estimation for DEX swaps and lending
* **NFT Minting:** Better handling of gas spikes during popular mints
* **Smart Contract Deployment:** More predictable deployment costs

### Best Practices

* Always set a reasonable maxFeePerGas to avoid excessive costs
* Monitor network conditions to optimize priority fees
* Implement proper error handling for fee-related issues
* Consider using EIP-1559-aware libraries and tools

### Challenges and Considerations

* **MEV Impact:** Relationship with Maximal Extractable Value
* **Network Congestion:** Handling of extreme network conditions
* **Validator Economics:** Changes to validator revenue model

This implementation has become a cornerstone of Ethereum's economic model, significantly improving the network's usability and efficiency while introducing a deflationary mechanism through fee burning.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.ankitavirani.com/experience/protocols/ercs-and-eips/eip-1559.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
