@openvtc/trust-tasks 0.26.29 → 0.27.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/CHANGELOG.md +64 -0
- package/dist/_shared/components.d.ts +15 -1
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/persona/contact/get/1.1/payload.d.ts +12 -5
- package/dist/persona/contact/get/1.1/payload.d.ts.map +1 -1
- package/dist/persona/contact/get/1.1/payload.js +4 -4
- package/dist/persona/contact/get/1.1/payload.js.map +1 -1
- package/dist/persona/contact/list/1.1/payload.d.ts +12 -5
- package/dist/persona/contact/list/1.1/payload.d.ts.map +1 -1
- package/dist/persona/contact/list/1.1/payload.js +4 -4
- package/dist/persona/contact/list/1.1/payload.js.map +1 -1
- package/dist/persona/contact/put/1.1/payload.d.ts +32 -6
- package/dist/persona/contact/put/1.1/payload.d.ts.map +1 -1
- package/dist/persona/contact/put/1.1/payload.js +32 -2
- package/dist/persona/contact/put/1.1/payload.js.map +1 -1
- 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/board/read/0.1/payload.d.ts +58 -2
- package/dist/voting/board/read/0.1/payload.d.ts.map +1 -1
- package/dist/voting/board/read/0.1/payload.js +36 -0
- package/dist/voting/board/read/0.1/payload.js.map +1 -1
- package/dist/voting/trustees/authorize/0.1/payload.d.ts +617 -0
- package/dist/voting/trustees/authorize/0.1/payload.d.ts.map +1 -0
- package/dist/voting/trustees/authorize/0.1/payload.js +386 -0
- package/dist/voting/trustees/authorize/0.1/payload.js.map +1 -0
- package/dist/voting/trustees/status/0.1/payload.d.ts +106 -2
- package/dist/voting/trustees/status/0.1/payload.d.ts.map +1 -1
- package/dist/voting/trustees/status/0.1/payload.js +48 -0
- package/dist/voting/trustees/status/0.1/payload.js.map +1 -1
- package/dist/vta/pcs/trustee/deal/0.2/payload.d.ts +1832 -0
- package/dist/vta/pcs/trustee/deal/0.2/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/deal/0.2/payload.js +1077 -0
- package/dist/vta/pcs/trustee/deal/0.2/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/decrypt/0.2/payload.d.ts +758 -0
- package/dist/vta/pcs/trustee/decrypt/0.2/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/decrypt/0.2/payload.js +423 -0
- package/dist/vta/pcs/trustee/decrypt/0.2/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/justify/0.2/payload.d.ts +1867 -0
- package/dist/vta/pcs/trustee/justify/0.2/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/justify/0.2/payload.js +1095 -0
- package/dist/vta/pcs/trustee/justify/0.2/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/keys/0.2/payload.d.ts +1912 -0
- package/dist/vta/pcs/trustee/keys/0.2/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/keys/0.2/payload.js +1115 -0
- package/dist/vta/pcs/trustee/keys/0.2/payload.js.map +1 -0
- package/dist/vta/pcs/vote-encrypted/0.2/payload.d.ts +2228 -0
- package/dist/vta/pcs/vote-encrypted/0.2/payload.d.ts.map +1 -0
- package/dist/vta/pcs/vote-encrypted/0.2/payload.js +1300 -0
- package/dist/vta/pcs/vote-encrypted/0.2/payload.js.map +1 -0
- package/dist/vtc/elections/show/0.1/payload.d.ts +86 -2
- package/dist/vtc/elections/show/0.1/payload.d.ts.map +1 -1
- package/dist/vtc/elections/show/0.1/payload.js +40 -0
- package/dist/vtc/elections/show/0.1/payload.js.map +1 -1
- package/package.json +1 -1
- package/src/_shared/components.ts +16 -1
- package/src/index.ts +6 -0
- package/src/persona/contact/get/1.1/payload.ts +8 -5
- package/src/persona/contact/list/1.1/payload.ts +8 -5
- package/src/persona/contact/put/1.1/payload.ts +34 -4
- package/src/voting/_shared/0.1/voting.ts +1 -1
- package/src/voting/board/read/0.1/payload.ts +38 -2
- package/src/voting/trustees/authorize/0.1/payload.ts +434 -0
- package/src/voting/trustees/status/0.1/payload.ts +58 -2
- package/src/vta/pcs/trustee/deal/0.2/payload.ts +1148 -0
- package/src/vta/pcs/trustee/decrypt/0.2/payload.ts +500 -0
- package/src/vta/pcs/trustee/justify/0.2/payload.ts +1167 -0
- package/src/vta/pcs/trustee/keys/0.2/payload.ts +1194 -0
- package/src/vta/pcs/vote-encrypted/0.2/payload.ts +1369 -0
- package/src/vtc/elections/show/0.1/payload.ts +46 -2
|
@@ -0,0 +1,1300 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/pcs/vote-encrypted/0.2/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
/** Trust Task type URI. */
|
|
6
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vta/pcs/vote-encrypted/0.2";
|
|
7
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
8
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/pcs/vote-encrypted/0.2#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/vote-encrypted/0.2",
|
|
21
|
+
"title": "VTA PCS — Vote Encrypted — payload",
|
|
22
|
+
"description": "The voter's VTA checks a ballot against the manifest, encrypts it to the election key as the election's level requires, and returns the cast signed by a key made for it alone.",
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"required": [
|
|
26
|
+
"contextId",
|
|
27
|
+
"community",
|
|
28
|
+
"parameters",
|
|
29
|
+
"manifest",
|
|
30
|
+
"ballot",
|
|
31
|
+
"ceremony"
|
|
32
|
+
],
|
|
33
|
+
"properties": {
|
|
34
|
+
"contextId": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"minLength": 1,
|
|
37
|
+
"maxLength": 256,
|
|
38
|
+
"description": "The context the voter belongs to."
|
|
39
|
+
},
|
|
40
|
+
"community": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"minLength": 1,
|
|
43
|
+
"maxLength": 2048,
|
|
44
|
+
"description": "The community's DID."
|
|
45
|
+
},
|
|
46
|
+
"parameters": {
|
|
47
|
+
"$ref": "#/$defs/VotingParameters"
|
|
48
|
+
},
|
|
49
|
+
"manifest": {
|
|
50
|
+
"$ref": "#/$defs/Manifest"
|
|
51
|
+
},
|
|
52
|
+
"ballot": {
|
|
53
|
+
"$ref": "#/$defs/Ballot"
|
|
54
|
+
},
|
|
55
|
+
"ceremony": {
|
|
56
|
+
"$ref": "#/$defs/TrusteeCeremony",
|
|
57
|
+
"description": "The ceremony as the board holds it: voting/trustees/status's `steps`, passed on unchanged. The VTA verifies every step as its trustee's before taking it."
|
|
58
|
+
},
|
|
59
|
+
"ext": {
|
|
60
|
+
"$ref": "#/$defs/Ext"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"$defs": {
|
|
64
|
+
"Response": {
|
|
65
|
+
"$anchor": "response",
|
|
66
|
+
"title": "VTA PCS — Vote Encrypted — response payload",
|
|
67
|
+
"type": "object",
|
|
68
|
+
"additionalProperties": false,
|
|
69
|
+
"required": [
|
|
70
|
+
"castDocument",
|
|
71
|
+
"tag"
|
|
72
|
+
],
|
|
73
|
+
"properties": {
|
|
74
|
+
"castDocument": {
|
|
75
|
+
"title": "CastDocument",
|
|
76
|
+
"description": "The voting/ballot/cast-encrypted request, signed by a key made for this cast alone (VTI-VOT-003).",
|
|
77
|
+
"type": "object",
|
|
78
|
+
"required": [
|
|
79
|
+
"id",
|
|
80
|
+
"type",
|
|
81
|
+
"issuer",
|
|
82
|
+
"recipient",
|
|
83
|
+
"issuedAt",
|
|
84
|
+
"payload",
|
|
85
|
+
"proof"
|
|
86
|
+
],
|
|
87
|
+
"properties": {
|
|
88
|
+
"id": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"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}$"
|
|
91
|
+
},
|
|
92
|
+
"type": {
|
|
93
|
+
"const": "https://trusttasks.org/spec/voting/ballot/cast-encrypted/0.1"
|
|
94
|
+
},
|
|
95
|
+
"issuer": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"minLength": 1,
|
|
98
|
+
"maxLength": 2048,
|
|
99
|
+
"description": "The signer."
|
|
100
|
+
},
|
|
101
|
+
"recipient": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"minLength": 1,
|
|
104
|
+
"maxLength": 2048,
|
|
105
|
+
"description": "The ballot box."
|
|
106
|
+
},
|
|
107
|
+
"issuedAt": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"format": "date-time"
|
|
110
|
+
},
|
|
111
|
+
"expiresAt": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"format": "date-time"
|
|
114
|
+
},
|
|
115
|
+
"payload": {
|
|
116
|
+
"type": "object",
|
|
117
|
+
"description": "That task's request payload."
|
|
118
|
+
},
|
|
119
|
+
"proof": {
|
|
120
|
+
"type": "object",
|
|
121
|
+
"description": "A Data Integrity proof by an `authentication` key of `issuer`."
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"tag": {
|
|
126
|
+
"$ref": "#/$defs/Multibase"
|
|
127
|
+
},
|
|
128
|
+
"ext": {
|
|
129
|
+
"$ref": "#/$defs/Ext"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"Ext": {
|
|
134
|
+
"title": "Ext",
|
|
135
|
+
"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.",
|
|
136
|
+
"type": "object",
|
|
137
|
+
"minProperties": 1,
|
|
138
|
+
"additionalProperties": true,
|
|
139
|
+
"propertyNames": {
|
|
140
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"Multibase": {
|
|
144
|
+
"title": "Multibase",
|
|
145
|
+
"description": "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.",
|
|
146
|
+
"type": "string",
|
|
147
|
+
"maxLength": 16384,
|
|
148
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
149
|
+
},
|
|
150
|
+
"TrusteeCeremony": {
|
|
151
|
+
"title": "TrusteeCeremony",
|
|
152
|
+
"description": "The trustees' ceremony as the board holds it: the `request` of every `trusteeStep` entry, in board order, each exactly as the ballot box received it (CONVENTIONS §9.6). Whoever acts on it verifies each step as its trustee's before taking it; nothing in it is believed for having been passed along.",
|
|
153
|
+
"type": "array",
|
|
154
|
+
"minItems": 1,
|
|
155
|
+
"maxItems": 4224,
|
|
156
|
+
"items": {
|
|
157
|
+
"$ref": "#/$defs/SignedRequest"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"SignedRequest": {
|
|
161
|
+
"title": "SignedRequest",
|
|
162
|
+
"description": "A whole Trust Task request document — `id`, `type`, `issuer`, `payload` and every other member, `proof` included — exactly as the ballot box received it, never re-serialised: its proof is taken over its members, and a re-serialised copy does not reliably reproduce them. Typed as an open object so every member survives; CONVENTIONS §9.6 gives the checks that make it a trustee's step.",
|
|
163
|
+
"type": "object",
|
|
164
|
+
"minProperties": 1
|
|
165
|
+
},
|
|
166
|
+
"Ballot": {
|
|
167
|
+
"title": "Ballot",
|
|
168
|
+
"description": "An open ballot: one answer per question of the manifest, in any order. The bytes a cast's proof binds are the RFC 8785 (JCS) canonicalization of this object as received.",
|
|
169
|
+
"type": "object",
|
|
170
|
+
"additionalProperties": false,
|
|
171
|
+
"required": [
|
|
172
|
+
"electionId",
|
|
173
|
+
"manifestDigest",
|
|
174
|
+
"answers"
|
|
175
|
+
],
|
|
176
|
+
"properties": {
|
|
177
|
+
"electionId": {
|
|
178
|
+
"$ref": "#/$defs/ElectionId"
|
|
179
|
+
},
|
|
180
|
+
"manifestDigest": {
|
|
181
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
182
|
+
},
|
|
183
|
+
"answers": {
|
|
184
|
+
"type": "array",
|
|
185
|
+
"minItems": 1,
|
|
186
|
+
"maxItems": 128,
|
|
187
|
+
"items": {
|
|
188
|
+
"$ref": "#/$defs/Answer"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"Answer": {
|
|
194
|
+
"title": "Answer",
|
|
195
|
+
"description": "The answer to one question. Exactly one member besides `question` is present, matching the question's type, or `abstain` for an optional question left unanswered.",
|
|
196
|
+
"type": "object",
|
|
197
|
+
"additionalProperties": false,
|
|
198
|
+
"required": [
|
|
199
|
+
"question"
|
|
200
|
+
],
|
|
201
|
+
"minProperties": 2,
|
|
202
|
+
"maxProperties": 2,
|
|
203
|
+
"properties": {
|
|
204
|
+
"question": {
|
|
205
|
+
"$ref": "#/$defs/Key"
|
|
206
|
+
},
|
|
207
|
+
"choice": {
|
|
208
|
+
"type": "array",
|
|
209
|
+
"items": {
|
|
210
|
+
"$ref": "#/$defs/Key"
|
|
211
|
+
},
|
|
212
|
+
"uniqueItems": true
|
|
213
|
+
},
|
|
214
|
+
"ranking": {
|
|
215
|
+
"type": "array",
|
|
216
|
+
"items": {
|
|
217
|
+
"$ref": "#/$defs/Key"
|
|
218
|
+
},
|
|
219
|
+
"uniqueItems": true
|
|
220
|
+
},
|
|
221
|
+
"scores": {
|
|
222
|
+
"type": "object",
|
|
223
|
+
"propertyNames": {
|
|
224
|
+
"$ref": "#/$defs/Key"
|
|
225
|
+
},
|
|
226
|
+
"additionalProperties": {
|
|
227
|
+
"type": "integer"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"text": {
|
|
231
|
+
"type": "string",
|
|
232
|
+
"maxLength": 4096
|
|
233
|
+
},
|
|
234
|
+
"abstain": {
|
|
235
|
+
"const": true
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"Key": {
|
|
240
|
+
"title": "Key",
|
|
241
|
+
"description": "A question or option key, unique within its manifest or question.",
|
|
242
|
+
"type": "string",
|
|
243
|
+
"pattern": "^[A-Za-z0-9._-]{1,64}$"
|
|
244
|
+
},
|
|
245
|
+
"ElectionId": {
|
|
246
|
+
"title": "ElectionId",
|
|
247
|
+
"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.",
|
|
248
|
+
"type": "string",
|
|
249
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
250
|
+
},
|
|
251
|
+
"DigestMultibase": {
|
|
252
|
+
"title": "DigestMultibase",
|
|
253
|
+
"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`.",
|
|
254
|
+
"type": "string",
|
|
255
|
+
"minLength": 16,
|
|
256
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
257
|
+
"examples": [
|
|
258
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
259
|
+
]
|
|
260
|
+
},
|
|
261
|
+
"Manifest": {
|
|
262
|
+
"title": "Manifest",
|
|
263
|
+
"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).",
|
|
264
|
+
"type": "object",
|
|
265
|
+
"additionalProperties": false,
|
|
266
|
+
"required": [
|
|
267
|
+
"electionId",
|
|
268
|
+
"community",
|
|
269
|
+
"questions",
|
|
270
|
+
"secrecy",
|
|
271
|
+
"roll",
|
|
272
|
+
"registrationOpens",
|
|
273
|
+
"votingOpens",
|
|
274
|
+
"votingCloses",
|
|
275
|
+
"revote",
|
|
276
|
+
"board",
|
|
277
|
+
"ballotBox",
|
|
278
|
+
"binding",
|
|
279
|
+
"allowEarlyClose",
|
|
280
|
+
"resultsBeforeClose",
|
|
281
|
+
"textReleaseThreshold"
|
|
282
|
+
],
|
|
283
|
+
"properties": {
|
|
284
|
+
"electionId": {
|
|
285
|
+
"$ref": "#/$defs/ElectionId"
|
|
286
|
+
},
|
|
287
|
+
"community": {
|
|
288
|
+
"type": "string",
|
|
289
|
+
"minLength": 1,
|
|
290
|
+
"maxLength": 2048,
|
|
291
|
+
"description": "The community's DID."
|
|
292
|
+
},
|
|
293
|
+
"title": {
|
|
294
|
+
"type": "string",
|
|
295
|
+
"maxLength": 512
|
|
296
|
+
},
|
|
297
|
+
"description": {
|
|
298
|
+
"type": "string",
|
|
299
|
+
"maxLength": 8192
|
|
300
|
+
},
|
|
301
|
+
"questions": {
|
|
302
|
+
"type": "array",
|
|
303
|
+
"minItems": 1,
|
|
304
|
+
"maxItems": 128,
|
|
305
|
+
"items": {
|
|
306
|
+
"$ref": "#/$defs/Question"
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
"secrecy": {
|
|
310
|
+
"$ref": "#/$defs/SecrecyLevel"
|
|
311
|
+
},
|
|
312
|
+
"roll": {
|
|
313
|
+
"$ref": "#/$defs/RollRule"
|
|
314
|
+
},
|
|
315
|
+
"registrationOpens": {
|
|
316
|
+
"type": "string",
|
|
317
|
+
"format": "date-time"
|
|
318
|
+
},
|
|
319
|
+
"votingOpens": {
|
|
320
|
+
"type": "string",
|
|
321
|
+
"format": "date-time"
|
|
322
|
+
},
|
|
323
|
+
"votingCloses": {
|
|
324
|
+
"type": "string",
|
|
325
|
+
"format": "date-time"
|
|
326
|
+
},
|
|
327
|
+
"revote": {
|
|
328
|
+
"$ref": "#/$defs/Revote"
|
|
329
|
+
},
|
|
330
|
+
"board": {
|
|
331
|
+
"type": "object",
|
|
332
|
+
"additionalProperties": false,
|
|
333
|
+
"required": [
|
|
334
|
+
"visibility",
|
|
335
|
+
"auditors"
|
|
336
|
+
],
|
|
337
|
+
"properties": {
|
|
338
|
+
"visibility": {
|
|
339
|
+
"$ref": "#/$defs/BoardVisibility"
|
|
340
|
+
},
|
|
341
|
+
"auditors": {
|
|
342
|
+
"type": "array",
|
|
343
|
+
"items": {
|
|
344
|
+
"type": "string",
|
|
345
|
+
"minLength": 1,
|
|
346
|
+
"maxLength": 2048
|
|
347
|
+
},
|
|
348
|
+
"uniqueItems": true
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
"ballotBox": {
|
|
353
|
+
"type": "string",
|
|
354
|
+
"minLength": 1,
|
|
355
|
+
"maxLength": 2048,
|
|
356
|
+
"description": "The DID of the voting service that holds the board."
|
|
357
|
+
},
|
|
358
|
+
"trustees": {
|
|
359
|
+
"$ref": "#/$defs/Trustees"
|
|
360
|
+
},
|
|
361
|
+
"binding": {
|
|
362
|
+
"type": "boolean",
|
|
363
|
+
"description": "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081)."
|
|
364
|
+
},
|
|
365
|
+
"allowEarlyClose": {
|
|
366
|
+
"type": "boolean"
|
|
367
|
+
},
|
|
368
|
+
"resultsBeforeClose": {
|
|
369
|
+
"type": "boolean",
|
|
370
|
+
"description": "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061)."
|
|
371
|
+
},
|
|
372
|
+
"textReleaseThreshold": {
|
|
373
|
+
"type": "integer",
|
|
374
|
+
"minimum": 10,
|
|
375
|
+
"description": "Counted ballots required before any text answer is disclosed (VTI-VOT-065)."
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
"Trustees": {
|
|
380
|
+
"title": "Trustees",
|
|
381
|
+
"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.",
|
|
382
|
+
"type": "object",
|
|
383
|
+
"additionalProperties": false,
|
|
384
|
+
"required": [
|
|
385
|
+
"dids",
|
|
386
|
+
"threshold"
|
|
387
|
+
],
|
|
388
|
+
"properties": {
|
|
389
|
+
"dids": {
|
|
390
|
+
"type": "array",
|
|
391
|
+
"minItems": 2,
|
|
392
|
+
"items": {
|
|
393
|
+
"type": "string",
|
|
394
|
+
"minLength": 1,
|
|
395
|
+
"maxLength": 2048
|
|
396
|
+
},
|
|
397
|
+
"uniqueItems": true
|
|
398
|
+
},
|
|
399
|
+
"threshold": {
|
|
400
|
+
"type": "integer",
|
|
401
|
+
"minimum": 2
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
"BoardVisibility": {
|
|
406
|
+
"title": "BoardVisibility",
|
|
407
|
+
"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).",
|
|
408
|
+
"type": "string",
|
|
409
|
+
"enum": [
|
|
410
|
+
"public",
|
|
411
|
+
"private"
|
|
412
|
+
]
|
|
413
|
+
},
|
|
414
|
+
"Revote": {
|
|
415
|
+
"title": "Revote",
|
|
416
|
+
"description": "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).",
|
|
417
|
+
"type": "string",
|
|
418
|
+
"enum": [
|
|
419
|
+
"replace",
|
|
420
|
+
"refuse"
|
|
421
|
+
]
|
|
422
|
+
},
|
|
423
|
+
"RollRule": {
|
|
424
|
+
"title": "RollRule",
|
|
425
|
+
"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.",
|
|
426
|
+
"type": "object",
|
|
427
|
+
"additionalProperties": false,
|
|
428
|
+
"required": [
|
|
429
|
+
"rule"
|
|
430
|
+
],
|
|
431
|
+
"properties": {
|
|
432
|
+
"rule": {
|
|
433
|
+
"type": "string",
|
|
434
|
+
"enum": [
|
|
435
|
+
"members",
|
|
436
|
+
"membersAndListed",
|
|
437
|
+
"listed"
|
|
438
|
+
]
|
|
439
|
+
},
|
|
440
|
+
"listed": {
|
|
441
|
+
"type": "array",
|
|
442
|
+
"items": {
|
|
443
|
+
"type": "string",
|
|
444
|
+
"minLength": 1,
|
|
445
|
+
"maxLength": 2048,
|
|
446
|
+
"description": "A DID enfranchised by name."
|
|
447
|
+
},
|
|
448
|
+
"uniqueItems": true
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
"SecrecyLevel": {
|
|
453
|
+
"title": "SecrecyLevel",
|
|
454
|
+
"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).",
|
|
455
|
+
"type": "string",
|
|
456
|
+
"enum": [
|
|
457
|
+
"open",
|
|
458
|
+
"sealed",
|
|
459
|
+
"talliedEncrypted"
|
|
460
|
+
]
|
|
461
|
+
},
|
|
462
|
+
"Question": {
|
|
463
|
+
"title": "Question",
|
|
464
|
+
"description": "One question. Tagged union over `type`.",
|
|
465
|
+
"oneOf": [
|
|
466
|
+
{
|
|
467
|
+
"title": "ChoiceQuestion",
|
|
468
|
+
"description": "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.",
|
|
469
|
+
"type": "object",
|
|
470
|
+
"additionalProperties": false,
|
|
471
|
+
"required": [
|
|
472
|
+
"key",
|
|
473
|
+
"type",
|
|
474
|
+
"options",
|
|
475
|
+
"minSelections",
|
|
476
|
+
"maxSelections",
|
|
477
|
+
"optional"
|
|
478
|
+
],
|
|
479
|
+
"properties": {
|
|
480
|
+
"key": {
|
|
481
|
+
"$ref": "#/$defs/Key"
|
|
482
|
+
},
|
|
483
|
+
"type": {
|
|
484
|
+
"const": "choice"
|
|
485
|
+
},
|
|
486
|
+
"text": {
|
|
487
|
+
"type": "string",
|
|
488
|
+
"maxLength": 2048
|
|
489
|
+
},
|
|
490
|
+
"options": {
|
|
491
|
+
"type": "array",
|
|
492
|
+
"minItems": 2,
|
|
493
|
+
"maxItems": 256,
|
|
494
|
+
"items": {
|
|
495
|
+
"$ref": "#/$defs/QuestionOption"
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
"minSelections": {
|
|
499
|
+
"type": "integer",
|
|
500
|
+
"minimum": 0
|
|
501
|
+
},
|
|
502
|
+
"maxSelections": {
|
|
503
|
+
"type": "integer",
|
|
504
|
+
"minimum": 1
|
|
505
|
+
},
|
|
506
|
+
"optional": {
|
|
507
|
+
"type": "boolean"
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
"title": "RankingQuestion",
|
|
513
|
+
"description": "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.",
|
|
514
|
+
"type": "object",
|
|
515
|
+
"additionalProperties": false,
|
|
516
|
+
"required": [
|
|
517
|
+
"key",
|
|
518
|
+
"type",
|
|
519
|
+
"options",
|
|
520
|
+
"partial",
|
|
521
|
+
"optional"
|
|
522
|
+
],
|
|
523
|
+
"properties": {
|
|
524
|
+
"key": {
|
|
525
|
+
"$ref": "#/$defs/Key"
|
|
526
|
+
},
|
|
527
|
+
"type": {
|
|
528
|
+
"const": "ranking"
|
|
529
|
+
},
|
|
530
|
+
"text": {
|
|
531
|
+
"type": "string",
|
|
532
|
+
"maxLength": 2048
|
|
533
|
+
},
|
|
534
|
+
"options": {
|
|
535
|
+
"type": "array",
|
|
536
|
+
"minItems": 2,
|
|
537
|
+
"maxItems": 64,
|
|
538
|
+
"items": {
|
|
539
|
+
"$ref": "#/$defs/QuestionOption"
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
"partial": {
|
|
543
|
+
"type": "boolean"
|
|
544
|
+
},
|
|
545
|
+
"optional": {
|
|
546
|
+
"type": "boolean"
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
"title": "ScoreQuestion",
|
|
552
|
+
"description": "Give each option an integer score within [min, max].",
|
|
553
|
+
"type": "object",
|
|
554
|
+
"additionalProperties": false,
|
|
555
|
+
"required": [
|
|
556
|
+
"key",
|
|
557
|
+
"type",
|
|
558
|
+
"options",
|
|
559
|
+
"min",
|
|
560
|
+
"max",
|
|
561
|
+
"optional"
|
|
562
|
+
],
|
|
563
|
+
"properties": {
|
|
564
|
+
"key": {
|
|
565
|
+
"$ref": "#/$defs/Key"
|
|
566
|
+
},
|
|
567
|
+
"type": {
|
|
568
|
+
"const": "score"
|
|
569
|
+
},
|
|
570
|
+
"text": {
|
|
571
|
+
"type": "string",
|
|
572
|
+
"maxLength": 2048
|
|
573
|
+
},
|
|
574
|
+
"options": {
|
|
575
|
+
"type": "array",
|
|
576
|
+
"minItems": 1,
|
|
577
|
+
"maxItems": 256,
|
|
578
|
+
"items": {
|
|
579
|
+
"$ref": "#/$defs/QuestionOption"
|
|
580
|
+
}
|
|
581
|
+
},
|
|
582
|
+
"min": {
|
|
583
|
+
"type": "integer"
|
|
584
|
+
},
|
|
585
|
+
"max": {
|
|
586
|
+
"type": "integer"
|
|
587
|
+
},
|
|
588
|
+
"optional": {
|
|
589
|
+
"type": "boolean"
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
"title": "TextQuestion",
|
|
595
|
+
"description": "Free text of at most `maxLength` characters.",
|
|
596
|
+
"type": "object",
|
|
597
|
+
"additionalProperties": false,
|
|
598
|
+
"required": [
|
|
599
|
+
"key",
|
|
600
|
+
"type",
|
|
601
|
+
"maxLength",
|
|
602
|
+
"optional"
|
|
603
|
+
],
|
|
604
|
+
"properties": {
|
|
605
|
+
"key": {
|
|
606
|
+
"$ref": "#/$defs/Key"
|
|
607
|
+
},
|
|
608
|
+
"type": {
|
|
609
|
+
"const": "text"
|
|
610
|
+
},
|
|
611
|
+
"text": {
|
|
612
|
+
"type": "string",
|
|
613
|
+
"maxLength": 2048
|
|
614
|
+
},
|
|
615
|
+
"maxLength": {
|
|
616
|
+
"type": "integer",
|
|
617
|
+
"minimum": 1,
|
|
618
|
+
"maximum": 4096
|
|
619
|
+
},
|
|
620
|
+
"optional": {
|
|
621
|
+
"type": "boolean"
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
]
|
|
626
|
+
},
|
|
627
|
+
"QuestionOption": {
|
|
628
|
+
"title": "QuestionOption",
|
|
629
|
+
"type": "object",
|
|
630
|
+
"additionalProperties": false,
|
|
631
|
+
"required": [
|
|
632
|
+
"key"
|
|
633
|
+
],
|
|
634
|
+
"properties": {
|
|
635
|
+
"key": {
|
|
636
|
+
"$ref": "#/$defs/Key"
|
|
637
|
+
},
|
|
638
|
+
"label": {
|
|
639
|
+
"type": "string",
|
|
640
|
+
"maxLength": 512,
|
|
641
|
+
"description": "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014)."
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
},
|
|
645
|
+
"VotingParameters": {
|
|
646
|
+
"title": "VotingParameters",
|
|
647
|
+
"description": "The community's published voting parameters: the PCS suite and the voting verification key tickets are issued under (VTI-VOT-020). Distinct from its hidden-vetting helper key.",
|
|
648
|
+
"type": "object",
|
|
649
|
+
"additionalProperties": false,
|
|
650
|
+
"required": [
|
|
651
|
+
"suite",
|
|
652
|
+
"votingKey"
|
|
653
|
+
],
|
|
654
|
+
"properties": {
|
|
655
|
+
"suite": {
|
|
656
|
+
"type": "string",
|
|
657
|
+
"const": "ps-ddh-bls12381"
|
|
658
|
+
},
|
|
659
|
+
"votingKey": {
|
|
660
|
+
"$ref": "#/$defs/Multibase"
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
667
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
668
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
669
|
+
"$ref": "#/$defs/Response",
|
|
670
|
+
"$defs": {
|
|
671
|
+
"Response": {
|
|
672
|
+
"$anchor": "response",
|
|
673
|
+
"title": "VTA PCS — Vote Encrypted — response payload",
|
|
674
|
+
"type": "object",
|
|
675
|
+
"additionalProperties": false,
|
|
676
|
+
"required": [
|
|
677
|
+
"castDocument",
|
|
678
|
+
"tag"
|
|
679
|
+
],
|
|
680
|
+
"properties": {
|
|
681
|
+
"castDocument": {
|
|
682
|
+
"title": "CastDocument",
|
|
683
|
+
"description": "The voting/ballot/cast-encrypted request, signed by a key made for this cast alone (VTI-VOT-003).",
|
|
684
|
+
"type": "object",
|
|
685
|
+
"required": [
|
|
686
|
+
"id",
|
|
687
|
+
"type",
|
|
688
|
+
"issuer",
|
|
689
|
+
"recipient",
|
|
690
|
+
"issuedAt",
|
|
691
|
+
"payload",
|
|
692
|
+
"proof"
|
|
693
|
+
],
|
|
694
|
+
"properties": {
|
|
695
|
+
"id": {
|
|
696
|
+
"type": "string",
|
|
697
|
+
"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}$"
|
|
698
|
+
},
|
|
699
|
+
"type": {
|
|
700
|
+
"const": "https://trusttasks.org/spec/voting/ballot/cast-encrypted/0.1"
|
|
701
|
+
},
|
|
702
|
+
"issuer": {
|
|
703
|
+
"type": "string",
|
|
704
|
+
"minLength": 1,
|
|
705
|
+
"maxLength": 2048,
|
|
706
|
+
"description": "The signer."
|
|
707
|
+
},
|
|
708
|
+
"recipient": {
|
|
709
|
+
"type": "string",
|
|
710
|
+
"minLength": 1,
|
|
711
|
+
"maxLength": 2048,
|
|
712
|
+
"description": "The ballot box."
|
|
713
|
+
},
|
|
714
|
+
"issuedAt": {
|
|
715
|
+
"type": "string",
|
|
716
|
+
"format": "date-time"
|
|
717
|
+
},
|
|
718
|
+
"expiresAt": {
|
|
719
|
+
"type": "string",
|
|
720
|
+
"format": "date-time"
|
|
721
|
+
},
|
|
722
|
+
"payload": {
|
|
723
|
+
"type": "object",
|
|
724
|
+
"description": "That task's request payload."
|
|
725
|
+
},
|
|
726
|
+
"proof": {
|
|
727
|
+
"type": "object",
|
|
728
|
+
"description": "A Data Integrity proof by an `authentication` key of `issuer`."
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
},
|
|
732
|
+
"tag": {
|
|
733
|
+
"$ref": "#/$defs/Multibase"
|
|
734
|
+
},
|
|
735
|
+
"ext": {
|
|
736
|
+
"$ref": "#/$defs/Ext"
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
"Ext": {
|
|
741
|
+
"title": "Ext",
|
|
742
|
+
"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.",
|
|
743
|
+
"type": "object",
|
|
744
|
+
"minProperties": 1,
|
|
745
|
+
"additionalProperties": true,
|
|
746
|
+
"propertyNames": {
|
|
747
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
"Multibase": {
|
|
751
|
+
"title": "Multibase",
|
|
752
|
+
"description": "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.",
|
|
753
|
+
"type": "string",
|
|
754
|
+
"maxLength": 16384,
|
|
755
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
756
|
+
},
|
|
757
|
+
"TrusteeCeremony": {
|
|
758
|
+
"title": "TrusteeCeremony",
|
|
759
|
+
"description": "The trustees' ceremony as the board holds it: the `request` of every `trusteeStep` entry, in board order, each exactly as the ballot box received it (CONVENTIONS §9.6). Whoever acts on it verifies each step as its trustee's before taking it; nothing in it is believed for having been passed along.",
|
|
760
|
+
"type": "array",
|
|
761
|
+
"minItems": 1,
|
|
762
|
+
"maxItems": 4224,
|
|
763
|
+
"items": {
|
|
764
|
+
"$ref": "#/$defs/SignedRequest"
|
|
765
|
+
}
|
|
766
|
+
},
|
|
767
|
+
"SignedRequest": {
|
|
768
|
+
"title": "SignedRequest",
|
|
769
|
+
"description": "A whole Trust Task request document — `id`, `type`, `issuer`, `payload` and every other member, `proof` included — exactly as the ballot box received it, never re-serialised: its proof is taken over its members, and a re-serialised copy does not reliably reproduce them. Typed as an open object so every member survives; CONVENTIONS §9.6 gives the checks that make it a trustee's step.",
|
|
770
|
+
"type": "object",
|
|
771
|
+
"minProperties": 1
|
|
772
|
+
},
|
|
773
|
+
"Ballot": {
|
|
774
|
+
"title": "Ballot",
|
|
775
|
+
"description": "An open ballot: one answer per question of the manifest, in any order. The bytes a cast's proof binds are the RFC 8785 (JCS) canonicalization of this object as received.",
|
|
776
|
+
"type": "object",
|
|
777
|
+
"additionalProperties": false,
|
|
778
|
+
"required": [
|
|
779
|
+
"electionId",
|
|
780
|
+
"manifestDigest",
|
|
781
|
+
"answers"
|
|
782
|
+
],
|
|
783
|
+
"properties": {
|
|
784
|
+
"electionId": {
|
|
785
|
+
"$ref": "#/$defs/ElectionId"
|
|
786
|
+
},
|
|
787
|
+
"manifestDigest": {
|
|
788
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
789
|
+
},
|
|
790
|
+
"answers": {
|
|
791
|
+
"type": "array",
|
|
792
|
+
"minItems": 1,
|
|
793
|
+
"maxItems": 128,
|
|
794
|
+
"items": {
|
|
795
|
+
"$ref": "#/$defs/Answer"
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
},
|
|
800
|
+
"Answer": {
|
|
801
|
+
"title": "Answer",
|
|
802
|
+
"description": "The answer to one question. Exactly one member besides `question` is present, matching the question's type, or `abstain` for an optional question left unanswered.",
|
|
803
|
+
"type": "object",
|
|
804
|
+
"additionalProperties": false,
|
|
805
|
+
"required": [
|
|
806
|
+
"question"
|
|
807
|
+
],
|
|
808
|
+
"minProperties": 2,
|
|
809
|
+
"maxProperties": 2,
|
|
810
|
+
"properties": {
|
|
811
|
+
"question": {
|
|
812
|
+
"$ref": "#/$defs/Key"
|
|
813
|
+
},
|
|
814
|
+
"choice": {
|
|
815
|
+
"type": "array",
|
|
816
|
+
"items": {
|
|
817
|
+
"$ref": "#/$defs/Key"
|
|
818
|
+
},
|
|
819
|
+
"uniqueItems": true
|
|
820
|
+
},
|
|
821
|
+
"ranking": {
|
|
822
|
+
"type": "array",
|
|
823
|
+
"items": {
|
|
824
|
+
"$ref": "#/$defs/Key"
|
|
825
|
+
},
|
|
826
|
+
"uniqueItems": true
|
|
827
|
+
},
|
|
828
|
+
"scores": {
|
|
829
|
+
"type": "object",
|
|
830
|
+
"propertyNames": {
|
|
831
|
+
"$ref": "#/$defs/Key"
|
|
832
|
+
},
|
|
833
|
+
"additionalProperties": {
|
|
834
|
+
"type": "integer"
|
|
835
|
+
}
|
|
836
|
+
},
|
|
837
|
+
"text": {
|
|
838
|
+
"type": "string",
|
|
839
|
+
"maxLength": 4096
|
|
840
|
+
},
|
|
841
|
+
"abstain": {
|
|
842
|
+
"const": true
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
},
|
|
846
|
+
"Key": {
|
|
847
|
+
"title": "Key",
|
|
848
|
+
"description": "A question or option key, unique within its manifest or question.",
|
|
849
|
+
"type": "string",
|
|
850
|
+
"pattern": "^[A-Za-z0-9._-]{1,64}$"
|
|
851
|
+
},
|
|
852
|
+
"ElectionId": {
|
|
853
|
+
"title": "ElectionId",
|
|
854
|
+
"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.",
|
|
855
|
+
"type": "string",
|
|
856
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
857
|
+
},
|
|
858
|
+
"DigestMultibase": {
|
|
859
|
+
"title": "DigestMultibase",
|
|
860
|
+
"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`.",
|
|
861
|
+
"type": "string",
|
|
862
|
+
"minLength": 16,
|
|
863
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
864
|
+
"examples": [
|
|
865
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
866
|
+
]
|
|
867
|
+
},
|
|
868
|
+
"Manifest": {
|
|
869
|
+
"title": "Manifest",
|
|
870
|
+
"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).",
|
|
871
|
+
"type": "object",
|
|
872
|
+
"additionalProperties": false,
|
|
873
|
+
"required": [
|
|
874
|
+
"electionId",
|
|
875
|
+
"community",
|
|
876
|
+
"questions",
|
|
877
|
+
"secrecy",
|
|
878
|
+
"roll",
|
|
879
|
+
"registrationOpens",
|
|
880
|
+
"votingOpens",
|
|
881
|
+
"votingCloses",
|
|
882
|
+
"revote",
|
|
883
|
+
"board",
|
|
884
|
+
"ballotBox",
|
|
885
|
+
"binding",
|
|
886
|
+
"allowEarlyClose",
|
|
887
|
+
"resultsBeforeClose",
|
|
888
|
+
"textReleaseThreshold"
|
|
889
|
+
],
|
|
890
|
+
"properties": {
|
|
891
|
+
"electionId": {
|
|
892
|
+
"$ref": "#/$defs/ElectionId"
|
|
893
|
+
},
|
|
894
|
+
"community": {
|
|
895
|
+
"type": "string",
|
|
896
|
+
"minLength": 1,
|
|
897
|
+
"maxLength": 2048,
|
|
898
|
+
"description": "The community's DID."
|
|
899
|
+
},
|
|
900
|
+
"title": {
|
|
901
|
+
"type": "string",
|
|
902
|
+
"maxLength": 512
|
|
903
|
+
},
|
|
904
|
+
"description": {
|
|
905
|
+
"type": "string",
|
|
906
|
+
"maxLength": 8192
|
|
907
|
+
},
|
|
908
|
+
"questions": {
|
|
909
|
+
"type": "array",
|
|
910
|
+
"minItems": 1,
|
|
911
|
+
"maxItems": 128,
|
|
912
|
+
"items": {
|
|
913
|
+
"$ref": "#/$defs/Question"
|
|
914
|
+
}
|
|
915
|
+
},
|
|
916
|
+
"secrecy": {
|
|
917
|
+
"$ref": "#/$defs/SecrecyLevel"
|
|
918
|
+
},
|
|
919
|
+
"roll": {
|
|
920
|
+
"$ref": "#/$defs/RollRule"
|
|
921
|
+
},
|
|
922
|
+
"registrationOpens": {
|
|
923
|
+
"type": "string",
|
|
924
|
+
"format": "date-time"
|
|
925
|
+
},
|
|
926
|
+
"votingOpens": {
|
|
927
|
+
"type": "string",
|
|
928
|
+
"format": "date-time"
|
|
929
|
+
},
|
|
930
|
+
"votingCloses": {
|
|
931
|
+
"type": "string",
|
|
932
|
+
"format": "date-time"
|
|
933
|
+
},
|
|
934
|
+
"revote": {
|
|
935
|
+
"$ref": "#/$defs/Revote"
|
|
936
|
+
},
|
|
937
|
+
"board": {
|
|
938
|
+
"type": "object",
|
|
939
|
+
"additionalProperties": false,
|
|
940
|
+
"required": [
|
|
941
|
+
"visibility",
|
|
942
|
+
"auditors"
|
|
943
|
+
],
|
|
944
|
+
"properties": {
|
|
945
|
+
"visibility": {
|
|
946
|
+
"$ref": "#/$defs/BoardVisibility"
|
|
947
|
+
},
|
|
948
|
+
"auditors": {
|
|
949
|
+
"type": "array",
|
|
950
|
+
"items": {
|
|
951
|
+
"type": "string",
|
|
952
|
+
"minLength": 1,
|
|
953
|
+
"maxLength": 2048
|
|
954
|
+
},
|
|
955
|
+
"uniqueItems": true
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
},
|
|
959
|
+
"ballotBox": {
|
|
960
|
+
"type": "string",
|
|
961
|
+
"minLength": 1,
|
|
962
|
+
"maxLength": 2048,
|
|
963
|
+
"description": "The DID of the voting service that holds the board."
|
|
964
|
+
},
|
|
965
|
+
"trustees": {
|
|
966
|
+
"$ref": "#/$defs/Trustees"
|
|
967
|
+
},
|
|
968
|
+
"binding": {
|
|
969
|
+
"type": "boolean",
|
|
970
|
+
"description": "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081)."
|
|
971
|
+
},
|
|
972
|
+
"allowEarlyClose": {
|
|
973
|
+
"type": "boolean"
|
|
974
|
+
},
|
|
975
|
+
"resultsBeforeClose": {
|
|
976
|
+
"type": "boolean",
|
|
977
|
+
"description": "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061)."
|
|
978
|
+
},
|
|
979
|
+
"textReleaseThreshold": {
|
|
980
|
+
"type": "integer",
|
|
981
|
+
"minimum": 10,
|
|
982
|
+
"description": "Counted ballots required before any text answer is disclosed (VTI-VOT-065)."
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
},
|
|
986
|
+
"Trustees": {
|
|
987
|
+
"title": "Trustees",
|
|
988
|
+
"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.",
|
|
989
|
+
"type": "object",
|
|
990
|
+
"additionalProperties": false,
|
|
991
|
+
"required": [
|
|
992
|
+
"dids",
|
|
993
|
+
"threshold"
|
|
994
|
+
],
|
|
995
|
+
"properties": {
|
|
996
|
+
"dids": {
|
|
997
|
+
"type": "array",
|
|
998
|
+
"minItems": 2,
|
|
999
|
+
"items": {
|
|
1000
|
+
"type": "string",
|
|
1001
|
+
"minLength": 1,
|
|
1002
|
+
"maxLength": 2048
|
|
1003
|
+
},
|
|
1004
|
+
"uniqueItems": true
|
|
1005
|
+
},
|
|
1006
|
+
"threshold": {
|
|
1007
|
+
"type": "integer",
|
|
1008
|
+
"minimum": 2
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
},
|
|
1012
|
+
"BoardVisibility": {
|
|
1013
|
+
"title": "BoardVisibility",
|
|
1014
|
+
"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).",
|
|
1015
|
+
"type": "string",
|
|
1016
|
+
"enum": [
|
|
1017
|
+
"public",
|
|
1018
|
+
"private"
|
|
1019
|
+
]
|
|
1020
|
+
},
|
|
1021
|
+
"Revote": {
|
|
1022
|
+
"title": "Revote",
|
|
1023
|
+
"description": "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).",
|
|
1024
|
+
"type": "string",
|
|
1025
|
+
"enum": [
|
|
1026
|
+
"replace",
|
|
1027
|
+
"refuse"
|
|
1028
|
+
]
|
|
1029
|
+
},
|
|
1030
|
+
"RollRule": {
|
|
1031
|
+
"title": "RollRule",
|
|
1032
|
+
"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.",
|
|
1033
|
+
"type": "object",
|
|
1034
|
+
"additionalProperties": false,
|
|
1035
|
+
"required": [
|
|
1036
|
+
"rule"
|
|
1037
|
+
],
|
|
1038
|
+
"properties": {
|
|
1039
|
+
"rule": {
|
|
1040
|
+
"type": "string",
|
|
1041
|
+
"enum": [
|
|
1042
|
+
"members",
|
|
1043
|
+
"membersAndListed",
|
|
1044
|
+
"listed"
|
|
1045
|
+
]
|
|
1046
|
+
},
|
|
1047
|
+
"listed": {
|
|
1048
|
+
"type": "array",
|
|
1049
|
+
"items": {
|
|
1050
|
+
"type": "string",
|
|
1051
|
+
"minLength": 1,
|
|
1052
|
+
"maxLength": 2048,
|
|
1053
|
+
"description": "A DID enfranchised by name."
|
|
1054
|
+
},
|
|
1055
|
+
"uniqueItems": true
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
},
|
|
1059
|
+
"SecrecyLevel": {
|
|
1060
|
+
"title": "SecrecyLevel",
|
|
1061
|
+
"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).",
|
|
1062
|
+
"type": "string",
|
|
1063
|
+
"enum": [
|
|
1064
|
+
"open",
|
|
1065
|
+
"sealed",
|
|
1066
|
+
"talliedEncrypted"
|
|
1067
|
+
]
|
|
1068
|
+
},
|
|
1069
|
+
"Question": {
|
|
1070
|
+
"title": "Question",
|
|
1071
|
+
"description": "One question. Tagged union over `type`.",
|
|
1072
|
+
"oneOf": [
|
|
1073
|
+
{
|
|
1074
|
+
"title": "ChoiceQuestion",
|
|
1075
|
+
"description": "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.",
|
|
1076
|
+
"type": "object",
|
|
1077
|
+
"additionalProperties": false,
|
|
1078
|
+
"required": [
|
|
1079
|
+
"key",
|
|
1080
|
+
"type",
|
|
1081
|
+
"options",
|
|
1082
|
+
"minSelections",
|
|
1083
|
+
"maxSelections",
|
|
1084
|
+
"optional"
|
|
1085
|
+
],
|
|
1086
|
+
"properties": {
|
|
1087
|
+
"key": {
|
|
1088
|
+
"$ref": "#/$defs/Key"
|
|
1089
|
+
},
|
|
1090
|
+
"type": {
|
|
1091
|
+
"const": "choice"
|
|
1092
|
+
},
|
|
1093
|
+
"text": {
|
|
1094
|
+
"type": "string",
|
|
1095
|
+
"maxLength": 2048
|
|
1096
|
+
},
|
|
1097
|
+
"options": {
|
|
1098
|
+
"type": "array",
|
|
1099
|
+
"minItems": 2,
|
|
1100
|
+
"maxItems": 256,
|
|
1101
|
+
"items": {
|
|
1102
|
+
"$ref": "#/$defs/QuestionOption"
|
|
1103
|
+
}
|
|
1104
|
+
},
|
|
1105
|
+
"minSelections": {
|
|
1106
|
+
"type": "integer",
|
|
1107
|
+
"minimum": 0
|
|
1108
|
+
},
|
|
1109
|
+
"maxSelections": {
|
|
1110
|
+
"type": "integer",
|
|
1111
|
+
"minimum": 1
|
|
1112
|
+
},
|
|
1113
|
+
"optional": {
|
|
1114
|
+
"type": "boolean"
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
"title": "RankingQuestion",
|
|
1120
|
+
"description": "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.",
|
|
1121
|
+
"type": "object",
|
|
1122
|
+
"additionalProperties": false,
|
|
1123
|
+
"required": [
|
|
1124
|
+
"key",
|
|
1125
|
+
"type",
|
|
1126
|
+
"options",
|
|
1127
|
+
"partial",
|
|
1128
|
+
"optional"
|
|
1129
|
+
],
|
|
1130
|
+
"properties": {
|
|
1131
|
+
"key": {
|
|
1132
|
+
"$ref": "#/$defs/Key"
|
|
1133
|
+
},
|
|
1134
|
+
"type": {
|
|
1135
|
+
"const": "ranking"
|
|
1136
|
+
},
|
|
1137
|
+
"text": {
|
|
1138
|
+
"type": "string",
|
|
1139
|
+
"maxLength": 2048
|
|
1140
|
+
},
|
|
1141
|
+
"options": {
|
|
1142
|
+
"type": "array",
|
|
1143
|
+
"minItems": 2,
|
|
1144
|
+
"maxItems": 64,
|
|
1145
|
+
"items": {
|
|
1146
|
+
"$ref": "#/$defs/QuestionOption"
|
|
1147
|
+
}
|
|
1148
|
+
},
|
|
1149
|
+
"partial": {
|
|
1150
|
+
"type": "boolean"
|
|
1151
|
+
},
|
|
1152
|
+
"optional": {
|
|
1153
|
+
"type": "boolean"
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
"title": "ScoreQuestion",
|
|
1159
|
+
"description": "Give each option an integer score within [min, max].",
|
|
1160
|
+
"type": "object",
|
|
1161
|
+
"additionalProperties": false,
|
|
1162
|
+
"required": [
|
|
1163
|
+
"key",
|
|
1164
|
+
"type",
|
|
1165
|
+
"options",
|
|
1166
|
+
"min",
|
|
1167
|
+
"max",
|
|
1168
|
+
"optional"
|
|
1169
|
+
],
|
|
1170
|
+
"properties": {
|
|
1171
|
+
"key": {
|
|
1172
|
+
"$ref": "#/$defs/Key"
|
|
1173
|
+
},
|
|
1174
|
+
"type": {
|
|
1175
|
+
"const": "score"
|
|
1176
|
+
},
|
|
1177
|
+
"text": {
|
|
1178
|
+
"type": "string",
|
|
1179
|
+
"maxLength": 2048
|
|
1180
|
+
},
|
|
1181
|
+
"options": {
|
|
1182
|
+
"type": "array",
|
|
1183
|
+
"minItems": 1,
|
|
1184
|
+
"maxItems": 256,
|
|
1185
|
+
"items": {
|
|
1186
|
+
"$ref": "#/$defs/QuestionOption"
|
|
1187
|
+
}
|
|
1188
|
+
},
|
|
1189
|
+
"min": {
|
|
1190
|
+
"type": "integer"
|
|
1191
|
+
},
|
|
1192
|
+
"max": {
|
|
1193
|
+
"type": "integer"
|
|
1194
|
+
},
|
|
1195
|
+
"optional": {
|
|
1196
|
+
"type": "boolean"
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1200
|
+
{
|
|
1201
|
+
"title": "TextQuestion",
|
|
1202
|
+
"description": "Free text of at most `maxLength` characters.",
|
|
1203
|
+
"type": "object",
|
|
1204
|
+
"additionalProperties": false,
|
|
1205
|
+
"required": [
|
|
1206
|
+
"key",
|
|
1207
|
+
"type",
|
|
1208
|
+
"maxLength",
|
|
1209
|
+
"optional"
|
|
1210
|
+
],
|
|
1211
|
+
"properties": {
|
|
1212
|
+
"key": {
|
|
1213
|
+
"$ref": "#/$defs/Key"
|
|
1214
|
+
},
|
|
1215
|
+
"type": {
|
|
1216
|
+
"const": "text"
|
|
1217
|
+
},
|
|
1218
|
+
"text": {
|
|
1219
|
+
"type": "string",
|
|
1220
|
+
"maxLength": 2048
|
|
1221
|
+
},
|
|
1222
|
+
"maxLength": {
|
|
1223
|
+
"type": "integer",
|
|
1224
|
+
"minimum": 1,
|
|
1225
|
+
"maximum": 4096
|
|
1226
|
+
},
|
|
1227
|
+
"optional": {
|
|
1228
|
+
"type": "boolean"
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
]
|
|
1233
|
+
},
|
|
1234
|
+
"QuestionOption": {
|
|
1235
|
+
"title": "QuestionOption",
|
|
1236
|
+
"type": "object",
|
|
1237
|
+
"additionalProperties": false,
|
|
1238
|
+
"required": [
|
|
1239
|
+
"key"
|
|
1240
|
+
],
|
|
1241
|
+
"properties": {
|
|
1242
|
+
"key": {
|
|
1243
|
+
"$ref": "#/$defs/Key"
|
|
1244
|
+
},
|
|
1245
|
+
"label": {
|
|
1246
|
+
"type": "string",
|
|
1247
|
+
"maxLength": 512,
|
|
1248
|
+
"description": "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014)."
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
},
|
|
1252
|
+
"VotingParameters": {
|
|
1253
|
+
"title": "VotingParameters",
|
|
1254
|
+
"description": "The community's published voting parameters: the PCS suite and the voting verification key tickets are issued under (VTI-VOT-020). Distinct from its hidden-vetting helper key.",
|
|
1255
|
+
"type": "object",
|
|
1256
|
+
"additionalProperties": false,
|
|
1257
|
+
"required": [
|
|
1258
|
+
"suite",
|
|
1259
|
+
"votingKey"
|
|
1260
|
+
],
|
|
1261
|
+
"properties": {
|
|
1262
|
+
"suite": {
|
|
1263
|
+
"type": "string",
|
|
1264
|
+
"const": "ps-ddh-bls12381"
|
|
1265
|
+
},
|
|
1266
|
+
"votingKey": {
|
|
1267
|
+
"$ref": "#/$defs/Multibase"
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
};
|
|
1273
|
+
/**
|
|
1274
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
1275
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
1276
|
+
* per-specification and cannot be derived from the document alone, and
|
|
1277
|
+
* item 2 needs the schema this carries.
|
|
1278
|
+
*/
|
|
1279
|
+
export const SPEC = {
|
|
1280
|
+
typeUri: TYPE_URI,
|
|
1281
|
+
isBearer: false,
|
|
1282
|
+
isProofRequired: true,
|
|
1283
|
+
isRecipientRequired: true,
|
|
1284
|
+
isIssuedAtRequired: true,
|
|
1285
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
1286
|
+
};
|
|
1287
|
+
/**
|
|
1288
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
1289
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
1290
|
+
* parties (§7.3 item 5).
|
|
1291
|
+
*/
|
|
1292
|
+
export const RESPONSE_SPEC = {
|
|
1293
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
1294
|
+
isBearer: false,
|
|
1295
|
+
isProofRequired: false,
|
|
1296
|
+
isRecipientRequired: true,
|
|
1297
|
+
isIssuedAtRequired: true,
|
|
1298
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
1299
|
+
};
|
|
1300
|
+
//# sourceMappingURL=payload.js.map
|