{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://alignedaccelerationism.com/specs/zk-compute-attestation-v0.3.schema.json",
  "title": "Privacy-Preserving Frontier Compute Attestation Receipt (v0.3)",
  "description": "Formal JSON Schema (draft 2020-12) for a zero-knowledge hardware attestation receipt emitted by datacenter-class frontier AI compute clusters. Proves hardware-rooted compliance with a coarse FLOP ceiling and binds a safety-evaluation commitment digest while structurally preventing disclosure of model weights, prompts, datasets, exact utilization, or civilian traffic.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "receiptId",
    "issuedAtUtc",
    "epochWindow",
    "clusterScope",
    "hardwareAttestationChain",
    "computeBoundClaim",
    "safetyEvalCommitment",
    "withheldFieldsGuarantee"
  ],
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "0.3.0",
      "description": "Exact semantic version of the OP-02 selective-disclosure compute attestation receipt specification."
    },
    "receiptId": {
      "type": "string",
      "format": "uuid",
      "description": "Unique RFC 4122 UUID identifying this epoch attestation receipt."
    },
    "issuedAtUtc": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 UTC timestamp recorded by the hardware root-of-trust epoch clock when the receipt was finalized."
    },
    "epochWindow": {
      "type": "object",
      "description": "Tamper-evident sequential time window anchoring the monotonic FLOP accumulator delta.",
      "additionalProperties": false,
      "required": [
        "epochSequenceNumber",
        "startUtc",
        "endUtc",
        "previousReceiptSha256"
      ],
      "properties": {
        "epochSequenceNumber": {
          "type": "integer",
          "minimum": 1,
          "description": "Strictly monotonically increasing epoch index for the attested cluster."
        },
        "startUtc": {
          "type": "string",
          "format": "date-time",
          "description": "Inclusive UTC start timestamp of the attested reporting epoch."
        },
        "endUtc": {
          "type": "string",
          "format": "date-time",
          "description": "Inclusive UTC end timestamp of the attested reporting epoch."
        },
        "previousReceiptSha256": {
          "$ref": "#/$defs/sha256Hex",
          "description": "SHA-256 digest of the canonicalized receipt from epochSequenceNumber - 1 (all-zero hex digest only for genesis epoch 1) to prevent omission or silent rollback."
        }
      }
    },
    "clusterScope": {
      "type": "object",
      "description": "Strict scoping metadata confirming that attestation applies exclusively to datacenter-class frontier accelerators and never to consumer or civilian endpoint devices.",
      "additionalProperties": false,
      "required": [
        "deviceClass",
        "consumerHardwareExcluded",
        "attestedAcceleratorCountBucket",
        "interconnectFabricClass",
        "jurisdictionRegistryCode",
        "operatorPseudonymCommitment"
      ],
      "properties": {
        "deviceClass": {
          "type": "string",
          "enum": [
            "datacenter_frontier_accelerator_tier_a",
            "datacenter_frontier_accelerator_tier_b",
            "datacenter_optical_interconnect_switch"
          ],
          "description": "Permitted hardware classes governed by this protocol. Consumer GPUs, workstations, laptops, and personal devices are structurally out of scope."
        },
        "consumerHardwareExcluded": {
          "type": "boolean",
          "const": true,
          "description": "Mandatory invariant asserting that zero personal, consumer, or general-purpose civilian compute endpoints participate in the attested hardware root."
        },
        "attestedAcceleratorCountBucket": {
          "type": "string",
          "enum": [
            "1k_to_4k",
            "4k_to_16k",
            "16k_to_64k",
            "64k_to_256k",
            "over_256k"
          ],
          "description": "Coarse order-of-magnitude accelerator bucket preventing exact commercial fleet sizing disclosure."
        },
        "interconnectFabricClass": {
          "type": "string",
          "enum": [
            "high_radix_nvlink_infiniband",
            "optical_circuit_switched_fabric",
            "roce_v2_ultra_ethernet_datacenter"
          ],
          "description": "Physical fabric category used to correlate hardware attestation against facility-level interconnect audits."
        },
        "jurisdictionRegistryCode": {
          "type": "string",
          "pattern": "^[A-Z]{2}(-[A-Z0-9]{1,8})?$",
          "description": "ISO 3166-1 alpha-2 treaty-party or multilateral inspection zone identifier."
        },
        "operatorPseudonymCommitment": {
          "$ref": "#/$defs/sha256Hex",
          "description": "Salted SHA-256 commitment to the registered facility identifier, preserving commercial confidentiality in public transparency logs while verifiable by treaty inspectors."
        }
      }
    },
    "hardwareAttestationChain": {
      "type": "object",
      "description": "Multi-party threshold root-of-trust attestation chain proving silicon authenticity and firmware integrity without entrusting any single nation or vendor with unilateral signing authority.",
      "additionalProperties": false,
      "required": [
        "ceremonyId",
        "thresholdPolicy",
        "thresholdSignatureScheme",
        "rootPublicKeyFingerprint",
        "foundryTransparencyInclusionProof",
        "enclaveQuote",
        "thresholdAggregateSignature"
      ],
      "properties": {
        "ceremonyId": {
          "type": "string",
          "pattern": "^CEREMONY-[0-9]{4}-[A-Z0-9]{4,16}$",
          "description": "Identifier of the auditable distributed key generation (DKG) ceremony that minted the root verification key."
        },
        "thresholdPolicy": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "thresholdT",
            "totalCustodiansN",
            "minDistinctJurisdictions",
            "custodianCategories"
          ],
          "properties": {
            "thresholdT": {
              "type": "integer",
              "minimum": 3,
              "description": "Minimum number of independent custodian key shares required to authorize root endorsement or firmware policy updates."
            },
            "totalCustodiansN": {
              "type": "integer",
              "minimum": 5,
              "description": "Total number of independent custodian shares provisioned in the DKG ceremony (must satisfy thresholdT > totalCustodiansN / 2)."
            },
            "minDistinctJurisdictions": {
              "type": "integer",
              "minimum": 3,
              "description": "Minimum count of non-aligned geopolitical jurisdictions represented in any valid signing quorum."
            },
            "custodianCategories": {
              "type": "array",
              "minItems": 3,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "multilateral_treaty_inspectorate",
                  "independent_academic_cryptography_consortium",
                  "silicon_foundry_hardware_security_officer",
                  "non_aligned_civil_society_auditor",
                  "national_standards_metrology_institute"
                ]
              },
              "description": "Heterogeneous stakeholder classes participating in threshold governance so neither a single state nor a single vendor holds unilateral authority."
            }
          }
        },
        "thresholdSignatureScheme": {
          "type": "string",
          "enum": [
            "FROST-Ristretto255-SHA512",
            "FROST-Ed25519-SHA512",
            "BLS12-381-MinPk-Threshold"
          ],
          "description": "Standardized threshold signature suite (e.g., IETF RFC 9591 FROST) used for multi-party attestation."
        },
        "rootPublicKeyFingerprint": {
          "$ref": "#/$defs/sha256Hex",
          "description": "SHA-256 fingerprint of the joint threshold root public key published in the append-only governance transparency log."
        },
        "foundryTransparencyInclusionProof": {
          "type": "object",
          "description": "Merkle inclusion proof demonstrating that the hardware endorsement certificate batch was logged publicly at fabrication time.",
          "additionalProperties": false,
          "required": [
            "logTreeHeadSha256",
            "leafIndex",
            "treeSize",
            "auditPath"
          ],
          "properties": {
            "logTreeHeadSha256": {
              "$ref": "#/$defs/sha256Hex"
            },
            "leafIndex": {
              "type": "integer",
              "minimum": 0
            },
            "treeSize": {
              "type": "integer",
              "minimum": 1
            },
            "auditPath": {
              "type": "array",
              "minItems": 1,
              "maxItems": 64,
              "items": {
                "$ref": "#/$defs/sha256Hex"
              }
            }
          }
        },
        "enclaveQuote": {
          "type": "object",
          "description": "Cryptographic measurement of the on-package hardware security module (HSM) and immutable minimal firmware running the FLOP telemetry accumulator.",
          "additionalProperties": false,
          "required": [
            "firmwareMeasurementSha256",
            "formalVerificationBuildDigest",
            "secureBootVerified",
            "debugInterfacesPermanentlyFused",
            "tamperMeshIntact",
            "hardwareNonceHex"
          ],
          "properties": {
            "firmwareMeasurementSha256": {
              "$ref": "#/$defs/sha256Hex",
              "description": "Measured hash of the minimal RoT counter and ZK-prover orchestration firmware."
            },
            "formalVerificationBuildDigest": {
              "$ref": "#/$defs/sha256Hex",
              "description": "Reproducible build digest matching the publicly audited, formally verified counter state-machine specification."
            },
            "secureBootVerified": {
              "type": "boolean",
              "const": true
            },
            "debugInterfacesPermanentlyFused": {
              "type": "boolean",
              "const": true,
              "description": "Asserts JTAG/SWD and privileged scan-chain debug fuses are irreversibly blown on production silicon."
            },
            "tamperMeshIntact": {
              "type": "boolean",
              "const": true,
              "description": "Asserts active die-shielding mesh and voltage/clock glitch detectors reported zero physical intrusion events during the epoch."
            },
            "hardwareNonceHex": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$",
              "description": "Fresh 256-bit verifier challenge nonce preventing replay of historical attestation quotes."
            }
          }
        },
        "thresholdAggregateSignature": {
          "$ref": "#/$defs/base64UrlPayload",
          "description": "Compact aggregate threshold signature over the canonical JSON digest of all receipt fields excluding this signature field."
        }
      }
    },
    "computeBoundClaim": {
      "type": "object",
      "description": "Zero-knowledge range-proof claim establishing that cumulative epoch compute delta satisfies 0 <= delta_F <= declaredCapFlop without revealing exact utilization or workload structure.",
      "additionalProperties": false,
      "required": [
        "metricUnit",
        "declaredCapFlopLog10",
        "declaredCapFlopMantissa",
        "pedersenCommitmentHex",
        "rangeProof",
        "monotonicCounterAnchor"
      ],
      "properties": {
        "metricUnit": {
          "type": "string",
          "enum": [
            "fp8_fp16_equivalent_training_flop",
            "raw_tensor_core_mac_ops_x2"
          ],
          "description": "Standardized hardware counter normalization unit for matrix-multiply accumulation."
        },
        "declaredCapFlopLog10": {
          "type": "integer",
          "minimum": 22,
          "maximum": 30,
          "description": "Base-10 exponent of the treaty or pacing-tier compute cap (e.g., 26 for 10^26 FLOP)."
        },
        "declaredCapFlopMantissa": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 10,
          "description": "Mantissa multiplier for the declared compute ceiling (cap = declaredCapFlopMantissa * 10^declaredCapFlopLog10)."
        },
        "pedersenCommitmentHex": {
          "type": "string",
          "pattern": "^[0-9a-f]{64,130}$",
          "description": "Compressed elliptic-curve Pedersen commitment C = delta_F * G + r * H hiding the exact monotonic hardware FLOP counter increment delta_F."
        },
        "rangeProof": {
          "type": "object",
          "description": "Non-interactive zero-knowledge range proof attesting that the committed value delta_F lies strictly inside [0, cap] and equals the hardware-signed counter difference F_end - F_start.",
          "additionalProperties": false,
          "required": [
            "proofSystem",
            "statementSpecId",
            "rangeBitLength",
            "publicInputsSha256",
            "verifierKeySha256",
            "proofBytesBase64Url"
          ],
          "properties": {
            "proofSystem": {
              "type": "string",
              "enum": [
                "Bulletproofs-Ristretto255",
                "Halo2-Pasta",
                "PlonK-BN254",
                "STARK-Goldilocks"
              ],
              "description": "Zero-knowledge proof system selected for transparent (no trusted setup) or auditable range-proof verification."
            },
            "statementSpecId": {
              "type": "string",
              "const": "op02:zk-range-bound:deltaF-lte-cap:v0.3",
              "description": "Canonical circuit/relation identifier proving 0 <= delta_F <= cap and binding delta_F to the enclave-attested counter commitment."
            },
            "rangeBitLength": {
              "type": "integer",
              "enum": [
                64,
                96,
                128
              ],
              "description": "Bit-width of the non-negative range proof preventing wrap-around modular arithmetic exploits."
            },
            "publicInputsSha256": {
              "$ref": "#/$defs/sha256Hex",
              "description": "SHA-256 digest of all public verifier inputs (cap encoding, commitment C, epoch nonce, counter anchor hashes)."
            },
            "verifierKeySha256": {
              "$ref": "#/$defs/sha256Hex",
              "description": "SHA-256 digest of the deterministic public verification parameters."
            },
            "proofBytesBase64Url": {
              "$ref": "#/$defs/base64UrlPayload",
              "maxLength": 32768,
              "description": "Serialized zero-knowledge range proof bytes (bounded in length to foreclose covert exfiltration channels)."
            }
          }
        },
        "monotonicCounterAnchor": {
          "type": "object",
          "description": "Commitments to the hardware-enforced monotonic accumulator before and after the epoch.",
          "additionalProperties": false,
          "required": [
            "counterStartCommitmentHex",
            "counterEndCommitmentHex",
            "rollbackDetected",
            "hardwareTamperFlag"
          ],
          "properties": {
            "counterStartCommitmentHex": {
              "type": "string",
              "pattern": "^[0-9a-f]{64,130}$",
              "description": "Pedersen commitment to F_{t-1}, matching counterEndCommitmentHex from the prior epoch receipt."
            },
            "counterEndCommitmentHex": {
              "type": "string",
              "pattern": "^[0-9a-f]{64,130}$",
              "description": "Pedersen commitment to F_t, proving continuity without disclosing cumulative historical FLOP totals."
            },
            "rollbackDetected": {
              "type": "boolean",
              "const": false
            },
            "hardwareTamperFlag": {
              "type": "boolean",
              "const": false
            }
          }
        }
      }
    },
    "safetyEvalCommitment": {
      "type": "object",
      "description": "Cryptographic binding between the attested compute epoch and an independent pre-deployment safety evaluation gate (interlocking with OP-01 Oversight Fidelity Index packets).",
      "additionalProperties": false,
      "required": [
        "evalProtocolVersion",
        "evaluationTier",
        "checkpointWeightsCommitmentSha256",
        "auditorQuorumTranscriptSha256",
        "gateOutcome",
        "evaluatedAtUtc"
      ],
      "properties": {
        "evalProtocolVersion": {
          "type": "string",
          "pattern": "^[a-z0-9._-]{3,32}$",
          "description": "Version identifier of the bound evaluation protocol (e.g., 'ofi-gate-v0.3')."
        },
        "evaluationTier": {
          "type": "string",
          "enum": [
            "tier-0-below-reporting-threshold",
            "tier-1-automated-redteam-cleared",
            "tier-2-blind-ofi-auditor-cleared",
            "tier-3-multilateral-joint-inspection-cleared"
          ],
          "description": "Oversight gate tier corresponding to the declared compute ceiling."
        },
        "checkpointWeightsCommitmentSha256": {
          "$ref": "#/$defs/sha256Hex",
          "description": "Salted Merkle root commitment to the model checkpoint evaluated by independent auditors, proving the evaluated artifact matches the trained run without exposing any weight values."
        },
        "auditorQuorumTranscriptSha256": {
          "$ref": "#/$defs/sha256Hex",
          "description": "SHA-256 commitment to the signed blind flaw-injection and safety evaluation decision packet."
        },
        "gateOutcome": {
          "type": "string",
          "enum": [
            "PASS",
            "CONDITIONAL_STAGED",
            "HOLD_REQUIRES_REMEDIATION"
          ],
          "description": "Coarse evaluation disposition returned by the independent oversight body."
        },
        "evaluatedAtUtc": {
          "type": "string",
          "format": "date-time",
          "description": "UTC timestamp when the bound safety evaluation verdict was finalized."
        }
      }
    },
    "withheldFieldsGuarantee": {
      "type": "object",
      "description": "Explicit machine-verifiable non-disclosure contract guaranteeing that proprietary AI assets and civilian communications are excluded from telemetry and receipts.",
      "additionalProperties": false,
      "required": [
        "disclosurePolicy",
        "maxReceiptBytes",
        "prohibitedFieldsGuaranteedWithheld",
        "covertChannelPaddingCheckPassed"
      ],
      "properties": {
        "disclosurePolicy": {
          "type": "string",
          "const": "binary_invariant_selective_disclosure_only",
          "description": "Policy constant prohibiting raw telemetry, plaintext inspection, or behavioral profiling."
        },
        "maxReceiptBytes": {
          "type": "integer",
          "minimum": 1024,
          "maximum": 65536,
          "description": "Hard ceiling (<= 64 KiB) on serialized receipt size to structurally prevent bulk data exfiltration."
        },
        "prohibitedFieldsGuaranteedWithheld": {
          "type": "array",
          "description": "Explicit enumeration of sensitive data classes guaranteed excluded from both hardware telemetry emission and the signed receipt payload.",
          "minItems": 7,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "enum": [
              "model_weights",
              "gradient_tensors",
              "training_corpus_samples",
              "user_prompts",
              "inference_outputs",
              "civilian_network_traffic",
              "customer_identities",
              "exact_flop_utilization",
              "hyperparameter_schedules",
              "internal_rack_topology"
            ]
          },
          "allOf": [
            { "contains": { "const": "model_weights" } },
            { "contains": { "const": "training_corpus_samples" } },
            { "contains": { "const": "user_prompts" } },
            { "contains": { "const": "inference_outputs" } },
            { "contains": { "const": "civilian_network_traffic" } },
            { "contains": { "const": "customer_identities" } },
            { "contains": { "const": "exact_flop_utilization" } }
          ]
        },
        "covertChannelPaddingCheckPassed": {
          "type": "boolean",
          "const": true,
          "description": "Confirms that all receipt fields conform strictly to deterministic fixed-schema encodings with zero arbitrary free-text or unverified opaque blobs."
        }
      }
    }
  },
  "$defs": {
    "sha256Hex": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$",
      "description": "Lowercase hexadecimal SHA-256 digest (32 bytes / 64 hex characters)."
    },
    "base64UrlPayload": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{32,32768}$",
      "description": "Unpadded RFC 4648 base64url-encoded cryptographic signature or zero-knowledge proof."
    }
  }
}
