Paymasters
A Paymaster is a smart contract that agrees to pay the gas fees for an incoming UserOperation under certain conditions.
This is the key technology behind “gasless transactions.”
Sponsoring Gas (Gasless)
Section titled “Sponsoring Gas (Gasless)”When building traditional dApps, user onboarding funnel drop-off is brutal because users must acquire native tokens (like ETH or MATIC) from a central exchange before they can click a single button.
With a Verifying Paymaster, your platform deposits ETH into the Paymaster contract. When a user sends a UserOperation, the Paymaster looks at the operation, checks your backend’s API signature attached to it, and says: “Yes, I will cover the gas for this.”
The EntryPoint executes the transaction, deducts the gas cost from your Paymaster deposit, and the user pays nothing.
ERC-20 Gas Payments
Section titled “ERC-20 Gas Payments”What if you don’t want to sponsor the transaction entirely, but the user only has USDC?
A Token Paymaster accepts ERC-20 tokens from the user’s Smart Account, exchanges them on a DEX for ETH in real-time, and uses that ETH to pay the EntryPoint for the gas cost. The user pays gas, but they never need to hold the native chain token.
The 0xGasless Dashboard & Paymaster
Section titled “The 0xGasless Dashboard & Paymaster”When you use the paymasterUrl in our SDK, you are routing your requests through our Paymaster API.
const PAYMASTER_URL = `https://paymaster.0xgasless.com/v1/11155111/rpc/${API_KEY}`;With the 0xGasless Dashboard, you can define Policies for this Paymaster API:
- Global Sponsorship: Sponsor every transaction generated by your API key.
- Contract allowlists: Only sponsor transactions interacting with your specific NFT contract.
- Rate limits: Only sponsor up to 5 transactions per user per day.
- Value limits: Only sponsor transactions if the gas price is below a certain gwei.
When the SDK sends a request to the paymasterUrl, our backend evaluates your Policies. If the transaction is approved, we return a cryptographic signature that the SDK attaches to the UserOperation, guaranteeing the Paymaster contract will cover the fee on-chain.