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