AIIR Commit Receipt Specification
The normative specification for aiir/commit_receipt.v1 —
the open format for tamper-evident AI authorship receipts.
Overview
The AIIR specification defines a content-addressed receipt format for recording AI involvement in git commits. A receipt is a JSON document with 6 core fields that are hashed using canonical JSON + SHA-256. Any modification to the core fields invalidates the receipt.
Spec version: 1.0.1
Schema identifier: aiir/commit_receipt.v1
Status: Stable
Permanent URL: invariantsystems.io/spec
Core fields
These 6 keys form the hash input — and only these 6:
| Field | Type | Description |
|---|---|---|
type | string | Always "aiir.commit_receipt" |
schema | string | Schema identifier, e.g. "aiir/commit_receipt.v1" |
version | string | SemVer of generating tool |
commit | object | Git commit metadata (sha, author, committer, diff_hash, …) |
ai_attestation | object | AI authorship detection results |
provenance | object | Repository, tool, and generator identifiers |
All other fields (receipt_id, content_hash, timestamp, extensions) are derived and do not affect the hash.
Canonical JSON
The canonical encoding ensures identical bytes for identical input:
- Sorted keys — all object keys sorted lexicographically (recursive)
- No whitespace — separators are
,and: - ASCII-safe — all non-ASCII escaped as
\uXXXX - Depth limit — 64 levels maximum
Python equivalent:
json.dumps(obj, sort_keys=True, separators=(",", ":"), ensure_ascii=True, allow_nan=False)
Verification algorithm
- Validate receipt JSON structure and type fields
- Extract
core = {k: v for k in CORE_KEYS} - Compute
content_hash = "sha256:" + hex(SHA-256(canonical_json(core))) - Compute
receipt_id = "g1-" + content_hash[7:39] - Compare using constant-time comparison (prevent timing attacks)
Resources
Governance
This specification is maintained by Invariant Systems, Inc. Changes follow Semantic Versioning and require corresponding updates to the reference implementation and test vectors. See §15 Specification Governance for the full change process.
Third-party implementations claiming AIIR compatibility should reference the spec version they conform to and pass all published test vectors. See TRADEMARK.md for badge usage guidelines.