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.
ERC7677 proposes a standardized API for communicating with the paymaster services introduced by ERC4337, allowing an app to specify the service that its user's wallet should communicate with.
This article translates, summarizes, and expands on the proposal below.
I also cover other EIPs here:
Overview
EIP5792 enables apps to communicate with wallets and use advanced capabilities. ERC7677 defines a capability through which an app can request that an ERC4337 wallet communicate with a specific paymaster service. It also defines a standardized API for paymaster services to support this capability.
A paymaster is a contract that can pay the transaction fees incurred by a smart contract wallet. This allows users to execute transactions without paying the gas fees themselves when their operations are sponsored. ERC7677 proposes an API through which wallets communicate with services that provide this paymaster functionality.
EIP5792 defines several new JSON-RPC methods, including one for submitting batches of calls. For more details, see the following article.
[EIP5792] JSON-RPC Methods for Batch Transactions
For background on ERC4337, see the following articles.
[ERC4337] Account Abstraction Without Protocol Changes
Motivation
Before this proposal, app developers who wanted a paymaster to cover their users' transaction fees had no standardized way to instruct a wallet to communicate with a particular paymaster service. There was also no common standard for communication between wallets and paymaster services. A standard is therefore needed for both interactions: how an app tells a wallet which paymaster service to use, and how that wallet communicates with the service.
Specification
The proposal defines a new EIP5792 wallet capability. It also defines a standard interface for paymaster services.
Paymaster web service interface
pm_getPaymasterStubData
This method returns stub paymaster data used to estimate gas for a sponsored operation, and may return paymaster-specific gas limits. It accepts the following inputs.
- An unsigned user operation
- The EntryPoint address
- The chain ID
- A context object
Paymaster service providers can define the fields that app developers need to supply when the wallet communicates with their service.
Depending on the supplied EntryPoint version, this method may return paymaster-specific gas values.
For example, for EntryPoint v0.7, the method may return paymasterVerificationGasLimit and paymasterPostOpGasLimit.
When submitting the UserOperation to the bundler for gas estimation, the wallet must use the supplied gas values.
The EntryPoint is the contract responsible for operations including signature validation. A UserOperation describes the transaction-related actions that the user wants to execute. A bundler collects operations from multiple smart contract wallets and submits a transaction to execute them together, typically using an EOA to submit the bundle. For more details, see the following article.
The method may also return a sponsor object containing a name field and an optional icon field.
The name field identifies the entity sponsoring the transaction, and icon is a URI for an image.
Wallet developers may choose to display this sponsor information to users.
The icon URI must be a data URI as defined by RFC-2397, and the image should be square with a resolution of at least 96 × 96 px.
Easily rendered image formats such as PNG, WebP, and SVG are recommended.
Because SVG can contain executable JavaScript, wallets must render SVG images using an <img> tag to prevent the execution of untrusted JavaScript.
In some cases, such as when the paymaster data does not include a signature, the initial pm_getPaymasterStubData call can provide all the data needed.
The service can then return isFinal: true so that the wallet skips the second RPC call, pm_getPaymasterData.
During pm_getPaymasterStubData, the paymaster web service should validate the supplied UserOperation and reject the request at this stage if it does not intend to sponsor the operation.
Examples of use
-
Obtaining stub values for gas estimation
- The app initiates the wallet flow, in which the wallet calls this method with an unsigned user operation.
- The paymaster service returns the applicable gas values.
- The wallet uses those values to estimate gas.
-
Displaying sponsor information
- The method returns an object containing the sponsor's name and icon URI.
- The wallet displays the information to the user.
-
When a further signature or data request is unnecessary
- Returning
isFinal: trueallows the wallet to skip the additional RPC call.
- Returning
pm_getPaymasterStubData RPC specification
The UserOperation parameter does not contain a signature, because the user signs only after all the other fields have been populated.
Input parameters
There are four input parameters.
- userOp
sender- The sender's address.
nonce- The nonce used to identify the operation in the sender's nonce space.
initCode- Initialization code.
callData- The call data.
callGasLimit- The gas limit for the call.
verificationGasLimit- The gas limit for verification.
preVerificationGas- The gas overhead before verification.
maxFeePerGas- The maximum fee per unit of gas.
maxPriorityFeePerGas- The priority fee per unit of gas.
- EntryPoint
- The EntryPoint address.
- Chain ID
- The chain identifier.
- Context
- Additional information specified by the service provider, such as
policyId.
- Additional information specified by the service provider, such as
Return values
The response depends on which EntryPoint version the paymaster service uses.
- Common field
sponsor- Sponsor information: the name and optionally an icon URI.
- EntryPoint v0.6
paymasterAndData- The paymaster and its data.
- EntryPoint v0.7
paymaster- The paymaster address.
paymasterData- The paymaster data.
paymasterVerificationGasLimit- The paymaster verification gas limit (optional).
paymasterPostOpGasLimit- The paymaster post-operation gas limit (optional).
isFinal- A flag indicating that another RPC call is unnecessary (optional).
Examples
Example input
[
{
"sender": "0x...",
"nonce": "0x...",
"initCode": "0x",
"callData": "0x...",
"callGasLimit": "0x...",
"verificationGasLimit": "0x...",
"preVerificationGas": "0x...",
"maxFeePerGas": "0x...",
"maxPriorityFeePerGas": "0x..."
},
"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
"0x2105",
{
"policyId": "962b252c-a726-4a37-8d86-333ce0a07299"
}
]Example responses
- EntryPoint v0.6
{
"sponsor": {
"name": "My App",
"icon": "https://..."
},
"paymasterAndData": "0x..."
}- EntryPoint v0.7
{
"sponsor": {
"name": "My App",
"icon": "https://..."
},
"paymaster": "0x...",
"paymasterData": "0x..."
}- EntryPoint v0.7 with paymaster gas estimates
{
"sponsor": {
"name": "My App",
"icon": "https://..."
},
"paymaster": "0x...",
"paymasterData": "0x...",
"paymasterVerificationGasLimit": "0x...",
"paymasterPostOpGasLimit": "0x..."
}- Response indicating that no further RPC call is necessary
{
"sponsor": {
"name": "My App",
"icon": "https://..."
},
"paymaster": "0x...",
"paymasterData": "0x...",
"isFinal": true
}pm_getPaymasterData
This JSON-RPC method returns the values for the paymaster-related fields of the UserOperation that will ultimately be signed and submitted. It accepts an unsigned UserOperation, the EntryPoint address, the chain ID, and a context object.
pm_getPaymasterData RPC specification
Input parameters
There are four input parameters.
- userOp (user operation)
sender- The sender's address.
nonce- The nonce used to identify the operation in the sender's nonce space.
initCode- Initialization code.
callData- The call data.
callGasLimit- The gas limit for the call.
verificationGasLimit- The gas limit for verification.
preVerificationGas- The gas overhead before verification.
maxFeePerGas- The maximum fee per unit of gas.
maxPriorityFeePerGas- The priority fee per unit of gas.
- EntryPoint
- The EntryPoint address.
- Chain ID
- The chain identifier.
- Context
- Additional information specified by the service provider, such as
policyId.
- Additional information specified by the service provider, such as
Return values
The response depends on which EntryPoint version the paymaster service uses.
- EntryPoint v0.6
paymasterAndData- The paymaster and its data.
- EntryPoint v0.7
paymaster- The paymaster address.
paymasterData- The paymaster data.
Examples
Example input
[
{
"sender": "0x...",
"nonce": "0x...",
"initCode": "0x",
"callData": "0x...",
"callGasLimit": "0x...",
"verificationGasLimit": "0x...",
"preVerificationGas": "0x...",
"maxFeePerGas": "0x...",
"maxPriorityFeePerGas": "0x..."
},
"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
"0x2105",
{
"policyId": "962b252c-a726-4a37-8d86-333ce0a07299"
}
]Example responses
- EntryPoint v0.6
{
"paymasterAndData": "0x..."
}- EntryPoint v0.7
{
"paymaster": "0x...",
"paymasterData": "0x..."
}paymasterService
The paymasterService capability is implemented by both the app and the wallet.
App implementation
PaymasterService capability
Both the app and the wallet implement the paymasterService capability. It allows the app to supply a particular paymaster service URL to the wallet, which then makes RPC calls to that URL.
Implementing the capability in an app
The app needs to pass a paymaster service URL to the wallet.
To do so, it uses the paymasterService capability as part of the wallet_sendCalls request proposed in EIP5792.
wallet_sendCalls paymaster capability specification
- PaymasterCapabilityParams
url- The paymaster service URL.
context- Additional information specified by the service provider.
type PaymasterCapabilityParams = {
url: string;
context: Record<string, any>;
}Example wallet_sendCalls parameters
The following is an example wallet_sendCalls request.
[
{
"version": "1.0",
"chainId": "0x01",
"from": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
"calls": [
{
"to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
"value": "0x9184e72a",
"data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
},
{
"to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
"value": "0x182183",
"data": "0xfbadbaf01"
}
],
"capabilities": {
"paymasterService": {
"url": "https://...",
"context": {
"policyId": "962b252c-a726-4a37-8d86-333ce0a07299"
}
}
}
}
]- version
- The API version.
- chainId
- The chain identifier.
- from
- The address from which the transactions originate.
- calls
- Details of the multiple calls to execute.
- Each call contains the following fields.
to- The destination address.
value- The value of the call, denominated in wei.
data- The call data.
- capabilities
- Specifies the capabilities to use.
- In this example, the capability is
paymasterService.
url- The paymaster service URL.
context- Additional information specified by the service provider, such as
policyId.
- Additional information specified by the service provider, such as
Wallet behavior
The wallet makes the paymaster RPC calls described above to the service URL supplied by the app.
Specifically, it obtains the necessary data by calling pm_getPaymasterStubData and, when necessary, pm_getPaymasterData at the specified URL.
Wallet implementation
To conform to this specification, smart contract wallets that support app-sponsored transactions must meet the following requirements.
- The wallet must indicate to the app that it can communicate with a paymaster web service.
- The app can determine this from the EIP-5792 wallet_getCapabilities response.
- The wallet must use the values for the paymaster service specified by the app.
- This means using the paymaster service values supplied in the
capabilitiesfield of the EIP-5792 wallet_sendCalls request. - There are exceptions, such as when the wallet allows the user to choose a different paymaster.
- Because the specified service may ultimately not be used, an app must not assume that its supplied paymaster will necessarily pay the transaction fees.
- This means using the paymaster service values supplied in the
wallet_getCapabilities response specification
The wallet responds to wallet_getCapabilities in the following format.
type PaymasterServiceCapability = {
supported: boolean;
}Example wallet_getCapabilities response
{
"0x2105": {
"paymasterService": {
"supported": true
}
},
"0x14A34": {
"paymasterService": {
"supported": true
}
}
}Flow diagram

-
Request from the app
- The app sends transaction calls to the wallet using
wallet_sendCalls. - The call includes the paymaster service URL and context information.
- The app sends transaction calls to the wallet using
-
Wallet processing
- The wallet obtains the data it needs by making RPC calls such as
pm_getPaymasterStubDataandpm_getPaymasterDatato the specified paymaster service URL.
- The wallet obtains the data it needs by making RPC calls such as
-
Transaction processing
- The wallet uses the returned data to process the transaction and displays sponsor information to the user when appropriate.
Additional notes
Gas estimation
At the time of the proposal, paymaster services used pm_sponsorUserOperation to return fields associated with a UserOperation together with gas estimates.
However, different providers used different estimation methods, leading to inconsistent and sometimes insufficient estimates.
The proposal therefore favors leaving gas estimation to the wallet. Because the wallet knows how the UserOperation will be passed to the bundler, it is better positioned to produce an accurate estimate. The wallet then requests sponsorship from the paymaster service based on that estimate.
The pm_getPaymasterStubData method
pm_getPaymasterStubData can return paymaster-specific gas estimates, reducing the risk that the bundler underestimates gas.
Chain ID parameter
At the time of the proposal, paymaster service providers typically supplied a separate URL for each chain rather than using a multichain endpoint. A chain ID parameter allows the wallet to tell the paymaster service which chain the request targets.
- Option 1
- Formalize the existing convention in which each paymaster service URL corresponds to exactly one chain.
- Option 2
- Require a chain ID parameter in paymaster service requests.
The second option is more flexible because it also accommodates service providers offering multichain URLs.
Gas estimation challenges
Making gas estimation more flexible introduces several considerations for paymaster services that want to provide reliable estimates.
preVerificationGas
The preVerificationGas value depends heavily on the size of the UserOperation and the ratio of zero to nonzero bytes.
Consequently, estimation using the data returned by pm_getPaymasterStubData may underestimate the preVerificationGas required for the final data returned by pm_getPaymasterData.
If this happens, the bundler may reject the operation with an insufficient preVerificationGas error when eth_sendUserOperation is called.
To avoid this scenario, the paymaster service must return stub data that meets these conditions for gas estimation.
- It has the same length as the final data.
- It contains no more zero bytes (
0x00) than the final data.
Consistent code paths
Stub data consisting of repeated arbitrary bytes, such as 0x01, with the same length as the final UserOperation data can work for preVerificationGas estimation, but it may fail simulation.
Even valid stub data can lead to an underestimate.
This occurs when the stub data causes validatePaymasterUserOp or postOp to follow a different code path during simulation.
For example, if code exits early during simulation, the estimate may be lower than the actual requirement, causing an out-of-gas error when the UserOperation submitted to the bundler is executed.
The paymaster service must therefore return stub data that causes the simulation to follow the same code path as the UserOperation that will actually execute.
Security
The URLs that paymaster service providers give app developers often include API keys. App developers may not want to disclose those keys to wallets. The following approach is recommended.
- The app developer supplies the URL of the app's backend, which proxies requests to the paymaster service.
- The app's backend processes incoming requests and forwards them to the paymaster service using the required API key.
Flow diagram

-
Request to the app's backend
- The app provides the wallet with its backend URL instead of the paymaster service URL.
- The wallet sends paymaster service requests such as
pm_getPaymasterStubDataandpm_getPaymasterDatato this backend URL.
-
Backend processing
- The app's backend uses the received request to make the actual API request to the paymaster service.
- It attaches the necessary API key.
- It receives the response from the paymaster service and performs additional simulation or validation if necessary.
-
Response from the backend to the wallet
- The backend returns the paymaster service's response to the wallet in the appropriate format.
Detailed flow
-
App configuration
- The app provides the wallet with a URL such as the following.
texthttps://app-backend.example.com/proxy-paymaster -
Wallet request
- The wallet sends a
pm_getPaymasterStubDatarequest to the backend. The following example illustrates the request data rather than a complete JSON-RPC envelope.
json{ "sender": "0x...", "nonce": "0x...", "initCode": "0x...", "callData": "0x...", "callGasLimit": "0x...", "verificationGasLimit": "0x...", "preVerificationGas": "0x...", "maxFeePerGas": "0x...", "maxPriorityFeePerGas": "0x...", "entryPoint": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", "chainId": "0x2105", "context": { "policyId": "962b252c-a726-4a37-8d86-333ce0a07299" } } - The wallet sends a
-
Backend processing and request to the paymaster service
- The backend receives the request, attaches the API key, and sends a request containing data such as the following to the paymaster service.
json{ "sender": "0x...", "nonce": "0x...", "initCode": "0x...", "callData": "0x...", "callGasLimit": "0x...", "verificationGasLimit": "0x...", "preVerificationGas": "0x...", "maxFeePerGas": "0x...", "maxPriorityFeePerGas": "0x...", "entryPoint": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", "chainId": "0x2105", "context": { "policyId": "962b252c-a726-4a37-8d86-333ce0a07299" } } -
Paymaster service response and backend processing
- The backend receives the paymaster service's response and performs additional validation if needed.
-
Response from the backend to the wallet
- The backend returns the final response to the wallet.
Reference
Lukas Rosario (@lukasrosario), Dror Tirosh (@drortirosh), Wilson Cusack (@wilsoncusack), Kristof Gazso (@kristofgazso), Hazim Jumali (@hazim-j), "ERC-7677: Paymaster Web Service Capability [DRAFT]," Ethereum Improvement Proposals, no. 7677, April 2024. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7677.
Conclusion
This article has examined ERC7677, which proposes a standardized API for communicating with ERC4337 paymaster services and lets apps specify which paymaster service their users' wallets should contact.
If you have questions, feel free to reach out via direct message on Twitter.
I also publish on the following platforms:



