A provably fair coin flip game on the Ritual testnet. Powered by drand verifiable randomness via Ritual's 0x0801 HTTP precompile. Session wallet architecture — sign once, flip without popups forever.
Derived deterministically from your MetaMask signature. Sign once — play forever with no popups per flip. Your private key is computed in-browser and never stored or sent anywhere.
Deposit RITUAL from MetaMask to your game wallet in one click. Withdraw your remaining balance back to MetaMask anytime — no confirmation popup on withdrawal.
Each flip costs a small precompile fee (~0.000044 RITUAL) drawn from your RitualWallet credit. The app automatically tops it up when credit falls below 0.002 RITUAL — completely invisible to you.
The signing message includes the site domain, so a game wallet derived on this site cannot be replicated by a phishing copy. Your wallet is safe even if you sign a look-alike message elsewhere.
Quick bet size buttons to halve, double, or max out your current bet in one click.
Automatically doubles your bet after every loss. Resets to base bet on a win. Toggle in the bet panel. Persists across reloads.
Set a fixed flip count, Stop Loss %, and Take Profit %. Auto-bet runs all flips continuously — no clicking needed.
Full session history: flip count, total wagered, net PnL, win rate, and a scrollable flip log. Saved to localStorage — survives reloads.
Full theme toggle, persists in localStorage.
Click the background to cycle: Day ☀️ → Night 🌙 → Winter ❄️.
After each flip, share a 1200×630px card to X with your PnL, stats, and a pepe image. Copy, download, or post directly.
Real-time feed of all flips on the contract — address, won/lost, amount. Polls every 1 second.
Shows real-time vault balance and effective max bet in the menu. Updated every 30 seconds.
A Scheduler contract runs autoManage() every ~12 min — adjusts maxBet to 5% of current vault and auto-pauses if vault drops below 50% of its initial value.
payout = (bet − fee) × 2 where fee = bet × 2%| BET | WIN → RECEIVE | WIN NET | LOSE NET |
|---|---|---|---|
| 0.001 | 0.00196 | +0.00096 | −0.001 |
| 0.005 | 0.0098 | +0.0048 | −0.005 |
| 0.01 | 0.0196 | +0.0096 | −0.01 |
flip() tx is sent from your game wallet.drand.cloudflare.com/public/latest inside a TEE (Trusted Execution Environment) — the result is cryptographically attested.keccak256(drand_body, player, block) % 2 — neither the house, player, nor validators can predict or influence it.19790xc87eb197024d93e188ec5ef9bf70a3fd1b13f94b
[View on Explorer ↗]
Solidity 0.8.2015,776,364flip(bool choice) payable — called by game wallet. Fetches drand via 0x0801, computes result, pays winner. All in one fulfilled-replay transaction.autoManage(uint256 index) — Scheduler callback (~every 12 min). Adjusts maxBet to 5% of vault. Pauses/unpauses based on vault floor. Self-reschedules perpetually.houseBalance() — returns current vault balance.deposit() payable onlyOwner — adds funds to vault, resets vaultFloor to 50% of new total.withdraw(amount) onlyOwner — owner withdraws from vault.setPaused(bool) onlyOwner — emergency pause/unpause.startAutoManage() — owner call once after deploy to activate the Scheduler vault manager.flip() call) — protects vault even during win streaks.ritual-flip.vercel.app). A phishing site with a different domain cannot replay the same signature to derive your game wallet.FlipResult and FlipRefunded — fully auditable on-chain.| Network Name | Ritual Testnet |
| Chain ID | 1979 |
| RPC URL | https://rpc.ritualfoundation.org |
| Currency | RITUAL (native, 18 decimals) |
| Explorer | explorer.ritualfoundation.org |
| Faucet | faucet.ritualfoundation.org |
| Block Time | ~350ms |
| RitualWallet | 0x532F0dF0896F353d8C3DD8cc134e8129DA2a3948 |
ritual-flip.vercel.app — a phishing site with a different URL cannot reproduce the same game wallet from the same signature. Keep game wallet funds small (just enough to play), as they are hot wallet funds by nature.
drand.cloudflare.com inside a TEE to fetch verifiable randomness. This fetch takes a few seconds, then Ritual re-executes your transaction with the result injected. The delay is the price of true verifiable randomness — not a bug.
flip() tx triggers Ritual's 0x0801 HTTP precompile to fetch the latest drand round inside a TEE. Result = keccak256(drand_body, player_address, block_number) % 2. Neither the house, the player, nor validators can predict or influence it. Every flip is auditable on the explorer.
flip() call on-chain. This protects the vault during win streaks. The Scheduler's autoManage() also updates the displayed maxBet every ~12 minutes. As the vault grows, the max bet grows with it.