Spunk Odds Reference

Scratch cards guide

Dragon Scratch: checking a digital instant-win card

Dragon here is a label for the page and not the name of any digital game. The subject is how an online instant-win card can draw its prize from a hash, and how a player can recompute that draw afterwards.

Paper runs versus hash draws

A printed card comes from a fixed print run. A digital card usually does not. Instead, each card is an independent draw from a table of probabilities. There is no pool to run out, so no prize is ever "used up", and the odds are the same for the millionth card as for the first.

In this illustrative model, a card costs 1 unit and the prize tiers are set as chances that add up to one:

Illustrative digital card: tiers as probabilities (hypothetical)
Prize (units)ChanceCumulative upper bound
0.0070.0%0.700
1.0018.0%0.880
2.008.0%0.960
5.003.0%0.990
20.000.9%0.999
100.000.1%1.000

Expected prize 0.770 units per 1-unit card, a return of 77.00%. Invented for teaching.

From seeds to a prize

The service commits to a secret server seed by publishing its SHA-256 hash before play. The player supplies a client seed, and a counter called the nonce increases with each card. After the seed is revealed, anyone can repeat the steps below. Every value was computed in code for this page.

Worked hash example (scratch), computed with Python's hashlib; nonce 37
Server seed (revealed later)dragon-card-server-91c4e
Commitment shown before play: SHA-256(server seed)30ca735c7227e81f304c9a40ec6ada98f79fb696c045edfb5e07df4dce58ace9
Client seed : nonce : rounddragon-player-seed:37:0
HMAC-SHA256(server seed, message)4e2ce62870a3a3d930850116050cdb664f6c4cd74a0dfb0c3a4522a38b81408b
First 4 bytes (8 hex digits)4e2ce628 = 1,311,565,352
Float = value / 2^320.3053726051
Prize tier from cumulative chances0.00 units

One common construction, shown for teaching. Real services document their own message format; check theirs before verifying.

The last two rows are the scratch-specific part. The float in [0, 1) is compared with the cumulative bounds in the first table. The first bound that exceeds the float picks the tier. A float below 0.700 is a losing card; one between 0.700 and 0.880 is a 1-unit refund, and so on up to the top tier, which needs a float of 0.999 or higher.

What to check yourself

  1. Hash the revealed server seed with SHA-256 and confirm it matches the commitment you saw before play.
  2. Build the message from your client seed, the nonce and the round index, in the exact format the service documents.
  3. Compute HMAC-SHA256 with the server seed as the key, take the first 4 bytes and divide by 232.
  4. Look the float up against the published tier table and confirm the prize matches what you were shown.

Passing all four checks shows the card was not altered after you bought it. It does not show that the tier table is generous. The return is set by the table, and here it is below 1, so each card loses on average.

Common questions

Can the service change the tiers between cards?

It can change the published table, which is why the table in force should be part of what you check. The hash only protects the draw.

Is a digital card fairer than paper?

Not in return. It is easier to verify a single draw, but the expected loss depends only on the tier table.

Where is the general method explained?

The hash fairness guide covers commitments and seed rotation across all game types.