Many users hold USDC or another ERC-20 token, but no ETH. Without ETH they cannot pay gas, so they cannot do anything. A token paymaster solves this: it pays the gas in ETH and charges the user the equivalent in a token they do have. For payment apps, trading apps and anything denominated in stablecoins, this removes the most confusing step in the user journey.
How a Token Paymaster Works
- The user's smart account signs a user operation and approves the paymaster to take tokens, often in the same operation.
- During validation, the paymaster checks the price of ETH in the user's token, adds a margin for price movement and confirms the user can pay.
- The transaction executes, and the gas is paid from the paymaster's ETH deposit in the EntryPoint.
- Afterwards, the paymaster charges the actual cost in tokens and refunds anything it reserved too much.
- Collected tokens are periodically swapped to ETH to refill the deposit.
The Hard Parts
- Pricing: the ETH/token price must come from a reliable oracle, never from a single pool that can be manipulated, and stale prices must be rejected.
- Charging safely: if the paymaster only charges after execution, a user can revoke the approval during the transaction and leave the paymaster with the bill. Pre-charging or reserving tokens during validation closes that gap.
- Volatility: a configurable markup covers price movement between validation and settlement, and for stablecoins the risk is small.
- Treasury management: tokens pile up and ETH runs down. Automatic swaps and refills keep the paymaster solvent.
- Supported tokens: a whitelist of tokens with good liquidity and reliable price feeds, with care for tokens that charge fees on transfer.
Prefer to pay the gas yourself? See gas sponsorship. Combining both, sponsoring onboarding and charging tokens afterwards, is a common setup.
Frequently Asked Questions about Token Paymasters
Which tokens can users pay gas in?
Any ERC-20 with good liquidity and a reliable price feed. Stablecoins such as USDC are the most common choice because their price is predictable.
Can we earn a margin on gas payments?
Technically yes: the paymaster can add a markup on the gas price. Most projects use a small markup to cover price risk and swap costs rather than as a revenue source.
What happens if the oracle fails?
The paymaster should refuse to sponsor rather than use a stale or wrong price. Users can then still pay gas in ETH, and monitoring alerts your team.
Who owns the code?
Ownership of the source code is set out in the contract, and the code can be fully yours, including documentation and tests.
Part of our paymaster development and account abstraction work.
Let Users Pay Gas in Tokens
Tell us which tokens your users hold and on which chains. We will design a token paymaster with safe pricing and charging.