GAMBLEHOODRobinhood Chain

Provably Fair (Player vs Player)

How GAMBLEHOOD keeps every match honest

There is no house, no dealer, and no hidden random number generator. GAMBLEHOOD is 100% player-vs-player: the platform only escrows both stakes and releases the pot to the winner. Fairness comes from double commit-reveal— both players lock a hashed seed up front, so neither can adapt after seeing the other's move.

Because the commitment is published on Robinhood Chain before the match locks, a player can never retroactively change their seed. This is the same scheme used by top P2P betting dApps, minus any centralized operator.

The 4-Step Fairness Workflow

1. Both Players Commit

Each player commits keccak256(their secret seed) on-chain before the match is locked. Neither side can change their move once committed.

2. Stakes Escrowed

Both players deposit an equal $BCAT stake into the contract. The platform holds it — no house funds are ever at risk.

3. Double Reveal

On settlement, BOTH seeds are revealed and verified against the original commitments. The outcome is computed from keccak256(seedA, seedB, blockhash).

4. Verifiable Payout

The winner receives the full pot minus a 2% platform fee. Anyone can re-run the reveal math to confirm neither player could have cheated.

Verify a Coin Flip Yourself

After a match settles, both seeds are public. Recompute the outcome with standard keccak256:

// npm i js-sha3
const { keccak256 } = require("js-sha3");

function verifyCoinFlip(playerASeed, playerBSeed, blockHash) {
  const combined = playerASeed + playerBSeed + blockHash;
  const hash = keccak256(combined);
  const numericVal = parseInt(hash.slice(0, 8), 16);
  const outcome = numericVal % 2;        // 0 = HEADS, 1 = TAILS
  return outcome === 0 ? "HEADS" : "TAILS";
}

// Anyone can fetch both seeds from the on-chain RoomResolved event and confirm
// the winner was computed honestly. No operator can interfere.
console.log(verifyCoinFlip("0xabc...", "0xdef...", "0x5a2...7c"));