Skip to content

fix(provably-fair): add clientSeed param to computeCrashPoint — empty seed breaks provably-fair guarantee#6

Open
amathxbt wants to merge 1 commit into
canopy-network:mainfrom
amathxbt:fix/crash-point-missing-client-seed
Open

fix(provably-fair): add clientSeed param to computeCrashPoint — empty seed breaks provably-fair guarantee#6
amathxbt wants to merge 1 commit into
canopy-network:mainfrom
amathxbt:fix/crash-point-missing-client-seed

Conversation

@amathxbt

Copy link
Copy Markdown

Bug

computeCrashPoint() called computeHMAC(serverSeed, "", nonce)always passing an empty string as the client seed:

const h = computeHMAC(serverSeed, "", nonce); // ← client seed is hardcoded empty

The client seed is the player-supplied entropy that lets them independently verify outcomes were not predetermined by the house. With an empty seed, the crash point is a pure function of serverSeed and nonce alone — the player contributes zero entropy and cannot verify the game was not rigged against them for any given round.

Impact: The provably-fair guarantee is broken for every crash round. Players are told they can verify outcomes, but the client seed they submit has no effect on the result.

Fix

Add clientSeed as a required parameter, validate it is non-empty, and pass it through to computeHMAC. Throw an explicit error if it is empty so callers cannot accidentally reproduce the bug.

computeCrashPoint() called computeHMAC(serverSeed, "", nonce) — always
passing an empty string as the client seed. The client seed is the
player-supplied entropy that lets them independently verify outcomes are
not predetermined. With an empty seed, the crash point is solely a
function of the server seed and nonce; the player contributes nothing
and cannot verify the game was not rigged against them.

Add clientSeed as a required parameter and throw if it is empty.
Update the JSDoc comment accordingly.
@andrewnguyen22 andrewnguyen22 requested a review from ezeike June 27, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant