Skip to main content

validateWorkChallenge

@totemsdk/txpow


@totemsdk/txpow / validateWorkChallenge

Function: validateWorkChallenge()

validateWorkChallenge(challenge, expected?): object

Validate a WorkChallenge at verification time.

Checks structural integrity, expiry, and that the challenge binds to the expected recipient/domain. Does NOT check the proof hash — that is the caller's job via verifyWorkAdmission.

Parameters​

challenge​

WorkChallenge

expected?​

domain?​

string

now?​

number

recipient?​

string

Returns​

object

reason?​

optional reason?: string

valid​

valid: boolean