CHAPTER 3 of 11

Minimal Paywall

The full x402 protocol: request content, get 402, pay, access granted.

What changed from Chapter 2: A server now gates the content. Asking for the article returns HTTP 402 (Payment Required) with the price. After a verified payment, the server sets a signed access cookie and the content unlocks. This is the x402 protocol in its complete form, served by this gateway's x402 engine.
Devnet only: test tokens with no value. Get devnet SOL from the Solana faucet and devnet USDC from Circle's faucet.
// Chapters 1-2: the client sends USDC directly
// No server needed, no gating

// Chapter 3: the server gates content
GET /articles/premium-1 → 402 PAYMENT-REQUIRED
// the wallet signs a USDC transfer, then:
POST /x402/settle → verified, settled, signed cookie
GET /articles/premium-1 → 200 (the article)
1
Request content — GET /articles/premium-1
2
Server returns 402 — the payment requirements
3
Sign a USDC transfer — in your wallet
4
Verify, settle and grant access — POST /x402/settle
5
Content unlocked — GET /articles/premium-1 returns 200
🔒

Federal Reserve Digital Dollar Framework

This article costs $0.01 in devnet USDC to read.