Skip to content

Core: Implement Gas Station Network for Sponsor Gas Fees on EVM Chains #454

Description

@Smartdevs17

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

Metadata

Metadata

Assignees

Labels

200-points200 point issueStellar WaveIssues in the Stellar wave programdrips-waveIssues in the Drips Wave programhighHigh complexity issue

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions