-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenproof-receipt-schema.json
More file actions
134 lines (134 loc) · 4 KB
/
Copy pathopenproof-receipt-schema.json
File metadata and controls
134 lines (134 loc) · 4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/sparshsam/openproof/blob/main/docs/spec/openproof-receipt-schema.json",
"title": "OpenProof Receipt",
"description": "Canonical JSON Schema for OpenProof proof receipts — a portable, self-contained cryptographic attestation format. See docs/spec/receipt-specification.md for the full specification.",
"type": "object",
"additionalProperties": false,
"required": [
"signature",
"subject",
"timestamp",
"type",
"version"
],
"properties": {
"commitment": {
"type": "string",
"pattern": "^sha256:[a-f0-9]{64}$",
"description": "SHA-256 hash of the canonical receipt body (excluding commitment and signature fields). Computed, included for self-description. Verification MUST recompute and compare."
},
"commitments": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"pattern": "^sha256:[a-f0-9]{64}$"
},
"description": "Array of commitment hashes. REQUIRED when type is 'bundle'. MUST be absent when type is 'proof-receipt'."
},
"metadata": {
"type": "object",
"additionalProperties": {
"type": [
"string",
"number",
"boolean",
"null"
]
},
"propertyNames": {
"pattern": "^[a-zA-Z0-9_-]{1,64}$"
},
"description": "Optional key-value metadata. Keys: ^[a-zA-Z0-9_-]{1,64}$. Values: String, Number (integer or finite float), Boolean, or null. Nested objects and arrays NOT permitted."
},
"signature": {
"type": "object",
"additionalProperties": false,
"required": [
"algorithm",
"publicKey",
"value"
],
"properties": {
"algorithm": {
"type": "string",
"const": "ed25519",
"description": "Signature algorithm. Currently only 'ed25519' is valid."
},
"publicKey": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{43}$",
"description": "Base64url-encoded Ed25519 public key (32 bytes raw, 43 base64url characters, no padding)."
},
"value": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{86}$",
"description": "Base64url-encoded Ed25519 signature (64 bytes raw, 86 base64url characters, no padding). Signs the raw 32-byte SHA-256 commitment digest."
}
}
},
"subject": {
"type": "string",
"pattern": "^sha256:[a-f0-9]{64}$",
"description": "Hash of the content being attested to. For type 'proof-receipt': SHA-256 of the content bytes. For type 'bundle': SHA-256 of the canonical JSON of the sorted commitments array."
},
"timestamp": {
"type": "integer",
"minimum": 0,
"maximum": 253402300799,
"description": "Unix epoch seconds (uint64, UTC). Non-negative. Maximum: 253402300799 (year 9999)."
},
"type": {
"type": "string",
"enum": [
"proof-receipt",
"bundle"
],
"description": "Receipt type. 'proof-receipt': standard single-subject attestation. 'bundle': aggregated attestation over multiple receipt commitments."
},
"version": {
"type": "integer",
"const": 1,
"description": "Receipt format version. Currently always 1."
}
},
"allOf": [
{
"if": {
"properties": {
"type": {
"const": "bundle"
}
},
"required": [
"type"
]
},
"then": {
"required": [
"commitments"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "proof-receipt"
}
},
"required": [
"type"
]
},
"then": {
"not": {
"required": [
"commitments"
]
}
}
}
]
}