Pay as you go internet: unlock content with one click, powered by onchain micropayments.
Pay402 is a browser extension that enables micropayments for online content. Instead of $15/month subscriptions, readers pay small amounts (like $0.50) only for articles they actually want to read.
The Problem: Credit cards can't handle micropayments—a $0.50 transaction costs $0.31 in fees, making pay-per-article impossible. This forces publishers into subscription models and blocks casual readers from accessing content they'd happily pay a small amount for.
Our Solution: Pay402 uses Yellow Network state channels and PYUSD stablecoin to enable instant, near-zero-fee micropayments. The browser extension automatically detects paywalls, handles one-click payments, and unlocks content in under 1 second.
How it works for readers:
How it works for publishers:
Add 3 meta tags to your HTML (price, wallet address) and implement a simple /pay402/unlock API endpoint to verify payments and serve content.
Why it matters:
This is a fully functional system with real Yellow Network integration, live PYUSD payments on Sepolia testnet, automatic paywall detection, and a complete payment verification backend.
Architecture: Pay402 is a monorepo with 4 packages:
Partner Technologies:
Yellow Network - The core payment layer. We integrated their Nitrolite SDK for state channel payments. This was the hardest part—minimal documentation meant reverse-engineering the WebSocket protocol to communicate with ClearNode (wss://clearnet-sandbox.yellow.com/ws). State channels give us sub-second settlement and ~$0.001 fees per payment. We wrote custom wrappers for session management, channel opening/closing, and payment submission.
PYUSD - PayPal's stablecoin on Sepolia testnet (0xCaC524BcA292aaade2DF8A05cC58F0a65B1B3bB9). This gives users stable USD pricing—no crypto volatility. $0.50 means 50 cents, always.
ZeroDev - Account abstraction via ERC-4337 smart accounts with session keys. This lets users make payments without manually approving every transaction or managing gas fees. The extension creates session keys that can spend small amounts automatically, making the UX feel like one-click payments.
Privy - Embedded wallet SDK for easy wallet connection and authentication in the browser extension.
Notable hacks:
Paywall Detection - Built a generic detector using DOM inspection (looks for blur filters, overlay elements with data-paywall, meta tags with pricing). Works across different paywall styles without site-specific code.
Extension Message Passing - Chrome Manifest V3 made communication tricky. Content scripts detect paywalls, send messages to the service worker which handles payments, then posts results back to content scripts to unlock the DOM. Had to carefully manage async message passing and race conditions.
Session Key Security - Storing session keys in a browser extension is risky. We use Chrome's encrypted storage API and isolate keys from content scripts (only the service worker can access them). Session keys have spending limits and expiration.
Cryptographic Receipt Verification - Unlike other micropayment demos that use client-side-only verification, Pay402 implements production-grade security:
The trickiest part was making Yellow Network's state channels and all other aspects work in a browser extension context—most examples assume a Node.js server. We had to handle wallet connection, network switching to Sepolia, and WebSocket management all within the extension's service worker constraints.
Security Architecture:

