Live: roll402.xyz · Token: <TBD_CA> · Twitter: @roll402sol
HTTP 402 — Payment Required. For thirty years, this status code did nothing. Then x402 arrived.
Roll402 is an onchain dice roll experiment built on the x402 payment primitive. Pick a number from 1 to 402. Pay the protocol. Beat the odds.
Built as an entry for the Solana x402 Hackathon 2026 — narrative track. The repo, the site, and the token all ship together.
x402 is an open HTTP payment standard incubated by Coinbase, integrated by Stripe, Google Cloud, and Cloudflare. It revives the dormant HTTP 402 "Payment Required" status code — turning it into a real payment layer for AI agents on Solana.
Every second, thousands of agents make x402 calls: paying for API access, compute, data feeds. Not every payment returns something valuable. Sometimes the response is worth millions. Sometimes — nothing.
Roll402 distills that uncertainty into a game.
→ x402.org → Solana x402 docs → Coinbase x402 spec
| Mode | Odds | Payout | Cost |
|---|---|---|---|
| x402 Roll | 1 in 402 | ×380 | 0.005 SOL |
- Connect your Solana wallet (Phantom, Solflare, MetaMask Snap)
- Pick a number from 1 to 402
- Pay 0.005 SOL to the protocol
- The protocol rolls. You win ×380 — or you don't.
The number you're rolling against — 402 — is the HTTP status code itself. The payout — ×380 — accounts for the house edge while keeping expected value close to fair.
If you hit it, the protocol paid you back. And then some.
One in 402 times, the door opens.
- Frontend: Next.js 16 (App Router) + TypeScript + Tailwind CSS
- Animations: Framer Motion + Paper Design Shaders
- Wallet: Solana Wallet Adapter (Phantom, Solflare, MetaMask Snap)
- Payments: @solana/web3.js — direct SOL transfer on Solana mainnet
- Randomness: Client-side, seeded from the transaction signature hash
The current implementation uses client-side randomness derived from the confirmed transaction signature. It is deterministic and auditable — the outcome is fixed at the moment of on-chain confirmation.
Upgrade path to provably fair: Switchboard VRF or Pyth Entropy. See SECURITY.md.
git clone https://github.com/roll402/roll402
cd roll402
npm install
cp .env.example .env.local
npm run devOpen http://localhost:3000.
There is a house edge. It is documented transparently in docs/ODDS.md.
Short version: expected value per roll is ~0.00472 SOL on a 0.005 SOL stake. House edge: ~5.5%.
- Token mint (Solana):
<TBD_CA> - Buy on Pump.fun: pump.fun/coin/<TBD_CA>
- Track on DexScreener: populated automatically after first swap
- Payments wallet (protocol):
BDJP1CSHNQ87jWP1Yfrs84YMXGCrREKwPup99NmRgqeY
- Site: roll402.xyz
- Twitter: @roll402sol
- DexScreener: coming soon (post-listing)
- Streamflow: vesting schedule will be published on listing day
- x402 Foundation: x402.org
Roll402 is a community experiment on the x402 narrative. Not financial advice. Play responsibly.
MIT