Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
ERC7769 proposes a JSON-RPC API that allows ERC4337 contract accounts to submit UserOperation objects to bundlers.
This article translates, summarizes, and expands on the proposal below.
I also cover other EIPs here:
Overview
ERC7769 defines new JSON-RPC methods that allow ERC4337 contract accounts to communicate with nodes and bundlers in the UserOperation mempool. These methods provide functionality similar to the API for conventional Ethereum transactions. The proposal also defines debug methods to make development, testing, and debugging easier.
For background on ERC4337, see the following article.
[ERC4337] Account Abstraction Without Protocol Changes
Motivation
ERC4337 uses a UserOperation object instead of a conventional Ethereum transaction to express a user's intended operation. The object contains all the information needed to describe what the user wants to execute.
Existing Ethereum JSON-RPC methods, however, were not designed to handle UserOperation objects. Operating an ERC4337 mempool therefore requires a common API that all compatible implementations can use. A standardized API ensures interoperability between implementations and lets developers interact with different ERC4337 environments through the same interface.
Specification
What is a bundler?
A bundler is a node that collects ERC4337 UserOperation objects and submits them to Ethereum in batches.
Specifically, the bundler groups multiple UserOperation objects and processes them together through the handleOps function of the EntryPoint contract.
This is a different way of managing operations from conventional Ethereum transactions.
What is eth_sendUserOperation?
eth_sendUserOperation is a JSON-RPC method for submitting a UserOperation object to the UserOperation mempool.
It validates the submitted operation and returns the appropriate response.
On success, it returns the operation's hash (userOpHash).
If validation fails or the operation cannot be admitted to the mempool, the method returns an error.
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_sendUserOperation",
"params": [
{
sender, // address
nonce, // uint256
factory, // address
factoryData, // bytes
callData, // bytes
callGasLimit, // uint256
verificationGasLimit, // uint256
preVerificationGas, // uint256
maxFeePerGas, // uint256
maxPriorityFeePerGas, // uint256
paymaster, // address
paymasterVerificationGasLimit, // uint256
paymasterPostOpGasLimit, // uint256
paymasterData, // bytes
signature // bytes
},
entryPoint // address
]
}Parameters
The method accepts an object containing the UserOperation fields and the address of the EntryPoint contract that will process it.
UserOperation contains the sender's address (sender), gas parameters such as callGasLimit and verificationGasLimit, the signature (signature), and paymaster-related information (paymaster).
entryPoint identifies the EntryPoint contract responsible for processing the UserOperation.
These parameters must generally be encoded in hexadecimal.
The factory and factoryData fields must be supplied together, as must the paymaster-related fields when a paymaster is used.
Return values and error codes
Successful response
If the UserOperation is admitted to the mempool, the method returns its hash (userOpHash).
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x123456789012345678901234567890123456789012345678901234567890abcd"
}Error response
If the UserOperation is rejected for any reason, the response contains an error message and an error code.
- Invalid UserOperation structure (code: -32602)
- Returned when the UserOperation's format or fields are invalid.
- Wallet creation or validation failure (code: -32500)
- Returned when validation fails in the EntryPoint contract's
simulateValidationflow.
- Returned when validation fails in the EntryPoint contract's
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"message": "AA21 didn't pay prefund",
"code": -32500
}
}-
Paymaster validation failure (code: -32501)
- Returned when
validatePaymasterUserOprejects the operation. The paymaster is the contract that pays the UserOperation fees.
- Returned when
-
ERC7562 rule violation (code: -32502)
- Returned when a UserOperation violates the opcode validation rules defined by ERC7562.
For further context, see the validation rules in ERC7562.
-
Validity period violation (code: -32503)
- Returned when the operation is outside the validity period set by the wallet or paymaster.
- The response contains validity information such as
validUntilandvalidAfter.
-
Paymaster throttling or banning (code: -32504)
- Returned when the paymaster is restricted under the reputation rules in ERC7562.
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"message": "paymaster stake too low",
"data": {
"paymaster": "0x123456789012345678901234567890123456790",
"minimumStake": "0xde0b6b3a7640000",
"minimumUnstakeDelay": "0x15180"
},
"code": -32504
}
}-
Wallet signature validation failure (code: -32507)
- Returned when the wallet's signature check fails.
-
Insufficient paymaster balance (code: -32508)
- Returned when the paymaster has insufficient funds.
- Other UserOperation objects may have already reserved some of the available funds.
What is eth_estimateUserOperationGas?
eth_estimateUserOperationGas is a JSON-RPC method for estimating the gas usage of a UserOperation.
It calculates the gas limits required to execute the operation.
In particular, the method can estimate the necessary values without requiring the caller to specify the gas limits or gas prices in advance.
The signature field is not used for actual authorization during gas estimation, so the user's approval is not required at this stage. However, the field must contain a dummy value of an appropriate length, such as placeholder signature data with the expected size, to preserve the expected data structure.
The method optionally accepts a State Override Set, which allows the blockchain state used for gas estimation to be temporarily modified.
This works in the same way as the override facility of eth_call.
The response contains the following gas values.
preVerificationGas- The gas overhead incurred before the UserOperation is verified.
verificationGasLimit- The gas needed to validate the UserOperation.
paymasterVerificationGasLimit- The gas needed to validate the paymaster, when a paymaster is specified.
callGasLimit- The gas needed to execute the account's call.
The postOpGasLimit cannot be estimated reliably, so the paymaster must supply this value and account for it correctly on-chain.
If an error occurs, the method returns the same error codes as eth_sendUserOperation.
An error can also occur if execution within the contract account reverts or if the paymaster's postOp processing reverts.
What is eth_getUserOperationByHash?
eth_getUserOperationByHash retrieves information about a UserOperation using the userOpHash returned by eth_sendUserOperation.
When called with a userOpHash, the method behaves as follows.
- If the UserOperation has already been included in a block, it returns the complete UserOperation data along with the
entryPointaddress,blockNumber,blockHash, andtransactionHash. - If the operation has not yet been included in a block but remains in the bundler's mempool, the method may return the full UserOperation data with
blockNumber,blockHash, andtransactionHashset tonull. - Otherwise, such as when an operation has been removed from the mempool, it returns
null.
What is eth_getUserOperationReceipt?
eth_getUserOperationReceipt retrieves the execution result, or receipt, of a UserOperation by its userOpHash.
If the UserOperation has not yet been included in a block, the method returns null.
Once it has been included, the following information is available.
userOpHash- The hash of the UserOperation.
entryPoint- The address of the EntryPoint contract that processed the operation.
sender- The sender address of the UserOperation.
nonce- The nonce used to execute the UserOperation.
paymaster- The paymaster used for the operation, if any.
actualGasCost- The actual gas cost paid by the account or paymaster.
actualGasUsed- The total gas used by the UserOperation, including pre-verification, creation, validation, and execution.
success- Whether execution succeeded (
truefor success,falsefor failure).
- Whether execution succeeded (
reason- The error data as bytes if the UserOperation reverted.
logs- The logs generated by this UserOperation, excluding logs from other operations in the same bundle.
receipt- The transaction receipt for the entire bundle, not a receipt specific to this individual UserOperation.
What is eth_supportedEntryPoints?
eth_supportedEntryPoints retrieves the addresses of the EntryPoint contracts supported by the client.
The method returns an array of supported EntryPoint addresses. The first element is the client's preferred EntryPoint contract.
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_supportedEntryPoints",
"params": []
}For example, the request above may return the following response.
{
"jsonrpc": "2.0",
"id": 1,
"result": [
"0xcd01C8aa8995A59eB7B2627E69b40e0524B5ecf8",
"0x7A0A0d159218E6a2f407B99173A2b12A6DDfC2a6"
]
}In this example, 0xcd01C8aa8995A59eB7B2627E69b40e0524B5ecf8 is the preferred EntryPoint.
What is eth_chainId?
eth_chainId retrieves the chain ID of the current network, as introduced by EIP155.
For more information on EIP155, see the following article.
[EIP155] Preventing Replay Attacks on Ethereum
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_chainId",
"params": []
}On Ethereum mainnet, for example, the preceding request returns the following response.
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1"
}The value 0x1 represents the chain ID of Ethereum mainnet.
Other chains return different values.
For example, Polygon uses 0x89, and the historical Goerli testnet uses 0x5.
What is the debug namespace?
The JSON-RPC methods in the debug namespace are debugging APIs designed to make ERC4337 bundlers easier to test.
These methods are intended for test environments and should not be exposed in production.
Their primary purpose is to facilitate interoperability testing and debugging.
What is debug_bundler_clearState?
This method resets the bundler's mempool and the reputation data associated with paymasters, accounts, and factories. It is useful when a test needs to start from a clean state.
{
"jsonrpc": "2.0",
"id": 1,
"method": "debug_bundler_clearState",
"params": []
}A successful request returns "ok".
{
"jsonrpc": "2.0",
"id": 1,
"result": "ok"
}What is debug_bundler_dumpMempool?
This method retrieves a list of the UserOperation objects currently held in the bundler's mempool. When an EntryPoint address is specified, the method returns the list of operations associated with that contract.
{
"jsonrpc": "2.0",
"id": 1,
"method": "debug_bundler_dumpMempool",
"params": ["0x1306b01bC3e4AD202612D3843387e94737673F53"]
}For example, the request above may return the following response.
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
sender, // address
nonce, // uint256
factory, // address
factoryData, // bytes
callData, // bytes
callGasLimit, // uint256
verificationGasLimit, // uint256
preVerificationGas, // uint256
maxFeePerGas, // uint256
maxPriorityFeePerGas, // uint256
signature // bytes
}
]
}Inspecting the UserOperation objects in the mempool makes it possible to check whether the bundler is behaving as expected.
What is debug_bundler_sendBundleNow?
Under normal operation, a bundler follows its bundling rules to group UserOperation objects and submit them to Ethereum. This method instead instructs the bundler to submit a bundle of the operations currently in its mempool immediately.
{
"jsonrpc": "2.0",
"id": 1,
"method": "debug_bundler_sendBundleNow",
"params": []
}The response contains the transaction hash of the submitted bundle.
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xdead9e43632ac70c46b4003434058b18db0ad809617bd29f3448d46ca9085576"
}What is debug_bundler_setBundlingMode?
This method changes the bundler's operating mode.
- When set to
auto, the bundler processes bundles automatically according to its normal rules. - When set to
manual, the bundler does not bundle UserOperation objects unlessdebug_bundler_sendBundleNowis called explicitly.
{
"jsonrpc": "2.0",
"id": 1,
"method": "debug_bundler_setBundlingMode",
"params": ["manual"]
}For example, the preceding request switches the bundler to manual mode and returns the following response.
{
"jsonrpc": "2.0",
"id": 1,
"result": "ok"
}On success, the method returns "ok".
What is debug_bundler_setReputation?
This method sets reputation data for a particular address.
opsSeen- The number of UserOperation objects associated with the address that have been admitted to the mempool.
opsIncluded- The number of associated UserOperation objects included on-chain.
The method allows tests to modify an address's reputation and simulate different conditions.
{
"jsonrpc": "2.0",
"id": 1,
"method": "debug_bundler_setReputation",
"params": [
[
{
"address": "0x7A0A0d159218E6a2f407B99173A2b12A6DDfC2a6",
"opsSeen": "0x14",
"opsIncluded": "0x0D"
}
],
"0x1306b01bC3e4AD202612D3843387e94737673F53"
]
}For example, the request above sets the reputation of a particular address and returns the following response.
{
"jsonrpc": "2.0",
"id": 1,
"result": "ok"
}On success, the method returns "ok".
What is debug_bundler_dumpReputation?
This method retrieves the reputation data that the bundler currently records for all addresses.
opsSeen- The number of UserOperation objects admitted to the mempool.
opsIncluded- The number of UserOperation objects included on-chain.
status- The current status of the address (
ok/throttled/banned).
- The current status of the address (
{
"jsonrpc": "2.0",
"id": 1,
"method": "debug_bundler_dumpReputation",
"params": ["0x1306b01bC3e4AD202612D3843387e94737673F53"]
}For example, the request above returns a response such as the following.
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{ "address": "0x7A0A0d159218E6a2f407B99173A2b12A6DDfC2a6",
"opsSeen": "0x14",
"opsIncluded": "0x13",
"status": "ok"
}
]
}If an address has a throttled or banned status, a paymaster or account may be subject to rate limits and may require attention.
What is debug_bundler_addUserOps?
Normally, UserOperation objects undergo bundler validation before entering the mempool. This method allows operations to be added directly to the mempool without validation.
It is often used in tests to simulate a particular state.
{
"jsonrpc": "2.0",
"id": 1,
"method": "debug_bundler_addUserOps",
"params": [
[
{ sender: "0xa...", ... },
{ sender: "0xb...", ... }
]
]
}For example, the following request adds multiple UserOperation objects and produces the response shown below.
{
"jsonrpc": "2.0",
"id": 1,
"result": "ok"
}On success, the method returns "ok".
Additional notes
Bundlers are expected to provide the full set of debugging features so that testers can verify compliance with the ERC7769 specification.
Backward compatibility
ERC7769 defines a new JSON-RPC API without introducing backward-compatibility issues.
Security
Protecting the UserOperation mempool against denial-of-service attacks
Operating an ERC4337 node is computationally expensive. Publicly accessible production nodes, in particular, may become targets of denial-of-service (DoS) attacks.
The validation rules in ERC7562 address this problem. ERC7562 defines a mechanism for tracking the reputation of participants, helping prevent invalid UserOperation objects from entering the mempool.
For example, if someone submits large volumes of spam UserOperation objects in an attempt to overload a node, the ERC7562 mechanisms can identify abusive addresses and throttle or ban them.
Production ERC4337 nodes should therefore implement the rules in ERC7562. These rules help reduce attack risks and keep node operation stable.
Disabling debug APIs in production
The ERC4337 debug APIs are intended only for development and testing and must not be exposed in production environments.
They include methods for directly modifying the mempool and forcibly changing bundler behavior. If these interfaces were exposed in production, an attacker could manipulate node behavior and undermine system stability.
Specific risks include:
- Misusing
debug_bundler_clearStateto clear the mempool and delete all pending UserOperation objects. - Calling
debug_bundler_sendBundleNowrepeatedly to make the bundler submit bundles at unintended times. - Manipulating
debug_bundler_setReputationto unfairly ban or favor particular accounts.
Debug APIs must therefore be disabled by default in production. If a debug API must be enabled for a particular reason, the system should display a warning and take sufficient precautions to prevent accidental exposure.
Reference
Vitalik Buterin (@vbuterin), Yoav Weiss (@yoavw), Dror Tirosh (@drortirosh), Shahaf Nacson (@shahafn), Alex Forshtat (@forshtat), "ERC-7769: JSON-RPC API for ERC-4337 [DRAFT]," Ethereum Improvement Proposals, no. 7769, August 2024. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7769.
Conclusion
This article has examined ERC7769, a proposal for JSON-RPC methods that enable ERC4337 contract accounts to submit UserOperation objects to bundlers.
If you have questions, feel free to reach out via direct message on Twitter.
I also publish on the following platforms:



