Skip to main content
Version: Next

Receipt Schema

Receipt JSON Schema and example from MVP.

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://projectbeacon.example/schemas/receipt.json",
"title": "Receipt",
"type": "object",
"additionalProperties": false,
"required": [
"version",
"job_id",
"job_spec_hash",
"runner_instance",
"hardware",
"environment",
"geo",
"run",
"artefacts",
"created_at"
],
"properties": {
"version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+$" },
"job_id": { "type": "string", "pattern": "^[a-z0-9-]{6,64}$" },
"job_spec_hash": { "type": "string", "pattern": "^(sha256|blake3):[A-Fa-f0-9]{64,}$" },
"runner_instance": {
"type": "object",
"additionalProperties": false,
"required": ["provider_id", "region", "instance_id"],
"properties": {
"provider_id": { "type": "string", "minLength": 3, "maxLength": 120 },
"region": { "type": "string", "pattern": "^[A-Z]{2}$" },
"instance_id": { "type": "string", "minLength": 3, "maxLength": 120 }
}
},
"hardware": {
"type": "object",
"additionalProperties": false,
"required": ["cpu", "ram_gb"],
"properties": {
"cpu": { "type": "string", "minLength": 1, "maxLength": 200 },
"gpu": { "type": "string", "maxLength": 200 },
"gpu_vram_gb": { "type": "number", "minimum": 0 },
"ram_gb": { "type": "number", "minimum": 0 },
"storage_gb": { "type": "number", "minimum": 0 },
"driver": { "type": "string", "maxLength": 200 },
"microcode": { "type": "string", "maxLength": 200 },
"power_cap_w": { "type": "number", "minimum": 0 }
}
},
"environment": {
"type": "object",
"additionalProperties": false,
"properties": {
"kernel": { "type": "string", "maxLength": 200 },
"os": { "type": "string", "maxLength": 200 },
"container_runtime": { "type": "string", "maxLength": 200 },
"runner_commit": { "type": "string", "maxLength": 80 }
}
},
"geo": {
"type": "object",
"additionalProperties": false,
"required": ["ip", "asn"],
"properties": {
"ip": { "type": "string", "format": "ipv4" },
"asn": { "type": "integer", "minimum": 1 },
"rtts_ms": {
"type": "array",
"items": { "type": "number", "minimum": 0 },
"minItems": 1
},
"gps_claim": {
"type": "object",
"additionalProperties": false,
"properties": {
"lat": { "type": "number", "minimum": -90, "maximum": 90 },
"lon": { "type": "number", "minimum": -180, "maximum": 180 },
"accuracy_m": { "type": "number", "minimum": 0 }
}
}
}
},
"run": {
"type": "object",
"additionalProperties": false,
"required": ["started_at", "ended_at", "outputs_hash"],
"properties": {
"started_at": { "type": "string", "format": "date-time" },
"ended_at": { "type": "string", "format": "date-time" },
"tok_per_s": { "type": "number", "minimum": 0 },
"p50_latency_ms": { "type": "number", "minimum": 0 },
"p95_latency_ms": { "type": "number", "minimum": 0 },
"cost_estimate": { "type": "number", "minimum": 0 },
"throttling_events": { "type": "integer", "minimum": 0 },
"outputs_hash": { "type": "string", "pattern": "^(sha256|blake3):[A-Fa-f0-9]{64,}$" }
}
},
"artefacts": {
"type": "object",
"additionalProperties": false,
"required": ["bundle_cid"],
"properties": {
"bundle_cid": { "type": "string", "minLength": 10, "maxLength": 200 },
"stdout_hash": { "type": "string", "pattern": "^(sha256|blake3):[A-Fa-f0-9]{64,}$" },
"logs_hash": { "type": "string", "pattern": "^(sha256|blake3):[A-Fa-f0-9]{64,}$" }
}
},
"attestations": {
"type": "object",
"additionalProperties": false,
"properties": {
"tpm_quote": { "type": "string", "maxLength": 50000 },
"tee_quote": { "type": "string", "maxLength": 50000 },
"witness_sigs": {
"type": "array",
"items": { "type": "string", "maxLength": 2000 },
"uniqueItems": true
}
}
},
"created_at": { "type": "string", "format": "date-time" },
"notes": { "type": "string", "maxLength": 2000 }
}
}