95 lines
1.9 KiB
JSON
95 lines
1.9 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://paperspec.scient.ing/schemas/proof.schema.json",
|
|
"title": "Merkle proof",
|
|
"description": "scienting-proof/1: an RFC 9162 inclusion proof of one item of a receipt, or a consistency proof between two revisions of a document's history; spec/08-fidelity.md §8.5, spec/11-corrections.md §11.5.",
|
|
"type": "object",
|
|
"properties": {
|
|
"format": {
|
|
"const": "scienting-proof/1"
|
|
},
|
|
"kind": {
|
|
"enum": [
|
|
"inclusion",
|
|
"consistency"
|
|
]
|
|
},
|
|
"receipt": {
|
|
"$ref": "common.schema.json#/$defs/recordId"
|
|
},
|
|
"doc": {
|
|
"$ref": "common.schema.json#/$defs/qualifiedKey"
|
|
},
|
|
"item": {
|
|
"type": "array",
|
|
"minItems": 1
|
|
},
|
|
"index": {
|
|
"type": "integer",
|
|
"minimum": 0
|
|
},
|
|
"size": {
|
|
"type": "integer",
|
|
"minimum": 1
|
|
},
|
|
"root": {
|
|
"$ref": "common.schema.json#/$defs/hash"
|
|
},
|
|
"from_rev": {
|
|
"type": "integer",
|
|
"minimum": 0
|
|
},
|
|
"to_rev": {
|
|
"type": "integer",
|
|
"minimum": 0
|
|
},
|
|
"from_root": {
|
|
"$ref": "common.schema.json#/$defs/hash"
|
|
},
|
|
"to_root": {
|
|
"$ref": "common.schema.json#/$defs/hash"
|
|
},
|
|
"path": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "common.schema.json#/$defs/hash"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"format",
|
|
"kind",
|
|
"path"
|
|
],
|
|
"additionalProperties": false,
|
|
"allOf": [
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"kind": {
|
|
"const": "inclusion"
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"required": [
|
|
"receipt",
|
|
"item",
|
|
"index",
|
|
"size",
|
|
"root"
|
|
]
|
|
},
|
|
"else": {
|
|
"required": [
|
|
"doc",
|
|
"from_rev",
|
|
"to_rev",
|
|
"from_root",
|
|
"to_root"
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|