CDP Paymaster supports ERC20 token gas payments, enabling users to pay for gas in tokens like USDC instead of ETH. This eliminates the need for users to hold native tokens while still covering their own transaction costs.Documentation Index
Fetch the complete documentation index at: https://docs.cloud.coinbase.com/llms.txt
Use this file to discover all available pages before exploring further.
How it works
Instead of the developer sponsoring gas, the user pays for gas in an ERC20 token:- User approves the Paymaster to spend their tokens
- User submits a transaction
- Paymaster takes tokens from the user and pays gas in ETH
- Transaction executes
When to use this
| Scenario | Recommended approach |
|---|---|
| Developer pays all gas costs | Gas Sponsorship with useCdpPaymaster: true |
| User pays gas, but in tokens (no ETH needed) | ERC20 Gas Payments (this guide) |
| User pays gas in ETH | No Paymaster needed |
Supported tokens
| Token | Address (Base) |
|---|---|
| USDC | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
Implementation
The key requirement is ensuring the user has approved the Paymaster to spend their tokens. Include an approval in your transaction batch if the allowance is insufficient.The approval is included in the same batch as your main transaction. This ensures the user only signs once, and the approval + transaction execute atomically.
Paymaster contract address
Users must approve the Paymaster contract to spend their tokens. This is the address that will transfer tokens from the user’s wallet as payment for gas.| Network | Paymaster address |
|---|---|
| Base Mainnet | 0x2FAEB0760D4230Ef2aC21496Bb4F0b47D634FD4c |
This address is returned in the
paymasterAddress field of error responses when approval is insufficient, so you can also discover it dynamically.RPC methods
CDP Paymaster implements the following methods for ERC20 gas payments:pm_getAcceptedPaymentTokens
Returns the tokens the Paymaster accepts for payment. Request:pm_getPaymasterData with ERC20 context
To request ERC20 payment, include the token address in the context field: Request:tokenPayment field showing the fee details:
Comparison: Sponsorship vs ERC20 payments
| Aspect | Gas sponsorship | ERC20 gas payments |
|---|---|---|
| Who pays | Developer | User |
| Payment currency | Developer billed in USD | User pays in tokens (USDC) |
| User needs ETH | No | No |
| User needs tokens | No | Yes (for payment) |
| Approval required | No | Yes (token approval to Paymaster) |
| Use case | Onboarding, removing friction | Users cover own costs without ETH |
Next steps
- Gas sponsorship quickstart — Developer-paid gas
- Paymaster FAQs — Common questions
- Base Account documentation — Additional context on ERC20 gas payments