The Simplest Possible Payment
One HTML file. One wallet. One blockchain. No backend, no database, no API keys. A buyer opens a web page, clicks a button, approves a transaction in their Phantom wallet, and one cent of USDC moves from their wallet to the recipient's wallet on Solana. On this public site that is Solana devnet, with test USDC from a faucet, so no real money is at stake.
That's it. That's the entire payment stack.
This is the primitive that everything else builds on. Every chapter that follows — dynamic recipients, content paywalls, multi-chain support, mobile payments, automated testing, monitored addresses — uses the same underlying transfer. The protocol never changes. Only what's built on top of it does.
What Happens When You Click "Pay"
- The page asks Phantom to connect (the buyer sees a popup asking for permission)
- JavaScript builds a USDC transfer instruction: "send $0.01 from this wallet to that wallet"
- Phantom shows the transaction details and asks the buyer to approve
- The signed transaction is submitted directly to Solana (devnet, on this site)
- In about 1 second, the transfer settles on-chain — permanent, verifiable, irreversible
- The page shows a receipt with a link to verify on Solscan (the Solana block explorer)
The Code
The entire payment flow is three lines of meaningful code:
const TO = quote.accepts[0].payTo // the recipient the server's 402 names
const tx = buildUsdcTransfer(payer, TO, 0.01)
await phantom.signTransaction(tx)
Everything else — connecting the wallet, constructing the SPL Token instruction, submitting to the RPC, polling for confirmation — is boilerplate that every Solana payment shares. The protocol primitive is just: build a transfer, sign it, submit it.
What This Proves
- A real transfer settles. On this public site it runs on Solana devnet with test USDC, so no real money is at stake, but the transfer is a real, signed Solana transaction, verifiable on a block explorer (devnet cluster).
- No intermediary. There's no payment processor, no merchant account, no 3% fee. The transfer goes directly from wallet to wallet. The only cost is the Solana network fee: about $0.0005.
- No backend required. The entire page is a static HTML file. A browser, a wallet, and a blockchain — that's the complete infrastructure.
- Settlement is final. Once confirmed on-chain, the payment can't be reversed, disputed, or charged back. The recipient has the money.
Why USDC, not SOL? USDC is a stablecoin — 1 USDC is always worth $1 USD, backed by cash reserves at Circle. SOL is a volatile cryptocurrency whose price changes constantly. When a shirt costs $12, the buyer should pay $12 — not "however much SOL $12 buys at this moment, which might be $11.50 by the time the seller checks." Stablecoins make crypto payments predictable for both sides.
What's Next
This chapter hardcodes a single recipient. In Chapter 2, the buyer picks who to pay from a dropdown — proving the protocol scales to any number of recipients without changing the payment code.