← Back to home

Priv Pay

Private USDC checkout links on Polygon with Railgun-based shielding.

Problem Statement

Every crypto payment today broadcasts who paid whom and how much to the entire blockchain - killing business confidentiality and financial privacy. PrivPay solves this with private checkout links powered by Railgun's zero-knowledge protocol on Polygon.How to use it:Merchants: Sign in with Privy → get Railgun private wallet automatically → create checkout linksPayers: Open link → connect any wallet (or create one via Privy) → click "Pay Privately"Result: USDC shielded in ~45 seconds, completely invisible on-chainEach checkout exposes an x402-compatible endpoint returning machine-readable payment instructions (amount, token, merchant's 0zk address). Payers shield USDC directly to merchants using client-side Railgun proof generation - no specialized wallets required.Technology Integration:Railgun SDK: Generates zero-knowledge proofs client-side for private transactionsPrivy: Handles authentication + creates embedded wallets for users without MetaMask (mainstream adoption)Polygon: Makes privacy economically viable at ~$0.01 per transaction vs $5+ on Ethereumx402 protocol: Machine-readable payment requests enabling automation and subscription billingThe prototype demonstrates real end-to-end private payments working on Polygon mainnet - proving privacy can be simple for subscriptions, ecommerce, and B2B invoicing.

Solution

Core Innovation: First browser-native Railgun integration for payment checkouts. We run the entire ZK proof engine client-side, eliminating centralized wallet servers - truly decentralized private payments.Architecture: pnpm monorepo with Vite + React + TypeScript frontend and Express + TypeScript backend connected to MongoDB.Railgun Integration: When merchants log in via Privy, backend generates Railgun wallets using the official SDK and stores encrypted mnemonics plus 0zk addresses. Frontend uses Railgun'spopulateShield()to generate zero-knowledge proofs entirely in-browser - proof generation runs client-side using BrowserLevel for IndexedDB and LocalForage for cryptographic artifacts.Payment Flow: Checkout endpoints return x402-structured JSON (token address, amount, network, merchant 0zk address). Payers connect wallets, app checks USDC balances and ERC-20 allowances, creates shield transactions. Each checkout uses deterministic 0zk addresses viakeccak256(checkoutId + merchantId)- unique privacy pools without storing keys.Partner Technology Synergy:Privy eliminates the "you need MetaMask" barrier - payers without wallets get one created in 5 seconds, critical for mainstream adoptionPolygon provides fast finality and low costs making privacy practical for everyday payments, not just high-value transfersWhat Works: Railgun wallet generation, x402 endpoints, USDC balance detection, EIP-2612 permit signatures (gasless approvals), full shield transaction creation and execution tested on Polygon mainnet with real USDC. This forms the foundation for automated private merchant distribution and recurring payment flows.

Hackathon

ETHGlobal Buenos Aires

2025

Contributors