hackquest logo

PermiPay

PermiPay is a permission-metered Web3 analytics dApp that replaces flat subscriptions with wallet-controlled, pay-per-use access to advanced DeFi insights.

视频

描述

PermiPay: Permission-Metered Web3 Analytics

THE PROBLEM: Subscription Fatigue & UX Friction in Web3

New crypto users face multiple barriers:

  1. Approval Hell: Every transaction requires a MetaMask popup. Analyze 5 contracts? Click "Approve" 5 times. This repetitive signing drives users away.

  2. Gas Fee Anxiety: Each approval costs gas. A $0.05 query can cost $2-5 in gas during congestion—users pay more in gas than for the service.

  3. Subscription Lock-In: Pay $20/month but only use 2 features? You're locked in. Cancel and lose access entirely.

  4. Zero Transparency: No itemized billing, no real-time tracking, just blind monthly charges.

  5. All-or-Nothing Access: Pay for full subscription or get nothing. No middle ground for occasional users.

Result: Users abandon Web3 analytics tools within the first week due to high friction and unpredictable costs.

OUR SOLUTION: Pay for What You Actually Use

  1. One-Time Permission Grant

  • Grant bounded USDC allowance once (e.g., $10 for 30 days)

  • No more popups or repeated approvals

  • Example: Grant $10 → Use 20 services seamlessly

  1. Pay-Per-Use Pricing

  • Contract Inspector: $0.05 | Wallet Audit: $0.15 | Wallet Reputation: $0.10

  • Use 3 services? Pay $0.30. Use 50? Pay exactly what you used.

  1. Gasless Execution

  • Pimlico paymaster sponsors all gas via ERC-4337

  • Analyze 10 contracts = $0.50 total (not $0.50 + $30 gas)

  1. Real-Time Transparency

  • Live dashboard shows every charge

  • Transaction history with Etherscan links

  • Budget tracking: "$3.40 spent of $10.00 limit"

  1. Full Control

  • Set spending caps and expiration dates

  • Revoke permission anytime

  • No hidden charges

HOW METAMASK ADVANCED PERMISSIONS (ERC-7715) POWERS THIS

ERC-7715 enables delegated permissions—users grant a session account permission to spend a limited amount on their behalf.

Traditional vs PermiPay Flow:

Without ERC-7715: Click button → MetaMask popup → Confirm → Wait → Repeat for EVERY transaction

With ERC-7715: Grant permission ONCE → Use services seamlessly → No popups ever again

Implementation:

One-time permission grant
await erc7715Client.requestExecutionPermissions([{
chainId: sepolia.id,
permission: {
type: 'erc20-token-periodic',
data: {
tokenAddress: USDC_ADDRESS,
periodAmount: '10000000', // $10.00
periodDuration: 2592000, // 30 days
}
}
}]);

Seamless execution (no popup)
await executeService(ServiceType.CONTRACT_INSPECTOR, contractAddress);
$0.05 automatically deducted

Benefits:

  • No repetitive approvals

  • Bounded spending limits with expiration

  • Users can revoke anytime

  • All permissions visible in MetaMask

  • Combined with ERC-4337 for $0 gas fees

HOW ENVIO HYPERINDEX POWERS REAL-TIME ANALYTICS

Envio is a real-time blockchain indexer that syncs smart contract events to a GraphQL database in 2-3 seconds.

Why We Need It:

Without Envio: Transaction confirmed (12s) → Query blockchain → Parse logs → Update UI = 30-60 seconds

With Envio: Transaction confirmed (3s) → Envio indexes (2s) → GraphQL returns data = 5 seconds total

What Envio Indexes:

event PermissionGranted(address user, uint256 limit, uint256 expiresAt);
event ServiceExecuted(address user, uint8 serviceType, uint256 cost);

GraphQL Queries:

User Dashboard
query UserData($address: String!) {
ServiceExecution(where: {user: {_eq: $address}}) {
serviceType
cost
timestamp
transactionHash
}
ServiceExecution_aggregate {
aggregate {
sum { cost } # Total spent: $3.80
count # Total transactions: 25
}
}
}

Benefits:

  • 2-3 second indexing latency

  • GraphQL API for easy integration

  • Full transaction history instantly

  • Real-time dashboard updates

  • Platform-wide analytics

ARCHITECTURE & TECH STACK

Flow:

  1. Grant Permission (one-time) → MetaMask ERC-7715 + session account created

  2. Use Service (seamless) → No popup, Pimlico executes, $0 gas

  3. Envio Indexes (2s) → Event captured, GraphQL updated

  4. Dashboard Updates (instant) → Real-time budget and history

Technology:

Frontend: Next.js 15, TypeScript, TailwindCSS, Wagmi, Viem, Chart.js

Smart Contracts: PermiPayBilling (Sepolia), USDC Token, Solidity

Account Abstraction: ERC-4337, Pimlico bundler/paymaster

Permissions: ERC-7715 (MetaMask Flask)

Indexing: Envio HyperIndex v2.32.3, GraphQL, PostgreSQL

APIs: Etherscan, Groq AI (Llama 3.3 70B)

KEY FEATURES & SERVICES

For Users:

  • One-Time Setup: Grant permission once, use forever

  • Transparent Pricing: $0.05-$0.15 per feature, no hidden fees

  • Zero Gas Fees: Pimlico sponsors all gas

  • Budget Control: Set limits, expiration dates, revoke anytime

  • Real-Time Dashboard: Track spending, view history with Etherscan links

Available Services:

Contract Inspector ($0.05): Analyze verified Ethereum contracts, view ABI/bytecode, AI security analysis

Wallet Audit ($0.15): Comprehensive security analysis, transaction patterns, risk scoring

Wallet Reputation ($0.10): Reputation scoring (0-100), activity metrics, ENS resolution

WHY THIS MATTERS

Lowering Web3 Barriers:

  • Simplified UX (no gas fee understanding needed)

  • Predictable costs ("$0.05" vs "0.002 ETH + gas")

  • No commitment (try once, pay once)

  • Full transparency (every charge visible on-chain)

Sustainable Model:

  • Fair pricing (pay for value, not time)

  • Scalable (more usage = more revenue)

  • Lower churn (no lock-in)

CURRENT DEPLOYMENT

Live on Sepolia Testnet:

  • Contract: 0x6B3c3435DfC8dE86018dC311915E8D7af826c3Fa

  • Total Users: 2 | Active Permissions: 2

  • Total Revenue: $3.70 USDC | Total Executions: 25

  • Envio Status: Fully synced | Latency: 2-3 seconds

TRY IT

Prerequisites: MetaMask Flask, Sepolia ETH & USDC

Steps:

  1. npm run dev → http://localhost:3000

  2. Connect wallet → Grant $10 permission

  3. Use services: Contract Inspector ($0.05), Wallet Audit ($0.15), Reputation ($0.10)

  4. Watch dashboard update in real-time!

ROADMAP

Phase 1 (Current): ERC-7715, 3 services, Envio indexing, gasless transactions

Phase 2 (Q1 2026): Mainnet, more services, mobile-responsive, multi-chain

Phase 3 (Q2 2026): Custom permissions, team accounts, API access, ML analytics

CONCLUSION

PermiPay combines ERC-7715 (one-time permissions), ERC-4337 (gasless), Envio (real-time), and pay-per-use pricing to create an experience that's:

Simpler • Cheaper • Transparent • Flexible

No more subscription fatigue. No more gas fee anxiety. Just use what you need, when you need it.

Built with love using Next.js, Envio, and ERC-7715

GitHub: https://github.com/Rohitamalraj/PermiPay

Live demo: https://permipay.vercel.app/

本次黑客松进展

🎯 Progress During Hackathon ✅ Core Implementation Complete Smart Contract Development Deployed PermiPayBilling contract on Sepolia (0x6B3c...4787) Implemented ERC-7715 permission management system Integrated ERC-4337 account abstraction for gasless transactions Service pricing logic: Contract Inspector ($0.05), Wallet Audit ($0.15), Wallet Reputation ($0.10) Frontend Application Built full-stack Next.js 15 dApp with TypeScript Implemented MetaMask wallet connection with Wagmi/Viem Created permission grant UI with ERC-7715 integration Designed responsive interface with TailwindCSS + custom GridScan 3D background Real-time dashboard with Chart.js analytics Envio HyperIndex Integration Configured Envio indexer for PermiPayBilling events Real-time GraphQL queries for user spending and platform analytics 2-3 second indexing latency for instant dashboard updates 100% event capture (25 service executions indexed) Three Service Features Live 🔍 Contract Inspector: AI-powered analysis with Groq (Llama 3.3 70B) 🛡️ Wallet Audit: Security analysis with Etherscan API ⭐ Wallet Reputation: Scoring system with ENS resolution Account Abstraction & Gasless UX Pimlico bundler/paymaster integration Users pay $0 in gas fees (sponsor covers all) Session accounts for delegated permissions No MetaMask popups after initial permission grant 📊 Current Status Deployment: Live on Sepolia testnet Users: 2 active with granted permissions Transactions: 25 successful service executions Revenue: $3.70 USDC processed Uptime: 100% (Envio fully synced) 🎥 Demo-Ready Features ✅ One-click permission grant ($10 for 30 days) ✅ Seamless service execution (no popups) ✅ Real-time budget tracking dashboard ✅ Transaction history with Etherscan links ✅ AI contract analysis with security insights ✅ Wallet security audits and reputation scoring 🚀 Innovation Highlights No Subscription Model: Pay-per-use pricing eliminates subscription fatigue Zero Gas Anxiety: Users never pay gas fees Full Transparency: Every charge visible in real-time with on-chain verification True Wallet Control: Set spending caps, revoke anytime, no lock-in Tech Stack: Next.js 15, Solidity, ERC-7715, ERC-4337, Pimlico, Envio HyperIndex, Groq AI, Etherscan API

技术栈

React
Next
Web3
Node
Solidity
队长
RRohit Amal Raj
赛道
DeFiOtherInfra