Skip to main content
Use third-party on-chain paymasters for ERC-20 gas payments. This approach gives you flexibility to use different paymaster providers while still benefiting from Gelato’s high-performance bundler.
On-chain paymasters are smart contracts that sponsor gas fees by accepting ERC-20 tokens from users. They handle the token-to-ETH conversion on-chain, allowing users to pay gas with tokens they hold.

Implementations

This example uses Pimlico’s ERC-20 Paymaster. You can substitute any compatible on-chain paymaster.
1

Create an API Key

Check out our How-To Guide for detailed instructions on generating a Gelato API key.You’ll also need an API key from your paymaster provider (e.g., Pimlico).
2

Create Smart Account

3

Create Paymaster Client

Set up the on-chain paymaster client. This example uses Pimlico:
4

Create Smart Account Client with Gelato Bundler

Combine Gelato’s bundler with the on-chain paymaster:
5

Send Transaction

How It Works

  1. Request Sponsorship - Your app requests paymaster data from the on-chain paymaster provider
  2. Build UserOperation - Include the paymaster fields (paymaster, paymasterData, gas limits)
  3. Submit to Bundler - Gelato validates and bundles the UserOperation
  4. On-Chain Execution - The paymaster validates the operation and charges ERC-20 tokens

Compatible Paymasters

Any ERC-4337 compatible paymaster works with Gelato’s bundler:

Additional Resources