@openvtc/trust-tasks 0.26.24 → 0.26.26
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 +93 -0
- package/dist/_shared/components.d.ts +248 -5
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/device/list/0.1/payload.d.ts +4 -4
- package/dist/device/list/0.1/payload.d.ts.map +1 -1
- package/dist/device/list/0.1/payload.js +4 -2
- package/dist/device/list/0.1/payload.js.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.1/payload.d.ts +4 -4
- package/dist/device/register/0.1/payload.d.ts.map +1 -1
- package/dist/device/register/0.1/payload.js +4 -2
- package/dist/device/register/0.1/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 +15 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/rooms/keys/act/0.6/payload.d.ts +546 -0
- package/dist/rooms/keys/act/0.6/payload.d.ts.map +1 -0
- package/dist/rooms/keys/act/0.6/payload.js +305 -0
- package/dist/rooms/keys/act/0.6/payload.js.map +1 -0
- package/dist/voting/_shared/0.1/voting.d.ts +1 -1
- package/dist/voting/_shared/0.1/voting.d.ts.map +1 -1
- package/dist/voting/ballot/cast-encrypted/0.1/payload.d.ts +1166 -0
- package/dist/voting/ballot/cast-encrypted/0.1/payload.d.ts.map +1 -0
- package/dist/voting/ballot/cast-encrypted/0.1/payload.js +690 -0
- package/dist/voting/ballot/cast-encrypted/0.1/payload.js.map +1 -0
- package/dist/voting/board/read/0.1/payload.d.ts +2555 -719
- package/dist/voting/board/read/0.1/payload.d.ts.map +1 -1
- package/dist/voting/board/read/0.1/payload.js +1517 -391
- package/dist/voting/board/read/0.1/payload.js.map +1 -1
- package/dist/voting/election/register/0.1/payload.d.ts +4 -4
- package/dist/voting/election/register/0.1/payload.js +2 -2
- package/dist/voting/election/register/0.1/payload.js.map +1 -1
- package/dist/voting/election/show/0.1/payload.d.ts +4 -4
- package/dist/voting/election/show/0.1/payload.js +2 -2
- package/dist/voting/election/show/0.1/payload.js.map +1 -1
- package/dist/voting/trustees/confirm/0.1/payload.d.ts +620 -0
- package/dist/voting/trustees/confirm/0.1/payload.d.ts.map +1 -0
- package/dist/voting/trustees/confirm/0.1/payload.js +388 -0
- package/dist/voting/trustees/confirm/0.1/payload.js.map +1 -0
- package/dist/voting/trustees/deal/0.1/payload.d.ts +1032 -0
- package/dist/voting/trustees/deal/0.1/payload.d.ts.map +1 -0
- package/dist/voting/trustees/deal/0.1/payload.js +630 -0
- package/dist/voting/trustees/deal/0.1/payload.js.map +1 -0
- package/dist/voting/trustees/decrypt/0.1/payload.d.ts +1009 -0
- package/dist/voting/trustees/decrypt/0.1/payload.d.ts.map +1 -0
- package/dist/voting/trustees/decrypt/0.1/payload.js +623 -0
- package/dist/voting/trustees/decrypt/0.1/payload.js.map +1 -0
- package/dist/voting/trustees/enrol/0.1/payload.d.ts +792 -0
- package/dist/voting/trustees/enrol/0.1/payload.d.ts.map +1 -0
- package/dist/voting/trustees/enrol/0.1/payload.js +490 -0
- package/dist/voting/trustees/enrol/0.1/payload.js.map +1 -0
- package/dist/voting/trustees/justify/0.1/payload.d.ts +642 -0
- package/dist/voting/trustees/justify/0.1/payload.d.ts.map +1 -0
- package/dist/voting/trustees/justify/0.1/payload.js +402 -0
- package/dist/voting/trustees/justify/0.1/payload.js.map +1 -0
- package/dist/voting/trustees/status/0.1/payload.d.ts +1411 -0
- package/dist/voting/trustees/status/0.1/payload.d.ts.map +1 -0
- package/dist/voting/trustees/status/0.1/payload.js +822 -0
- package/dist/voting/trustees/status/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/deal/0.1/payload.d.ts +2005 -0
- package/dist/vta/pcs/trustee/deal/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/deal/0.1/payload.js +1176 -0
- package/dist/vta/pcs/trustee/deal/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/decrypt/0.1/payload.d.ts +736 -0
- package/dist/vta/pcs/trustee/decrypt/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/decrypt/0.1/payload.js +412 -0
- package/dist/vta/pcs/trustee/decrypt/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/enrol/0.1/payload.d.ts +1756 -0
- package/dist/vta/pcs/trustee/enrol/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/enrol/0.1/payload.js +1040 -0
- package/dist/vta/pcs/trustee/enrol/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/justify/0.1/payload.d.ts +504 -0
- package/dist/vta/pcs/trustee/justify/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/justify/0.1/payload.js +274 -0
- package/dist/vta/pcs/trustee/justify/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/keys/0.1/payload.d.ts +2501 -0
- package/dist/vta/pcs/trustee/keys/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/keys/0.1/payload.js +1455 -0
- package/dist/vta/pcs/trustee/keys/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/vote/0.1/payload.d.ts +4 -4
- package/dist/vta/pcs/vote/0.1/payload.js +2 -2
- package/dist/vta/pcs/vote/0.1/payload.js.map +1 -1
- package/dist/vta/pcs/vote-encrypted/0.1/payload.d.ts +2375 -0
- package/dist/vta/pcs/vote-encrypted/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/vote-encrypted/0.1/payload.js +1389 -0
- package/dist/vta/pcs/vote-encrypted/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/voter/register/0.1/payload.d.ts +4 -4
- package/dist/vta/pcs/voter/register/0.1/payload.js +2 -2
- package/dist/vta/pcs/voter/register/0.1/payload.js.map +1 -1
- package/dist/vtc/_shared/0.1/community-room.d.ts +1 -1
- package/dist/vtc/_shared/0.1/community-room.d.ts.map +1 -1
- package/dist/vtc/elections/create/0.1/payload.d.ts +4 -4
- package/dist/vtc/elections/create/0.1/payload.js +2 -2
- package/dist/vtc/elections/create/0.1/payload.js.map +1 -1
- package/dist/vtc/elections/show/0.1/payload.d.ts +4 -4
- package/dist/vtc/elections/show/0.1/payload.js +2 -2
- package/dist/vtc/elections/show/0.1/payload.js.map +1 -1
- package/dist/vtc/groups/bindings/add/0.1/payload.d.ts +4 -4
- package/dist/vtc/groups/bindings/add/0.1/payload.js +2 -2
- package/dist/vtc/groups/bindings/add/0.1/payload.js.map +1 -1
- package/dist/vtc/groups/bindings/list/0.1/payload.d.ts +4 -4
- package/dist/vtc/groups/bindings/list/0.1/payload.js +2 -2
- package/dist/vtc/groups/bindings/list/0.1/payload.js.map +1 -1
- package/dist/vtc/rooms/offers/list/0.3/payload.d.ts +1058 -0
- package/dist/vtc/rooms/offers/list/0.3/payload.d.ts.map +1 -0
- package/dist/vtc/rooms/offers/list/0.3/payload.js +614 -0
- package/dist/vtc/rooms/offers/list/0.3/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_shared/components.ts +263 -5
- package/src/device/list/0.1/payload.ts +4 -2
- package/src/device/list/0.2/payload.ts +4 -2
- package/src/device/register/0.1/payload.ts +4 -2
- package/src/device/register/0.2/payload.ts +4 -2
- package/src/index.ts +15 -0
- package/src/rooms/keys/act/0.6/payload.ts +380 -0
- package/src/voting/_shared/0.1/voting.ts +1 -1
- package/src/voting/ballot/cast-encrypted/0.1/payload.ts +735 -0
- package/src/voting/board/read/0.1/payload.ts +1519 -393
- package/src/voting/election/register/0.1/payload.ts +2 -2
- package/src/voting/election/show/0.1/payload.ts +2 -2
- package/src/voting/trustees/confirm/0.1/payload.ts +429 -0
- package/src/voting/trustees/deal/0.1/payload.ts +665 -0
- package/src/voting/trustees/decrypt/0.1/payload.ts +663 -0
- package/src/voting/trustees/enrol/0.1/payload.ts +525 -0
- package/src/voting/trustees/justify/0.1/payload.ts +439 -0
- package/src/voting/trustees/status/0.1/payload.ts +890 -0
- package/src/vta/pcs/trustee/deal/0.1/payload.ts +1250 -0
- package/src/vta/pcs/trustee/decrypt/0.1/payload.ts +489 -0
- package/src/vta/pcs/trustee/enrol/0.1/payload.ts +1107 -0
- package/src/vta/pcs/trustee/justify/0.1/payload.ts +341 -0
- package/src/vta/pcs/trustee/keys/0.1/payload.ts +1545 -0
- package/src/vta/pcs/vote/0.1/payload.ts +2 -2
- package/src/vta/pcs/vote-encrypted/0.1/payload.ts +1455 -0
- package/src/vta/pcs/voter/register/0.1/payload.ts +2 -2
- package/src/vtc/_shared/0.1/community-room.ts +1 -1
- package/src/vtc/elections/create/0.1/payload.ts +2 -2
- package/src/vtc/elections/show/0.1/payload.ts +2 -2
- package/src/vtc/groups/bindings/add/0.1/payload.ts +2 -2
- package/src/vtc/groups/bindings/list/0.1/payload.ts +2 -2
- package/src/vtc/rooms/offers/list/0.3/payload.ts +663 -0
|
@@ -0,0 +1,1455 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/pcs/trustee/keys/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
/** Trust Task type URI. */
|
|
6
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vta/pcs/trustee/keys/0.1";
|
|
7
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
8
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/pcs/trustee/keys/0.1#response";
|
|
9
|
+
/**
|
|
10
|
+
* This specification's payload schema, as a value.
|
|
11
|
+
*
|
|
12
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
13
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
14
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
15
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
16
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
17
|
+
*/
|
|
18
|
+
export const PAYLOAD_SCHEMA = {
|
|
19
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
20
|
+
"$id": "https://trusttasks.org/spec/vta/pcs/trustee/keys/0.1",
|
|
21
|
+
"title": "VTA PCS — Trustee Keys — payload",
|
|
22
|
+
"description": "The trustee's VTA opens the shares it was dealt, checks each, keeps its share of the election key, and returns the voting/trustees/confirm request signed as the trustee.",
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"required": [
|
|
26
|
+
"contextId",
|
|
27
|
+
"community",
|
|
28
|
+
"electionId",
|
|
29
|
+
"trustee",
|
|
30
|
+
"manifest",
|
|
31
|
+
"dealings"
|
|
32
|
+
],
|
|
33
|
+
"properties": {
|
|
34
|
+
"contextId": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"minLength": 1,
|
|
37
|
+
"maxLength": 256,
|
|
38
|
+
"description": "The VTA context the trustee's keys live in."
|
|
39
|
+
},
|
|
40
|
+
"community": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"minLength": 1,
|
|
43
|
+
"maxLength": 2048,
|
|
44
|
+
"description": "The community's DID."
|
|
45
|
+
},
|
|
46
|
+
"electionId": {
|
|
47
|
+
"$ref": "#/$defs/ElectionId"
|
|
48
|
+
},
|
|
49
|
+
"trustee": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"minLength": 1,
|
|
52
|
+
"maxLength": 2048,
|
|
53
|
+
"description": "The trustee's DID: a persona this VTA holds, named in the manifest's `trustees.dids`."
|
|
54
|
+
},
|
|
55
|
+
"manifest": {
|
|
56
|
+
"$ref": "#/$defs/Manifest"
|
|
57
|
+
},
|
|
58
|
+
"dealings": {
|
|
59
|
+
"type": "array",
|
|
60
|
+
"minItems": 1,
|
|
61
|
+
"maxItems": 64,
|
|
62
|
+
"items": {
|
|
63
|
+
"$ref": "#/$defs/Dealing"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"justifications": {
|
|
67
|
+
"type": "array",
|
|
68
|
+
"maxItems": 64,
|
|
69
|
+
"items": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"additionalProperties": false,
|
|
72
|
+
"required": [
|
|
73
|
+
"dealer",
|
|
74
|
+
"share"
|
|
75
|
+
],
|
|
76
|
+
"properties": {
|
|
77
|
+
"dealer": {
|
|
78
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
79
|
+
},
|
|
80
|
+
"share": {
|
|
81
|
+
"$ref": "#/$defs/GroupScalar"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"description": "Shares dealers revealed in answer to this trustee's complaints."
|
|
86
|
+
},
|
|
87
|
+
"electionKey": {
|
|
88
|
+
"$ref": "#/$defs/ElectionKey"
|
|
89
|
+
},
|
|
90
|
+
"ext": {
|
|
91
|
+
"$ref": "#/$defs/Ext"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"$defs": {
|
|
95
|
+
"Response": {
|
|
96
|
+
"$anchor": "response",
|
|
97
|
+
"title": "VTA PCS — Trustee Keys — response payload",
|
|
98
|
+
"type": "object",
|
|
99
|
+
"additionalProperties": false,
|
|
100
|
+
"required": [
|
|
101
|
+
"complaints",
|
|
102
|
+
"keyHeld"
|
|
103
|
+
],
|
|
104
|
+
"properties": {
|
|
105
|
+
"complaints": {
|
|
106
|
+
"type": "array",
|
|
107
|
+
"maxItems": 64,
|
|
108
|
+
"items": {
|
|
109
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"keyHeld": {
|
|
113
|
+
"type": "boolean",
|
|
114
|
+
"description": "Whether the VTA now holds the trustee's key share, checked against the election key's verification key."
|
|
115
|
+
},
|
|
116
|
+
"document": {
|
|
117
|
+
"title": "ConfirmDocument",
|
|
118
|
+
"description": "The voting/trustees/confirm request, signed as the trustee. Absent once the key share is held.",
|
|
119
|
+
"type": "object",
|
|
120
|
+
"required": [
|
|
121
|
+
"id",
|
|
122
|
+
"type",
|
|
123
|
+
"issuer",
|
|
124
|
+
"recipient",
|
|
125
|
+
"issuedAt",
|
|
126
|
+
"payload",
|
|
127
|
+
"proof"
|
|
128
|
+
],
|
|
129
|
+
"properties": {
|
|
130
|
+
"id": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"pattern": "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
|
|
133
|
+
},
|
|
134
|
+
"type": {
|
|
135
|
+
"const": "https://trusttasks.org/spec/voting/trustees/confirm/0.1"
|
|
136
|
+
},
|
|
137
|
+
"issuer": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"minLength": 1,
|
|
140
|
+
"maxLength": 2048,
|
|
141
|
+
"description": "The signer."
|
|
142
|
+
},
|
|
143
|
+
"recipient": {
|
|
144
|
+
"type": "string",
|
|
145
|
+
"minLength": 1,
|
|
146
|
+
"maxLength": 2048,
|
|
147
|
+
"description": "The ballot box."
|
|
148
|
+
},
|
|
149
|
+
"issuedAt": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"format": "date-time"
|
|
152
|
+
},
|
|
153
|
+
"expiresAt": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"format": "date-time"
|
|
156
|
+
},
|
|
157
|
+
"payload": {
|
|
158
|
+
"type": "object",
|
|
159
|
+
"description": "That task's request payload."
|
|
160
|
+
},
|
|
161
|
+
"proof": {
|
|
162
|
+
"type": "object",
|
|
163
|
+
"description": "A Data Integrity proof by an `authentication` key of `issuer`."
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"ext": {
|
|
168
|
+
"$ref": "#/$defs/Ext"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"Ext": {
|
|
173
|
+
"title": "Ext",
|
|
174
|
+
"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.",
|
|
175
|
+
"type": "object",
|
|
176
|
+
"minProperties": 1,
|
|
177
|
+
"additionalProperties": true,
|
|
178
|
+
"propertyNames": {
|
|
179
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"TrusteeIndex": {
|
|
183
|
+
"title": "TrusteeIndex",
|
|
184
|
+
"description": "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.",
|
|
185
|
+
"type": "integer",
|
|
186
|
+
"minimum": 1,
|
|
187
|
+
"maximum": 64
|
|
188
|
+
},
|
|
189
|
+
"ElectionKey": {
|
|
190
|
+
"title": "ElectionKey",
|
|
191
|
+
"description": "The election key and each trustee's public verification key, computed from the qualified dealings (CONVENTIONS §9.6). Anyone can recompute it from the board.",
|
|
192
|
+
"type": "object",
|
|
193
|
+
"additionalProperties": false,
|
|
194
|
+
"required": [
|
|
195
|
+
"key",
|
|
196
|
+
"qualified",
|
|
197
|
+
"verification"
|
|
198
|
+
],
|
|
199
|
+
"properties": {
|
|
200
|
+
"key": {
|
|
201
|
+
"$ref": "#/$defs/GroupElement"
|
|
202
|
+
},
|
|
203
|
+
"qualified": {
|
|
204
|
+
"type": "array",
|
|
205
|
+
"minItems": 1,
|
|
206
|
+
"maxItems": 64,
|
|
207
|
+
"items": {
|
|
208
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
209
|
+
},
|
|
210
|
+
"description": "The dealers whose dealings the key is formed from."
|
|
211
|
+
},
|
|
212
|
+
"verification": {
|
|
213
|
+
"type": "array",
|
|
214
|
+
"minItems": 2,
|
|
215
|
+
"maxItems": 64,
|
|
216
|
+
"items": {
|
|
217
|
+
"type": "object",
|
|
218
|
+
"additionalProperties": false,
|
|
219
|
+
"required": [
|
|
220
|
+
"trustee",
|
|
221
|
+
"key"
|
|
222
|
+
],
|
|
223
|
+
"properties": {
|
|
224
|
+
"trustee": {
|
|
225
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
226
|
+
},
|
|
227
|
+
"key": {
|
|
228
|
+
"$ref": "#/$defs/GroupElement"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"GroupElement": {
|
|
236
|
+
"title": "GroupElement",
|
|
237
|
+
"description": "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).",
|
|
238
|
+
"type": "string",
|
|
239
|
+
"minLength": 2,
|
|
240
|
+
"maxLength": 64,
|
|
241
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
242
|
+
},
|
|
243
|
+
"GroupScalar": {
|
|
244
|
+
"title": "GroupScalar",
|
|
245
|
+
"description": "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).",
|
|
246
|
+
"type": "string",
|
|
247
|
+
"minLength": 2,
|
|
248
|
+
"maxLength": 64,
|
|
249
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
250
|
+
},
|
|
251
|
+
"Dealing": {
|
|
252
|
+
"title": "Dealing",
|
|
253
|
+
"description": "A trustee's contribution to the election key: Feldman commitments to its polynomial, a proof of knowledge of the constant term, and one share per trustee sealed to that trustee's transport key (CONVENTIONS §9.6).",
|
|
254
|
+
"type": "object",
|
|
255
|
+
"additionalProperties": false,
|
|
256
|
+
"required": [
|
|
257
|
+
"dealer",
|
|
258
|
+
"commitments",
|
|
259
|
+
"pok",
|
|
260
|
+
"shares"
|
|
261
|
+
],
|
|
262
|
+
"properties": {
|
|
263
|
+
"dealer": {
|
|
264
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
265
|
+
},
|
|
266
|
+
"commitments": {
|
|
267
|
+
"type": "array",
|
|
268
|
+
"minItems": 2,
|
|
269
|
+
"maxItems": 64,
|
|
270
|
+
"items": {
|
|
271
|
+
"$ref": "#/$defs/GroupElement"
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
"pok": {
|
|
275
|
+
"$ref": "#/$defs/SigmaProof"
|
|
276
|
+
},
|
|
277
|
+
"shares": {
|
|
278
|
+
"type": "array",
|
|
279
|
+
"minItems": 2,
|
|
280
|
+
"maxItems": 64,
|
|
281
|
+
"items": {
|
|
282
|
+
"$ref": "#/$defs/SealedShare"
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
"SealedShare": {
|
|
288
|
+
"title": "SealedShare",
|
|
289
|
+
"type": "object",
|
|
290
|
+
"additionalProperties": false,
|
|
291
|
+
"required": [
|
|
292
|
+
"recipient",
|
|
293
|
+
"share"
|
|
294
|
+
],
|
|
295
|
+
"properties": {
|
|
296
|
+
"recipient": {
|
|
297
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
298
|
+
},
|
|
299
|
+
"share": {
|
|
300
|
+
"$ref": "#/$defs/SealedPayload"
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
"SealedPayload": {
|
|
305
|
+
"title": "SealedPayload",
|
|
306
|
+
"description": "Bytes sealed to a key: a random group element encrypted as `kem`, and the bytes under ChaCha20-Poly1305 with a key derived from it, multibase base58btc (CONVENTIONS §9.4).",
|
|
307
|
+
"type": "object",
|
|
308
|
+
"additionalProperties": false,
|
|
309
|
+
"required": [
|
|
310
|
+
"kem",
|
|
311
|
+
"body"
|
|
312
|
+
],
|
|
313
|
+
"properties": {
|
|
314
|
+
"kem": {
|
|
315
|
+
"$ref": "#/$defs/ElGamalCiphertext"
|
|
316
|
+
},
|
|
317
|
+
"body": {
|
|
318
|
+
"type": "string",
|
|
319
|
+
"minLength": 2,
|
|
320
|
+
"maxLength": 131072,
|
|
321
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
"ElGamalCiphertext": {
|
|
326
|
+
"title": "ElGamalCiphertext",
|
|
327
|
+
"description": "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).",
|
|
328
|
+
"type": "object",
|
|
329
|
+
"additionalProperties": false,
|
|
330
|
+
"required": [
|
|
331
|
+
"a",
|
|
332
|
+
"b"
|
|
333
|
+
],
|
|
334
|
+
"properties": {
|
|
335
|
+
"a": {
|
|
336
|
+
"$ref": "#/$defs/GroupElement"
|
|
337
|
+
},
|
|
338
|
+
"b": {
|
|
339
|
+
"$ref": "#/$defs/GroupElement"
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
"SigmaProof": {
|
|
344
|
+
"title": "SigmaProof",
|
|
345
|
+
"description": "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).",
|
|
346
|
+
"type": "object",
|
|
347
|
+
"additionalProperties": false,
|
|
348
|
+
"required": [
|
|
349
|
+
"c",
|
|
350
|
+
"z"
|
|
351
|
+
],
|
|
352
|
+
"properties": {
|
|
353
|
+
"c": {
|
|
354
|
+
"$ref": "#/$defs/GroupScalar"
|
|
355
|
+
},
|
|
356
|
+
"z": {
|
|
357
|
+
"$ref": "#/$defs/GroupScalar"
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
"Manifest": {
|
|
362
|
+
"title": "Manifest",
|
|
363
|
+
"description": "What an election asks and how it is decided (VTI-VOT-010). Its digest (`manifestDigest`) is the SHA-256 multihash of its RFC 8785 (JCS) canonicalization, and every cast is bound to it (VTI-VOT-011).",
|
|
364
|
+
"type": "object",
|
|
365
|
+
"additionalProperties": false,
|
|
366
|
+
"required": [
|
|
367
|
+
"electionId",
|
|
368
|
+
"community",
|
|
369
|
+
"questions",
|
|
370
|
+
"secrecy",
|
|
371
|
+
"roll",
|
|
372
|
+
"registrationOpens",
|
|
373
|
+
"votingOpens",
|
|
374
|
+
"votingCloses",
|
|
375
|
+
"revote",
|
|
376
|
+
"board",
|
|
377
|
+
"ballotBox",
|
|
378
|
+
"binding",
|
|
379
|
+
"allowEarlyClose",
|
|
380
|
+
"resultsBeforeClose",
|
|
381
|
+
"textReleaseThreshold"
|
|
382
|
+
],
|
|
383
|
+
"properties": {
|
|
384
|
+
"electionId": {
|
|
385
|
+
"$ref": "#/$defs/ElectionId"
|
|
386
|
+
},
|
|
387
|
+
"community": {
|
|
388
|
+
"type": "string",
|
|
389
|
+
"minLength": 1,
|
|
390
|
+
"maxLength": 2048,
|
|
391
|
+
"description": "The community's DID."
|
|
392
|
+
},
|
|
393
|
+
"title": {
|
|
394
|
+
"type": "string",
|
|
395
|
+
"maxLength": 512
|
|
396
|
+
},
|
|
397
|
+
"description": {
|
|
398
|
+
"type": "string",
|
|
399
|
+
"maxLength": 8192
|
|
400
|
+
},
|
|
401
|
+
"questions": {
|
|
402
|
+
"type": "array",
|
|
403
|
+
"minItems": 1,
|
|
404
|
+
"maxItems": 128,
|
|
405
|
+
"items": {
|
|
406
|
+
"$ref": "#/$defs/Question"
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
"secrecy": {
|
|
410
|
+
"$ref": "#/$defs/SecrecyLevel"
|
|
411
|
+
},
|
|
412
|
+
"roll": {
|
|
413
|
+
"$ref": "#/$defs/RollRule"
|
|
414
|
+
},
|
|
415
|
+
"registrationOpens": {
|
|
416
|
+
"type": "string",
|
|
417
|
+
"format": "date-time"
|
|
418
|
+
},
|
|
419
|
+
"votingOpens": {
|
|
420
|
+
"type": "string",
|
|
421
|
+
"format": "date-time"
|
|
422
|
+
},
|
|
423
|
+
"votingCloses": {
|
|
424
|
+
"type": "string",
|
|
425
|
+
"format": "date-time"
|
|
426
|
+
},
|
|
427
|
+
"revote": {
|
|
428
|
+
"$ref": "#/$defs/Revote"
|
|
429
|
+
},
|
|
430
|
+
"board": {
|
|
431
|
+
"type": "object",
|
|
432
|
+
"additionalProperties": false,
|
|
433
|
+
"required": [
|
|
434
|
+
"visibility",
|
|
435
|
+
"auditors"
|
|
436
|
+
],
|
|
437
|
+
"properties": {
|
|
438
|
+
"visibility": {
|
|
439
|
+
"$ref": "#/$defs/BoardVisibility"
|
|
440
|
+
},
|
|
441
|
+
"auditors": {
|
|
442
|
+
"type": "array",
|
|
443
|
+
"items": {
|
|
444
|
+
"type": "string",
|
|
445
|
+
"minLength": 1,
|
|
446
|
+
"maxLength": 2048
|
|
447
|
+
},
|
|
448
|
+
"uniqueItems": true
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
"ballotBox": {
|
|
453
|
+
"type": "string",
|
|
454
|
+
"minLength": 1,
|
|
455
|
+
"maxLength": 2048,
|
|
456
|
+
"description": "The DID of the voting service that holds the board."
|
|
457
|
+
},
|
|
458
|
+
"trustees": {
|
|
459
|
+
"$ref": "#/$defs/Trustees"
|
|
460
|
+
},
|
|
461
|
+
"binding": {
|
|
462
|
+
"type": "boolean",
|
|
463
|
+
"description": "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081)."
|
|
464
|
+
},
|
|
465
|
+
"allowEarlyClose": {
|
|
466
|
+
"type": "boolean"
|
|
467
|
+
},
|
|
468
|
+
"resultsBeforeClose": {
|
|
469
|
+
"type": "boolean",
|
|
470
|
+
"description": "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061)."
|
|
471
|
+
},
|
|
472
|
+
"textReleaseThreshold": {
|
|
473
|
+
"type": "integer",
|
|
474
|
+
"minimum": 10,
|
|
475
|
+
"description": "Counted ballots required before any text answer is disclosed (VTI-VOT-065)."
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
"Trustees": {
|
|
480
|
+
"title": "Trustees",
|
|
481
|
+
"description": "The trustees of a sealed or tallied-encrypted election and the number of them decryption needs (VTI-VOT-062). Neither the community nor the ballot box may be one.",
|
|
482
|
+
"type": "object",
|
|
483
|
+
"additionalProperties": false,
|
|
484
|
+
"required": [
|
|
485
|
+
"dids",
|
|
486
|
+
"threshold"
|
|
487
|
+
],
|
|
488
|
+
"properties": {
|
|
489
|
+
"dids": {
|
|
490
|
+
"type": "array",
|
|
491
|
+
"minItems": 2,
|
|
492
|
+
"items": {
|
|
493
|
+
"type": "string",
|
|
494
|
+
"minLength": 1,
|
|
495
|
+
"maxLength": 2048
|
|
496
|
+
},
|
|
497
|
+
"uniqueItems": true
|
|
498
|
+
},
|
|
499
|
+
"threshold": {
|
|
500
|
+
"type": "integer",
|
|
501
|
+
"minimum": 2
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
"BoardVisibility": {
|
|
506
|
+
"title": "BoardVisibility",
|
|
507
|
+
"description": "`public`: anyone reads the board. `private`: the community, the auditors the manifest names and, for one cast's inclusion, the holder of its receipt (VTI-VOT-052).",
|
|
508
|
+
"type": "string",
|
|
509
|
+
"enum": [
|
|
510
|
+
"public",
|
|
511
|
+
"private"
|
|
512
|
+
]
|
|
513
|
+
},
|
|
514
|
+
"Revote": {
|
|
515
|
+
"title": "Revote",
|
|
516
|
+
"description": "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).",
|
|
517
|
+
"type": "string",
|
|
518
|
+
"enum": [
|
|
519
|
+
"replace",
|
|
520
|
+
"refuse"
|
|
521
|
+
]
|
|
522
|
+
},
|
|
523
|
+
"RollRule": {
|
|
524
|
+
"title": "RollRule",
|
|
525
|
+
"description": "Who may be issued a ticket (VTI-VOT-021): the community's active members, its active members and the parties `listed` names, or only the parties `listed` names.",
|
|
526
|
+
"type": "object",
|
|
527
|
+
"additionalProperties": false,
|
|
528
|
+
"required": [
|
|
529
|
+
"rule"
|
|
530
|
+
],
|
|
531
|
+
"properties": {
|
|
532
|
+
"rule": {
|
|
533
|
+
"type": "string",
|
|
534
|
+
"enum": [
|
|
535
|
+
"members",
|
|
536
|
+
"membersAndListed",
|
|
537
|
+
"listed"
|
|
538
|
+
]
|
|
539
|
+
},
|
|
540
|
+
"listed": {
|
|
541
|
+
"type": "array",
|
|
542
|
+
"items": {
|
|
543
|
+
"type": "string",
|
|
544
|
+
"minLength": 1,
|
|
545
|
+
"maxLength": 2048,
|
|
546
|
+
"description": "A DID enfranchised by name."
|
|
547
|
+
},
|
|
548
|
+
"uniqueItems": true
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
},
|
|
552
|
+
"SecrecyLevel": {
|
|
553
|
+
"title": "SecrecyLevel",
|
|
554
|
+
"description": "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060). The encrypted levels are cast with `voting/ballot/cast-encrypted/0.1`, under an election key the trustees generate with `voting/trustees/*` (CONVENTIONS §9).",
|
|
555
|
+
"type": "string",
|
|
556
|
+
"enum": [
|
|
557
|
+
"open",
|
|
558
|
+
"sealed",
|
|
559
|
+
"talliedEncrypted"
|
|
560
|
+
]
|
|
561
|
+
},
|
|
562
|
+
"Question": {
|
|
563
|
+
"title": "Question",
|
|
564
|
+
"description": "One question. Tagged union over `type`.",
|
|
565
|
+
"oneOf": [
|
|
566
|
+
{
|
|
567
|
+
"title": "ChoiceQuestion",
|
|
568
|
+
"description": "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.",
|
|
569
|
+
"type": "object",
|
|
570
|
+
"additionalProperties": false,
|
|
571
|
+
"required": [
|
|
572
|
+
"key",
|
|
573
|
+
"type",
|
|
574
|
+
"options",
|
|
575
|
+
"minSelections",
|
|
576
|
+
"maxSelections",
|
|
577
|
+
"optional"
|
|
578
|
+
],
|
|
579
|
+
"properties": {
|
|
580
|
+
"key": {
|
|
581
|
+
"$ref": "#/$defs/Key"
|
|
582
|
+
},
|
|
583
|
+
"type": {
|
|
584
|
+
"const": "choice"
|
|
585
|
+
},
|
|
586
|
+
"text": {
|
|
587
|
+
"type": "string",
|
|
588
|
+
"maxLength": 2048
|
|
589
|
+
},
|
|
590
|
+
"options": {
|
|
591
|
+
"type": "array",
|
|
592
|
+
"minItems": 2,
|
|
593
|
+
"maxItems": 256,
|
|
594
|
+
"items": {
|
|
595
|
+
"$ref": "#/$defs/QuestionOption"
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
"minSelections": {
|
|
599
|
+
"type": "integer",
|
|
600
|
+
"minimum": 0
|
|
601
|
+
},
|
|
602
|
+
"maxSelections": {
|
|
603
|
+
"type": "integer",
|
|
604
|
+
"minimum": 1
|
|
605
|
+
},
|
|
606
|
+
"optional": {
|
|
607
|
+
"type": "boolean"
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
"title": "RankingQuestion",
|
|
613
|
+
"description": "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.",
|
|
614
|
+
"type": "object",
|
|
615
|
+
"additionalProperties": false,
|
|
616
|
+
"required": [
|
|
617
|
+
"key",
|
|
618
|
+
"type",
|
|
619
|
+
"options",
|
|
620
|
+
"partial",
|
|
621
|
+
"optional"
|
|
622
|
+
],
|
|
623
|
+
"properties": {
|
|
624
|
+
"key": {
|
|
625
|
+
"$ref": "#/$defs/Key"
|
|
626
|
+
},
|
|
627
|
+
"type": {
|
|
628
|
+
"const": "ranking"
|
|
629
|
+
},
|
|
630
|
+
"text": {
|
|
631
|
+
"type": "string",
|
|
632
|
+
"maxLength": 2048
|
|
633
|
+
},
|
|
634
|
+
"options": {
|
|
635
|
+
"type": "array",
|
|
636
|
+
"minItems": 2,
|
|
637
|
+
"maxItems": 64,
|
|
638
|
+
"items": {
|
|
639
|
+
"$ref": "#/$defs/QuestionOption"
|
|
640
|
+
}
|
|
641
|
+
},
|
|
642
|
+
"partial": {
|
|
643
|
+
"type": "boolean"
|
|
644
|
+
},
|
|
645
|
+
"optional": {
|
|
646
|
+
"type": "boolean"
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
"title": "ScoreQuestion",
|
|
652
|
+
"description": "Give each option an integer score within [min, max].",
|
|
653
|
+
"type": "object",
|
|
654
|
+
"additionalProperties": false,
|
|
655
|
+
"required": [
|
|
656
|
+
"key",
|
|
657
|
+
"type",
|
|
658
|
+
"options",
|
|
659
|
+
"min",
|
|
660
|
+
"max",
|
|
661
|
+
"optional"
|
|
662
|
+
],
|
|
663
|
+
"properties": {
|
|
664
|
+
"key": {
|
|
665
|
+
"$ref": "#/$defs/Key"
|
|
666
|
+
},
|
|
667
|
+
"type": {
|
|
668
|
+
"const": "score"
|
|
669
|
+
},
|
|
670
|
+
"text": {
|
|
671
|
+
"type": "string",
|
|
672
|
+
"maxLength": 2048
|
|
673
|
+
},
|
|
674
|
+
"options": {
|
|
675
|
+
"type": "array",
|
|
676
|
+
"minItems": 1,
|
|
677
|
+
"maxItems": 256,
|
|
678
|
+
"items": {
|
|
679
|
+
"$ref": "#/$defs/QuestionOption"
|
|
680
|
+
}
|
|
681
|
+
},
|
|
682
|
+
"min": {
|
|
683
|
+
"type": "integer"
|
|
684
|
+
},
|
|
685
|
+
"max": {
|
|
686
|
+
"type": "integer"
|
|
687
|
+
},
|
|
688
|
+
"optional": {
|
|
689
|
+
"type": "boolean"
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
"title": "TextQuestion",
|
|
695
|
+
"description": "Free text of at most `maxLength` characters.",
|
|
696
|
+
"type": "object",
|
|
697
|
+
"additionalProperties": false,
|
|
698
|
+
"required": [
|
|
699
|
+
"key",
|
|
700
|
+
"type",
|
|
701
|
+
"maxLength",
|
|
702
|
+
"optional"
|
|
703
|
+
],
|
|
704
|
+
"properties": {
|
|
705
|
+
"key": {
|
|
706
|
+
"$ref": "#/$defs/Key"
|
|
707
|
+
},
|
|
708
|
+
"type": {
|
|
709
|
+
"const": "text"
|
|
710
|
+
},
|
|
711
|
+
"text": {
|
|
712
|
+
"type": "string",
|
|
713
|
+
"maxLength": 2048
|
|
714
|
+
},
|
|
715
|
+
"maxLength": {
|
|
716
|
+
"type": "integer",
|
|
717
|
+
"minimum": 1,
|
|
718
|
+
"maximum": 4096
|
|
719
|
+
},
|
|
720
|
+
"optional": {
|
|
721
|
+
"type": "boolean"
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
]
|
|
726
|
+
},
|
|
727
|
+
"Key": {
|
|
728
|
+
"title": "Key",
|
|
729
|
+
"description": "A question or option key, unique within its manifest or question.",
|
|
730
|
+
"type": "string",
|
|
731
|
+
"pattern": "^[A-Za-z0-9._-]{1,64}$"
|
|
732
|
+
},
|
|
733
|
+
"QuestionOption": {
|
|
734
|
+
"title": "QuestionOption",
|
|
735
|
+
"type": "object",
|
|
736
|
+
"additionalProperties": false,
|
|
737
|
+
"required": [
|
|
738
|
+
"key"
|
|
739
|
+
],
|
|
740
|
+
"properties": {
|
|
741
|
+
"key": {
|
|
742
|
+
"$ref": "#/$defs/Key"
|
|
743
|
+
},
|
|
744
|
+
"label": {
|
|
745
|
+
"type": "string",
|
|
746
|
+
"maxLength": 512,
|
|
747
|
+
"description": "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014)."
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
},
|
|
751
|
+
"ElectionId": {
|
|
752
|
+
"title": "ElectionId",
|
|
753
|
+
"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.",
|
|
754
|
+
"type": "string",
|
|
755
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
};
|
|
759
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
760
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
761
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
762
|
+
"$ref": "#/$defs/Response",
|
|
763
|
+
"$defs": {
|
|
764
|
+
"Response": {
|
|
765
|
+
"$anchor": "response",
|
|
766
|
+
"title": "VTA PCS — Trustee Keys — response payload",
|
|
767
|
+
"type": "object",
|
|
768
|
+
"additionalProperties": false,
|
|
769
|
+
"required": [
|
|
770
|
+
"complaints",
|
|
771
|
+
"keyHeld"
|
|
772
|
+
],
|
|
773
|
+
"properties": {
|
|
774
|
+
"complaints": {
|
|
775
|
+
"type": "array",
|
|
776
|
+
"maxItems": 64,
|
|
777
|
+
"items": {
|
|
778
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
779
|
+
}
|
|
780
|
+
},
|
|
781
|
+
"keyHeld": {
|
|
782
|
+
"type": "boolean",
|
|
783
|
+
"description": "Whether the VTA now holds the trustee's key share, checked against the election key's verification key."
|
|
784
|
+
},
|
|
785
|
+
"document": {
|
|
786
|
+
"title": "ConfirmDocument",
|
|
787
|
+
"description": "The voting/trustees/confirm request, signed as the trustee. Absent once the key share is held.",
|
|
788
|
+
"type": "object",
|
|
789
|
+
"required": [
|
|
790
|
+
"id",
|
|
791
|
+
"type",
|
|
792
|
+
"issuer",
|
|
793
|
+
"recipient",
|
|
794
|
+
"issuedAt",
|
|
795
|
+
"payload",
|
|
796
|
+
"proof"
|
|
797
|
+
],
|
|
798
|
+
"properties": {
|
|
799
|
+
"id": {
|
|
800
|
+
"type": "string",
|
|
801
|
+
"pattern": "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
|
|
802
|
+
},
|
|
803
|
+
"type": {
|
|
804
|
+
"const": "https://trusttasks.org/spec/voting/trustees/confirm/0.1"
|
|
805
|
+
},
|
|
806
|
+
"issuer": {
|
|
807
|
+
"type": "string",
|
|
808
|
+
"minLength": 1,
|
|
809
|
+
"maxLength": 2048,
|
|
810
|
+
"description": "The signer."
|
|
811
|
+
},
|
|
812
|
+
"recipient": {
|
|
813
|
+
"type": "string",
|
|
814
|
+
"minLength": 1,
|
|
815
|
+
"maxLength": 2048,
|
|
816
|
+
"description": "The ballot box."
|
|
817
|
+
},
|
|
818
|
+
"issuedAt": {
|
|
819
|
+
"type": "string",
|
|
820
|
+
"format": "date-time"
|
|
821
|
+
},
|
|
822
|
+
"expiresAt": {
|
|
823
|
+
"type": "string",
|
|
824
|
+
"format": "date-time"
|
|
825
|
+
},
|
|
826
|
+
"payload": {
|
|
827
|
+
"type": "object",
|
|
828
|
+
"description": "That task's request payload."
|
|
829
|
+
},
|
|
830
|
+
"proof": {
|
|
831
|
+
"type": "object",
|
|
832
|
+
"description": "A Data Integrity proof by an `authentication` key of `issuer`."
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
},
|
|
836
|
+
"ext": {
|
|
837
|
+
"$ref": "#/$defs/Ext"
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
},
|
|
841
|
+
"Ext": {
|
|
842
|
+
"title": "Ext",
|
|
843
|
+
"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.",
|
|
844
|
+
"type": "object",
|
|
845
|
+
"minProperties": 1,
|
|
846
|
+
"additionalProperties": true,
|
|
847
|
+
"propertyNames": {
|
|
848
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
849
|
+
}
|
|
850
|
+
},
|
|
851
|
+
"TrusteeIndex": {
|
|
852
|
+
"title": "TrusteeIndex",
|
|
853
|
+
"description": "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.",
|
|
854
|
+
"type": "integer",
|
|
855
|
+
"minimum": 1,
|
|
856
|
+
"maximum": 64
|
|
857
|
+
},
|
|
858
|
+
"ElectionKey": {
|
|
859
|
+
"title": "ElectionKey",
|
|
860
|
+
"description": "The election key and each trustee's public verification key, computed from the qualified dealings (CONVENTIONS §9.6). Anyone can recompute it from the board.",
|
|
861
|
+
"type": "object",
|
|
862
|
+
"additionalProperties": false,
|
|
863
|
+
"required": [
|
|
864
|
+
"key",
|
|
865
|
+
"qualified",
|
|
866
|
+
"verification"
|
|
867
|
+
],
|
|
868
|
+
"properties": {
|
|
869
|
+
"key": {
|
|
870
|
+
"$ref": "#/$defs/GroupElement"
|
|
871
|
+
},
|
|
872
|
+
"qualified": {
|
|
873
|
+
"type": "array",
|
|
874
|
+
"minItems": 1,
|
|
875
|
+
"maxItems": 64,
|
|
876
|
+
"items": {
|
|
877
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
878
|
+
},
|
|
879
|
+
"description": "The dealers whose dealings the key is formed from."
|
|
880
|
+
},
|
|
881
|
+
"verification": {
|
|
882
|
+
"type": "array",
|
|
883
|
+
"minItems": 2,
|
|
884
|
+
"maxItems": 64,
|
|
885
|
+
"items": {
|
|
886
|
+
"type": "object",
|
|
887
|
+
"additionalProperties": false,
|
|
888
|
+
"required": [
|
|
889
|
+
"trustee",
|
|
890
|
+
"key"
|
|
891
|
+
],
|
|
892
|
+
"properties": {
|
|
893
|
+
"trustee": {
|
|
894
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
895
|
+
},
|
|
896
|
+
"key": {
|
|
897
|
+
"$ref": "#/$defs/GroupElement"
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
},
|
|
904
|
+
"GroupElement": {
|
|
905
|
+
"title": "GroupElement",
|
|
906
|
+
"description": "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).",
|
|
907
|
+
"type": "string",
|
|
908
|
+
"minLength": 2,
|
|
909
|
+
"maxLength": 64,
|
|
910
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
911
|
+
},
|
|
912
|
+
"GroupScalar": {
|
|
913
|
+
"title": "GroupScalar",
|
|
914
|
+
"description": "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).",
|
|
915
|
+
"type": "string",
|
|
916
|
+
"minLength": 2,
|
|
917
|
+
"maxLength": 64,
|
|
918
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
919
|
+
},
|
|
920
|
+
"Dealing": {
|
|
921
|
+
"title": "Dealing",
|
|
922
|
+
"description": "A trustee's contribution to the election key: Feldman commitments to its polynomial, a proof of knowledge of the constant term, and one share per trustee sealed to that trustee's transport key (CONVENTIONS §9.6).",
|
|
923
|
+
"type": "object",
|
|
924
|
+
"additionalProperties": false,
|
|
925
|
+
"required": [
|
|
926
|
+
"dealer",
|
|
927
|
+
"commitments",
|
|
928
|
+
"pok",
|
|
929
|
+
"shares"
|
|
930
|
+
],
|
|
931
|
+
"properties": {
|
|
932
|
+
"dealer": {
|
|
933
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
934
|
+
},
|
|
935
|
+
"commitments": {
|
|
936
|
+
"type": "array",
|
|
937
|
+
"minItems": 2,
|
|
938
|
+
"maxItems": 64,
|
|
939
|
+
"items": {
|
|
940
|
+
"$ref": "#/$defs/GroupElement"
|
|
941
|
+
}
|
|
942
|
+
},
|
|
943
|
+
"pok": {
|
|
944
|
+
"$ref": "#/$defs/SigmaProof"
|
|
945
|
+
},
|
|
946
|
+
"shares": {
|
|
947
|
+
"type": "array",
|
|
948
|
+
"minItems": 2,
|
|
949
|
+
"maxItems": 64,
|
|
950
|
+
"items": {
|
|
951
|
+
"$ref": "#/$defs/SealedShare"
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
},
|
|
956
|
+
"SealedShare": {
|
|
957
|
+
"title": "SealedShare",
|
|
958
|
+
"type": "object",
|
|
959
|
+
"additionalProperties": false,
|
|
960
|
+
"required": [
|
|
961
|
+
"recipient",
|
|
962
|
+
"share"
|
|
963
|
+
],
|
|
964
|
+
"properties": {
|
|
965
|
+
"recipient": {
|
|
966
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
967
|
+
},
|
|
968
|
+
"share": {
|
|
969
|
+
"$ref": "#/$defs/SealedPayload"
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
},
|
|
973
|
+
"SealedPayload": {
|
|
974
|
+
"title": "SealedPayload",
|
|
975
|
+
"description": "Bytes sealed to a key: a random group element encrypted as `kem`, and the bytes under ChaCha20-Poly1305 with a key derived from it, multibase base58btc (CONVENTIONS §9.4).",
|
|
976
|
+
"type": "object",
|
|
977
|
+
"additionalProperties": false,
|
|
978
|
+
"required": [
|
|
979
|
+
"kem",
|
|
980
|
+
"body"
|
|
981
|
+
],
|
|
982
|
+
"properties": {
|
|
983
|
+
"kem": {
|
|
984
|
+
"$ref": "#/$defs/ElGamalCiphertext"
|
|
985
|
+
},
|
|
986
|
+
"body": {
|
|
987
|
+
"type": "string",
|
|
988
|
+
"minLength": 2,
|
|
989
|
+
"maxLength": 131072,
|
|
990
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
},
|
|
994
|
+
"ElGamalCiphertext": {
|
|
995
|
+
"title": "ElGamalCiphertext",
|
|
996
|
+
"description": "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).",
|
|
997
|
+
"type": "object",
|
|
998
|
+
"additionalProperties": false,
|
|
999
|
+
"required": [
|
|
1000
|
+
"a",
|
|
1001
|
+
"b"
|
|
1002
|
+
],
|
|
1003
|
+
"properties": {
|
|
1004
|
+
"a": {
|
|
1005
|
+
"$ref": "#/$defs/GroupElement"
|
|
1006
|
+
},
|
|
1007
|
+
"b": {
|
|
1008
|
+
"$ref": "#/$defs/GroupElement"
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
},
|
|
1012
|
+
"SigmaProof": {
|
|
1013
|
+
"title": "SigmaProof",
|
|
1014
|
+
"description": "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).",
|
|
1015
|
+
"type": "object",
|
|
1016
|
+
"additionalProperties": false,
|
|
1017
|
+
"required": [
|
|
1018
|
+
"c",
|
|
1019
|
+
"z"
|
|
1020
|
+
],
|
|
1021
|
+
"properties": {
|
|
1022
|
+
"c": {
|
|
1023
|
+
"$ref": "#/$defs/GroupScalar"
|
|
1024
|
+
},
|
|
1025
|
+
"z": {
|
|
1026
|
+
"$ref": "#/$defs/GroupScalar"
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
},
|
|
1030
|
+
"Manifest": {
|
|
1031
|
+
"title": "Manifest",
|
|
1032
|
+
"description": "What an election asks and how it is decided (VTI-VOT-010). Its digest (`manifestDigest`) is the SHA-256 multihash of its RFC 8785 (JCS) canonicalization, and every cast is bound to it (VTI-VOT-011).",
|
|
1033
|
+
"type": "object",
|
|
1034
|
+
"additionalProperties": false,
|
|
1035
|
+
"required": [
|
|
1036
|
+
"electionId",
|
|
1037
|
+
"community",
|
|
1038
|
+
"questions",
|
|
1039
|
+
"secrecy",
|
|
1040
|
+
"roll",
|
|
1041
|
+
"registrationOpens",
|
|
1042
|
+
"votingOpens",
|
|
1043
|
+
"votingCloses",
|
|
1044
|
+
"revote",
|
|
1045
|
+
"board",
|
|
1046
|
+
"ballotBox",
|
|
1047
|
+
"binding",
|
|
1048
|
+
"allowEarlyClose",
|
|
1049
|
+
"resultsBeforeClose",
|
|
1050
|
+
"textReleaseThreshold"
|
|
1051
|
+
],
|
|
1052
|
+
"properties": {
|
|
1053
|
+
"electionId": {
|
|
1054
|
+
"$ref": "#/$defs/ElectionId"
|
|
1055
|
+
},
|
|
1056
|
+
"community": {
|
|
1057
|
+
"type": "string",
|
|
1058
|
+
"minLength": 1,
|
|
1059
|
+
"maxLength": 2048,
|
|
1060
|
+
"description": "The community's DID."
|
|
1061
|
+
},
|
|
1062
|
+
"title": {
|
|
1063
|
+
"type": "string",
|
|
1064
|
+
"maxLength": 512
|
|
1065
|
+
},
|
|
1066
|
+
"description": {
|
|
1067
|
+
"type": "string",
|
|
1068
|
+
"maxLength": 8192
|
|
1069
|
+
},
|
|
1070
|
+
"questions": {
|
|
1071
|
+
"type": "array",
|
|
1072
|
+
"minItems": 1,
|
|
1073
|
+
"maxItems": 128,
|
|
1074
|
+
"items": {
|
|
1075
|
+
"$ref": "#/$defs/Question"
|
|
1076
|
+
}
|
|
1077
|
+
},
|
|
1078
|
+
"secrecy": {
|
|
1079
|
+
"$ref": "#/$defs/SecrecyLevel"
|
|
1080
|
+
},
|
|
1081
|
+
"roll": {
|
|
1082
|
+
"$ref": "#/$defs/RollRule"
|
|
1083
|
+
},
|
|
1084
|
+
"registrationOpens": {
|
|
1085
|
+
"type": "string",
|
|
1086
|
+
"format": "date-time"
|
|
1087
|
+
},
|
|
1088
|
+
"votingOpens": {
|
|
1089
|
+
"type": "string",
|
|
1090
|
+
"format": "date-time"
|
|
1091
|
+
},
|
|
1092
|
+
"votingCloses": {
|
|
1093
|
+
"type": "string",
|
|
1094
|
+
"format": "date-time"
|
|
1095
|
+
},
|
|
1096
|
+
"revote": {
|
|
1097
|
+
"$ref": "#/$defs/Revote"
|
|
1098
|
+
},
|
|
1099
|
+
"board": {
|
|
1100
|
+
"type": "object",
|
|
1101
|
+
"additionalProperties": false,
|
|
1102
|
+
"required": [
|
|
1103
|
+
"visibility",
|
|
1104
|
+
"auditors"
|
|
1105
|
+
],
|
|
1106
|
+
"properties": {
|
|
1107
|
+
"visibility": {
|
|
1108
|
+
"$ref": "#/$defs/BoardVisibility"
|
|
1109
|
+
},
|
|
1110
|
+
"auditors": {
|
|
1111
|
+
"type": "array",
|
|
1112
|
+
"items": {
|
|
1113
|
+
"type": "string",
|
|
1114
|
+
"minLength": 1,
|
|
1115
|
+
"maxLength": 2048
|
|
1116
|
+
},
|
|
1117
|
+
"uniqueItems": true
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
},
|
|
1121
|
+
"ballotBox": {
|
|
1122
|
+
"type": "string",
|
|
1123
|
+
"minLength": 1,
|
|
1124
|
+
"maxLength": 2048,
|
|
1125
|
+
"description": "The DID of the voting service that holds the board."
|
|
1126
|
+
},
|
|
1127
|
+
"trustees": {
|
|
1128
|
+
"$ref": "#/$defs/Trustees"
|
|
1129
|
+
},
|
|
1130
|
+
"binding": {
|
|
1131
|
+
"type": "boolean",
|
|
1132
|
+
"description": "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081)."
|
|
1133
|
+
},
|
|
1134
|
+
"allowEarlyClose": {
|
|
1135
|
+
"type": "boolean"
|
|
1136
|
+
},
|
|
1137
|
+
"resultsBeforeClose": {
|
|
1138
|
+
"type": "boolean",
|
|
1139
|
+
"description": "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061)."
|
|
1140
|
+
},
|
|
1141
|
+
"textReleaseThreshold": {
|
|
1142
|
+
"type": "integer",
|
|
1143
|
+
"minimum": 10,
|
|
1144
|
+
"description": "Counted ballots required before any text answer is disclosed (VTI-VOT-065)."
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
},
|
|
1148
|
+
"Trustees": {
|
|
1149
|
+
"title": "Trustees",
|
|
1150
|
+
"description": "The trustees of a sealed or tallied-encrypted election and the number of them decryption needs (VTI-VOT-062). Neither the community nor the ballot box may be one.",
|
|
1151
|
+
"type": "object",
|
|
1152
|
+
"additionalProperties": false,
|
|
1153
|
+
"required": [
|
|
1154
|
+
"dids",
|
|
1155
|
+
"threshold"
|
|
1156
|
+
],
|
|
1157
|
+
"properties": {
|
|
1158
|
+
"dids": {
|
|
1159
|
+
"type": "array",
|
|
1160
|
+
"minItems": 2,
|
|
1161
|
+
"items": {
|
|
1162
|
+
"type": "string",
|
|
1163
|
+
"minLength": 1,
|
|
1164
|
+
"maxLength": 2048
|
|
1165
|
+
},
|
|
1166
|
+
"uniqueItems": true
|
|
1167
|
+
},
|
|
1168
|
+
"threshold": {
|
|
1169
|
+
"type": "integer",
|
|
1170
|
+
"minimum": 2
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
},
|
|
1174
|
+
"BoardVisibility": {
|
|
1175
|
+
"title": "BoardVisibility",
|
|
1176
|
+
"description": "`public`: anyone reads the board. `private`: the community, the auditors the manifest names and, for one cast's inclusion, the holder of its receipt (VTI-VOT-052).",
|
|
1177
|
+
"type": "string",
|
|
1178
|
+
"enum": [
|
|
1179
|
+
"public",
|
|
1180
|
+
"private"
|
|
1181
|
+
]
|
|
1182
|
+
},
|
|
1183
|
+
"Revote": {
|
|
1184
|
+
"title": "Revote",
|
|
1185
|
+
"description": "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).",
|
|
1186
|
+
"type": "string",
|
|
1187
|
+
"enum": [
|
|
1188
|
+
"replace",
|
|
1189
|
+
"refuse"
|
|
1190
|
+
]
|
|
1191
|
+
},
|
|
1192
|
+
"RollRule": {
|
|
1193
|
+
"title": "RollRule",
|
|
1194
|
+
"description": "Who may be issued a ticket (VTI-VOT-021): the community's active members, its active members and the parties `listed` names, or only the parties `listed` names.",
|
|
1195
|
+
"type": "object",
|
|
1196
|
+
"additionalProperties": false,
|
|
1197
|
+
"required": [
|
|
1198
|
+
"rule"
|
|
1199
|
+
],
|
|
1200
|
+
"properties": {
|
|
1201
|
+
"rule": {
|
|
1202
|
+
"type": "string",
|
|
1203
|
+
"enum": [
|
|
1204
|
+
"members",
|
|
1205
|
+
"membersAndListed",
|
|
1206
|
+
"listed"
|
|
1207
|
+
]
|
|
1208
|
+
},
|
|
1209
|
+
"listed": {
|
|
1210
|
+
"type": "array",
|
|
1211
|
+
"items": {
|
|
1212
|
+
"type": "string",
|
|
1213
|
+
"minLength": 1,
|
|
1214
|
+
"maxLength": 2048,
|
|
1215
|
+
"description": "A DID enfranchised by name."
|
|
1216
|
+
},
|
|
1217
|
+
"uniqueItems": true
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
},
|
|
1221
|
+
"SecrecyLevel": {
|
|
1222
|
+
"title": "SecrecyLevel",
|
|
1223
|
+
"description": "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060). The encrypted levels are cast with `voting/ballot/cast-encrypted/0.1`, under an election key the trustees generate with `voting/trustees/*` (CONVENTIONS §9).",
|
|
1224
|
+
"type": "string",
|
|
1225
|
+
"enum": [
|
|
1226
|
+
"open",
|
|
1227
|
+
"sealed",
|
|
1228
|
+
"talliedEncrypted"
|
|
1229
|
+
]
|
|
1230
|
+
},
|
|
1231
|
+
"Question": {
|
|
1232
|
+
"title": "Question",
|
|
1233
|
+
"description": "One question. Tagged union over `type`.",
|
|
1234
|
+
"oneOf": [
|
|
1235
|
+
{
|
|
1236
|
+
"title": "ChoiceQuestion",
|
|
1237
|
+
"description": "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.",
|
|
1238
|
+
"type": "object",
|
|
1239
|
+
"additionalProperties": false,
|
|
1240
|
+
"required": [
|
|
1241
|
+
"key",
|
|
1242
|
+
"type",
|
|
1243
|
+
"options",
|
|
1244
|
+
"minSelections",
|
|
1245
|
+
"maxSelections",
|
|
1246
|
+
"optional"
|
|
1247
|
+
],
|
|
1248
|
+
"properties": {
|
|
1249
|
+
"key": {
|
|
1250
|
+
"$ref": "#/$defs/Key"
|
|
1251
|
+
},
|
|
1252
|
+
"type": {
|
|
1253
|
+
"const": "choice"
|
|
1254
|
+
},
|
|
1255
|
+
"text": {
|
|
1256
|
+
"type": "string",
|
|
1257
|
+
"maxLength": 2048
|
|
1258
|
+
},
|
|
1259
|
+
"options": {
|
|
1260
|
+
"type": "array",
|
|
1261
|
+
"minItems": 2,
|
|
1262
|
+
"maxItems": 256,
|
|
1263
|
+
"items": {
|
|
1264
|
+
"$ref": "#/$defs/QuestionOption"
|
|
1265
|
+
}
|
|
1266
|
+
},
|
|
1267
|
+
"minSelections": {
|
|
1268
|
+
"type": "integer",
|
|
1269
|
+
"minimum": 0
|
|
1270
|
+
},
|
|
1271
|
+
"maxSelections": {
|
|
1272
|
+
"type": "integer",
|
|
1273
|
+
"minimum": 1
|
|
1274
|
+
},
|
|
1275
|
+
"optional": {
|
|
1276
|
+
"type": "boolean"
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
},
|
|
1280
|
+
{
|
|
1281
|
+
"title": "RankingQuestion",
|
|
1282
|
+
"description": "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.",
|
|
1283
|
+
"type": "object",
|
|
1284
|
+
"additionalProperties": false,
|
|
1285
|
+
"required": [
|
|
1286
|
+
"key",
|
|
1287
|
+
"type",
|
|
1288
|
+
"options",
|
|
1289
|
+
"partial",
|
|
1290
|
+
"optional"
|
|
1291
|
+
],
|
|
1292
|
+
"properties": {
|
|
1293
|
+
"key": {
|
|
1294
|
+
"$ref": "#/$defs/Key"
|
|
1295
|
+
},
|
|
1296
|
+
"type": {
|
|
1297
|
+
"const": "ranking"
|
|
1298
|
+
},
|
|
1299
|
+
"text": {
|
|
1300
|
+
"type": "string",
|
|
1301
|
+
"maxLength": 2048
|
|
1302
|
+
},
|
|
1303
|
+
"options": {
|
|
1304
|
+
"type": "array",
|
|
1305
|
+
"minItems": 2,
|
|
1306
|
+
"maxItems": 64,
|
|
1307
|
+
"items": {
|
|
1308
|
+
"$ref": "#/$defs/QuestionOption"
|
|
1309
|
+
}
|
|
1310
|
+
},
|
|
1311
|
+
"partial": {
|
|
1312
|
+
"type": "boolean"
|
|
1313
|
+
},
|
|
1314
|
+
"optional": {
|
|
1315
|
+
"type": "boolean"
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
},
|
|
1319
|
+
{
|
|
1320
|
+
"title": "ScoreQuestion",
|
|
1321
|
+
"description": "Give each option an integer score within [min, max].",
|
|
1322
|
+
"type": "object",
|
|
1323
|
+
"additionalProperties": false,
|
|
1324
|
+
"required": [
|
|
1325
|
+
"key",
|
|
1326
|
+
"type",
|
|
1327
|
+
"options",
|
|
1328
|
+
"min",
|
|
1329
|
+
"max",
|
|
1330
|
+
"optional"
|
|
1331
|
+
],
|
|
1332
|
+
"properties": {
|
|
1333
|
+
"key": {
|
|
1334
|
+
"$ref": "#/$defs/Key"
|
|
1335
|
+
},
|
|
1336
|
+
"type": {
|
|
1337
|
+
"const": "score"
|
|
1338
|
+
},
|
|
1339
|
+
"text": {
|
|
1340
|
+
"type": "string",
|
|
1341
|
+
"maxLength": 2048
|
|
1342
|
+
},
|
|
1343
|
+
"options": {
|
|
1344
|
+
"type": "array",
|
|
1345
|
+
"minItems": 1,
|
|
1346
|
+
"maxItems": 256,
|
|
1347
|
+
"items": {
|
|
1348
|
+
"$ref": "#/$defs/QuestionOption"
|
|
1349
|
+
}
|
|
1350
|
+
},
|
|
1351
|
+
"min": {
|
|
1352
|
+
"type": "integer"
|
|
1353
|
+
},
|
|
1354
|
+
"max": {
|
|
1355
|
+
"type": "integer"
|
|
1356
|
+
},
|
|
1357
|
+
"optional": {
|
|
1358
|
+
"type": "boolean"
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
},
|
|
1362
|
+
{
|
|
1363
|
+
"title": "TextQuestion",
|
|
1364
|
+
"description": "Free text of at most `maxLength` characters.",
|
|
1365
|
+
"type": "object",
|
|
1366
|
+
"additionalProperties": false,
|
|
1367
|
+
"required": [
|
|
1368
|
+
"key",
|
|
1369
|
+
"type",
|
|
1370
|
+
"maxLength",
|
|
1371
|
+
"optional"
|
|
1372
|
+
],
|
|
1373
|
+
"properties": {
|
|
1374
|
+
"key": {
|
|
1375
|
+
"$ref": "#/$defs/Key"
|
|
1376
|
+
},
|
|
1377
|
+
"type": {
|
|
1378
|
+
"const": "text"
|
|
1379
|
+
},
|
|
1380
|
+
"text": {
|
|
1381
|
+
"type": "string",
|
|
1382
|
+
"maxLength": 2048
|
|
1383
|
+
},
|
|
1384
|
+
"maxLength": {
|
|
1385
|
+
"type": "integer",
|
|
1386
|
+
"minimum": 1,
|
|
1387
|
+
"maximum": 4096
|
|
1388
|
+
},
|
|
1389
|
+
"optional": {
|
|
1390
|
+
"type": "boolean"
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
]
|
|
1395
|
+
},
|
|
1396
|
+
"Key": {
|
|
1397
|
+
"title": "Key",
|
|
1398
|
+
"description": "A question or option key, unique within its manifest or question.",
|
|
1399
|
+
"type": "string",
|
|
1400
|
+
"pattern": "^[A-Za-z0-9._-]{1,64}$"
|
|
1401
|
+
},
|
|
1402
|
+
"QuestionOption": {
|
|
1403
|
+
"title": "QuestionOption",
|
|
1404
|
+
"type": "object",
|
|
1405
|
+
"additionalProperties": false,
|
|
1406
|
+
"required": [
|
|
1407
|
+
"key"
|
|
1408
|
+
],
|
|
1409
|
+
"properties": {
|
|
1410
|
+
"key": {
|
|
1411
|
+
"$ref": "#/$defs/Key"
|
|
1412
|
+
},
|
|
1413
|
+
"label": {
|
|
1414
|
+
"type": "string",
|
|
1415
|
+
"maxLength": 512,
|
|
1416
|
+
"description": "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014)."
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
},
|
|
1420
|
+
"ElectionId": {
|
|
1421
|
+
"title": "ElectionId",
|
|
1422
|
+
"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.",
|
|
1423
|
+
"type": "string",
|
|
1424
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
};
|
|
1428
|
+
/**
|
|
1429
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
1430
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
1431
|
+
* per-specification and cannot be derived from the document alone, and
|
|
1432
|
+
* item 2 needs the schema this carries.
|
|
1433
|
+
*/
|
|
1434
|
+
export const SPEC = {
|
|
1435
|
+
typeUri: TYPE_URI,
|
|
1436
|
+
isBearer: false,
|
|
1437
|
+
isProofRequired: true,
|
|
1438
|
+
isRecipientRequired: true,
|
|
1439
|
+
isIssuedAtRequired: true,
|
|
1440
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
1441
|
+
};
|
|
1442
|
+
/**
|
|
1443
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
1444
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
1445
|
+
* parties (§7.3 item 5).
|
|
1446
|
+
*/
|
|
1447
|
+
export const RESPONSE_SPEC = {
|
|
1448
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
1449
|
+
isBearer: false,
|
|
1450
|
+
isProofRequired: false,
|
|
1451
|
+
isRecipientRequired: true,
|
|
1452
|
+
isIssuedAtRequired: true,
|
|
1453
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
1454
|
+
};
|
|
1455
|
+
//# sourceMappingURL=payload.js.map
|