audit — Group 0, Code 03

Returns audit-oriented reporting data.

Purpose

audit is the live audit/reporting endpoint in Group 0. It is distinct from show_stats and should be documented and handled separately.

Frontend guidance

Treat audit results as reporting data. Do not assume the response body shape is identical to show_stats.

Request body (18 bytes)

Same shape as echo — encrypted challenge plus terminator. cmd_audit reads no body fields.

CH CH CH CH CH CH CH CH CH CH CH CH CH CH CH CH 3E 3E

Response body

One 5-byte record per denomination: 1-byte denomination, followed by a 4-byte big-endian count of coins issued (i.e. coins with a non-zero mfs in their page records). Denominations run from MIN_DENOMINATION through MAX_DENOMINATION inclusive, so the total response size is TOTAL_DENOMINATIONS × 5 bytes.

DN CT CT CT CT // record 1: denom + 4-byte BE count DN CT CT CT CT // record 2 ... DN CT CT CT CT // record TOTAL_DENOMINATIONS

Per-record packet diagram

DN 0 Count (4 bytes, BE) 1 4

Offsets above are relative to the start of each 5-byte record. The full response is TOTAL_DENOMINATIONS of these laid out back-to-back.

Implementation note

The current implementation reads page files directly from disk to compute the count rather than from the in-memory cache, so it does not pollute the cache. A coin is counted as issued when its 17th byte (the mfs flag) is non-zero.