Provably Fair
Every coinflip and rock-paper-scissors round on Degenhub is verifiable end-to-end. The outcome is bound to a future Solana finalized slot at the moment your opponent locks in, so no one โ not even the operator โ can influence the result.
How a round is committed
- The server generates a 32-byte random
serverSeedand publishes only its SHA-256 hash before the round starts. The seed is hidden until reveal. - The challenger's join transaction confirms on Solana, fixing a
targetSlot = currentFinalizedSlot + 5. - Once
targetSlotis finalized, its blockhash becomes thepublicSeedโ a public, immutable, untouchable input. - Outcome is derived from
SHA-512(serverSeed | publicSeed | gameId); first 16 hex chars taken as a 64-bit BigInt, modulo the ticket range. Coinflip uses ticket < 500,000 โ HEADS. - At reveal, the server publishes
serverSeedand the blockhash it used. Anyone can re-run the SHA-512 themselves with the data below.
House fee
The house takes 5% of the WINNINGS โ that is, 5% of the amount the winner gains. Both players wager X. The winner takes the pot (2X) minus a 5% fee on their gain (5% of X). Winner receives 1.95X; net gain is 0.95X.
Example: Both players wager 0.01 SOL. Pot = 0.02 SOL. Fee = 0.0005 SOL (5% of 0.01). Winner receives 0.0195 SOL. Net win is +0.0095 SOL.
Reference snippet
Use this Node script to verify any resolved round. The result must match resultHash and ticket published on the room.
import crypto from 'crypto';
function compute(serverSeed, publicSeed, gameId) {
const hash = crypto.createHash('sha512')
.update(`${serverSeed}-${publicSeed}-${gameId}`)
.digest('hex');
const uint = BigInt('0x' + hash.slice(0, 16));
const ticket = Number(uint % BigInt(999_999 + 1));
return { hash, ticket, side: ticket < 500_000 ? 'HEADS' : 'TAILS' };
}
Verify a round in-browser
Paste the serverSeed, publicSeed, and gameIdfrom any revealed room and we'll re-compute the hash + ticket using the same algorithm. If it matches what's shown on the room card, the outcome is verified.
Currently running on Solana Devnet for the public beta. All provably-fair logic is identical to mainnet โ only the SOL is testnet.