@openvtc/trust-tasks 0.27.0 → 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 +51 -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/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/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,500 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/pcs/trustee/decrypt/0.2/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { DecryptionTarget, ElectionId, Ext, SignedRequest } from "../../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The trustee's VTA makes its partial decryption of each target, with proofs, and returns the voting/trustees/decrypt request signed as the trustee.
|
|
11
|
+
*/
|
|
12
|
+
export interface VTAPCSTrusteeDecryptPayload {
|
|
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
|
+
/**
|
|
27
|
+
* The targets voting/trustees/status lists.
|
|
28
|
+
*
|
|
29
|
+
* @minItems 1
|
|
30
|
+
* @maxItems 100000
|
|
31
|
+
*/
|
|
32
|
+
targets: [DecryptionTarget, ...DecryptionTarget[]];
|
|
33
|
+
/**
|
|
34
|
+
* The community's voting/trustees/authorize request, as voting/trustees/status carries it.
|
|
35
|
+
*/
|
|
36
|
+
authorization: SignedRequest;
|
|
37
|
+
ext?: Ext;
|
|
38
|
+
}
|
|
39
|
+
export interface VTAPCSTrusteeDecryptResponsePayload {
|
|
40
|
+
document: DecryptDocument;
|
|
41
|
+
ext?: Ext;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The voting/trustees/decrypt request, signed as the trustee.
|
|
45
|
+
*/
|
|
46
|
+
export interface DecryptDocument {
|
|
47
|
+
id: string;
|
|
48
|
+
type: "https://trusttasks.org/spec/voting/trustees/decrypt/0.1";
|
|
49
|
+
/**
|
|
50
|
+
* The signer.
|
|
51
|
+
*/
|
|
52
|
+
issuer: string;
|
|
53
|
+
/**
|
|
54
|
+
* The ballot box.
|
|
55
|
+
*/
|
|
56
|
+
recipient: string;
|
|
57
|
+
issuedAt: string;
|
|
58
|
+
expiresAt?: string;
|
|
59
|
+
/**
|
|
60
|
+
* That task's request payload.
|
|
61
|
+
*/
|
|
62
|
+
payload: {};
|
|
63
|
+
/**
|
|
64
|
+
* A Data Integrity proof by an `authentication` key of `issuer`.
|
|
65
|
+
*/
|
|
66
|
+
proof: {};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
70
|
+
export type { DecryptionTarget, ElectionId, Ext, SignedRequest };
|
|
71
|
+
|
|
72
|
+
/** Trust Task type URI. */
|
|
73
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vta/pcs/trustee/decrypt/0.2" as const;
|
|
74
|
+
|
|
75
|
+
/** Stable alias for this specification's request payload shape. */
|
|
76
|
+
export type Payload = VTAPCSTrusteeDecryptPayload;
|
|
77
|
+
|
|
78
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
79
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/pcs/trustee/decrypt/0.2#response" as const;
|
|
80
|
+
|
|
81
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
82
|
+
export type Response = VTAPCSTrusteeDecryptResponsePayload;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* This specification's payload schema, as a value.
|
|
86
|
+
*
|
|
87
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
88
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
89
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
90
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
91
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
92
|
+
*/
|
|
93
|
+
export const PAYLOAD_SCHEMA = {
|
|
94
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
95
|
+
"$id": "https://trusttasks.org/spec/vta/pcs/trustee/decrypt/0.2",
|
|
96
|
+
"title": "VTA PCS — Trustee Decrypt — payload",
|
|
97
|
+
"description": "The trustee's VTA makes its partial decryption of each target, with proofs, and returns the voting/trustees/decrypt request signed as the trustee.",
|
|
98
|
+
"type": "object",
|
|
99
|
+
"additionalProperties": false,
|
|
100
|
+
"required": [
|
|
101
|
+
"contextId",
|
|
102
|
+
"community",
|
|
103
|
+
"electionId",
|
|
104
|
+
"trustee",
|
|
105
|
+
"targets",
|
|
106
|
+
"authorization"
|
|
107
|
+
],
|
|
108
|
+
"properties": {
|
|
109
|
+
"contextId": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"minLength": 1,
|
|
112
|
+
"maxLength": 256,
|
|
113
|
+
"description": "The VTA context the trustee's keys live in."
|
|
114
|
+
},
|
|
115
|
+
"community": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"minLength": 1,
|
|
118
|
+
"maxLength": 2048,
|
|
119
|
+
"description": "The community's DID."
|
|
120
|
+
},
|
|
121
|
+
"electionId": {
|
|
122
|
+
"$ref": "#/$defs/ElectionId"
|
|
123
|
+
},
|
|
124
|
+
"trustee": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"minLength": 1,
|
|
127
|
+
"maxLength": 2048,
|
|
128
|
+
"description": "The trustee's DID: a persona this VTA holds, named in the manifest's `trustees.dids`."
|
|
129
|
+
},
|
|
130
|
+
"targets": {
|
|
131
|
+
"type": "array",
|
|
132
|
+
"minItems": 1,
|
|
133
|
+
"maxItems": 100000,
|
|
134
|
+
"items": {
|
|
135
|
+
"$ref": "#/$defs/DecryptionTarget"
|
|
136
|
+
},
|
|
137
|
+
"description": "The targets voting/trustees/status lists."
|
|
138
|
+
},
|
|
139
|
+
"authorization": {
|
|
140
|
+
"$ref": "#/$defs/SignedRequest",
|
|
141
|
+
"description": "The community's voting/trustees/authorize request, as voting/trustees/status carries it."
|
|
142
|
+
},
|
|
143
|
+
"ext": {
|
|
144
|
+
"$ref": "#/$defs/Ext"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"$defs": {
|
|
148
|
+
"Response": {
|
|
149
|
+
"$anchor": "response",
|
|
150
|
+
"title": "VTA PCS — Trustee Decrypt — response payload",
|
|
151
|
+
"type": "object",
|
|
152
|
+
"additionalProperties": false,
|
|
153
|
+
"required": [
|
|
154
|
+
"document"
|
|
155
|
+
],
|
|
156
|
+
"properties": {
|
|
157
|
+
"document": {
|
|
158
|
+
"title": "DecryptDocument",
|
|
159
|
+
"description": "The voting/trustees/decrypt request, signed as the trustee.",
|
|
160
|
+
"type": "object",
|
|
161
|
+
"required": [
|
|
162
|
+
"id",
|
|
163
|
+
"type",
|
|
164
|
+
"issuer",
|
|
165
|
+
"recipient",
|
|
166
|
+
"issuedAt",
|
|
167
|
+
"payload",
|
|
168
|
+
"proof"
|
|
169
|
+
],
|
|
170
|
+
"properties": {
|
|
171
|
+
"id": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"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}$"
|
|
174
|
+
},
|
|
175
|
+
"type": {
|
|
176
|
+
"const": "https://trusttasks.org/spec/voting/trustees/decrypt/0.1"
|
|
177
|
+
},
|
|
178
|
+
"issuer": {
|
|
179
|
+
"type": "string",
|
|
180
|
+
"minLength": 1,
|
|
181
|
+
"maxLength": 2048,
|
|
182
|
+
"description": "The signer."
|
|
183
|
+
},
|
|
184
|
+
"recipient": {
|
|
185
|
+
"type": "string",
|
|
186
|
+
"minLength": 1,
|
|
187
|
+
"maxLength": 2048,
|
|
188
|
+
"description": "The ballot box."
|
|
189
|
+
},
|
|
190
|
+
"issuedAt": {
|
|
191
|
+
"type": "string",
|
|
192
|
+
"format": "date-time"
|
|
193
|
+
},
|
|
194
|
+
"expiresAt": {
|
|
195
|
+
"type": "string",
|
|
196
|
+
"format": "date-time"
|
|
197
|
+
},
|
|
198
|
+
"payload": {
|
|
199
|
+
"type": "object",
|
|
200
|
+
"description": "That task's request payload."
|
|
201
|
+
},
|
|
202
|
+
"proof": {
|
|
203
|
+
"type": "object",
|
|
204
|
+
"description": "A Data Integrity proof by an `authentication` key of `issuer`."
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"ext": {
|
|
209
|
+
"$ref": "#/$defs/Ext"
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"Ext": {
|
|
214
|
+
"title": "Ext",
|
|
215
|
+
"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.",
|
|
216
|
+
"type": "object",
|
|
217
|
+
"minProperties": 1,
|
|
218
|
+
"additionalProperties": true,
|
|
219
|
+
"propertyNames": {
|
|
220
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"SignedRequest": {
|
|
224
|
+
"title": "SignedRequest",
|
|
225
|
+
"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.",
|
|
226
|
+
"type": "object",
|
|
227
|
+
"minProperties": 1
|
|
228
|
+
},
|
|
229
|
+
"DecryptionTarget": {
|
|
230
|
+
"title": "DecryptionTarget",
|
|
231
|
+
"description": "What a partial decryption decrypts: the sealed cast at a board leaf, or the total of one option of one question.",
|
|
232
|
+
"type": "object",
|
|
233
|
+
"additionalProperties": false,
|
|
234
|
+
"required": [
|
|
235
|
+
"ciphertext"
|
|
236
|
+
],
|
|
237
|
+
"properties": {
|
|
238
|
+
"leafIndex": {
|
|
239
|
+
"type": "integer",
|
|
240
|
+
"minimum": 0,
|
|
241
|
+
"description": "A sealed cast's board leaf."
|
|
242
|
+
},
|
|
243
|
+
"question": {
|
|
244
|
+
"$ref": "#/$defs/Key"
|
|
245
|
+
},
|
|
246
|
+
"option": {
|
|
247
|
+
"$ref": "#/$defs/Key"
|
|
248
|
+
},
|
|
249
|
+
"ciphertext": {
|
|
250
|
+
"$ref": "#/$defs/ElGamalCiphertext"
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
"oneOf": [
|
|
254
|
+
{
|
|
255
|
+
"required": [
|
|
256
|
+
"leafIndex"
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"required": [
|
|
261
|
+
"question",
|
|
262
|
+
"option"
|
|
263
|
+
]
|
|
264
|
+
}
|
|
265
|
+
]
|
|
266
|
+
},
|
|
267
|
+
"ElGamalCiphertext": {
|
|
268
|
+
"title": "ElGamalCiphertext",
|
|
269
|
+
"description": "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).",
|
|
270
|
+
"type": "object",
|
|
271
|
+
"additionalProperties": false,
|
|
272
|
+
"required": [
|
|
273
|
+
"a",
|
|
274
|
+
"b"
|
|
275
|
+
],
|
|
276
|
+
"properties": {
|
|
277
|
+
"a": {
|
|
278
|
+
"$ref": "#/$defs/GroupElement"
|
|
279
|
+
},
|
|
280
|
+
"b": {
|
|
281
|
+
"$ref": "#/$defs/GroupElement"
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
"GroupElement": {
|
|
286
|
+
"title": "GroupElement",
|
|
287
|
+
"description": "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).",
|
|
288
|
+
"type": "string",
|
|
289
|
+
"minLength": 2,
|
|
290
|
+
"maxLength": 64,
|
|
291
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
292
|
+
},
|
|
293
|
+
"Key": {
|
|
294
|
+
"title": "Key",
|
|
295
|
+
"description": "A question or option key, unique within its manifest or question.",
|
|
296
|
+
"type": "string",
|
|
297
|
+
"pattern": "^[A-Za-z0-9._-]{1,64}$"
|
|
298
|
+
},
|
|
299
|
+
"ElectionId": {
|
|
300
|
+
"title": "ElectionId",
|
|
301
|
+
"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.",
|
|
302
|
+
"type": "string",
|
|
303
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
} as const;
|
|
307
|
+
|
|
308
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
309
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
310
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
311
|
+
"$ref": "#/$defs/Response",
|
|
312
|
+
"$defs": {
|
|
313
|
+
"Response": {
|
|
314
|
+
"$anchor": "response",
|
|
315
|
+
"title": "VTA PCS — Trustee Decrypt — response payload",
|
|
316
|
+
"type": "object",
|
|
317
|
+
"additionalProperties": false,
|
|
318
|
+
"required": [
|
|
319
|
+
"document"
|
|
320
|
+
],
|
|
321
|
+
"properties": {
|
|
322
|
+
"document": {
|
|
323
|
+
"title": "DecryptDocument",
|
|
324
|
+
"description": "The voting/trustees/decrypt request, signed as the trustee.",
|
|
325
|
+
"type": "object",
|
|
326
|
+
"required": [
|
|
327
|
+
"id",
|
|
328
|
+
"type",
|
|
329
|
+
"issuer",
|
|
330
|
+
"recipient",
|
|
331
|
+
"issuedAt",
|
|
332
|
+
"payload",
|
|
333
|
+
"proof"
|
|
334
|
+
],
|
|
335
|
+
"properties": {
|
|
336
|
+
"id": {
|
|
337
|
+
"type": "string",
|
|
338
|
+
"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}$"
|
|
339
|
+
},
|
|
340
|
+
"type": {
|
|
341
|
+
"const": "https://trusttasks.org/spec/voting/trustees/decrypt/0.1"
|
|
342
|
+
},
|
|
343
|
+
"issuer": {
|
|
344
|
+
"type": "string",
|
|
345
|
+
"minLength": 1,
|
|
346
|
+
"maxLength": 2048,
|
|
347
|
+
"description": "The signer."
|
|
348
|
+
},
|
|
349
|
+
"recipient": {
|
|
350
|
+
"type": "string",
|
|
351
|
+
"minLength": 1,
|
|
352
|
+
"maxLength": 2048,
|
|
353
|
+
"description": "The ballot box."
|
|
354
|
+
},
|
|
355
|
+
"issuedAt": {
|
|
356
|
+
"type": "string",
|
|
357
|
+
"format": "date-time"
|
|
358
|
+
},
|
|
359
|
+
"expiresAt": {
|
|
360
|
+
"type": "string",
|
|
361
|
+
"format": "date-time"
|
|
362
|
+
},
|
|
363
|
+
"payload": {
|
|
364
|
+
"type": "object",
|
|
365
|
+
"description": "That task's request payload."
|
|
366
|
+
},
|
|
367
|
+
"proof": {
|
|
368
|
+
"type": "object",
|
|
369
|
+
"description": "A Data Integrity proof by an `authentication` key of `issuer`."
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
"ext": {
|
|
374
|
+
"$ref": "#/$defs/Ext"
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
"Ext": {
|
|
379
|
+
"title": "Ext",
|
|
380
|
+
"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.",
|
|
381
|
+
"type": "object",
|
|
382
|
+
"minProperties": 1,
|
|
383
|
+
"additionalProperties": true,
|
|
384
|
+
"propertyNames": {
|
|
385
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
"SignedRequest": {
|
|
389
|
+
"title": "SignedRequest",
|
|
390
|
+
"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.",
|
|
391
|
+
"type": "object",
|
|
392
|
+
"minProperties": 1
|
|
393
|
+
},
|
|
394
|
+
"DecryptionTarget": {
|
|
395
|
+
"title": "DecryptionTarget",
|
|
396
|
+
"description": "What a partial decryption decrypts: the sealed cast at a board leaf, or the total of one option of one question.",
|
|
397
|
+
"type": "object",
|
|
398
|
+
"additionalProperties": false,
|
|
399
|
+
"required": [
|
|
400
|
+
"ciphertext"
|
|
401
|
+
],
|
|
402
|
+
"properties": {
|
|
403
|
+
"leafIndex": {
|
|
404
|
+
"type": "integer",
|
|
405
|
+
"minimum": 0,
|
|
406
|
+
"description": "A sealed cast's board leaf."
|
|
407
|
+
},
|
|
408
|
+
"question": {
|
|
409
|
+
"$ref": "#/$defs/Key"
|
|
410
|
+
},
|
|
411
|
+
"option": {
|
|
412
|
+
"$ref": "#/$defs/Key"
|
|
413
|
+
},
|
|
414
|
+
"ciphertext": {
|
|
415
|
+
"$ref": "#/$defs/ElGamalCiphertext"
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
"oneOf": [
|
|
419
|
+
{
|
|
420
|
+
"required": [
|
|
421
|
+
"leafIndex"
|
|
422
|
+
]
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
"required": [
|
|
426
|
+
"question",
|
|
427
|
+
"option"
|
|
428
|
+
]
|
|
429
|
+
}
|
|
430
|
+
]
|
|
431
|
+
},
|
|
432
|
+
"ElGamalCiphertext": {
|
|
433
|
+
"title": "ElGamalCiphertext",
|
|
434
|
+
"description": "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).",
|
|
435
|
+
"type": "object",
|
|
436
|
+
"additionalProperties": false,
|
|
437
|
+
"required": [
|
|
438
|
+
"a",
|
|
439
|
+
"b"
|
|
440
|
+
],
|
|
441
|
+
"properties": {
|
|
442
|
+
"a": {
|
|
443
|
+
"$ref": "#/$defs/GroupElement"
|
|
444
|
+
},
|
|
445
|
+
"b": {
|
|
446
|
+
"$ref": "#/$defs/GroupElement"
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
"GroupElement": {
|
|
451
|
+
"title": "GroupElement",
|
|
452
|
+
"description": "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).",
|
|
453
|
+
"type": "string",
|
|
454
|
+
"minLength": 2,
|
|
455
|
+
"maxLength": 64,
|
|
456
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
457
|
+
},
|
|
458
|
+
"Key": {
|
|
459
|
+
"title": "Key",
|
|
460
|
+
"description": "A question or option key, unique within its manifest or question.",
|
|
461
|
+
"type": "string",
|
|
462
|
+
"pattern": "^[A-Za-z0-9._-]{1,64}$"
|
|
463
|
+
},
|
|
464
|
+
"ElectionId": {
|
|
465
|
+
"title": "ElectionId",
|
|
466
|
+
"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.",
|
|
467
|
+
"type": "string",
|
|
468
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
} as const;
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
475
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
476
|
+
* per-specification and cannot be derived from the document alone, and
|
|
477
|
+
* item 2 needs the schema this carries.
|
|
478
|
+
*/
|
|
479
|
+
export const SPEC = {
|
|
480
|
+
typeUri: TYPE_URI,
|
|
481
|
+
isBearer: false,
|
|
482
|
+
isProofRequired: true,
|
|
483
|
+
isRecipientRequired: true,
|
|
484
|
+
isIssuedAtRequired: true,
|
|
485
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
486
|
+
} as const;
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
490
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
491
|
+
* parties (§7.3 item 5).
|
|
492
|
+
*/
|
|
493
|
+
export const RESPONSE_SPEC = {
|
|
494
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
495
|
+
isBearer: false,
|
|
496
|
+
isProofRequired: false,
|
|
497
|
+
isRecipientRequired: true,
|
|
498
|
+
isIssuedAtRequired: true,
|
|
499
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
500
|
+
} as const;
|