ERC-4337 Paymaster: Gas Sponsorship Explained
Biconomy provides all paymaster functionality through the MEE (Modular Execution Environment) stack. While this page explains how ERC-4337 paymasters work conceptually, you should use MEE to implement gas sponsorship in your applications—it provides paymaster capabilities plus cross-chain orchestration in a unified interface.
What is a Paymaster in ERC-4337?
What is a Paymaster in ERC-4337?
A Paymaster is a smart contract in the ERC-4337 account abstraction standard that pays gas fees on behalf of users. Instead of users needing ETH for gas, the paymaster covers the cost.Paymasters enable:
- Gasless transactions: Users pay nothing
- Gas abstraction: Users pay in ERC-20 tokens (USDC, DAI, etc.)
- Sponsored transactions: Apps cover user gas costs
How does a Paymaster work technically?
How does a Paymaster work technically?
The paymaster integrates with the ERC-4337 flow:Key steps:
- User creates and signs a UserOperation
- UserOperation includes
paymasterAndDatafield - Bundler submits to EntryPoint
- EntryPoint calls
validatePaymasterUserOpon Paymaster - Paymaster validates and agrees to pay
- Transaction executes
- Paymaster’s deposit is debited for gas
What types of Paymasters exist?
What types of Paymasters exist?
| Paymaster Type | How It Works | Use Case |
|---|---|---|
| Verifying Paymaster | Off-chain signature authorizes sponsorship | App-controlled sponsorship with policies |
| Token Paymaster | Accepts ERC-20 tokens as gas payment | Let users pay gas in stablecoins |
| Deposit Paymaster | Users pre-deposit funds for gas | Enterprise/institutional use |
| Sponsoring Paymaster | Unconditionally sponsors gas | Development, promotions |
- Flexible sponsorship policies
- Token payment options (pay gas in USDC, DAI, etc.)
- Spending limits (per transaction, total)
- Plus cross-chain gas abstraction (pay on any chain with tokens from any chain)
How do I implement gas sponsorship with Biconomy?
How do I implement gas sponsorship with Biconomy?
Biconomy provides paymaster functionality through MEE (Modular Execution Environment):Step 1: Get your MEE API key from DashboardStep 2: Initialize MEE clientStep 3: Send sponsored transactionMEE handles all gas sponsorship automatically based on your dashboard configuration.
How do I configure sponsorship policies?
How do I configure sponsorship policies?
Configure policies in the Biconomy Dashboard or via API:Per-Transaction Limit:Total Spending Limit:
How do spending limits work?
How do spending limits work?
Spending limits help you control costs and prevent abuse:Per-Transaction Limits:
- Set maximum gas cost per individual transaction
- Prevents unexpectedly expensive operations from draining your balance
- Set an overall spending cap
- MEE automatically stops sponsoring once the limit is reached
How do I let users pay gas in tokens?
How do I let users pay gas in tokens?
MEE supports paying gas in ERC-20 tokens (gas abstraction):MEE supports cross-chain gas payment - pay for gas on any chain using tokens from any other supported chain!Supported gas payment tokens vary by chain. Common options:
- USDC
- USDT
- DAI
- WETH
How do I monitor gas sponsorship usage?
How do I monitor gas sponsorship usage?
Biconomy Dashboard provides:Set up alerts:
- Real-time gas spending
- Contract interaction breakdown
- Spending trends over time
What are gas sponsorship security best practices?
What are gas sponsorship security best practices?
1. Set per-transaction limits:2. Set total spending caps:3. Monitor for abuse:
- Watch for unusual patterns
- Set up anomaly alerts
- Review spending regularly in the dashboard
How does MEE handle sponsorship failures?
How does MEE handle sponsorship failures?
Common failure scenarios and handling:
Implement fallback logic:
| Scenario | Cause | Solution |
|---|---|---|
| ”Sponsorship validation failed” | Policy rejected | Check spending limits |
| ”Insufficient sponsorship balance” | Low balance | Top up deposit in dashboard |
| ”Spending limit exceeded” | Transaction or total limit hit | Adjust limits in dashboard |
| ”Quote expired” | Quote too old | Get fresh quote |