# BeemBam independent verifier

Versions: custom-games-v1.0 (all games) and custom-games-v2.0 (Pickaxe). Currency: NeftGames nefti only.

Download math.mjs, pickaxe-v2.mjs, verifier.mjs, verify-bet.mjs, vector.json and vector-v2.json into one folder. No packages or BeemBam connection are needed. Node.js24:

    node verify-bet.mjs vector.json
    node verify-bet.mjs vector-v2.json
    node verify-bet.mjs downloaded-bet.json

Expected: {"valid":true}. Exit status1 means failure. A changed payout, result, accepted parameter hash or seed commitment must fail. A settled bet can be downloaded from its history on BeemBam.

Browser: import { verifyBet } from './verifier.mjs'; await verifyBet(bet). Web Crypto requires HTTPS or localhost.

Protocol: HMAC-SHA256 with the32 decoded seed bytes as key; UTF-8 message bambeem|mathematicalVersion|game|clientSeed|nonce|blockIndex. Use the recorded mathematicalVersion; custom-games-v2.0 is supported only for Pickaxe. An explicit version in accepted params must match the bet version; dispatch never adds it to the parameter hash. Nonce and blockIndex are unpadded decimal integers, blockIndex starts at0; digest is a256-bit big-endian integer. For bound n, accept z < floor(2^256/n)*n, return z%n, consuming every rejected block too. Commit is SHA256 of the decoded32seed bytes. Parameter hashing sorts object keys recursively and uses compact JSON, without mutable Beesweeper openings.

Known first HMAC digest: c0c84728a0730b83a8231d411d463f58d570293800a8c1527f5bbefa867df361 for the vector's seed, fishing, client_A, nonce7, block0.

This reproduces the committed RNG outcome and exact payout arithmetic, including Crash manual cashout bets with cashoutPolicy=server-time-v1. The verifier checks the accepted target, reached safe maximum, cashout amount, policy, and result metadata. cashoutAt is a server-attested ISO timestamp; this protocol cannot independently prove when the request was received or that it arrived before the crash. It does not prove that a server never discarded a seed before publishing its commit. Shared Crash currently has no independent future entropy beacon and makes no such claim.
