@openvtc/trust-tasks 0.26.20 → 0.26.21
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/CHANGELOG.md +75 -0
- package/dist/_shared/components.d.ts +327 -16
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/device/list/0.2/payload.d.ts +4 -4
- package/dist/device/list/0.2/payload.d.ts.map +1 -1
- package/dist/device/list/0.2/payload.js +4 -2
- package/dist/device/list/0.2/payload.js.map +1 -1
- package/dist/device/register/0.2/payload.d.ts +4 -4
- package/dist/device/register/0.2/payload.d.ts.map +1 -1
- package/dist/device/register/0.2/payload.js +4 -2
- package/dist/device/register/0.2/payload.js.map +1 -1
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -1
- package/dist/voting/_shared/0.1/voting.d.ts +16 -0
- package/dist/voting/_shared/0.1/voting.d.ts.map +1 -0
- package/dist/voting/_shared/0.1/voting.js +6 -0
- package/dist/voting/_shared/0.1/voting.js.map +1 -0
- package/dist/voting/ballot/cast/0.1/payload.d.ts +887 -0
- package/dist/voting/ballot/cast/0.1/payload.d.ts.map +1 -0
- package/dist/voting/ballot/cast/0.1/payload.js +506 -0
- package/dist/voting/ballot/cast/0.1/payload.js.map +1 -0
- package/dist/voting/board/consistency/0.1/payload.d.ts +389 -0
- package/dist/voting/board/consistency/0.1/payload.d.ts.map +1 -0
- package/dist/voting/board/consistency/0.1/payload.js +218 -0
- package/dist/voting/board/consistency/0.1/payload.js.map +1 -0
- package/dist/voting/board/head/0.1/payload.d.ts +380 -0
- package/dist/voting/board/head/0.1/payload.d.ts.map +1 -0
- package/dist/voting/board/head/0.1/payload.js +224 -0
- package/dist/voting/board/head/0.1/payload.js.map +1 -0
- package/dist/voting/board/inclusion/0.1/payload.d.ts +449 -0
- package/dist/voting/board/inclusion/0.1/payload.d.ts.map +1 -0
- package/dist/voting/board/inclusion/0.1/payload.js +246 -0
- package/dist/voting/board/inclusion/0.1/payload.js.map +1 -0
- package/dist/voting/board/read/0.1/payload.d.ts +1596 -0
- package/dist/voting/board/read/0.1/payload.d.ts.map +1 -0
- package/dist/voting/board/read/0.1/payload.js +920 -0
- package/dist/voting/board/read/0.1/payload.js.map +1 -0
- package/dist/voting/election/cancel/0.1/payload.d.ts +540 -0
- package/dist/voting/election/cancel/0.1/payload.d.ts.map +1 -0
- package/dist/voting/election/cancel/0.1/payload.js +331 -0
- package/dist/voting/election/cancel/0.1/payload.js.map +1 -0
- package/dist/voting/election/close/0.1/payload.d.ts +540 -0
- package/dist/voting/election/close/0.1/payload.d.ts.map +1 -0
- package/dist/voting/election/close/0.1/payload.js +330 -0
- package/dist/voting/election/close/0.1/payload.js.map +1 -0
- package/dist/voting/election/register/0.1/payload.d.ts +1920 -0
- package/dist/voting/election/register/0.1/payload.d.ts.map +1 -0
- package/dist/voting/election/register/0.1/payload.js +1166 -0
- package/dist/voting/election/register/0.1/payload.js.map +1 -0
- package/dist/voting/election/show/0.1/payload.d.ts +1824 -0
- package/dist/voting/election/show/0.1/payload.d.ts.map +1 -0
- package/dist/voting/election/show/0.1/payload.js +1112 -0
- package/dist/voting/election/show/0.1/payload.js.map +1 -0
- package/dist/voting/result/show/0.1/payload.d.ts +849 -0
- package/dist/voting/result/show/0.1/payload.d.ts.map +1 -0
- package/dist/voting/result/show/0.1/payload.js +498 -0
- package/dist/voting/result/show/0.1/payload.js.map +1 -0
- package/dist/vta/_shared/0.1/app-state-record.d.ts +1 -1
- package/dist/vta/_shared/0.1/app-state-record.d.ts.map +1 -1
- package/dist/vta/_shared/0.4/pcs-engine.d.ts +1 -1
- package/dist/vta/_shared/0.4/pcs-engine.d.ts.map +1 -1
- package/dist/vta/app-state/delete/1.0/payload.d.ts +1 -1
- package/dist/vta/app-state/delete/1.0/payload.d.ts.map +1 -1
- package/dist/vta/app-state/get/1.0/payload.d.ts +1 -1
- package/dist/vta/app-state/get/1.0/payload.d.ts.map +1 -1
- package/dist/vta/app-state/get-many/1.0/payload.d.ts +1 -1
- package/dist/vta/app-state/get-many/1.0/payload.d.ts.map +1 -1
- package/dist/vta/app-state/list/1.0/payload.d.ts +1 -1
- package/dist/vta/app-state/list/1.0/payload.d.ts.map +1 -1
- package/dist/vta/app-state/put/1.0/payload.d.ts +1 -1
- package/dist/vta/app-state/put/1.0/payload.d.ts.map +1 -1
- package/dist/vta/app-state/put-many/1.0/payload.d.ts +1 -1
- package/dist/vta/app-state/put-many/1.0/payload.d.ts.map +1 -1
- package/dist/vta/pcs/applications/create/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/applications/create/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/applications/show/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/applications/show/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/attest/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/attest/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/prove/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/prove/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/root-accept/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/root-accept/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/tokens/abandon/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/tokens/abandon/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/tokens/accept/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/tokens/accept/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/verify-attestation/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/verify-attestation/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/vetter/show/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/vetter/show/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/vote/0.1/payload.d.ts +2208 -0
- package/dist/vta/pcs/vote/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/vote/0.1/payload.js +1282 -0
- package/dist/vta/pcs/vote/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/voter/accept/0.1/payload.d.ts +450 -0
- package/dist/vta/pcs/voter/accept/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/voter/accept/0.1/payload.js +247 -0
- package/dist/vta/pcs/voter/accept/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/voter/receipt/0.1/payload.d.ts +531 -0
- package/dist/vta/pcs/voter/receipt/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/voter/receipt/0.1/payload.js +301 -0
- package/dist/vta/pcs/voter/receipt/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/voter/register/0.1/payload.d.ts +1934 -0
- package/dist/vta/pcs/voter/register/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/voter/register/0.1/payload.js +1133 -0
- package/dist/vta/pcs/voter/register/0.1/payload.js.map +1 -0
- package/dist/vtc/directory/card/present/0.1/payload.d.ts +2 -2
- package/dist/vtc/directory/card/present/0.1/payload.js +1 -1
- package/dist/vtc/directory/card/present/0.1/payload.js.map +1 -1
- package/dist/vtc/elections/cancel/0.1/payload.d.ts +301 -0
- package/dist/vtc/elections/cancel/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/cancel/0.1/payload.js +183 -0
- package/dist/vtc/elections/cancel/0.1/payload.js.map +1 -0
- package/dist/vtc/elections/certify/0.1/payload.d.ts +914 -0
- package/dist/vtc/elections/certify/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/certify/0.1/payload.js +512 -0
- package/dist/vtc/elections/certify/0.1/payload.js.map +1 -0
- package/dist/vtc/elections/close/0.1/payload.d.ts +301 -0
- package/dist/vtc/elections/close/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/close/0.1/payload.js +182 -0
- package/dist/vtc/elections/close/0.1/payload.js.map +1 -0
- package/dist/vtc/elections/create/0.1/payload.d.ts +1656 -0
- package/dist/vtc/elections/create/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/create/0.1/payload.js +994 -0
- package/dist/vtc/elections/create/0.1/payload.js.map +1 -0
- package/dist/vtc/elections/list/0.1/payload.d.ts +521 -0
- package/dist/vtc/elections/list/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/list/0.1/payload.js +290 -0
- package/dist/vtc/elections/list/0.1/payload.js.map +1 -0
- package/dist/vtc/elections/show/0.1/payload.d.ts +2688 -0
- package/dist/vtc/elections/show/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/show/0.1/payload.js +1581 -0
- package/dist/vtc/elections/show/0.1/payload.js.map +1 -0
- package/dist/vtc/elections/tickets/issue/0.1/payload.d.ts +597 -0
- package/dist/vtc/elections/tickets/issue/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/tickets/issue/0.1/payload.js +318 -0
- package/dist/vtc/elections/tickets/issue/0.1/payload.js.map +1 -0
- package/dist/vtc/groups/create/0.1/payload.d.ts +4 -4
- package/dist/vtc/groups/create/0.1/payload.js +2 -2
- package/dist/vtc/groups/create/0.1/payload.js.map +1 -1
- package/dist/vtc/groups/list/0.1/payload.d.ts +4 -4
- package/dist/vtc/groups/list/0.1/payload.js +2 -2
- package/dist/vtc/groups/list/0.1/payload.js.map +1 -1
- package/dist/vtc/groups/managers/add/0.1/payload.d.ts +337 -0
- package/dist/vtc/groups/managers/add/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/groups/managers/add/0.1/payload.js +184 -0
- package/dist/vtc/groups/managers/add/0.1/payload.js.map +1 -0
- package/dist/vtc/groups/managers/remove/0.1/payload.d.ts +337 -0
- package/dist/vtc/groups/managers/remove/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/groups/managers/remove/0.1/payload.js +184 -0
- package/dist/vtc/groups/managers/remove/0.1/payload.js.map +1 -0
- package/dist/vtc/groups/show/0.1/payload.d.ts +4 -4
- package/dist/vtc/groups/show/0.1/payload.js +2 -2
- package/dist/vtc/groups/show/0.1/payload.js.map +1 -1
- package/dist/vtc/groups/update/0.1/payload.d.ts +4 -4
- package/dist/vtc/groups/update/0.1/payload.js +2 -2
- package/dist/vtc/groups/update/0.1/payload.js.map +1 -1
- package/package.json +1 -1
- package/src/_shared/components.ts +330 -16
- package/src/device/list/0.2/payload.ts +4 -2
- package/src/device/register/0.2/payload.ts +4 -2
- package/src/index.ts +24 -0
- package/src/voting/_shared/0.1/voting.ts +17 -0
- package/src/voting/ballot/cast/0.1/payload.ts +560 -0
- package/src/voting/board/consistency/0.1/payload.ts +264 -0
- package/src/voting/board/head/0.1/payload.ts +257 -0
- package/src/voting/board/inclusion/0.1/payload.ts +300 -0
- package/src/voting/board/read/0.1/payload.ts +981 -0
- package/src/voting/election/cancel/0.1/payload.ts +368 -0
- package/src/voting/election/close/0.1/payload.ts +367 -0
- package/src/voting/election/register/0.1/payload.ts +1207 -0
- package/src/voting/election/show/0.1/payload.ts +1149 -0
- package/src/voting/result/show/0.1/payload.ts +536 -0
- package/src/vta/_shared/0.1/app-state-record.ts +1 -1
- package/src/vta/_shared/0.4/pcs-engine.ts +1 -1
- package/src/vta/app-state/delete/1.0/payload.ts +1 -1
- package/src/vta/app-state/get/1.0/payload.ts +1 -1
- package/src/vta/app-state/get-many/1.0/payload.ts +1 -1
- package/src/vta/app-state/list/1.0/payload.ts +1 -1
- package/src/vta/app-state/put/1.0/payload.ts +1 -1
- package/src/vta/app-state/put-many/1.0/payload.ts +1 -1
- package/src/vta/pcs/applications/create/0.1/payload.ts +1 -1
- package/src/vta/pcs/applications/show/0.1/payload.ts +1 -1
- package/src/vta/pcs/attest/0.1/payload.ts +1 -1
- package/src/vta/pcs/prove/0.1/payload.ts +1 -1
- package/src/vta/pcs/root-accept/0.1/payload.ts +1 -1
- package/src/vta/pcs/tokens/abandon/0.1/payload.ts +1 -1
- package/src/vta/pcs/tokens/accept/0.1/payload.ts +1 -1
- package/src/vta/pcs/verify-attestation/0.1/payload.ts +1 -1
- package/src/vta/pcs/vetter/show/0.1/payload.ts +1 -1
- package/src/vta/pcs/vote/0.1/payload.ts +1365 -0
- package/src/vta/pcs/voter/accept/0.1/payload.ts +306 -0
- package/src/vta/pcs/voter/receipt/0.1/payload.ts +367 -0
- package/src/vta/pcs/voter/register/0.1/payload.ts +1211 -0
- package/src/vtc/directory/card/present/0.1/payload.ts +1 -1
- package/src/vtc/elections/cancel/0.1/payload.ts +223 -0
- package/src/vtc/elections/certify/0.1/payload.ts +565 -0
- package/src/vtc/elections/close/0.1/payload.ts +222 -0
- package/src/vtc/elections/create/0.1/payload.ts +1041 -0
- package/src/vtc/elections/list/0.1/payload.ts +371 -0
- package/src/vtc/elections/show/0.1/payload.ts +1671 -0
- package/src/vtc/elections/tickets/issue/0.1/payload.ts +394 -0
- package/src/vtc/groups/create/0.1/payload.ts +2 -2
- package/src/vtc/groups/list/0.1/payload.ts +2 -2
- package/src/vtc/groups/managers/add/0.1/payload.ts +230 -0
- package/src/vtc/groups/managers/remove/0.1/payload.ts +230 -0
- package/src/vtc/groups/show/0.1/payload.ts +2 -2
- package/src/vtc/groups/update/0.1/payload.ts +2 -2
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/voting/board/inclusion/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { DigestMultibase, ElectionId, Ext, MerklePath, Multibase_VotingV0_1 as Multibase } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Asks for an RFC 9162 inclusion proof that one board entry is in the tree of a given size.
|
|
11
|
+
*/
|
|
12
|
+
export interface VotingBoardInclusionPayload {
|
|
13
|
+
/**
|
|
14
|
+
* The community's DID.
|
|
15
|
+
*/
|
|
16
|
+
community: string;
|
|
17
|
+
electionId: ElectionId;
|
|
18
|
+
/**
|
|
19
|
+
* The index of the entry to prove.
|
|
20
|
+
*/
|
|
21
|
+
leafIndex: number;
|
|
22
|
+
/**
|
|
23
|
+
* The size of the tree to prove it in — the size of a head the reader holds. Greater than `leafIndex`, at most the current size.
|
|
24
|
+
*/
|
|
25
|
+
treeSize: number;
|
|
26
|
+
/**
|
|
27
|
+
* The `receiptToken` of the voting/ballot/cast receipt for the cast at `leafIndex`. Authorizes this read on a private board; ignored on a public one.
|
|
28
|
+
*/
|
|
29
|
+
receiptToken?: Multibase;
|
|
30
|
+
ext?: Ext;
|
|
31
|
+
}
|
|
32
|
+
export interface VotingBoardInclusionResponsePayload {
|
|
33
|
+
leafIndex: number;
|
|
34
|
+
treeSize: number;
|
|
35
|
+
/**
|
|
36
|
+
* The RFC 9162 leaf hash of the entry at `leafIndex`.
|
|
37
|
+
*/
|
|
38
|
+
entryHash: DigestMultibase;
|
|
39
|
+
/**
|
|
40
|
+
* The RFC 9162 §2.1.3 inclusion proof of `leafIndex` in the tree of `treeSize` entries.
|
|
41
|
+
*/
|
|
42
|
+
path: MerklePath;
|
|
43
|
+
ext?: Ext;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
47
|
+
export type { DigestMultibase, ElectionId, Ext, MerklePath, Multibase };
|
|
48
|
+
|
|
49
|
+
/** Trust Task type URI. */
|
|
50
|
+
export const TYPE_URI = "https://trusttasks.org/spec/voting/board/inclusion/0.1" as const;
|
|
51
|
+
|
|
52
|
+
/** Stable alias for this specification's request payload shape. */
|
|
53
|
+
export type Payload = VotingBoardInclusionPayload;
|
|
54
|
+
|
|
55
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
56
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/voting/board/inclusion/0.1#response" as const;
|
|
57
|
+
|
|
58
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
59
|
+
export type Response = VotingBoardInclusionResponsePayload;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* This specification's payload schema, as a value.
|
|
63
|
+
*
|
|
64
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
65
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
66
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
67
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
68
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
69
|
+
*/
|
|
70
|
+
export const PAYLOAD_SCHEMA = {
|
|
71
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
72
|
+
"$id": "https://trusttasks.org/spec/voting/board/inclusion/0.1",
|
|
73
|
+
"title": "Voting — Board Inclusion — payload",
|
|
74
|
+
"description": "Asks for an RFC 9162 inclusion proof that one board entry is in the tree of a given size.",
|
|
75
|
+
"type": "object",
|
|
76
|
+
"additionalProperties": false,
|
|
77
|
+
"required": [
|
|
78
|
+
"community",
|
|
79
|
+
"electionId",
|
|
80
|
+
"leafIndex",
|
|
81
|
+
"treeSize"
|
|
82
|
+
],
|
|
83
|
+
"properties": {
|
|
84
|
+
"community": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"minLength": 1,
|
|
87
|
+
"maxLength": 2048,
|
|
88
|
+
"description": "The community's DID."
|
|
89
|
+
},
|
|
90
|
+
"electionId": {
|
|
91
|
+
"$ref": "#/$defs/ElectionId"
|
|
92
|
+
},
|
|
93
|
+
"leafIndex": {
|
|
94
|
+
"type": "integer",
|
|
95
|
+
"minimum": 0,
|
|
96
|
+
"description": "The index of the entry to prove."
|
|
97
|
+
},
|
|
98
|
+
"treeSize": {
|
|
99
|
+
"type": "integer",
|
|
100
|
+
"minimum": 1,
|
|
101
|
+
"description": "The size of the tree to prove it in — the size of a head the reader holds. Greater than `leafIndex`, at most the current size."
|
|
102
|
+
},
|
|
103
|
+
"receiptToken": {
|
|
104
|
+
"$ref": "#/$defs/Multibase",
|
|
105
|
+
"description": "The `receiptToken` of the voting/ballot/cast receipt for the cast at `leafIndex`. Authorizes this read on a private board; ignored on a public one."
|
|
106
|
+
},
|
|
107
|
+
"ext": {
|
|
108
|
+
"$ref": "#/$defs/Ext"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"$defs": {
|
|
112
|
+
"Response": {
|
|
113
|
+
"$anchor": "response",
|
|
114
|
+
"title": "Voting — Board Inclusion — response payload",
|
|
115
|
+
"type": "object",
|
|
116
|
+
"additionalProperties": false,
|
|
117
|
+
"required": [
|
|
118
|
+
"leafIndex",
|
|
119
|
+
"treeSize",
|
|
120
|
+
"entryHash",
|
|
121
|
+
"path"
|
|
122
|
+
],
|
|
123
|
+
"properties": {
|
|
124
|
+
"leafIndex": {
|
|
125
|
+
"type": "integer",
|
|
126
|
+
"minimum": 0
|
|
127
|
+
},
|
|
128
|
+
"treeSize": {
|
|
129
|
+
"type": "integer",
|
|
130
|
+
"minimum": 1
|
|
131
|
+
},
|
|
132
|
+
"entryHash": {
|
|
133
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
134
|
+
"description": "The RFC 9162 leaf hash of the entry at `leafIndex`."
|
|
135
|
+
},
|
|
136
|
+
"path": {
|
|
137
|
+
"$ref": "#/$defs/MerklePath",
|
|
138
|
+
"description": "The RFC 9162 §2.1.3 inclusion proof of `leafIndex` in the tree of `treeSize` entries."
|
|
139
|
+
},
|
|
140
|
+
"ext": {
|
|
141
|
+
"$ref": "#/$defs/Ext"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"Ext": {
|
|
146
|
+
"title": "Ext",
|
|
147
|
+
"description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
|
|
148
|
+
"type": "object",
|
|
149
|
+
"minProperties": 1,
|
|
150
|
+
"additionalProperties": true,
|
|
151
|
+
"propertyNames": {
|
|
152
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"MerklePath": {
|
|
156
|
+
"title": "MerklePath",
|
|
157
|
+
"description": "An RFC 9162 audit or consistency path: the node hashes, in the order §2.1.3 / §2.1.4 define.",
|
|
158
|
+
"type": "array",
|
|
159
|
+
"maxItems": 64,
|
|
160
|
+
"items": {
|
|
161
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"DigestMultibase": {
|
|
165
|
+
"title": "DigestMultibase",
|
|
166
|
+
"description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
|
|
167
|
+
"type": "string",
|
|
168
|
+
"minLength": 16,
|
|
169
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
170
|
+
"examples": [
|
|
171
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
"Multibase": {
|
|
175
|
+
"title": "Multibase",
|
|
176
|
+
"description": "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.",
|
|
177
|
+
"type": "string",
|
|
178
|
+
"maxLength": 16384,
|
|
179
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
180
|
+
},
|
|
181
|
+
"ElectionId": {
|
|
182
|
+
"title": "ElectionId",
|
|
183
|
+
"description": "An election's identifier, unique within its community. A closed alphabet: it appears in the ticket class label `voter/<electionId>` and is framed into every hash a cast is bound to.",
|
|
184
|
+
"type": "string",
|
|
185
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
} as const;
|
|
189
|
+
|
|
190
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
191
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
192
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
193
|
+
"$ref": "#/$defs/Response",
|
|
194
|
+
"$defs": {
|
|
195
|
+
"Response": {
|
|
196
|
+
"$anchor": "response",
|
|
197
|
+
"title": "Voting — Board Inclusion — response payload",
|
|
198
|
+
"type": "object",
|
|
199
|
+
"additionalProperties": false,
|
|
200
|
+
"required": [
|
|
201
|
+
"leafIndex",
|
|
202
|
+
"treeSize",
|
|
203
|
+
"entryHash",
|
|
204
|
+
"path"
|
|
205
|
+
],
|
|
206
|
+
"properties": {
|
|
207
|
+
"leafIndex": {
|
|
208
|
+
"type": "integer",
|
|
209
|
+
"minimum": 0
|
|
210
|
+
},
|
|
211
|
+
"treeSize": {
|
|
212
|
+
"type": "integer",
|
|
213
|
+
"minimum": 1
|
|
214
|
+
},
|
|
215
|
+
"entryHash": {
|
|
216
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
217
|
+
"description": "The RFC 9162 leaf hash of the entry at `leafIndex`."
|
|
218
|
+
},
|
|
219
|
+
"path": {
|
|
220
|
+
"$ref": "#/$defs/MerklePath",
|
|
221
|
+
"description": "The RFC 9162 §2.1.3 inclusion proof of `leafIndex` in the tree of `treeSize` entries."
|
|
222
|
+
},
|
|
223
|
+
"ext": {
|
|
224
|
+
"$ref": "#/$defs/Ext"
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"Ext": {
|
|
229
|
+
"title": "Ext",
|
|
230
|
+
"description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
|
|
231
|
+
"type": "object",
|
|
232
|
+
"minProperties": 1,
|
|
233
|
+
"additionalProperties": true,
|
|
234
|
+
"propertyNames": {
|
|
235
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"MerklePath": {
|
|
239
|
+
"title": "MerklePath",
|
|
240
|
+
"description": "An RFC 9162 audit or consistency path: the node hashes, in the order §2.1.3 / §2.1.4 define.",
|
|
241
|
+
"type": "array",
|
|
242
|
+
"maxItems": 64,
|
|
243
|
+
"items": {
|
|
244
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"DigestMultibase": {
|
|
248
|
+
"title": "DigestMultibase",
|
|
249
|
+
"description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
|
|
250
|
+
"type": "string",
|
|
251
|
+
"minLength": 16,
|
|
252
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
253
|
+
"examples": [
|
|
254
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
255
|
+
]
|
|
256
|
+
},
|
|
257
|
+
"Multibase": {
|
|
258
|
+
"title": "Multibase",
|
|
259
|
+
"description": "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.",
|
|
260
|
+
"type": "string",
|
|
261
|
+
"maxLength": 16384,
|
|
262
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
263
|
+
},
|
|
264
|
+
"ElectionId": {
|
|
265
|
+
"title": "ElectionId",
|
|
266
|
+
"description": "An election's identifier, unique within its community. A closed alphabet: it appears in the ticket class label `voter/<electionId>` and is framed into every hash a cast is bound to.",
|
|
267
|
+
"type": "string",
|
|
268
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
} as const;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
275
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
276
|
+
* per-specification and cannot be derived from the document alone, and
|
|
277
|
+
* item 2 needs the schema this carries.
|
|
278
|
+
*/
|
|
279
|
+
export const SPEC = {
|
|
280
|
+
typeUri: TYPE_URI,
|
|
281
|
+
isBearer: false,
|
|
282
|
+
isProofRequired: false,
|
|
283
|
+
isRecipientRequired: true,
|
|
284
|
+
isIssuedAtRequired: false,
|
|
285
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
286
|
+
} as const;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
290
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
291
|
+
* parties (§7.3 item 5).
|
|
292
|
+
*/
|
|
293
|
+
export const RESPONSE_SPEC = {
|
|
294
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
295
|
+
isBearer: false,
|
|
296
|
+
isProofRequired: false,
|
|
297
|
+
isRecipientRequired: false,
|
|
298
|
+
isIssuedAtRequired: false,
|
|
299
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
300
|
+
} as const;
|