Skip to main content

verifyWorkAdmission

@totemsdk/txpow


@totemsdk/txpow / verifyWorkAdmission

Function: verifyWorkAdmission()

verifyWorkAdmission(action, challenge, proof, templateProvider?, options?): Promise<WorkAdmissionVerification>

Verify a Machine Work Admission proof.

The admission target is taken from the validated challenge — never from the proof. proof.qualifiesAsMinimaBlock, proof.superLevel, and proof.isBlock are treated as derived metadata and are NOT trusted; the Super level is recomputed from the re-derived txpowId and the template's block difficulty.

Parameters

action

MachineWorkAction

The application action the proof claims to commit.

challenge

WorkChallenge

The challenge the proof claims to satisfy.

proof

MachineWorkAdmissionProof

The mined proof.

templateProvider?

MinimaWorkTemplateProvider

Optional live provider. When supplied, template freshness and broadcastability are checked and broadcastable is set. When omitted, verification runs in offline mode and does NOT claim Minima block contribution (broadcastable is undefined).

options?

VerifyWorkAdmissionOptions

Verification options.

Returns

Promise<WorkAdmissionVerification>