Skip to main content

Module challenge

Module challenge 

Source
Expand description

Server challenge protocol for unattributed proofs.

For unattributed proofs the server challenge (CWT Nonce, RFC 9711) is REQUIRED, not optional. The server maintains a rotating opaque challenge with a short reviewed window. Clients MAY reuse the current challenge across requests while request_id remains unique per request. A missing, expired, or unknown challenge in an unattributed proof denies before any replay-store insertion.

Every DispatchDenied response carries the current challenge uniformly, regardless of the internal denial cause. A client without a challenge sends its request, receives DispatchDenied bearing a usable challenge, and performs at most one immediate bounded retry with a fresh request_id.

Structs§

ChallengeManager
A rotating challenge manager that produces and validates challenges.
ServerChallenge
A rotating server challenge with its acceptance deadline.

Constants§

DEFAULT_CHALLENGE_OVERLAP_SECS
The default acceptance overlap past a window’s end: one bounded retry plus clock skew, never a whole following window.
DEFAULT_CHALLENGE_WINDOW_SECS
The default rotation window: short enough that stockpiling an unattributed proof is useless, long enough that a client may reuse one challenge across requests.

Functions§

random_challenge_value
Generate a fresh 32-byte challenge value from the OS CSPRNG.