Skip to content
View roll402's full-sized avatar
  • Joined May 14, 2026

Block or report roll402

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
roll402/README.md

ROLL402

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.


What is x402?

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.orgSolana x402 docsCoinbase x402 spec


How it works

Mode Odds Payout Cost
x402 Roll 1 in 402 ×380 0.005 SOL
  1. Connect your Solana wallet (Phantom, Solflare, MetaMask Snap)
  2. Pick a number from 1 to 402
  3. Pay 0.005 SOL to the protocol
  4. The protocol rolls. You win ×380 — or you don't.

The 402 connection

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.


Architecture

  • 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

Randomness note

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.


Run locally

git clone https://github.com/roll402/roll402
cd roll402
npm install
cp .env.example .env.local
npm run dev

Open http://localhost:3000.


House edge

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 & DEX

  • 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

Links

  • Site: roll402.xyz
  • Twitter: @roll402sol
  • DexScreener: coming soon (post-listing)
  • Streamflow: vesting schedule will be published on listing day
  • x402 Foundation: x402.org

Disclaimer

Roll402 is a community experiment on the x402 narrative. Not financial advice. Play responsibly.

License

MIT

Popular repositories Loading

  1. roll402 roll402 Public

    The x402 dice roll experiment on Solana