Skip to content

kavehtehrani/pypay

Repository files navigation

PyPay Logo
Send PYUSD without gas fees

PyPay - Gasless PYUSD Payments

PYUSD Ethereum EIP-7702 Next.js TypeScript Tailwind CSS Hardhat Privy Pimlico Viem

🛈 This is a submission for ETHOnline 2025 hackathon.

Problem

One of the biggest hurdles for new crypto users is understanding “gas.” In the real world, when you pay with a credit card, the fee comes out in the same currency you’re spending. On chain, that logic breaks. You use one token (like a stablecoin) for payments, but need a completely different asset (ETH) just to move it. That extra step is confusing and a major barrier to everyday use.

Solution

Think of this as Venmo, but for PYUSD, and it actually works without you paying gas fees. Users can send PYUSD to anyone without worrying about gas costs. That part is handled through our gas sponsorship. There is a reward system that gives users free transactions to try it out, then switches to a "1 in X" free model to keep users interested in using the app.

Note that even when a fee is taken, this fee is still in PYUSD and the user never has to worry about anything other than their use of the PYYSD stablecoin.

The app can also generate QR codes / links to request payments that are on-chain but are seamless.

screenshot-app screenshot-request-payment

Demo Walkthrough 🎥

Watch the complete demo to see PyPay in action:

PyPay Demo Video

Gas Sponsorship Via EIP-7702

That is the core of "gasless" payments that went live earlier via Pectra's upgrade that made gasless transactions possible via EIP-7702 Using this app, the users can send and request everyday payments in PYUSD without worrying about the scary part: gas fees.

The magic happens with EIP-7702 (making regular wallets act like smart accounts), Pimlico (sponsoring the gas), and Privy (making wallet creation user-friendly).

There is a TransactionCounter contract deployed that keeps track of user's total number of transfers and enables the owner to set parameters for gas sponsorship, i.e. initial number of free transactions and the frequency of free transfers afterward.

screenshot-admin-dashboard

Tech Stack

  • Frontend: Next.js 15 with TypeScript and Tailwind
  • Authentication: Privy for embedded wallets (email or wallet login)
  • Hardhat 3: Hardhat 3 for local development and contract deployment/verification
  • Blockchain: Viem for clean Ethereum interactions
  • Account Abstraction: EIP-7702 for smart account functionality
  • Gas Sponsorship: Pimlico handles the gas fees
  • Smart Contracts: Custom reward system with admin controls

Local Deployment

Quick Start

  1. Clone and install:

    git clone <repo>
    cd gasless-payments-clean
    npm install
  2. Set up environment: Create .env.local with your keys:

    # Privy Configuration
    NEXT_PUBLIC_PRIVY_APP_ID=your_privy_app_id_here
    PRIVY_SECRET=your_privy_secret
    
    # Pimlico Configuration
    NEXT_PUBLIC_PIMLICO_API_KEY=your_pimlico_api_key_here
    NEXT_PUBLIC_SPONSORSHIP_POLICY_ID=your_sponsorship_policy_id_here
  3. Run it:

    npm run dev

What You Can Do

For Users

  • Connect with email or wallet
  • Send PYUSD without paying gas fees
  • See your reward status and remaining free transactions
  • Generate payment links to share with others
  • Test basic transactions to verify everything works

For Admins

  • Access /admin to manage the reward system
  • Update free reward limits and ratios
  • Monitor contract usage and configuration
  • Adjust service fees as needed

Onchain Details

About

Send and receive PYUSD on-chain without paying gas

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published