# Account Abstraction

**Version:** ERC-4337 (EntryPoint v0.6)\
**Deployed Components:** EntryPoint, Bundler Service, Verifying Paymaster\
**Network:** BlockDAG Mainnet

### 1. Introduction

Account Abstraction (AA) redefines Ethereum’s account model by moving from Externally Owned Accounts (EOAs) with private keys and gas payments toward smart contract accounts that define their own validation logic.

The key enabler is ERC-4337, which introduces a new transaction flow without requiring changes to Ethereum’s consensus layer. Instead of EOAs sending transactions directly, users submit UserOperations (UserOps) to an alternative mempool, processed by a bundler service.

This model unlocks:

* Custom signature schemes (biometrics, MPC, social recovery).
* Gas sponsorships (transactions without holding ETH).
* Flexible UX (batching, meta-transactions, account upgradeability).

### 2. UserOperations

A UserOperation is the ERC-4337 equivalent of a transaction, but with richer structure.

#### Core Fields

* sender – Smart account address.
* nonce – Replay protection.
* initCode – Code to deploy the account if it doesn’t exist yet.
* callData – Encoded function calls.
* callGasLimit, verificationGasLimit, preVerificationGas – Gas budgeting.
* maxFeePerGas, maxPriorityFeePerGas – Fee configuration (EIP-1559 compatible).
* paymasterAndData – Optional field for Paymaster sponsorship.
* signature – Authorization proof.\ <br>

1. User signs and submits a UserOperation to the bundler RPC.
2. Bundler validates via simulateValidation in EntryPoint.
3. If valid, it enters the alternative mempool.
4. Bundler selects UserOps, forms a bundle, and submits a single transaction to EntryPoint.
5. EntryPoint executes and emits UserOperationEvent logs.<br>

### 3. Core Components

#### 3.1 EntryPoint Contract (v0.6)

* Deployed once per chain.
* Provides validation and execution logic.
* Tracks deposits for accounts and Paymasters.
* Ensures replay protection and security checks.
* Emits logs (UserOperationEvent) for monitoring.

#### 3.2 Bundler Service

The bundler is a specialized node implementing the ERC-4337 mempool and RPC.

**Responsibilities**

* Accept UserOps via RPC (eth\_sendUserOperation).
* Run simulateValidation:
* Validates account logic.
* Checks Paymaster conditions.
* Computes prefunding.
* Maintain mempool and reputation system.
* Bundle UserOps based on thresholds/time and submit to EntryPoint.
* Provide query methods:
* eth\_estimateUserOperationGas
* eth\_getUserOperationReceipt
* eth\_getUserOperationByHash

**Execution Flow**

1. Validate UserOp.
2. Compute prefund requirement.
3. Add to mempool with reputation tracking.
4. Bundle → Submit → Process events.

**Bundler implementation:** Eth Infinitism reference repo, extended for BlockDAG.

#### 3.3 Paymaster Contract (Verifying Paymaster)

The Verifying Paymaster enables gasless transactions by covering gas costs for users.

**How paymasterAndData Works**

paymaster(20 bytes)&#x20;

\+ abi.encode(uint48 validUntil, uint48 validAfter)&#x20;

\+ signature

* Constructed by VerifyingPaymasterAPI.ts.
* Signs a hash of the UserOperation plus validity window.
* Computes preVerificationGas (PVG) with a placeholder signature, re-signs if necessary.\ <br>

**Runner Integration**

* CLI flags:
* \--paymaster \<addr>
* \--verifierMnemonic \<file>
* \--pmValidFor \<seconds>
* \--pmAutoTopUp
* Verifies account owner and Paymaster signatures before submission.
* Can automatically top up the Paymaster deposit in EntryPoint.\ <br>

**Requirements**

* Paymaster must be staked and funded.
* On-chain verifying signer must match the local signer.

**Outputs**

* Logs PVG components and computed hash.
* Provides detailed error diagnostics on failure.

### 4. System Workflow

flowchart TD

&#x20;   A\[User] -->|Signs UserOp| B\[Bundler RPC]

&#x20;   B --> C\[simulateValidation in EntryPoint]

&#x20;   C -->|Valid| D\[Mempool]

&#x20;   D --> E\[Bundle Manager]

&#x20;   E -->|Submit tx| F\[EntryPoint Contract]

&#x20;   F -->|Executes call| G\[dApp/Smart Account]

&#x20;   F -->|Gas Sponsorship| H\[Verifying Paymaster]

&#x20;   F --> I\[UserOperationEvent Logs]

### 5. References

* ERC-4337 Specification:\
  [EIP-4337: Account Abstraction Using Alt Mempool<br>](https://eips.ethereum.org/EIPS/eip-4337)
* EntryPoint Contracts:\
  [account-abstraction repo<br>](https://github.com/eth-infinitism/account-abstraction)
* Bundler Implementation:\
  [eth-infinitism bundler](https://github.com/eth-infinitism/bundler)

### 6. Conclusion

Account Abstraction on BlockDAG introduces programmable accounts, gasless transactions, and advanced sponsorship models. With EntryPoint v0.6, a fully compliant bundler service, and the Verifying Paymaster, we have established a secure and extensible framework for user-friendly decentralized applications.

<br>


---

# Agent Instructions: 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://docs.blockdagnetwork.io/new-features/account-abstraction.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.
