SKIP TO CONTENT

Decentralized Crypto Casino: What Actually Runs On-Chain

Bankroll, bet settlement and the dice roll: which parts sit in a smart contract, which stay on a server, and how to spot randomness a house can re-roll.

Rizz Cash Tape5 min read

Hands tossing red and white dice onto a dark table as they tumble through the air.
Photo: Shvets Production on Pexels

A decentralized crypto casino is one where the bet, the payout and the dice roll are handled by smart contracts you can read, not by a server you have to trust. In practice only some of that is on-chain, and the part that decides whether the game is rigged is the randomness. Check where the random number comes from first, then how the contract settles the bet.

That is the whole tape on this one. Everything else is marketing.

If you came here from our anonymous crypto casino breakdown, this is the other half: not what the chain records about you, but what it records about the house.

What actually runs on-chain at a decentralized casino?

Three pieces can live in a contract: the bankroll that pays winners, the logic that settles each bet, and the request for a random number. The website, the game graphics and often the odds display stay off-chain.

That split matters. A contract you can read beats a promise you cannot. A frontend you cannot read is just a normal casino site with a wallet button.

Here is how the pieces usually break down, and what a player can actually check:

PieceWhere it livesWhat you can check
BankrollContract balance, if the house uses oneWhether payouts come from a contract address or a hot wallet
Bet settlementContract functionWhether bets close before the random number is requested
RandomnessOracle, chain value, or server seedWhich source the contract calls, and whether it can be re-rolled
Game UI and odds displayOff-chain websiteNothing on-chain; compare it against the contract

The same habit that catches a rug works here. Our on-chain levers behind a meme coin rug pull apply to casino contracts too: who can change the contract, who can pull the funds, and who can pause it.

Where does the random number come from?

The randomness source is the single biggest tell. There are three common answers, and they are not equal.

Block hashes and timestamps: the bad answer

Solidity's own docs warn against using block.timestamp or blockhash as a random source, and the example they pick is literally a casino payout function run on a chosen, retried block hash, with bad actors retrying a different hash until it pays.

There is a second trap. blockhash only returns hashes for the 256 most recent blocks; anything older comes back as zero. A casino contract that settles late on an old block can end up rolling against a zero.

If the contract reads blockhash or block.timestamp to pick a winner, that is a red flag, full stop.

PREVRANDAO: better, still bendable

After the Merge, Ethereum contracts can read the beacon chain RANDAO value. The proposal that introduced it is blunt about the limits: every block proposer gets 1 bit of influence per slot, because they can refuse to propose.

For a casino, that bit has a specific shape. A biased proposer can censor a dice-roll transaction so it lands in the next block, using a RANDAO mix the proposer already knows.

The same proposal adds two numbers worth keeping. One honest block proposal is enough to unbias the RANDAO. And the usual rate of missed proposals on mainnet is about 1%, per the proposal's own figure.

Verifiable randomness oracles: the stronger answer

A verifiable random function (VRF) oracle delivers a random number with a proof that it was not tampered with. Chainlink VRF is the common one. Its security page says validators who rewrite chain history can only re-roll the dice, not predetermine or predict the outcome.

That is better than a block hash, but it is not automatic. The contract still has to use it correctly, and that is where you look next.

How do you check a decentralized crypto casino yourself?

Open the contract on a block explorer and read the bet and payout functions. You are looking for a few specific patterns, all of which come straight from the oracle's own security notes.

Bets close before the roll. Chainlink says a contract should not accept any additional user-supplied inputs after it submits the randomness request. If a bet can still be changed or added after the request, someone with an early look can play the result.

No re-roll, no cancel. As of November 2026, Chainlink's VRF security page treats any re-request or cancellation of randomness as an incorrect use of VRF v2.5. The reason: you must prevent the ability for any party to discard unfavorable randomness. A house that can cancel a roll it does not like is a house that never loses that roll.

The callback cannot fail. If the contract's fulfillRandomWords() function reverts, the VRF service will not retry it. Chainlink's advice is to store the randomness and do the heavier settlement in separate contract calls. A casino that settles everything inside the callback risks a bet that never resolves.

Who can change the rules. Look for admin roles, upgradeable proxies and pause switches. None of them prove a rig, but each is a lever, and levers get pulled.

What stays off-chain, and why it matters

Plenty of crypto casinos that call themselves decentralized run the actual game on a server and post a hash or proof afterwards. That can be honest, but the trust point moves off-chain: you are checking a receipt, not watching the roll.

The off-chain parts are also where the house edge hides. The odds shown on the site are a display. The payout math in the contract is the real edge. If they disagree, the contract wins every time.

For how odds get set on regular slot floors, our look at whether casino slots are rigged covers what state rules allow. More breakdowns sit in the crypto casinos lane.

None of this makes any game a winning bet. A fair roll still carries the house edge, and a provably fair loss is still a loss.

Straight answers

Is a decentralized crypto casino automatically fair?

No. Being on-chain only means the rules are readable. Fairness depends on the randomness source and on whether the contract lets anyone cancel or re-roll a result.

Can a casino rig a blockchain dice roll?

It depends on the source. Solidity's docs warn that block-hash randomness can be gamed by retrying hashes, and Ethereum's RANDAO gives each proposer 1 bit of influence per slot. A properly used VRF oracle limits an attacker to re-rolling, not predicting.

What should I look for in the casino's smart contract?

Bets that lock before the random number is requested, no function that cancels or re-requests randomness, a callback that stores the number instead of doing heavy settlement, and clear answers on who holds admin keys.

Why is block hash randomness unsafe for gambling?

Block producers can choose or retry the hash that suits them, and Solidity's own example of this attack is a casino payout. blockhash also returns zero for anything older than the 256 most recent blocks.

Where we got the numbers

PASS IT ON