Skip to main content
Defined in ERC-7677
The paymasterService capability enables apps to sponsor user transactions using ERC-4337 paymaster web services. This allows users to execute transactions without paying gas fees directly.
This capability is not yet finalized and may change in future iterations.

Parameters

url
string
required
The URL of the ERC-7677-compliant paymaster service that will sponsor the transactions.Format: Must be a valid HTTPS URL pointing to a paymaster service endpoint.

Returns

paymasterService
object
The paymaster service capability configuration for the specified chain.

Example Usage

Error Handling

CodeMessageDescription
4100Paymaster service not supportedWallet does not support paymaster service integration
4200Invalid paymaster URLThe provided paymaster service URL is invalid or unreachable
4300Paymaster service errorThe paymaster service returned an error or is unavailable
5700Paymaster capability requiredTransaction requires paymaster service but wallet doesn’t support it

Paymaster Service Implementation

The paymaster service must implement ERC-7677 compliance with these endpoints:

1. Gas Estimation Endpoint

2. Paymaster Data Endpoint

Complete Example

Here’s a complete example of implementing sponsored transactions:

Error Handling

Handle paymaster-related errors appropriately:

Use Cases

Gaming Applications

DeFi Onboarding

Best Practices

  1. Validate Paymaster URLs: Ensure paymaster service URLs are trustworthy and ERC-7677 compliant
  2. Handle Failures Gracefully: Implement fallbacks for when paymaster services are unavailable
  3. Monitor Costs: Track paymaster usage to manage sponsorship costs
  4. User Communication: Clearly communicate when transactions are sponsored
The paymaster service capability enables seamless user experiences by removing the need for users to hold native tokens for gas fees.