Beach Bingo - Provably Fair

Last updated: March 1, 2026

What does "provably fair" mean?

Every game outcome in Beach Bingo is determined by cryptographic randomness that neither the players nor the developers can predict or manipulate. You can independently verify every game result using only publicly available on-chain data.

1. How Randomness Works

Switchboard VRF (Verifiable Random Function)

Beach Bingo uses Switchboard On-Demand for all randomness. Switchboard is a decentralized oracle network that generates cryptographically verifiable random numbers. Here is how it works:

  1. Request: When a game round starts, the program requests randomness from a Switchboard oracle
  2. Generation: The oracle generates a random value using a VRF (Verifiable Random Function), which produces both a random output and a mathematical proof
  3. Verification: The Solana program verifies the proof on-chain before accepting the random value. If the proof is invalid, the randomness is rejected
  4. Derivation: Bingo numbers are derived from the verified random value using SHA-256 hashing with rejection sampling to ensure uniform distribution

Number Derivation

Each bingo number is derived as follows:

hash = SHA-256(vrf_result || round_id || number_index || attempt)
number = hash[0..2] as u16  // First 2 bytes as 16-bit integer
if number > max_valid:       // Rejection sampling (no modulo bias)
    increment attempt, retry
final_number = (number % 75) + 1  // Range: 1-75

Rejection sampling eliminates modulo bias, ensuring every number from 1-75 has an exactly equal probability of being selected.

2. Anti-Manipulation Protections

VRF Pre-Binding

The VRF account is bound to the round before randomness is generated. This prevents anyone from generating multiple random values and choosing a favorable one.

Staleness Check

VRF results expire after 300 Solana slots (approximately 2 minutes). If a VRF result is older than this, it is rejected. This prevents "VRF shopping" where someone might try to reuse old random values.

Replay Prevention

Each VRF account can only be used once per round. The program tracks the last VRF account used and rejects duplicates. A monotonically incrementing VRF call counter provides additional replay protection.

Admin Exclusion

Admin wallets are explicitly blocked from participating in games (AdminCannotPlay error). This prevents insider gaming.

3. Card Generation

Bingo cards are generated using a Fisher-Yates shuffle seeded with:

seed = VRF_result XOR player_pubkey XOR slot_index XOR purchase_nonce XOR clock_slot

This ensures every card is unique and unpredictable. The Fisher-Yates shuffle uses rejection sampling to eliminate modulo bias in the shuffle permutation.

4. Win Verification

Win verification is performed entirely on-chain:

  1. Every daubed cell is checked against the round's called number bitmask
  2. The winning pattern (row, column, diagonal, or blackout) is verified via bitmask comparison
  3. Card type restrictions are enforced (some modes require specific patterns)
  4. The prize is calculated using on-chain constants with full fee breakdown emitted as an event

5. On-Chain Transparency

Events Emitted

Every significant action emits an on-chain event that you can verify:

Fee Structure (On-Chain Constants)

Fee Rate
Prize Pool (Player Winnings)60%
House Treasury40%
Tournament Platform Fee5%
Community Raffle Fee15%
Maximum Tax Rate (capped)20%

How to Verify

Every game can be independently verified:

  1. Find the round: Look up the Round PDA on a Solana explorer using the round ID
  2. Check the VRF: The vrf_account field links to the Switchboard randomness account. Verify it was generated by an authorized Switchboard oracle
  3. Verify numbers: The called_bitmask field contains all called numbers. Apply the SHA-256 derivation algorithm above to the VRF result to confirm each number matches
  4. Check your card: Your BingoCard PDA stores your card grid and daubed cells. Verify the winning pattern matches the called numbers
  5. Confirm prizes: Transaction logs contain PrizeCalculatedEvent with the full fee breakdown

Program ID: G3qG9A87VSrHqMcQ56HHs5eTN4iwBFUTDmEwgS95eQ5y

6. Contact

Questions about fairness? Reach us at info@fetelabs.com or on X at @BeachBingoSol.