Pack shape
A proof pack is aSignedProofPack envelope (envelope.v1) carrying an
ordered array of signed, hash-chained records. Each record holds the
proof receipt payload, a per-record Ed25519 signature over its
payloadCanonical, and the chain anchors beforeHash / afterHash:
metering and settlement summaries the
auditor reconciles against the records. See
the proof-pack format reference for the
full field listing.
Canonical-JSON serialisation
Each record’ssignature is computed over the canonical-encoded
payloadCanonical string for that record’s payload. Canonical means:
sorted keys, no whitespace, deterministic number formatting. The auditor
library re-derives payloadCanonical from the wire payload and asserts
byte-equality before checking the signature.
Hash chain
Each record carriesbeforeHash (the previous record’s afterHash) and
afterHash (the SHA-256 hex of its own payloadCanonical). The genesis
record has beforeHash: null; when verifying a later pack in a tenant’s
chain you anchor it with the previous pack’s tail afterHash.
A missing or tampered record breaks the chain at the next record’s
beforeHash. The auditor walks the records in issuance order and
reports the first break with a stable reason code.
What the auditor does, in code-level detail
- Parse the pack into the
SignedProofPackenvelope and its records. - Re-derive each record’s
payloadCanonicalfrom itspayloadand assert byte-equality. - Check each record’s
afterHashequals the SHA-256 of itspayloadCanonical. - Verify each record’s Ed25519
signatureagainst the key identified by itskeyId. - Walk the chain:
records[i].beforeHash === records[i-1].afterHash, genesis-null, and non-decreasingpayload.issuedAt. - Re-project metering and re-run settlement reconciliation (when the pack carries those summaries) and assert bit-equality.