Paymaster & Gas Sponsoring
Let users interact with your app without holding ETH or native tokens first. Paymasters allow you to sponsor gas fees for your users entirely.
What you can do:- Sponsor Gas - Cover transaction costs for your users
- Multi-Chain - Same experience across all supported networks
- Set Policies - Control which transactions you sponsor
1. Choose a Provider
Pick a paymaster provider and create an account. Generate your API key in their dashboard and deposit funds to cover gas costs.
Compatible Providers:| Provider | Dashboard |
|---|---|
| Pimlico | dashboard.pimlico.io |
| Etherspot | developer.etherspot.io |
2. Integration Path
Pick your integration method:
| Approach | Best For |
|---|---|
| Wagmi | React apps already using wagmi connectors. |
| Core SDK | Custom implementations or non-React apps. |
3. Enable Paymasters
Add the paymasters configuration to your existing JAW setup. Use the URL from your provider along with your API key.
import { createConfig, http } from 'wagmi';
import { base } from 'wagmi/chains';
import { jaw } from '@jaw.id/wagmi';
export const config = createConfig({
chains: [base],
connectors: [
jaw({
apiKey: 'YOUR_JAW_API_KEY',
appName: 'My App',
// Add paymasters configuration
paymasters: {
8453: { url: 'https://api.pimlico.io/v2/8453/rpc?apikey=YOUR_PIMLICO_KEY' },
},
}),
],
transports: {
[base.id]: http(),
},
});4. Configuration Format
Each network is configured by chain ID with its own paymaster URL. The optional context object passes sponsorship policies or provider-specific settings.
paymasters: {
[chainId: number]: {
url: string; // Paymaster service URL (required)
context?: Record<string, unknown>; // Additional context sent with requests (optional)
}
}5. Add Sponsorship Policies
Control which transactions you sponsor with policies. Create these in your paymaster provider's dashboard.
Common policy options:- Sponsor only new users
- Set daily limits per user
- Sponsor during active time periods
- Whitelist specific contracts
- Blacklist certain operations
- Log into your paymaster provider dashboard
- Create a sponsorship policy with your rules
- Copy the policy ID from the policy page
- Add it to your paymaster configuration's
context
import { jaw } from '@jaw.id/wagmi';
const connector = jaw({
apiKey: 'YOUR_JAW_API_KEY',
paymasters: {
8453: {
url: 'https://api.pimlico.io/v2/8453/rpc?apikey=YOUR_PIMLICO_KEY',
// Add sponsorship policy (key name varies by provider)
context: {
sponsorshipPolicyId: 'sp_your_policy_id', // Pimlico
},
},
},
});6. Multi-Chain Configuration
Support multiple blockchains with gas sponsorship. Set up a paymaster for each network so users get the same smooth experience everywhere.
import { jaw } from '@jaw.id/wagmi';
const connector = jaw({
apiKey: 'YOUR_JAW_API_KEY',
paymasters: {
1: { url: 'https://api.pimlico.io/v2/1/rpc?apikey=...' }, // Ethereum Mainnet
10: { url: 'https://api.pimlico.io/v2/10/rpc?apikey=...' }, // Optimism
8453: { url: 'https://api.pimlico.io/v2/8453/rpc?apikey=...' }, // Base
42161: { url: 'https://api.pimlico.io/v2/42161/rpc?apikey=...' }, // Arbitrum
},
});Configuration Reference
| Property | Type | Required | Description |
|---|---|---|---|
url | string | Yes | The paymaster service endpoint URL |
context | Record<string, unknown> | No | Additional context passed to the paymaster (e.g., sponsorshipPolicyId) |
Related
- paymasters Configuration - Full configuration reference
- Quickstart - Initial JAW setup
- wallet_sendCalls - Batched transactions with sponsorship
- Supported Networks - Available chains