Verifying a Stake Baccarat Hand by Hand (It's Uglier Than You'd Think)

Published 2026-09-11 · Tags: verifier, guides

Byte stream to floats, floats to cards, the deal, and the third-card decision table that depends on an earlier draw. A full hand worked on paper.

Baccarat is coming to the verifier. It's one of the games we're adding in the current rebuild, and while building it I ended up doing the verification by hand to check the code, which turned out to be a good way to explain why it's harder than Dice. So here's a Baccarat hand, verified manually, with the ugly bits left in.

What you need

Server seed (revealed), client seed, nonce. Same as every Original. The difference is what the hash produces. For Dice it produces one number. For Baccarat it has to produce a sequence of cards, then run the game's drawing rules on them.

Step one: the byte stream

Stake generates results with HMAC-SHA256 over clientSeed:nonce:round, where round starts at 0 and increments when you need more than 32 bytes. Each 4 bytes become one float in [0,1) via the standard weighting (b0/256 + b1/256² + b2/256³ + b3/256⁴).

Baccarat needs up to six cards, so it needs up to six floats. One HMAC round gives eight. Fine.

Step two: floats to cards

Each float maps to a card: floor(float × 52) gives an index 0–51 into a fixed deck ordering. The deck is rank-major: indices 0–3 are the four 2s, 4–7 the 3s, and so on up to 48–51 for the aces. So rank is floor(index / 4) and suit is index % 4. Suits don't matter for Baccarat scoring but the verifier shows them anyway so you can match the cards on screen.

Stake deals with replacement here, so cards don't get removed; two identical cards in a hand is possible and fine.

Step three: the deal

The first two floats are the Player's cards, the next two are the Banker's. Score each hand: Ace = 1, 2–9 face value, 10/J/Q/K = 0, total mod 10.

Say the four floats gave us: 7♠, K♥, 4♦, 5♣. Player has 7 + 4 = 11 → 1. Banker has 0 + 5 = 5.

Step four: the third-card rules (this is the ugly bit)

This is where "hash to outcome" stops being a formula and becomes a rulebook.

Say float 5 gives 8♥. Player: 1 + 8 = 9.

Banker has 5. Player's third card was an 8. 8 is not in 4–7. Banker stands.

If Player had stood (6 or 7), the Banker rule simplifies: draw on 0–5, stand on 6–7.

Step five: the result

Player 9, Banker 5. Player wins. If you bet Player you're paid 1:1; Banker pays 0.95:1 (the 5% commission); Tie pays 8:1 and only on an equal total, in which case Player and Banker stakes are pushed back to you.

The verifier shows all six positions (with "not drawn" on unused ones), the running totals, which rule fired for each draw decision, and the result. If any of that disagrees with what Stake showed you, you have the exact step where it diverged.

Why this took longer than Dice

Dice is one float and one comparison. Baccarat is up to six floats, a card mapping, and a decision table with a dependency on an earlier draw. Every one of those is a place to be subtly wrong, and "subtly wrong" in a verifier is worse than no verifier at all, because people trust it. So it got tested against a few thousand real hands before it got anywhere near the page.

It'll be live with the rest of the new games soon. Until then, you now know how to do it on paper, which is a party trick almost nobody can perform.

Related Posts

Free Stake Tools

More Free Stake Tools