970 B
970 B
Policy Hash and Versioning Spec (v1)
Purpose
Ensure each quote, purchase, and entitlement is provably bound to an exact policy snapshot.
Canonical Policy Snapshot
- Serialize policy object with stable key ordering.
- Normalize numeric representations.
- Remove non-policy metadata fields.
Hashing
- Compute
policy_hash = SHA-256(canonical_policy_json). - Store hex-encoded 64-char hash.
- Include
policy_hashin quote response, receipt, and entitlement record.
Versioning
policy_versionis semantic (v1,v1.1, etc.) for human readability.policy_hashis authoritative for machine verification.- Breaking changes require new
policy_versionand migration note.
Enforcement
- Checkout confirm rejects if tx-linked quote policy hash differs from current quote policy hash.
- Entitlement activation uses stored
policy_hash; no retroactive mutation. - Historical purchases remain tied to their original policy hash.