Guide

Provably fair dice on Solana

“Provably fair” means you can check the math before you pay and confirm the outcome after — without trusting a black box. Garden Dice is a minimal, wallet-native demo of commit-reveal fairness plus a SOL micropayment.

The problem: trust in online rolls

A server could pick the die face after seeing your bet, or skew results in its favor. Traditional online games ask you to trust branding and audits. Commit-reveal schemes let you verify each round with public hashing — the same idea used in blockchain games, casinos, and lotteries.

Commit-reveal in three steps

  1. Commit. The server picks a secret serverSeed and shows you SHA-256(serverSeed) before you send SOL. The server cannot change the seed without changing the hash you already saw.
  2. Pay. You transfer a small amount of SOL from your wallet to the treasury. Your payment transaction signature can become the clientSeed (or you supply your own).
  3. Reveal & verify. The server reveals serverSeed. You recompute the hash and the die face. If anything was tampered with, verification fails.

How Garden Dice computes the roll

After payment confirms, the die face is:

hash = SHA-256(serverSeed + clientSeed)
roll = (first 8 hex chars of hash as integer mod 6) + 1

Same seeds always produce the same face (1–6). You can paste the seeds into any SHA-256 tool and check the math yourself. The commit hash must match SHA-256(serverSeed) from before you paid.

Why Solana fits micropay-per-roll

Sub-cent fees and sub-second finality make “pay 0.001 SOL, get an instant roll” practical. No card processor, no account signup — Phantom, Solflare, Backpack, or Solana Pay QR. Payments go straight to an on-chain treasury you can inspect on Solscan.

Garden Dice is pay-per-roll entertainment, not a casino with cash payouts. You pay for a verifiable roll and bragging rights — a transparent experiment in wallet-native payments.

Try it yourself

Connect a wallet or use Solana Pay on mobile. Watch the commit hash appear before you pay, then verify the revealed server seed matches.

FAQ

What is provably fair dice on Solana?
Commit-reveal hashing lets you verify each roll before and after you pay SOL from your wallet. Garden Dice is a minimal live demo at solana.garden/dice.
How much does a roll cost?
From 0.001 SOL per roll. Try the free demo first — no wallet required.
Is this a casino?
No cash payouts — you pay for a verifiable roll and challenge links, not winnings.

Further reading