v2.8 · RNG PRE-SUBMISSION PACKAGE v1.2
RAIN RNG · TWO-PARTY COMMIT-REVEAL · ORACLE-FREE

Provably fair by construction.
RAIN RNG — the two-party commit-reveal randomness that runs live casinos on Arbitrum.

Games. Markets. Insurance. One protocol, one RNG.

Every card, spin, reel and crash multiplier on the protocol is keccak256(pRev, hRev, sessionSeed, channelId, k) — one secret from the player, one from the house, both committed on-chain before play, both revealed per round. Random if either party is honest. No VRF, no oracle, no randomness provider to trust, bribe or censor. It is the most adversarial consumer of randomness there is — a casino — and it runs on it in production on two live deployments.

Two reference deployments, both on Arbitrum One, both play-money, both pre-audit: maycasino.xyz (#1 — 13 table games, ChannelManager V4) and playmarkets.bet (#2 — Engine V2 slots, Craps, Live Crash, Outperform markets, ChannelManagerAA smart accounts). Contract addresses are in the table below.

▸RAIN RNG — HOW ONE ROUND IS DECIDED

The whole mechanism fits in three steps and one formula. Full chapter, threat model and a verify-it-yourself walkthrough on the RAIN RNG page.

01COMMIT

At login the house commits houseSeedCommit = keccak256(houseSeed) before seeing the player's seed; the player's EIP-712 OpenChannel signature binds both playerSeed and that commit. Both parties also publish the root of a 4,096-deep hash chain. Everything is on-chain in the open transaction.

02OPEN

The contract checks the commit, then fixes sessionSeed = keccak256(houseSeed, playerSeed, channelId) and emits SessionSeedCommitReveal — the public fairness anchor for the whole session. One transaction; the channel is Active in the same block.

03REVEAL, PER ROUND

Round k: the player signs the bet together with pRev_k (next chain preimage); the house answers hRev_k + countersignature. r = keccak256(pRev, hRev, sessionSeed, channelId, k); the game maps r to an outcome (% 37, % 52, % 100 + 1, or a full slot engine seeded by r). Bet before randomness, always.

import { outcome, verifyRound } from '@rain/rng-core';

const r   = outcome({ pRev, hRev, sessionSeed, channelId, k });   // uint256 — same keccak as the verifiers
const ok  = verifyRound({ pRev, hRev, sessionSeed, channelId, k, hAnchor, claimed: r }); // true ⇔ VERIFIED
console.log(r % 37n, ok);                                        // e.g. roulette number, and whether the house told the truth

Package @rain/rng-core 2.1 — MIT + attribution (“Powered by RAIN RNG”). npm: ready, unpublished; source on the sdk-v2 mirror branch ↗. Integrator guide →

📦 Pre-submission package v1.2 → status · Dieharder / NIST STS / TestU01 · 10⁸ scaled outcomes · every document · downloads with SHA-256

01GAMES — LIVE

13 table games (maycasino) + 8 Engine V2 slots + Craps + Live Crash (playmarkets) — one channel per login, all games inside it, zero gas, email login via smart accounts (ERC-1271, Alchemy gas-sponsored, session key as validation entity → zero wallet popups). Every action is an off-chain dual-signed state; two on-chain transactions per session. Vertical → · Games →

02PREDICTIONS — LIVE VIA RAIN MARKETS

Risk traded for profit. The Rain prediction-markets side runs permissionless markets with an order book, liquidity, split/merge, and an AI + dispute + appeal resolution layer — the protocol's oracle for world events — shipped as rain-sdk-v2. Vertical →

03PARAMETRIC INSURANCE — SUPPORTED

Risk sold away as protection. A parametric cover is a prediction-market position bought as protection: flight delayed, rainfall > X, price < Y — resolved on public data, underwritten by vault capacity, paid instantly. Personal/individual insurance: roadmap, Stage 2. Vertical →

04RELATIVE-PERFORMANCE MARKETS — LIVE (OUTPERFORM)

5-minute pari-mutuel “which asset outperforms” markets on BTC / ETH / SOL / BNB: buy shares of the coin you think moves most, price-curve dividends flow to earlier holders, rounds are keeper-settled on-chain (CryptoRace 0x340991442B5BFCD80a46D709748be28b788414B7). Honest scope: settlement prices come from a house-signed off-chain oracle v1 (median of OKX + Bybit REST tickers, EIP-712-attested through OffchainOracleAdapter 0x47b33BbE635682E7164f0A4f33D02e25592D006e) — not provably fair yet; the house can't cherry-pick prices late (60-s deadline, else the round voids and refunds), but it can choose not to settle. The Pyth path is planned (adapter deployed, re-enabled via 48-h timelock). Trade it live ↗

▸RANDOMNESS AS A SERVICE

RAIN RNG is a core protocol capability, not a casino side-effect: oracle-free since v2.6.0, unbiased if either party is honest, with on-chain fraud proofs (proveBadTransition) and a bonded house. Use it without the casino — integrator personas: casinos wanting only the RNG, AI-agent builders, game studios. Research →

▸TOKEN-AGNOSTIC VAULT

The ChannelManager takes the settlement token and vault as constructor parameters. Deployment #1 settles in RUSD, deployment #2 in USDTTT — both play-money, both just instances. Any operator can run a USDC/USDT instance; limits, bonds and the fee waterfall follow. Deployment config →

▸THE DEEPEST LIMITS IN THE MARKET

Position limits are a pure, public function of vault TVL — not a negotiation. At the design target of $300M TVL the protocol underwrites $600,000 even-money positions. Three exposure rules bound the book mathematically. Whitepaper §3 · see the math run live.

▸TWO WAYS TO BUILD ON THE PROTOCOL

Same contracts, same RNG, same house node. Pick the layer you want to own.

AWHITE-LABEL — YOUR BRAND ON OUR DEPLOYMENT (REV-SHARE)

You bring brand, players and marketing; the platform holds liquidity, house node, games and RNG. A brand is a config layer (brand.json: identity, palette, promos, game list, legal, admin) generated by a 6-step wizard, applied for via the self-serve portal at playmarkets.bet/partners (free hosted URL · platform subdomain · your own domain), and operated from a multi-brand back-office (brands list, approve, deploy progress, redeploy, monthly rev-share statement — tiers 25 / 30 / 35 % of NGR by monthly GGR, 3-month soft negative carryover). Reference brand #1: maycasino.xyz (wizard at /create.html, on-chain claimBrand revenue via FeeSplitter). RTP and game math are untouchable by the brand.

BSDK — THE PROTOCOL INSIDE YOUR PRODUCT

Take the layers you need: @rain/rng-core (just the randomness + verifier), @rain/rng-session (hash chains, commit-reveal, EIP-712), @rain/channels (open / act / close / dispute against ChannelManager), @rain/games (rules engines mirroring the on-chain verifiers), @rain/markets (pari-mutuel Outperform + rain-sdk-v2 wrapper). Run your own token instance, your own house node, your own bond. SDK layering →

Honest scope: white-label and SDK both run on play-money deployments today (RUSD on #1, USDTTT on #2), pre-audit. Real-money operation requires the external audit and the licensing steps listed in the audit package — that is the claim, nothing more.

▸LIVE ON ARBITRUM ONE — WHAT'S ACTUALLY DEPLOYED TODAY

Honest numbers. Play-money tokens, pre-audit. Design targets are in the whitepaper; these are the live facts, per deployment.
GAMES LIVE (STATE CHANNELS)
13 table + 8 V2 slots + Craps + Live Crash
PER-ACTION LATENCY (MAINNET, MEASURED)
~300–480 ms (#1) · ~100 ms (Live Crash, #2)
LOGIN → PLAY (#2)
email login · 0 popups · 0 gas
DESIGN TARGET @ $300M TVL
$520k–600k / position

#2PLAYMARKET DEPLOYMENT (ARBITRUM ONE · 42161) — playmarkets.bet

CONTRACTADDRESSSTATUS
ChannelManagerAA (ERC-1271 smart-account channels, session-key validation, Alchemy gas-sponsored)0x60743006c2a5Dd5b9907CA37e7381854ff860959Sourcify exact_match ✅ · Sourcify
EngineV2RulesVerifier (8 Engine V2 slot games, engine-hash committed per game)0x5d6048AB261e6151AB44fE6053e7AEb35Cb5C1B1Sourcify exact_match ✅ · Sourcify
GameMuxVerifier9 (current mux — one verifier for all games in the channel; mux8 ranges + craps 224–254; supersedes GameMuxVerifier8 0xb72B…1b25 which stays for old disputes)0xDf214594D021a36bD61aB398c20c4A14cDD0b48eSourcify exact_match ✅ · Sourcify
HouseBond (operator bond; slashable on liveness fault)0x3D2d25373836C9d102E83f4200e87d087B29b998Sourcify exact_match ✅ · Sourcify
USDTTT (settlement token — play-money, 6 decimals)0x528F42C8560BBDa048690fB0982B07A9Ae52551ASourcify exact_match ✅ · Sourcify
CryptoRace v1.1 (Outperform — 5-min pari-mutuel markets)0x340991442B5BFCD80a46D709748be28b788414B7Sourcify exact_match ✅ · Sourcify
OffchainOracleAdapter v1 (house-signed EIP-712 price attestations — not provably fair)0x47b33BbE635682E7164f0A4f33D02e25592D006eSourcify exact_match ✅ · Sourcify

#1MAYCASINO DEPLOYMENT (ARBITRUM ONE · 42161) — maycasino.xyz · rainsandbox.xyz

CONTRACTADDRESSSTATUS
ChannelManager V4 (active — oracle-free session seed)0xD8a856BD76ad773875dcF9EA8c9255A3805e678aSourcify exact_match ✅ · Sourcify
ChannelManager V3 (legacy — Pyth-seed era, superseded)0xe13DC056111906aA4d3659880EBDC67138c76DA7Sourcify exact_match ✅ · Sourcify
GameMuxVerifier (manager's verifier)0x14155583112F87777B95AB0EA76786bf079c6A83Sourcify exact_match ✅ · Sourcify
GameMuxVerifier3 (routes all 13 games)0x5289cbE7F668362ee648e0a9d3026A6c9FE93fa5Deployed · Arbiscan
BaccaratRulesVerifier0x1c3cF9D0f5757F420C06d64b28612Cca3A3E57fDDeployed · Arbiscan
BlackjackRulesVerifier0xFdcCE2DE2F8A28cBBdBaB01131C3bab138Eb9293Sourcify exact_match ✅ · Sourcify
RouletteRulesVerifier0x5239969ff32e5733F319d3e80eD64D19adF4962fSourcify exact_match ✅ · Sourcify
HouseBond (2×100k RUSD operator bonds)0x37E41E1d1EE2F96cE0203af06d639448547ade84Sourcify exact_match ✅ · Sourcify
RUSD (demo token, 6 decimals)0x260c7019E760763988843Bc5b873d749b5937469Play-money faucet token

Deployment #1 max position is 3,125 RUSD, bond-limited (design target at $300M TVL: $520k–600k): the exposure engine clamps the table limit by the smallest of float-derived cap (1733 ppm of vault float), operator bond headroom (slashable/32) and operator liquidity; today the 100k RUSD bond binds. Raising bonds raises the limit automatically — no redeploy. Derivation in DEPLOYMENT.md.

▸SETTLEMENT & SELF-CUSTODY — WHAT THE CHAIN ENFORCES

01INSTANT, GUARANTEED SETTLEMENT

Two on-chain transactions per session; every position in between is an off-chain dual-signed EIP-712 state. On-chain close enforces the last dual-signed state even if the counterparty vanishes: forceClose → finalizeClose (and reclaimStale for abandoned channels) is the self-custody guarantee. Architecture.

02FRAUD PROOFS, NOT PROMISES

Every game has an on-chain IRulesVerifier — a pure referee. proveBadTransition slashes whoever signed an illegal state; a house liveness fault voids the stake and pays the player max(2× gross at risk, floor) from HouseBond. Channels spec.

03ONE SESSION AT LOGIN

One login → one channel → every game inside it, one bankroll, no reopen friction (#2: email login through an ERC-1271 smart account with a session key as validation entity, gas sponsored — no wallet popups, no gas). CASH OUT ALL settles the whole session in one on-chain close.

▸ONE PRIMITIVE, EVERY PRODUCT

A Position is {stake, distribution, payoutTable, spread}. The engine is product-agnostic and distribution-aware: a blackjack hand, a slot spin, a 5-minute outperformance market, a flight-delay index — the protocol knows only distributions, payout tables and spreads. Listing is decided by math: Σ(pᵢ·payoutᵢ) ≤ 1 − 1.25% and the exposure profile must be computable.

Base spread 1.25%, decomposed on-chain: 0.15% protocol fee → RAIN buyback & burn · 0.25% distribution · ~0.17% trader rebates · 0.05% Anchor Reserve standby · ~0.63% residual to the risk vault. Brands add 0–2.5% markup, disclosed on-chain.

Whitepaper — full economics →

▸TRACK RECORD, INCLUDING THE FAILURES

  • 163/163 forge tests + 38/38 Anvil integration tests green on the channels stack, incl. fraud-proof and conservation fuzzing; 48/48 on the Outperform off-chain-oracle path, 133/133 on its Pyth path.
  • Mainnet dispute drill executed — real forced close with a full challenge window on Arbitrum One.
  • Known V1 incident, fully disclosed: one stranded V1 channel (2,500 RUSD) — player refunded, house allocation written off, reclaimStale designed in as a consequence.
  • Honest gaps: forge coverage unobtainable under via_ir; Outperform's oracle is house-signed (v1); no external audit yet.

Full audit package →

▸EXPLORE

🎲
RAIN RNG
How it works, why not VRF, threat model, verify any round from Arbiscan, badge + licence, integrator guide.
📦
RNG Pre-Submission Package v1.2
For test labs: status table, Dieharder / NIST STS / TestU01 results, 10⁸ scaled outcomes, real-network latency, every document, zip + SHA-256. Not certified — self-run, gaps stated.
📄
RAIN RNG Whitepaper v1.2
🧩
SDK v2
@rain/rng-core · rng-session · channels · games · markets — what each does, who it's for, quickstarts.
📄
Whitepaper v1.0
The risk-trading thesis, three verticals, vault, limits math, fee waterfall, simulations. HTML + PDF.
◳
The Verticals
Games, predictions, parametric insurance, relative-performance markets — one trade, four forms.
🏗
Architecture
ChannelManager, GameMux, verifiers, HouseBond, fee waterfall, exposure caps.
⚡
RAIN Channels Spec
Commit-reveal chains, EIP-712 states, dispute game, no-stall-profit theorem.
🔬
Randomness Research
Stake, iGaming labs, Pyth, drand, FunFair channels — why this design won.
🃏
Live Games
Table games on #1; Engine V2 slots, Craps, Live Crash and step games on #2.
🏷
White-Label Self-Serve
Apply, configure in the 6-step wizard, get a hosted casino on the reference deployment.
🛡
Audit Package
Scope, 10 invariants, threat model, tests, incidents, accepted risks, downloads.
📈
$300M TVL Simulator
Monte-Carlo of the whitepaper's vault model — run the limits math yourself.