
Pay402
First x402 payment facilitator on SUI - Google OAuth to USDC payments in 600ms
Demo
About
## Pay402: First x402 Payment Facilitator on SUI **We're bringing proven technology to SUI with unique advantages impossible on other blockchains.** ### Market Context: x402 is Production-Ready x402 (HTTP 402 "Payment Required") is a proven protocol for micropayments: - **$600M** annualized payment volume (Dec 2025) - **63M+** monthly transactions - **1,100+** projects using the protocol - **Live on Base** (Coinbase SDK) and **Solana** (PayAI) **The opportunity:** SUI has NO x402 facilitator yet. We're first. ### The Problem with Current Implementations Existing x402 on Base and Solana face limitations: - **High friction:** Users need wallet extensions, seed phrases, crypto knowledge - **Gas complexity:** Users must hold gas tokens (ETH, SOL) in addition to USDC - **Slow finality:** 12+ minutes on Ethereum L1, ~2 seconds on Base L2 - **Expensive receipts:** $0.50-$5 per on-chain event on EVM makes micropayments uneconomical ### Our Solution: SUI's Unique Capabilities Pay402 leverages SUI-native features to deliver the **best x402 implementation, period:** **1. Onboarding Non-Crypto Users** (zkLogin + Enoki) → Google OAuth creates blockchain address. No wallet, no seed phrase, no crypto knowledge. **2. No Browser Wallet** (Gas Sponsorship - Native) → Facilitator pays all SUI gas fees. Users only need USDC. **3. Low Latency** (Sub-Second Finality) → 600-700ms blockchain settlement on testnet. Real-time payment confirmation. **4. Audit & Conflict Resolution** (Cheap On-Chain Events) → Receipt events cost ~$0.0003 per payment (vs $0.50-$5 on EVM). Makes micropayments viable. **5. Flexible Extensions** (Programmable Transaction Blocks) → Atomic multi-step: split coins, pay merchant, pay facilitator, emit receipt - all in one transaction. **6. Massive Scaling** (Object Model - Owned Objects) → Parallel execution without shared state bottlenecks. Fundamentally different from EVM. **These capabilities are difficult or impossible on EVM/Solana chains.** ### Live Demo **URL:** https://merchant-production-0255.up.railway.app (SUI Testnet) **Try it now:** 1️⃣ Visit merchant → Click "Get Premium Data ($0.10)" 2️⃣ Sign in with Google (no wallet needed!) 3️⃣ Get test USDC from faucet (first time only) 4️⃣ Review payment (widget verifies transaction) 5️⃣ Confirm with 1-click (zkLogin signature) 6️⃣ Content delivered instantly 7️⃣ Receipt on blockchain **Proof Transaction:** https://suiscan.xyz/testnet/tx/EV7D7z9gjzjrAQSKWSW8S1iLGdk8aEVPjn3zLA1aUSLE Real payment on SUI testnet showing: buyer zkLogin signature, facilitator gas sponsorship, atomic USDC transfers, on-chain receipt. ### Hackathon Achievements Built during ETH Global HackMoney 2026: ✅ OAuth Login (zkLogin + Enoki) ✅ Gas Sponsorship (native SUI) ✅ PTB Validation (client-side security) ✅ zkLogin Signing (1-click payments) ✅ Optimistic Settlement (instant delivery) ✅ Pessimistic Settlement (wait for finality) ✅ USDC Persistence (Circle native) ✅ Merchant Onboarding (JWT invoices) ✅ On-Chain Receipts (cheap audit trail) **Testing:** 276 automated tests passing **Deployment:** Live on Railway (facilitator + widget + merchant) ### Why This Matters **For SUI Ecosystem:** First x402 brings proven payment infrastructure ($600M ecosystem) to SUI, enabling: - API monetization for SUI developers - Content paywalls with zero user friction - AI agent commerce on SUI - New revenue models for dApps **For x402 Protocol:** Demonstrates that SUI's unique features (zkLogin, PTBs, object model) enable the BEST x402 implementation - superior to EVM and Solana. **Technical Innovation:** Shows how SUI-native features eliminate complexity that requires workarounds on other chains (EIP-4337 for gas abstraction, smart contract wallets for social recovery, etc.)
How it's made
## Technical Implementation **GitHub Repository:** https://github.com/hamiha70/Pay402 **Full Documentation:** - [Architecture](https://github.com/hamiha70/Pay402/blob/main/docs/ARCHITECTURE.md) - Mermaid diagrams, payment flows - [Trust Model](https://github.com/hamiha70/Pay402/blob/main/docs/TRUST_MODEL.md) - Security analysis, PTB verification - [Problem Statement](https://github.com/hamiha70/Pay402/blob/main/docs/PROBLEM_STATEMENT.md) - Market context, comparisons - [Move Contract](https://github.com/hamiha70/Pay402/blob/main/move/payment/sources/payment.move) - On-chain logic ### Technology Stack **On-Chain (SUI Blockchain):** - Smart Contract: SUI Move with generic `Coin<T>` support - PTBs: Programmable Transaction Blocks for atomic execution - zkLogin: Zero-knowledge proofs for OAuth-based signing - Gas Sponsorship: Native SUI feature (no EIP-4337 complexity) - Event Emission: Cheap on-chain receipts (~$0.0003) - Stablecoin: Circle USDC (native on SUI) **Off-Chain Components:** *Facilitator API (Node.js + TypeScript):* - PTB construction matching invoice terms - Balance verification - Dual settlement modes (optimistic/pessimistic) - Gas sponsorship coordination *Payment Widget (React + Vite):* - zkLogin integration (Enoki SDK) - Client-side PTB verification (security critical) - Stripe-like payment UX - OAuth session management *Demo Merchant (Node.js + Express):* - JWT invoice generation - HTTP 402 response pattern - Payment verification - Content delivery **Infrastructure:** - Enoki SDK (Mysten) - zkLogin infrastructure - Railway - Deployment platform - SUI Testnet - Network - 276 automated tests - Coverage **Example Transaction:** https://suiscan.xyz/testnet/tx/EV7D7z9gjzjrAQSKWSW8S1iLGdk8aEVPjn3zLA1aUSLE ### SUI-Specific Advantages That Enable This **1. zkLogin + Enoki (Unique to SUI)** Google OAuth creates a deterministic SUI address via zero-knowledge proofs. No browser extension, no seed phrase required. **2. Programmable Transaction Blocks (SUI Native)** Atomic multi-step transactions: split coins, transfer to merchant, transfer facilitator fee, emit receipt - all succeed or all revert together. **3. Object Model with Parallel Execution** Owned objects enable parallel transaction processing without global state locks. Multiple payments execute simultaneously without coordination overhead. **4. Native Gas Sponsorship** `ptb.setGasOwner(facilitatorAddress)` - built into the protocol. Buyer signs with USDC, facilitator signs with SUI, neither can spend the other's funds. *Why better than Solana:* Solana supports it but less elegantly. SUI's implementation is cleaner and native. ### What Stands out **Technical Depth:** - Full-stack implementation (Move, TypeScript, React) - Novel use of SUI-native features (zkLogin, PTBs, gas sponsorship) - Production-quality security (PTB verification, JWT auth) - Comprehensive testing (276 tests) **Real-World Utility:** - Solves actual problem (proven by $600M x402 market) - Live demo anyone can try - Clear path to mainnet deployment **SUI Ecosystem Contribution:** - First x402 on SUI - brings proven protocol to network - Demonstrates SUI advantages over EVM/Solana - Example of excellent SUI developer UX - Enables new revenue models for SUI dApps ### Next Steps / Roadmap **Immediate (Post-Hackathon):** - Mainnet deployment - Production monitoring (Sentry, uptime tracking) - Multi-region facilitator nodes **Short-Term:** - Browser extension for PTB verification (works with any x402, not just Pay402) - Embeddable widget (npm package) - Merchant SDK for easy integration **Medium-Term:** - CCTP integration (Circle's Cross-Chain Transfer Protocol) - merchants receive on preferred chain - Support for additional stablecoins beyond USDC - Merchant dashboard for reconciliation ### Partner Technologies **Mysten (SUI):** - SUI blockchain and Move language - Enoki SDK for zkLogin - Native gas sponsorship, PTBs, object model **Circle:** - USDC stablecoin (native on SUI) - Future: CCTP for cross-chain settlement **Railway:** - Infrastructure for deploying all services - Simple GitHub integration ### Solo Hacker Context Every aspect of this project - smart contract design, Move implementation, facilitator API architecture, widget UI/UX, PTB verification algorithm, testing strategy, documentation, and presentation - was built by one person during the hackathon. The comprehensive scope demonstrates: 1. SUI's excellent documentation and developer resources 2. Move's safety and expressiveness for payment logic 3. Enoki SDK's production-readiness for zkLogin 4. The power of SUI-native features to eliminate complexity