@bsv/dpp-core 0.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +58 -0
- package/README.md +95 -0
- package/dist/acceptance.d.ts +100 -0
- package/dist/acceptance.d.ts.map +1 -0
- package/dist/acceptance.js +202 -0
- package/dist/acceptance.js.map +1 -0
- package/dist/anchor.d.ts +66 -0
- package/dist/anchor.d.ts.map +1 -0
- package/dist/anchor.js +145 -0
- package/dist/anchor.js.map +1 -0
- package/dist/attestation.d.ts +40 -0
- package/dist/attestation.d.ts.map +1 -0
- package/dist/attestation.js +111 -0
- package/dist/attestation.js.map +1 -0
- package/dist/blob.d.ts +11 -0
- package/dist/blob.d.ts.map +1 -0
- package/dist/blob.js +16 -0
- package/dist/blob.js.map +1 -0
- package/dist/canonical.d.ts +32 -0
- package/dist/canonical.d.ts.map +1 -0
- package/dist/canonical.js +54 -0
- package/dist/canonical.js.map +1 -0
- package/dist/canonicalJson.d.ts +22 -0
- package/dist/canonicalJson.d.ts.map +1 -0
- package/dist/canonicalJson.js +60 -0
- package/dist/canonicalJson.js.map +1 -0
- package/dist/codec.d.ts +45 -0
- package/dist/codec.d.ts.map +1 -0
- package/dist/codec.js +459 -0
- package/dist/codec.js.map +1 -0
- package/dist/constants.d.ts +150 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +179 -0
- package/dist/constants.js.map +1 -0
- package/dist/did.d.ts +37 -0
- package/dist/did.d.ts.map +1 -0
- package/dist/did.js +129 -0
- package/dist/did.js.map +1 -0
- package/dist/evidence.d.ts +224 -0
- package/dist/evidence.d.ts.map +1 -0
- package/dist/evidence.js +716 -0
- package/dist/evidence.js.map +1 -0
- package/dist/evidencePackage.d.ts +114 -0
- package/dist/evidencePackage.d.ts.map +1 -0
- package/dist/evidencePackage.js +164 -0
- package/dist/evidencePackage.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/owner.d.ts +135 -0
- package/dist/owner.d.ts.map +1 -0
- package/dist/owner.js +181 -0
- package/dist/owner.js.map +1 -0
- package/dist/publisherPolicy.d.ts +70 -0
- package/dist/publisherPolicy.d.ts.map +1 -0
- package/dist/publisherPolicy.js +186 -0
- package/dist/publisherPolicy.js.map +1 -0
- package/dist/signatures.d.ts +84 -0
- package/dist/signatures.d.ts.map +1 -0
- package/dist/signatures.js +137 -0
- package/dist/signatures.js.map +1 -0
- package/dist/transition.d.ts +29 -0
- package/dist/transition.d.ts.map +1 -0
- package/dist/transition.js +117 -0
- package/dist/transition.js.map +1 -0
- package/dist/types.d.ts +135 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/verifyChain.d.ts +152 -0
- package/dist/verifyChain.d.ts.map +1 -0
- package/dist/verifyChain.js +314 -0
- package/dist/verifyChain.js.map +1 -0
- package/package.json +46 -0
- package/schemas/capabilities.schema.json +129 -0
- package/schemas/epcis-import.schema.json +212 -0
- package/schemas/evidence-export.schema.json +67 -0
- package/schemas/evidence-package.schema.json +307 -0
- package/schemas/native-evidence-extension.schema.json +66 -0
- package/schemas/paginated-history.schema.json +32 -0
- package/schemas/passport-projection.schema.json +151 -0
- package/schemas/passport-source.schema.json +370 -0
- package/schemas/profile-evidence.schema.json +706 -0
- package/schemas/publisher-policy.schema.json +173 -0
- package/schemas/verification-report.schema.json +397 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://bsv-blockchain.github.io/dpp/contracts/epcis-import.schema.json",
|
|
4
|
+
"title": "DPP EPCIS import record, version 1",
|
|
5
|
+
"description": "The durable record of one retained EPCIS source under the epcis-json@1 profile (spec/epcis-interoperability.md section 2): what was received, where its exact bytes are kept, how it was interpreted, what each event's validation and mapping found, which events conflict with earlier ones, what was published from it under separate authority, and how far a pull got. Operational state never substitutes for a verification report, and no field of this record is a token operation.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["importVersion", "importId", "requestId", "sourceId", "receivedAt", "mediaType", "byteLength", "sha256", "bytesRef", "sourceLocation", "contextRefs", "profileRefs", "policyId", "state", "events", "progress"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"importVersion": { "const": "1" },
|
|
11
|
+
"importId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "The stable internal identity of this import." },
|
|
12
|
+
"requestId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "The caller's idempotency key, bound to requestDigest: an identical retry resumes or returns this import, a reuse with different bytes is a conflict." },
|
|
13
|
+
"requestDigest": { "$ref": "#/$defs/sha256", "description": "SHA-256 of the canonical request the idempotency key is bound to." },
|
|
14
|
+
"sourceId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "The configured source identity events are scoped under. It names a configured origin, never an account type." },
|
|
15
|
+
"receivedAt": { "$ref": "#/$defs/dateTime" },
|
|
16
|
+
"mediaType": { "enum": ["application/json", "application/ld+json"] },
|
|
17
|
+
"byteLength": { "type": "integer", "minimum": 0 },
|
|
18
|
+
"sha256": { "$ref": "#/$defs/sha256", "description": "The digest of the exact received bytes; export returns bytes with this digest or nothing." },
|
|
19
|
+
"bytesRef": { "type": "string", "minLength": 1, "description": "Where the exact bytes are retained: a store key, a path or a content address, as the deployment names it." },
|
|
20
|
+
"sourceLocation": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"additionalProperties": false,
|
|
23
|
+
"required": ["kind"],
|
|
24
|
+
"description": "Provenance, never authentication proof. Credentials are never recorded here.",
|
|
25
|
+
"properties": {
|
|
26
|
+
"kind": { "enum": ["file", "query", "single-event"] },
|
|
27
|
+
"origin": { "type": "string", "format": "uri", "description": "The configured repository origin a query was made to, without credentials." },
|
|
28
|
+
"query": { "type": "object", "additionalProperties": { "type": "string" }, "description": "The standard query parameters used, by name." },
|
|
29
|
+
"page": { "type": "integer", "minimum": 1 },
|
|
30
|
+
"filename": { "type": "string" }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"contextRefs": {
|
|
34
|
+
"type": "array",
|
|
35
|
+
"description": "The context declarations of the source exactly as found, each with its pinned digest or the statement that it is unpinned.",
|
|
36
|
+
"items": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"required": ["kind", "value", "pinned"],
|
|
40
|
+
"properties": {
|
|
41
|
+
"kind": { "enum": ["iri", "inline"] },
|
|
42
|
+
"value": { "type": "string", "minLength": 1 },
|
|
43
|
+
"digest": { "$ref": "#/$defs/sha256" },
|
|
44
|
+
"pinned": { "type": "boolean" },
|
|
45
|
+
"scope": { "type": "string", "description": "document, or the pointer of the event that declared it." }
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"profileRefs": {
|
|
50
|
+
"type": "array",
|
|
51
|
+
"minItems": 1,
|
|
52
|
+
"items": { "type": "string", "pattern": "^[a-z][a-z0-9.-]*@[0-9][0-9a-z.-]*$" },
|
|
53
|
+
"description": "The interoperability and credential profiles this import was interpreted under, for example epcis-json@1 and epcis-vsc@1."
|
|
54
|
+
},
|
|
55
|
+
"policyId": { "type": "string", "minLength": 1, "description": "The named operator policy the limits, source scope and any automation were read from." },
|
|
56
|
+
"limits": { "type": "object", "additionalProperties": { "type": ["integer", "string"] }, "description": "The limits in force for this import, as the profile discloses them." },
|
|
57
|
+
"state": { "enum": ["received", "evaluated", "publication-pending", "published", "blocked"], "description": "received: bytes retained, not yet evaluated. evaluated: validation and mapping findings recorded, nothing published. publication-pending: a separately authorised publication was requested and is unresolved. published: at least one event was published as a credential. blocked: a conflict or a refused publication needs explicit resolution. Never a verification verdict." },
|
|
58
|
+
"envelope": {
|
|
59
|
+
"type": "object",
|
|
60
|
+
"additionalProperties": false,
|
|
61
|
+
"required": ["type"],
|
|
62
|
+
"properties": {
|
|
63
|
+
"type": { "enum": ["EPCISDocument", "EPCISQueryDocument"] },
|
|
64
|
+
"schemaVersion": { "type": "string" },
|
|
65
|
+
"creationDate": { "type": "string" },
|
|
66
|
+
"queryName": { "type": "string" },
|
|
67
|
+
"hasHeader": { "type": "boolean" },
|
|
68
|
+
"hasMasterData": { "type": "boolean" }
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"findings": { "type": "array", "items": { "$ref": "#/$defs/finding" }, "description": "Document-level findings: envelope, schema and context findings that are not about one event." },
|
|
72
|
+
"events": { "type": "array", "items": { "$ref": "#/$defs/event" } },
|
|
73
|
+
"progress": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"additionalProperties": false,
|
|
76
|
+
"required": ["pagesRead", "complete", "completenessLimits"],
|
|
77
|
+
"properties": {
|
|
78
|
+
"checkpoint": { "type": "string", "description": "The durable pull checkpoint (the next page token, or the record-time cutoff reached), written only after the page's imports and results are durable." },
|
|
79
|
+
"checkpointExpiresAt": { "$ref": "#/$defs/dateTime" },
|
|
80
|
+
"pagesRead": { "type": "integer", "minimum": 0 },
|
|
81
|
+
"bytesRead": { "type": "integer", "minimum": 0 },
|
|
82
|
+
"complete": { "type": "boolean", "description": "True only when the source answered the whole bounded query without a next page and within the limits; never an assertion of complete history." },
|
|
83
|
+
"completenessLimits": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "Every reason the result is not complete history: the query scope, a page limit reached, an expired cursor, a timestamp-only bound." },
|
|
84
|
+
"sourceOutcome": { "$ref": "#/$defs/sourceOutcome" },
|
|
85
|
+
"sourceDetail": { "type": "string" }
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"createdAt": { "$ref": "#/$defs/dateTime" },
|
|
89
|
+
"updatedAt": { "$ref": "#/$defs/dateTime" }
|
|
90
|
+
},
|
|
91
|
+
"$defs": {
|
|
92
|
+
"sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
|
|
93
|
+
"dateTime": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$" },
|
|
94
|
+
"pointer": { "type": "string", "pattern": "^(/[^/]*)*$", "description": "An RFC 6901 JSON pointer into the retained document; the empty pointer is a single event accepted as the whole source." },
|
|
95
|
+
"sourceOutcome": {
|
|
96
|
+
"enum": ["source-link-missing", "source-authentication-required", "source-forbidden", "source-unavailable", "unexpected-media-type", "invalid-source", "partial-history", "ok"],
|
|
97
|
+
"description": "The outcome of reaching a source: no discovered EPCIS link; the source demanded authentication; the source refused this caller; the source did not answer or answered an error; the source answered a media type that is not EPCIS (an HTML login page with status 200 is this, never success); the bytes were refused before retention; the bounded query ended before the source did; or the bounded query completed. A successful query with zero matching events is ok with an empty event list, never any other outcome."
|
|
98
|
+
},
|
|
99
|
+
"finding": {
|
|
100
|
+
"type": "object",
|
|
101
|
+
"additionalProperties": false,
|
|
102
|
+
"required": ["code", "path", "message", "severity"],
|
|
103
|
+
"properties": {
|
|
104
|
+
"code": { "type": "string", "minLength": 1 },
|
|
105
|
+
"path": { "type": "string" },
|
|
106
|
+
"message": { "type": "string", "minLength": 1 },
|
|
107
|
+
"severity": { "enum": ["error", "warning", "info"] }
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"identifier": {
|
|
111
|
+
"type": "object",
|
|
112
|
+
"additionalProperties": false,
|
|
113
|
+
"required": ["path", "value", "scheme"],
|
|
114
|
+
"properties": {
|
|
115
|
+
"path": { "$ref": "#/$defs/pointer" },
|
|
116
|
+
"value": { "type": "string" },
|
|
117
|
+
"scheme": { "enum": ["gs1-sgtin", "gs1-lgtin", "gs1-sgtin-pattern", "gs1-digital-link", "epc-other", "other"] },
|
|
118
|
+
"gtin": { "type": "string", "pattern": "^\\d{14}$" },
|
|
119
|
+
"serial": { "type": "string" },
|
|
120
|
+
"lot": { "type": "string" },
|
|
121
|
+
"checkDigitValid": { "type": "boolean" },
|
|
122
|
+
"problem": { "type": "string" }
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"event": {
|
|
126
|
+
"type": "object",
|
|
127
|
+
"additionalProperties": false,
|
|
128
|
+
"required": ["pointer", "identity", "identityKind", "eventType", "bodyDigest", "validation", "mapping"],
|
|
129
|
+
"properties": {
|
|
130
|
+
"pointer": { "$ref": "#/$defs/pointer" },
|
|
131
|
+
"eventId": { "type": "string", "format": "uri", "description": "The event's own eventID, when it carries one." },
|
|
132
|
+
"identity": { "type": "string", "minLength": 1, "description": "The scoped identity duplicates and conflicts are decided under: the eventID, or the local identity." },
|
|
133
|
+
"identityKind": { "enum": ["event-id", "local"] },
|
|
134
|
+
"eventType": { "type": "string", "minLength": 1 },
|
|
135
|
+
"eventTime": { "type": "string" },
|
|
136
|
+
"recordTime": { "type": "string" },
|
|
137
|
+
"bodyDigest": { "$ref": "#/$defs/sha256", "description": "The canonical event-body digest: RFC 8785 over the event without recordTime and errorDeclaration plus the sorted context digests." },
|
|
138
|
+
"identifiers": { "type": "array", "items": { "$ref": "#/$defs/identifier" } },
|
|
139
|
+
"preservedExtensions": { "type": "array", "items": { "type": "string" } },
|
|
140
|
+
"validation": {
|
|
141
|
+
"type": "object",
|
|
142
|
+
"additionalProperties": false,
|
|
143
|
+
"required": ["schema", "findings"],
|
|
144
|
+
"properties": {
|
|
145
|
+
"schema": { "enum": ["pass", "fail", "unknown"], "description": "Whether the pinned schema accepted the document this event belongs to; unknown when validation was not run." },
|
|
146
|
+
"findings": { "type": "array", "items": { "$ref": "#/$defs/finding" } }
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"errorDeclaration": {
|
|
150
|
+
"type": "object",
|
|
151
|
+
"additionalProperties": false,
|
|
152
|
+
"required": ["correctiveEventIDs", "resolution"],
|
|
153
|
+
"properties": {
|
|
154
|
+
"declarationTime": { "type": "string" },
|
|
155
|
+
"reason": { "type": "string" },
|
|
156
|
+
"correctiveEventIDs": { "type": "array", "items": { "type": "string" } },
|
|
157
|
+
"resolution": { "enum": ["resolved", "unresolved"], "description": "resolved only when every corrective event named is held under this source; an EPCIS error declaration is never a VSC correction." },
|
|
158
|
+
"missing": { "type": "array", "items": { "type": "string" } }
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"mapping": {
|
|
162
|
+
"type": "object",
|
|
163
|
+
"additionalProperties": false,
|
|
164
|
+
"required": ["outcome", "missing", "unmapped"],
|
|
165
|
+
"properties": {
|
|
166
|
+
"profile": { "type": "string", "pattern": "^[a-z][a-z0-9.-]*@[0-9][0-9a-z.-]*$" },
|
|
167
|
+
"outcome": { "enum": ["lossless", "transformed", "unsupported", "insufficient-data", "not-attempted"] },
|
|
168
|
+
"missing": { "type": "array", "items": { "type": "string" } },
|
|
169
|
+
"unmapped": { "type": "array", "items": { "type": "string" } }
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"arrival": { "enum": ["new", "duplicate", "new-observation", "conflict"], "description": "How this event relates to what the source already held under the same identity." },
|
|
173
|
+
"conflict": {
|
|
174
|
+
"type": "object",
|
|
175
|
+
"additionalProperties": false,
|
|
176
|
+
"required": ["withImportId", "withBodyDigest", "state"],
|
|
177
|
+
"description": "A different body under the same scoped identity; both bodies stay retained and visible until a person resolves it by name.",
|
|
178
|
+
"properties": {
|
|
179
|
+
"withImportId": { "type": "string" },
|
|
180
|
+
"withPointer": { "$ref": "#/$defs/pointer" },
|
|
181
|
+
"withBodyDigest": { "$ref": "#/$defs/sha256" },
|
|
182
|
+
"state": { "enum": ["open", "resolved"] },
|
|
183
|
+
"resolution": { "type": "string" },
|
|
184
|
+
"resolvedAt": { "$ref": "#/$defs/dateTime" }
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"publication": {
|
|
188
|
+
"type": "object",
|
|
189
|
+
"additionalProperties": false,
|
|
190
|
+
"required": ["state"],
|
|
191
|
+
"description": "The separately authorised publication of this event as a credential, if one was requested. The credential's bytes and identity are persisted before anchoring; a retry after an uncertain answer resumes this record and never issues again.",
|
|
192
|
+
"properties": {
|
|
193
|
+
"state": { "enum": ["requested", "issued", "submitted", "anchored", "refused", "unavailable"] },
|
|
194
|
+
"credentialId": { "type": "string", "format": "uri" },
|
|
195
|
+
"digest": { "$ref": "#/$defs/sha256", "description": "The digest of the exact issued credential bytes." },
|
|
196
|
+
"representation": { "type": "string" },
|
|
197
|
+
"operationId": { "type": "string", "description": "The durable operation the publication runs under." },
|
|
198
|
+
"anchor": {
|
|
199
|
+
"type": "object",
|
|
200
|
+
"additionalProperties": false,
|
|
201
|
+
"required": ["txid", "outputIndex"],
|
|
202
|
+
"properties": { "txid": { "$ref": "#/$defs/sha256" }, "outputIndex": { "type": "integer", "minimum": 0 } }
|
|
203
|
+
},
|
|
204
|
+
"refusal": { "type": "string" },
|
|
205
|
+
"authorisedBy": { "type": "string", "description": "The server-side authority that permitted publication; never a role the request body supplied." },
|
|
206
|
+
"at": { "$ref": "#/$defs/dateTime" }
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://bsv-blockchain.github.io/dpp/contracts/evidence-export.schema.json",
|
|
4
|
+
"title": "DPP evidence export part, version 1",
|
|
5
|
+
"description": "One part of a complete export (spec/portable-evidence.md section 2): a dpp-evidence-package@1 over the states of one passport whose source sequence lies in the part's range within one snapshot, beside the coverage record a reader needs to join the parts. The coverage record (exportVersion, passportId, snapshot, part, final, manifestSha256 and the signature's suite and signer) is signed by the exporter with the same key as the package manifest and bound to that manifest by its digest, so no unsigned field establishes coverage or finality; the cursor and the package bytes stay outside it. The parts of one snapshot tile its sequence range from 1 to the snapshot's sequence with no gap and no overlap; a part is complete for its own range and never for the snapshot, unless it is the only part. The package inside is inspected exactly as any other; the record is what says how the packages compose, and a signature over it attributes the assertion to the exporter without proving the exporter held everything that exists elsewhere.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["exportVersion", "passportId", "snapshot", "part", "nextCursor", "final", "manifestSha256", "signature", "package"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"exportVersion": { "const": "1" },
|
|
11
|
+
"passportId": { "type": "string", "minLength": 1, "maxLength": 512 },
|
|
12
|
+
"snapshot": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"additionalProperties": false,
|
|
15
|
+
"required": ["source", "id", "sequence"],
|
|
16
|
+
"properties": {
|
|
17
|
+
"source": { "type": "string", "minLength": 1, "description": "The service the snapshot was taken of." },
|
|
18
|
+
"id": { "type": "string", "minLength": 1, "description": "The snapshot identifier every part of this export and its package manifest name." },
|
|
19
|
+
"sequence": { "type": "integer", "minimum": 0, "description": "The source's highest sequence within the snapshot; the last part's range ends here." }
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"part": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"required": ["index", "sequenceRange", "states"],
|
|
26
|
+
"properties": {
|
|
27
|
+
"index": { "type": "integer", "minimum": 1, "description": "1 for the first part; consecutive." },
|
|
28
|
+
"sequenceRange": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"additionalProperties": false,
|
|
31
|
+
"required": ["from", "to"],
|
|
32
|
+
"properties": {
|
|
33
|
+
"from": { "type": "integer", "minimum": 0 },
|
|
34
|
+
"to": { "type": "integer", "minimum": 0 }
|
|
35
|
+
},
|
|
36
|
+
"description": "The sequences this part covers: from the position after the previous part to the last state here, or to the snapshot's sequence on the final part. Consecutive parts tile the snapshot."
|
|
37
|
+
},
|
|
38
|
+
"states": { "type": "integer", "minimum": 0, "description": "How many states of the passport lie in the range; each is in the package or declared absent by outpoint." }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"nextCursor": { "type": ["string", "null"], "description": "Opaque, bound to the passport and the snapshot; null on the final part. Outside the signed coverage record: a resumption token, never a statement about coverage." },
|
|
42
|
+
"final": { "type": "boolean", "description": "Signed. True exactly when the part ends at the snapshot's sequence; nextCursor is then null." },
|
|
43
|
+
"manifestSha256": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "Signed. SHA-256 of the canonical JSON of package.manifest exactly as signed, signature value included, binding the record to that package and no other." },
|
|
44
|
+
"signature": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["suite", "signer", "value"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"suite": { "const": "bsv-ecdsa-der", "description": "bsv-ecdsa-der: ECDSA over SHA-256 of the canonical JSON of the coverage record (exportVersion, passportId, snapshot, part, final, manifestSha256 and signature without value; object keys sorted recursively, no whitespace), DER encoded." },
|
|
50
|
+
"signer": { "type": "string", "pattern": "^0[23][0-9a-f]{64}$", "description": "The exporter's compressed key; the same key that signed package.manifest." },
|
|
51
|
+
"value": { "type": "string", "minLength": 1 }
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"package": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"required": ["manifest", "files"],
|
|
57
|
+
"description": "The part's dpp-evidence-package@1 in the JSON envelope form: the signed manifest beside every inventoried file, base64 by path.",
|
|
58
|
+
"properties": {
|
|
59
|
+
"manifest": { "$ref": "./evidence-package.schema.json" },
|
|
60
|
+
"files": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"additionalProperties": { "type": "string", "contentEncoding": "base64" }
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://bsv-blockchain.github.io/dpp/contracts/evidence-package.schema.json",
|
|
4
|
+
"title": "DPP evidence package manifest, version 1",
|
|
5
|
+
"description": "The signed manifest of a dpp-evidence-package@1 (spec/portable-evidence.md section 2): exact identities, export time, profile and policy references, source observations, disclosure scope, completeness declarations and a content-addressed inventory. The signature authenticates the exporter and the inventory, never the truth or exhaustiveness of what is inventoried.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"format",
|
|
10
|
+
"version",
|
|
11
|
+
"passportId",
|
|
12
|
+
"exportedAt",
|
|
13
|
+
"exporter",
|
|
14
|
+
"disclosure",
|
|
15
|
+
"completeness",
|
|
16
|
+
"sources",
|
|
17
|
+
"inventory",
|
|
18
|
+
"signature"
|
|
19
|
+
],
|
|
20
|
+
"properties": {
|
|
21
|
+
"format": {
|
|
22
|
+
"const": "dpp-evidence-package"
|
|
23
|
+
},
|
|
24
|
+
"version": {
|
|
25
|
+
"const": "1"
|
|
26
|
+
},
|
|
27
|
+
"passportId": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"minLength": 1,
|
|
30
|
+
"maxLength": 512
|
|
31
|
+
},
|
|
32
|
+
"genesis": {
|
|
33
|
+
"$ref": "#/$defs/outpoint"
|
|
34
|
+
},
|
|
35
|
+
"selectedTip": {
|
|
36
|
+
"$ref": "#/$defs/outpoint"
|
|
37
|
+
},
|
|
38
|
+
"exportedAt": {
|
|
39
|
+
"$ref": "#/$defs/dateTime"
|
|
40
|
+
},
|
|
41
|
+
"exporter": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"additionalProperties": false,
|
|
44
|
+
"required": [
|
|
45
|
+
"id",
|
|
46
|
+
"role"
|
|
47
|
+
],
|
|
48
|
+
"properties": {
|
|
49
|
+
"id": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"minLength": 1,
|
|
52
|
+
"description": "A DID or a compressed identity key of the party that assembled and signed the package."
|
|
53
|
+
},
|
|
54
|
+
"role": {
|
|
55
|
+
"enum": [
|
|
56
|
+
"registry",
|
|
57
|
+
"overlay",
|
|
58
|
+
"writer",
|
|
59
|
+
"reader",
|
|
60
|
+
"other"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
"software": {
|
|
64
|
+
"type": "string"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"profiles": {
|
|
69
|
+
"type": "array",
|
|
70
|
+
"items": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"pattern": "^[a-z][a-z0-9.-]*@[0-9][0-9a-z.-]*$"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"policyId": {
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
"disclosure": {
|
|
79
|
+
"type": "object",
|
|
80
|
+
"additionalProperties": false,
|
|
81
|
+
"required": [
|
|
82
|
+
"scope",
|
|
83
|
+
"recoveryBackup"
|
|
84
|
+
],
|
|
85
|
+
"properties": {
|
|
86
|
+
"scope": {
|
|
87
|
+
"enum": [
|
|
88
|
+
"public",
|
|
89
|
+
"public-and-owner",
|
|
90
|
+
"public-and-legitimate",
|
|
91
|
+
"public-and-authority",
|
|
92
|
+
"all-tiers"
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"recipient": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"description": "Who the restricted tiers are encrypted to, when any are included."
|
|
98
|
+
},
|
|
99
|
+
"recoveryBackup": {
|
|
100
|
+
"type": "boolean",
|
|
101
|
+
"description": "True only for a package that carries every tier for the operator's own recovery; a public-scope package is never one."
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"completeness": {
|
|
106
|
+
"type": "object",
|
|
107
|
+
"additionalProperties": false,
|
|
108
|
+
"required": [
|
|
109
|
+
"snapshots",
|
|
110
|
+
"withheld",
|
|
111
|
+
"absent"
|
|
112
|
+
],
|
|
113
|
+
"properties": {
|
|
114
|
+
"snapshots": {
|
|
115
|
+
"type": "array",
|
|
116
|
+
"items": {
|
|
117
|
+
"type": "object",
|
|
118
|
+
"additionalProperties": false,
|
|
119
|
+
"required": [
|
|
120
|
+
"source",
|
|
121
|
+
"snapshotId",
|
|
122
|
+
"completeForSnapshot"
|
|
123
|
+
],
|
|
124
|
+
"properties": {
|
|
125
|
+
"source": {
|
|
126
|
+
"type": "string"
|
|
127
|
+
},
|
|
128
|
+
"snapshotId": {
|
|
129
|
+
"type": "string"
|
|
130
|
+
},
|
|
131
|
+
"completeForSnapshot": {
|
|
132
|
+
"type": "boolean"
|
|
133
|
+
},
|
|
134
|
+
"scope": {
|
|
135
|
+
"type": "string"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"withheld": {
|
|
141
|
+
"type": "array",
|
|
142
|
+
"items": {
|
|
143
|
+
"type": "string"
|
|
144
|
+
},
|
|
145
|
+
"description": "Material known to exist and deliberately not included, by reference."
|
|
146
|
+
},
|
|
147
|
+
"absent": {
|
|
148
|
+
"type": "array",
|
|
149
|
+
"items": {
|
|
150
|
+
"type": "string"
|
|
151
|
+
},
|
|
152
|
+
"description": "Material referenced by included evidence that the exporter could not obtain."
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"sources": {
|
|
157
|
+
"type": "array",
|
|
158
|
+
"items": {
|
|
159
|
+
"type": "object",
|
|
160
|
+
"additionalProperties": false,
|
|
161
|
+
"required": [
|
|
162
|
+
"id",
|
|
163
|
+
"kind",
|
|
164
|
+
"observedAt",
|
|
165
|
+
"result"
|
|
166
|
+
],
|
|
167
|
+
"properties": {
|
|
168
|
+
"id": {
|
|
169
|
+
"type": "string"
|
|
170
|
+
},
|
|
171
|
+
"kind": {
|
|
172
|
+
"enum": [
|
|
173
|
+
"overlay-lookup",
|
|
174
|
+
"spend-status",
|
|
175
|
+
"header-source",
|
|
176
|
+
"registry",
|
|
177
|
+
"other"
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
"observedAt": {
|
|
181
|
+
"$ref": "#/$defs/dateTime"
|
|
182
|
+
},
|
|
183
|
+
"result": {
|
|
184
|
+
"enum": [
|
|
185
|
+
"unspent",
|
|
186
|
+
"spent",
|
|
187
|
+
"not-found",
|
|
188
|
+
"unavailable",
|
|
189
|
+
"conflicting"
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
"height": {
|
|
193
|
+
"type": "integer",
|
|
194
|
+
"minimum": 0
|
|
195
|
+
},
|
|
196
|
+
"blockHash": {
|
|
197
|
+
"type": "string",
|
|
198
|
+
"pattern": "^[0-9a-f]{64}$"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"inventory": {
|
|
204
|
+
"type": "array",
|
|
205
|
+
"minItems": 1,
|
|
206
|
+
"items": {
|
|
207
|
+
"type": "object",
|
|
208
|
+
"additionalProperties": false,
|
|
209
|
+
"required": [
|
|
210
|
+
"path",
|
|
211
|
+
"category",
|
|
212
|
+
"mediaType",
|
|
213
|
+
"byteLength",
|
|
214
|
+
"sha256"
|
|
215
|
+
],
|
|
216
|
+
"properties": {
|
|
217
|
+
"path": {
|
|
218
|
+
"type": "string",
|
|
219
|
+
"pattern": "^(?!/)(?!.*(^|/)\\.\\.(/|$))[^\\x00]+$",
|
|
220
|
+
"description": "Relative, no traversal."
|
|
221
|
+
},
|
|
222
|
+
"category": {
|
|
223
|
+
"enum": [
|
|
224
|
+
"transactions",
|
|
225
|
+
"proofs",
|
|
226
|
+
"native-claims",
|
|
227
|
+
"external-credentials",
|
|
228
|
+
"evidence",
|
|
229
|
+
"schemas",
|
|
230
|
+
"authority",
|
|
231
|
+
"status",
|
|
232
|
+
"reports"
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
"mediaType": {
|
|
236
|
+
"type": "string",
|
|
237
|
+
"minLength": 1
|
|
238
|
+
},
|
|
239
|
+
"byteLength": {
|
|
240
|
+
"type": "integer",
|
|
241
|
+
"minimum": 0
|
|
242
|
+
},
|
|
243
|
+
"sha256": {
|
|
244
|
+
"type": "string",
|
|
245
|
+
"pattern": "^[0-9a-f]{64}$"
|
|
246
|
+
},
|
|
247
|
+
"encrypted": {
|
|
248
|
+
"type": "boolean"
|
|
249
|
+
},
|
|
250
|
+
"represents": {
|
|
251
|
+
"type": "string",
|
|
252
|
+
"description": "What the file is: an outpoint, a credential id, a claim digest, a schema id."
|
|
253
|
+
},
|
|
254
|
+
"representation": {
|
|
255
|
+
"type": "string"
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"signature": {
|
|
261
|
+
"type": "object",
|
|
262
|
+
"additionalProperties": false,
|
|
263
|
+
"required": [
|
|
264
|
+
"suite",
|
|
265
|
+
"signer",
|
|
266
|
+
"value"
|
|
267
|
+
],
|
|
268
|
+
"properties": {
|
|
269
|
+
"suite": {
|
|
270
|
+
"const": "bsv-ecdsa-der",
|
|
271
|
+
"description": "bsv-ecdsa-der: ECDSA over SHA-256 of the canonical JSON of this manifest without signature.value (object keys sorted recursively, no whitespace, arrays in order, strings, booleans and safe integers only), DER encoded."
|
|
272
|
+
},
|
|
273
|
+
"signer": {
|
|
274
|
+
"type": "string"
|
|
275
|
+
},
|
|
276
|
+
"value": {
|
|
277
|
+
"type": "string",
|
|
278
|
+
"minLength": 1
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
"$defs": {
|
|
284
|
+
"dateTime": {
|
|
285
|
+
"type": "string",
|
|
286
|
+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$"
|
|
287
|
+
},
|
|
288
|
+
"outpoint": {
|
|
289
|
+
"type": "object",
|
|
290
|
+
"additionalProperties": false,
|
|
291
|
+
"required": [
|
|
292
|
+
"txid",
|
|
293
|
+
"outputIndex"
|
|
294
|
+
],
|
|
295
|
+
"properties": {
|
|
296
|
+
"txid": {
|
|
297
|
+
"type": "string",
|
|
298
|
+
"pattern": "^[0-9a-f]{64}$"
|
|
299
|
+
},
|
|
300
|
+
"outputIndex": {
|
|
301
|
+
"type": "integer",
|
|
302
|
+
"minimum": 0
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://bsv-blockchain.github.io/dpp/contracts/native-evidence-extension.schema.json",
|
|
4
|
+
"title": "DPP native evidence extension, version 1",
|
|
5
|
+
"description": "A reference, carried inside a credential in an external representation, to evidence that already exists on the native rails (spec/exchange.md section 5). A verifier resolves and verifies each reference independently; the credential's own signature is over these references, so no digest is circular. Identified by urn:bsv:dpp:native-evidence:1.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["type", "passportId", "state", "nativeProfile", "mappingVersion"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"type": { "const": "urn:bsv:dpp:native-evidence:1" },
|
|
11
|
+
"passportId": { "type": "string", "minLength": 1, "maxLength": 512, "description": "The exact passport identifier the referenced state carries in field 3." },
|
|
12
|
+
"state": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"additionalProperties": false,
|
|
15
|
+
"required": ["txid", "outputIndex"],
|
|
16
|
+
"properties": {
|
|
17
|
+
"txid": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
|
|
18
|
+
"outputIndex": { "type": "integer", "minimum": 0 },
|
|
19
|
+
"op": { "enum": ["ACTIVATE", "SOLD", "RESOLD", "REPAIRED", "RECYCLED", "EDIT", "TRANSFER"] }
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"genesis": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"required": ["txid", "outputIndex"],
|
|
26
|
+
"properties": {
|
|
27
|
+
"txid": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
|
|
28
|
+
"outputIndex": { "type": "integer", "minimum": 0 }
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"nativeClaim": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"additionalProperties": false,
|
|
34
|
+
"required": ["representation", "digest"],
|
|
35
|
+
"properties": {
|
|
36
|
+
"representation": { "const": "dpp-lifecycle-json-v1" },
|
|
37
|
+
"digest": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "SHA-256 of the complete signed native claim's canonical bytes, the digest the anchor commits to." },
|
|
38
|
+
"issuer": { "type": "string", "maxLength": 512 },
|
|
39
|
+
"eventType": { "enum": ["Origin", "Transfer", "Transformation", "Disposition"] }
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"anchor": {
|
|
43
|
+
"type": "object",
|
|
44
|
+
"additionalProperties": false,
|
|
45
|
+
"required": ["txid", "outputIndex", "format"],
|
|
46
|
+
"properties": {
|
|
47
|
+
"txid": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
|
|
48
|
+
"outputIndex": { "type": "integer", "minimum": 0 },
|
|
49
|
+
"format": { "const": "bsv-attestation-anchor-v1" },
|
|
50
|
+
"anchoredBy": { "type": "string", "pattern": "^0[23][0-9a-f]{64}$" }
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"nativeProfile": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"required": ["id", "version"],
|
|
57
|
+
"properties": {
|
|
58
|
+
"id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
|
|
59
|
+
"version": { "type": "integer", "minimum": 1 }
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"mappingVersion": { "type": "string", "minLength": 1, "description": "The version of the exchange profile's mapping under which the external credential was produced from the native evidence." },
|
|
63
|
+
"mappingResult": { "enum": ["lossless", "transformed", "unsupported", "insufficient-data"] },
|
|
64
|
+
"losses": { "type": "array", "items": { "type": "string" }, "description": "What the mapping could not carry, in words; never silent." }
|
|
65
|
+
}
|
|
66
|
+
}
|