Edit 2026-04-17: This kit is now free + MIT. Source: github.com/cryptomotifs/cipher-x402-mcp. Tip in SOL (
cR9KrbsLVJvir5rY9cfY3WeNoxMwUGofzpCoVyobryy) if it saved you time.
Shipped: x402 Paid Endpoint Starter Kit — Next.js 16
After my original x402 paywall walkthrough, the same five questions kept landing in my inbox:
- Which version of
@x402/nextactually works cleanly with the Next.js 16 app router? - Where does the facilitator middleware need to sit so Base mainnet USDC verifies correctly?
- Do I need a custom listener to verify the
X-PAYMENTheader, or does the SDK handle it? - What exact
.envvariables does a working deploy need? - How do I push this to Vercel without tripping on Node 22 module resolution?
I just packaged the full working answers as a 158 KB starter kit. $15, crypto-direct, no platform middleman.
What's inside the ZIP
- Complete Next.js 16 starter repo — no placeholders, this is the code I deploy myself
- Pre-wired
middleware.tsfor the x402 facilitator on Base mainnet USDC -
/app/protected/route.ts— the canonical route handler pattern, working end-to-end -
.env.examplewith every variable commented so you know which to set and which are optional - 7-page styled tutorial PDF of the original article — nice for offline reading
-
deploy.sh+deploy.bat— one-command Vercel deploy
How to buy
Three chains, pick whichever you already hold liquidity on:
| Chain | Asset | Address |
|---|---|---|
| Base / Ethereum / Polygon / Arbitrum / Optimism | USDC | (removed — see repo) |
| Solana | USDC-SPL or SOL | cR9KrbsLVJvir5rY9cfY3WeNoxMwUGofzpCoVyobryy |
| Bitcoin | BTC | (removed) |
- Send (free — MIT on GitHub) to any of the above.
- Email the TX hash to **** with subject line
(retracted) <chain>:<tx-hash>— e.g.(retracted) base:0xabc123.... - ZIP delivered to your inbox, usually within minutes. The verifier matches the TX on-chain, confirms receiver + amount + confirmations, then auto-sends the file via Resend.
Why wallet-direct
I started with Gumroad and Payhip. Both require Stripe or PayPal KYC on the seller side and neither offers a native crypto payout that matches what AI-agent buyers or on-chain customers actually hold. If you're building on x402, your checkout should route the same way your runtime does — to a wallet.
Related (free)
- cipher-x402-mcp on GitHub — the MCP server behind the stack, MIT-licensed
- cipher-starter — the 12-playbook Solana signal engine write-up the kit grew out of
Questions? Comment here or email. If you hit a gotcha after buying, I'll update the kit and re-send.
Tagged: #x402 #nextjs #ai #crypto #indiedev
Top comments (0)