Context
Gas fees on EVM chains prevent non-custodial adoption. Users need to hold native tokens (ETH, MATIC, etc.) just to pay gas, creating friction for new users.
Current Limitation/Problem
There is no gas sponsorship mechanism. Every transaction requires the sender to hold native gas tokens, which is a significant UX barrier for mainstream adoption.
Expected Outcome
A Gas Station Network (GSN) implementation that allows AgenticPay to sponsor gas fees for users on EVM chains, using meta-transactions with EIP-2771/EIP-712, with configurable sponsorship policies and budget controls.
Acceptance Criteria
- Implement forwarder contract (EIP-2771) on supported EVM chains
- Implement relay server that accepts signed meta-transactions and submits them
- Support gas price estimation with configurable multiplier
- Implement sponsorship budget management per merchant/app
- Rate limit sponsorship per wallet address
- Track gas sponsorship costs with billing to merchants
- Fallback to user-pays-gas when sponsorship budget exhausted
- Handle EIP-1559 transactions correctly
Technical Scope
contracts/evm/gsn/ - GSN forwarder and relay contracts
backend/src/services/gsn/relay-server.ts - meta-tx relay service
backend/src/services/gsn/budget-manager.ts - sponsorship budget tracking
- Prisma:
GasSponsorshipBudget, GasSponsorshipTx models
- Integration with ethers.js for contract interactions
- Redis for nonce management to prevent replay
- Edge cases: gas price spikes, budget exhaustion, relay failures, signature replay
Context
Gas fees on EVM chains prevent non-custodial adoption. Users need to hold native tokens (ETH, MATIC, etc.) just to pay gas, creating friction for new users.
Current Limitation/Problem
There is no gas sponsorship mechanism. Every transaction requires the sender to hold native gas tokens, which is a significant UX barrier for mainstream adoption.
Expected Outcome
A Gas Station Network (GSN) implementation that allows AgenticPay to sponsor gas fees for users on EVM chains, using meta-transactions with EIP-2771/EIP-712, with configurable sponsorship policies and budget controls.
Acceptance Criteria
Technical Scope
contracts/evm/gsn/- GSN forwarder and relay contractsbackend/src/services/gsn/relay-server.ts- meta-tx relay servicebackend/src/services/gsn/budget-manager.ts- sponsorship budget trackingGasSponsorshipBudget,GasSponsorshipTxmodels