Choose a paymaster service provider
As a prerequisite, you’ll need to obtain a paymaster service URL from a paymaster service provider. ERC20 paymasters have additional requirements that will be outlined below. We recommend the Coinbase Developer Platform paymaster as it is fully set up to work with Base Account ERC20 token gas payments out of the box. CDP is also offering up to $15k in gas credits as part of the Base Gasless Campaign. Otherwise if using a different paymaster provider, it must conform to the specification outlined in ERC20 Compatible Paymasters to correctly work with Base Account.App setup for custom token
Once you have a paymaster that is compatible with ERC20 gas payments on Base Account, you are only responsible for including the approvals to the paymaster for your token. It is recommended to periodically top up the allowance once they hit some threshold.ERC20 Compatible Paymasters
Coinbase Developer Platform is compatible out of the box and we will be working with other teams to include support soon! The paymaster must handle thepm_getPaymasterStubData
and pm_getPaymasterData
JSON-RPC requests specified by ERC-7677 in addition to pm_getAcceptedPaymentTokens
. We step through each request and response below.
pm_getPaymasterStubData and pm_getPaymasterData
- The paymaster must use the specified ERC20 for payment if specified in the 7677 context field under
erc20
. - Upon rejection / failure the paymaster should return a
data
field in the JSONRPC response which could be used to approve the paymaster and includes:
acceptedTokens
array which is a struct including the token addresspaymasterAddress
field which is the paymaster address which will perform the token transfers.
- Upon success the paymaster must return a
tokenPayment
field in the result. This includes:
tokenAddress
address of the token used for paymentmaxFee
the maximum fee to show in the UIdecimals
decimals to use in the UIname
name of the token
Request
This is a standard V0.6 Entrypoint request example with the additional context for the specified token to be used.Response
Successful response:pm_getAcceptedPaymentTokens
pm_getAcceptedPaymentTokens
returns an array of tokens the paymaster will accept for payment.
The request contains the entrypoint and the chain id with optional context.