> ## Documentation Index
> Fetch the complete documentation index at: https://docs.safefoundation.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> What is ERC-4337 and why do we need it?

## What is ERC-4337?

[ERC-4337](/more/glossary#erc-4337) addresses the challenges associated with account abstraction without requiring changes to the consensus-layer protocol. It serves as a transaction relayer for smart accounts like Safe. It does so by introducing a pseudo-transaction object called a `UserOperation`, which sends a transaction on behalf of the user.

Nodes in Ethereum can act as a Bundler, which picks up multiple user operations and packs them into a single transaction known as a bundle transaction. The bundle transactions are then sent to a global smart contract on Ethereum (of which there is only one) called the `EntryPoint`.

```mermaid theme={null}
---
title: Simplified ERC-4337 flow
---
flowchart TD
    A(Dapp
    Users kick off a ERC-4337 flow through a dapp) -->|UserOperation| B(Bundler
    Decentralized network of relayers to propagate UserOperations)
    B -->|Bundle Transactions| C(EntryPoint Contract
    Contract to ensure onchain authentication)
    C -->|Invoke UserOperation| D(Smart Account 
    Smart contract validates and executes the individual UserOperations)
    style A stroke:#12ff80
    style B stroke:#12ff80
    style C stroke:#12ff80
    style D stroke:#12ff80
```

ERC-4337 enhances usability by introducing paymasters. This decentralized mechanism allows users to pay gas fees using ERC-20 tokens (like USDC) instead of native tokens like ETH or to seek a third party to cover their gas fees entirely.

ERC-4337 is currently under development and still needs to be finalized, so developers should pay attention to new changes that may occur.

## Why ERC-4337?

ERC-4337 provides a bunch of benefits along with all the inherent advantages of utilizing smart accounts:

<Columns cols={3}>
  <Card title="Flexibility of payments" href="#why-erc-4337">
    Users can decide how to pay the gas fees. Use native tokens like ETH, ERC-20 tokens, or even sponsored transactions.
  </Card>

  <Card title="Freedom of Authentication" href="#why-erc-4337">
    It enables the use of different authentication mechanisms, such as multi-signature, passkeys, and future quantum-proof cryptography.
  </Card>

  <Card title="Decentralization" href="#why-erc-4337">
    It's supported by various providers, avoiding lock-in to a single-relayer technology, offering an anti-fragile approach with no single point of failure.
  </Card>
</Columns>

## Further reading

* [Official documentation](https://www.erc4337.io)
* [EIP document](https://eips.ethereum.org/EIPS/eip-4337)
