DEV Community

张先生
张先生

Posted on Edited on

How the winner is decided: future block hash plus a stat snapshot

How the Winner Is Decided: a Future Block Hash Plus a Stat Snapshot

Most on-chain games ask you to trust a number they generated. Red Veil Racing does something narrower and easier to check: the finishing order is derived from data that does not exist when you place your bet.

This is a personal write-up, not an official announcement. Nothing here is investment advice, and nothing in this game promises a return.

The two inputs

When a race is settled, the contract combines two values:

  • A future block hash — the hash of a block that is only produced after the race has started.
  • A stat snapshot — the horses' attributes frozen before the race begins, hashed into a single value.

The first input cannot be known when bets are open, because the block has not been mined yet. The second is fixed before the race, so no one can change a horse's attributes mid-race to steer the result.

Why the order of operations matters

A common failure mode in on-chain randomness is settling with data that already exists. If the seed is a past block hash, anyone who can read the chain can compute the result in advance and bet accordingly.

Red Veil avoids that by committing to a block in the future. Between the close of betting and the moment the block is produced, there is no way to know the outcome — including for the operator.

The stat snapshot closes the other gap. Even if the seed were unpredictable, an operator who could edit attributes after bets were placed could still bias the result. Freezing the stats first removes that lever.

What this does and does not prove

It proves the result was not chosen by a person after seeing the bets. Given the same snapshot and the same block hash, the winner is determined.

It does not make the game risk-free. The prize pool is funded by other players' bets, and the split is fixed by contract: 75% of the betting pool goes to the winner's payout, 5% to the horse owner's rebate, and 20% is divided across four platform tiers. If nobody picks the winning horse, that 75% goes to the race organizer at settlement rather than rolling over.

It also does not promise that the game is live on mainnet. Racing is currently in public beta on the test chain; the mainnet has the genesis blind boxes. Treat test-chain numbers as beta data, not as production figures.

How to check it yourself

Everything above is verifiable without trusting this article:

  1. Read the race contract on a block explorer and confirm the settlement function takes a block hash and a snapshot hash as inputs.
  2. Compare the snapshot hash before and after betting closes — it should not change.
  3. Match the block number used at settlement against the block that was produced after the race started.

That is the whole claim. Not "trust us", but "here are the two inputs, go look".

Personal notes. Not an official announcement. Not investment advice. No returns are promised.

Top comments (0)