@openvtc/trust-tasks 0.26.25 → 0.26.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -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 +13 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -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/elections/create/0.1/payload.d.ts +4 -4
- package/dist/vtc/elections/create/0.1/payload.js +2 -2
- package/dist/vtc/elections/create/0.1/payload.js.map +1 -1
- package/dist/vtc/elections/show/0.1/payload.d.ts +4 -4
- package/dist/vtc/elections/show/0.1/payload.js +2 -2
- package/dist/vtc/elections/show/0.1/payload.js.map +1 -1
- package/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 +13 -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/elections/create/0.1/payload.ts +2 -2
- package/src/vtc/elections/show/0.1/payload.ts +2 -2
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Source: specs/voting/board/read/0.1/payload.schema.json
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { Answer, Ballot, BoardEntry, BoardHead, Cast, CastEntry, DigestMultibase, ElectionId, ElectionResult, Ext, Key_VotingV0_1 as Key, LifecycleEntry, Multibase_VotingV0_1 as Multibase, QuestionResult, ReplacementEntry, ResultEntry } from "../../../../_shared/components.js";
|
|
6
|
+
import type { Answer, Ballot, BoardEntry, BoardHead, Cast, CastEntry, ConfirmationEntry, Dealing, DealingEntry, DecryptionTarget, DigestMultibase, ElectionId, ElectionKey, ElectionKeyEntry, ElectionResult, ElGamalCiphertext, EncryptedCast, EncryptedCastEntry, Ext, GroupElement, GroupScalar, JustificationEntry, Key_VotingV0_1 as Key, LifecycleEntry, Multibase_VotingV0_1 as Multibase, PartialDecryption, PartialDecryptionsEntry, QuestionResult, ReplacementEntry, ResultEntry, SealedPayload, SealedShare, SigmaProof, SpoiledEntry, TransportKey, TransportKeyEntry, TrusteeIndex, UnsealedEntry } from "../../../../_shared/components.js";
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -51,7 +51,7 @@ export interface VotingBoardReadResponsePayload {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
54
|
-
export type { Answer, Ballot, BoardEntry, BoardHead, Cast, CastEntry, DigestMultibase, ElectionId, ElectionResult, Ext, Key, LifecycleEntry, Multibase, QuestionResult, ReplacementEntry, ResultEntry };
|
|
54
|
+
export type { Answer, Ballot, BoardEntry, BoardHead, Cast, CastEntry, ConfirmationEntry, Dealing, DealingEntry, DecryptionTarget, DigestMultibase, ElectionId, ElectionKey, ElectionKeyEntry, ElectionResult, ElGamalCiphertext, EncryptedCast, EncryptedCastEntry, Ext, GroupElement, GroupScalar, JustificationEntry, Key, LifecycleEntry, Multibase, PartialDecryption, PartialDecryptionsEntry, QuestionResult, ReplacementEntry, ResultEntry, SealedPayload, SealedShare, SigmaProof, SpoiledEntry, TransportKey, TransportKeyEntry, TrusteeIndex, UnsealedEntry };
|
|
55
55
|
|
|
56
56
|
/** Trust Task type URI. */
|
|
57
57
|
export const TYPE_URI = "https://trusttasks.org/spec/voting/board/read/0.1" as const;
|
|
@@ -263,20 +263,203 @@ export const PAYLOAD_SCHEMA = {
|
|
|
263
263
|
"$ref": "#/$defs/ElectionResult"
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"title": "EncryptedCastEntry",
|
|
269
|
+
"type": "object",
|
|
270
|
+
"additionalProperties": false,
|
|
271
|
+
"required": [
|
|
272
|
+
"kind",
|
|
273
|
+
"cast"
|
|
274
|
+
],
|
|
275
|
+
"properties": {
|
|
276
|
+
"kind": {
|
|
277
|
+
"const": "encryptedCast"
|
|
278
|
+
},
|
|
279
|
+
"cast": {
|
|
280
|
+
"$ref": "#/$defs/EncryptedCast"
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"title": "TransportKeyEntry",
|
|
286
|
+
"type": "object",
|
|
287
|
+
"additionalProperties": false,
|
|
288
|
+
"required": [
|
|
289
|
+
"kind",
|
|
290
|
+
"transportKey"
|
|
291
|
+
],
|
|
292
|
+
"properties": {
|
|
293
|
+
"kind": {
|
|
294
|
+
"const": "transportKey"
|
|
295
|
+
},
|
|
296
|
+
"transportKey": {
|
|
297
|
+
"$ref": "#/$defs/TransportKey"
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"title": "DealingEntry",
|
|
303
|
+
"type": "object",
|
|
304
|
+
"additionalProperties": false,
|
|
305
|
+
"required": [
|
|
306
|
+
"kind",
|
|
307
|
+
"dealing"
|
|
308
|
+
],
|
|
309
|
+
"properties": {
|
|
310
|
+
"kind": {
|
|
311
|
+
"const": "dealing"
|
|
312
|
+
},
|
|
313
|
+
"dealing": {
|
|
314
|
+
"$ref": "#/$defs/Dealing"
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"title": "ConfirmationEntry",
|
|
320
|
+
"type": "object",
|
|
321
|
+
"additionalProperties": false,
|
|
322
|
+
"required": [
|
|
323
|
+
"kind",
|
|
324
|
+
"trustee",
|
|
325
|
+
"complaints"
|
|
326
|
+
],
|
|
327
|
+
"properties": {
|
|
328
|
+
"kind": {
|
|
329
|
+
"const": "confirmation"
|
|
330
|
+
},
|
|
331
|
+
"trustee": {
|
|
332
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
333
|
+
},
|
|
334
|
+
"complaints": {
|
|
335
|
+
"type": "array",
|
|
336
|
+
"maxItems": 64,
|
|
337
|
+
"items": {
|
|
338
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"title": "JustificationEntry",
|
|
345
|
+
"type": "object",
|
|
346
|
+
"additionalProperties": false,
|
|
347
|
+
"required": [
|
|
348
|
+
"kind",
|
|
349
|
+
"dealer",
|
|
350
|
+
"recipient",
|
|
351
|
+
"share"
|
|
352
|
+
],
|
|
353
|
+
"properties": {
|
|
354
|
+
"kind": {
|
|
355
|
+
"const": "justification"
|
|
356
|
+
},
|
|
357
|
+
"dealer": {
|
|
358
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
359
|
+
},
|
|
360
|
+
"recipient": {
|
|
361
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
362
|
+
},
|
|
363
|
+
"share": {
|
|
364
|
+
"$ref": "#/$defs/GroupScalar"
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"title": "ElectionKeyEntry",
|
|
370
|
+
"type": "object",
|
|
371
|
+
"additionalProperties": false,
|
|
372
|
+
"required": [
|
|
373
|
+
"kind",
|
|
374
|
+
"electionKey"
|
|
375
|
+
],
|
|
376
|
+
"properties": {
|
|
377
|
+
"kind": {
|
|
378
|
+
"const": "electionKey"
|
|
379
|
+
},
|
|
380
|
+
"electionKey": {
|
|
381
|
+
"$ref": "#/$defs/ElectionKey"
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"title": "PartialDecryptionsEntry",
|
|
387
|
+
"type": "object",
|
|
388
|
+
"additionalProperties": false,
|
|
389
|
+
"required": [
|
|
390
|
+
"kind",
|
|
391
|
+
"trustee",
|
|
392
|
+
"partials"
|
|
393
|
+
],
|
|
394
|
+
"properties": {
|
|
395
|
+
"kind": {
|
|
396
|
+
"const": "partials"
|
|
397
|
+
},
|
|
398
|
+
"trustee": {
|
|
399
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
400
|
+
},
|
|
401
|
+
"partials": {
|
|
402
|
+
"type": "array",
|
|
403
|
+
"minItems": 1,
|
|
404
|
+
"maxItems": 100000,
|
|
405
|
+
"items": {
|
|
406
|
+
"$ref": "#/$defs/PartialDecryption"
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"title": "UnsealedEntry",
|
|
413
|
+
"type": "object",
|
|
414
|
+
"additionalProperties": false,
|
|
415
|
+
"required": [
|
|
416
|
+
"kind",
|
|
417
|
+
"leafIndex",
|
|
418
|
+
"ballot"
|
|
419
|
+
],
|
|
420
|
+
"properties": {
|
|
421
|
+
"kind": {
|
|
422
|
+
"const": "unsealed"
|
|
423
|
+
},
|
|
424
|
+
"leafIndex": {
|
|
425
|
+
"type": "integer",
|
|
426
|
+
"minimum": 0
|
|
427
|
+
},
|
|
428
|
+
"ballot": {
|
|
429
|
+
"$ref": "#/$defs/Ballot"
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"title": "SpoiledEntry",
|
|
435
|
+
"description": "A sealed cast that did not open, or opened to no valid ballot: not counted (CONVENTIONS §9.7).",
|
|
436
|
+
"type": "object",
|
|
437
|
+
"additionalProperties": false,
|
|
438
|
+
"required": [
|
|
439
|
+
"kind",
|
|
440
|
+
"leafIndex"
|
|
441
|
+
],
|
|
442
|
+
"properties": {
|
|
443
|
+
"kind": {
|
|
444
|
+
"const": "spoiled"
|
|
445
|
+
},
|
|
446
|
+
"leafIndex": {
|
|
447
|
+
"type": "integer",
|
|
448
|
+
"minimum": 0
|
|
449
|
+
}
|
|
450
|
+
}
|
|
266
451
|
}
|
|
267
452
|
]
|
|
268
453
|
},
|
|
269
|
-
"
|
|
270
|
-
"title": "
|
|
271
|
-
"description": "An
|
|
454
|
+
"Ballot": {
|
|
455
|
+
"title": "Ballot",
|
|
456
|
+
"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.",
|
|
272
457
|
"type": "object",
|
|
273
458
|
"additionalProperties": false,
|
|
274
459
|
"required": [
|
|
275
460
|
"electionId",
|
|
276
461
|
"manifestDigest",
|
|
277
|
-
"
|
|
278
|
-
"questions",
|
|
279
|
-
"head"
|
|
462
|
+
"answers"
|
|
280
463
|
],
|
|
281
464
|
"properties": {
|
|
282
465
|
"electionId": {
|
|
@@ -285,51 +468,1050 @@ export const PAYLOAD_SCHEMA = {
|
|
|
285
468
|
"manifestDigest": {
|
|
286
469
|
"$ref": "#/$defs/DigestMultibase"
|
|
287
470
|
},
|
|
288
|
-
"
|
|
289
|
-
"type": "
|
|
290
|
-
"
|
|
471
|
+
"answers": {
|
|
472
|
+
"type": "array",
|
|
473
|
+
"minItems": 1,
|
|
474
|
+
"maxItems": 128,
|
|
475
|
+
"items": {
|
|
476
|
+
"$ref": "#/$defs/Answer"
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
"Answer": {
|
|
482
|
+
"title": "Answer",
|
|
483
|
+
"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.",
|
|
484
|
+
"type": "object",
|
|
485
|
+
"additionalProperties": false,
|
|
486
|
+
"required": [
|
|
487
|
+
"question"
|
|
488
|
+
],
|
|
489
|
+
"minProperties": 2,
|
|
490
|
+
"maxProperties": 2,
|
|
491
|
+
"properties": {
|
|
492
|
+
"question": {
|
|
493
|
+
"$ref": "#/$defs/Key"
|
|
291
494
|
},
|
|
292
|
-
"
|
|
495
|
+
"choice": {
|
|
293
496
|
"type": "array",
|
|
294
497
|
"items": {
|
|
295
|
-
"$ref": "#/$defs/
|
|
498
|
+
"$ref": "#/$defs/Key"
|
|
499
|
+
},
|
|
500
|
+
"uniqueItems": true
|
|
501
|
+
},
|
|
502
|
+
"ranking": {
|
|
503
|
+
"type": "array",
|
|
504
|
+
"items": {
|
|
505
|
+
"$ref": "#/$defs/Key"
|
|
506
|
+
},
|
|
507
|
+
"uniqueItems": true
|
|
508
|
+
},
|
|
509
|
+
"scores": {
|
|
510
|
+
"type": "object",
|
|
511
|
+
"propertyNames": {
|
|
512
|
+
"$ref": "#/$defs/Key"
|
|
513
|
+
},
|
|
514
|
+
"additionalProperties": {
|
|
515
|
+
"type": "integer"
|
|
296
516
|
}
|
|
297
517
|
},
|
|
298
|
-
"
|
|
299
|
-
"
|
|
300
|
-
"
|
|
518
|
+
"text": {
|
|
519
|
+
"type": "string",
|
|
520
|
+
"maxLength": 4096
|
|
521
|
+
},
|
|
522
|
+
"abstain": {
|
|
523
|
+
"const": true
|
|
301
524
|
}
|
|
302
525
|
}
|
|
303
526
|
},
|
|
304
|
-
"
|
|
305
|
-
"title": "
|
|
306
|
-
"description": "A
|
|
527
|
+
"Key": {
|
|
528
|
+
"title": "Key",
|
|
529
|
+
"description": "A question or option key, unique within its manifest or question.",
|
|
530
|
+
"type": "string",
|
|
531
|
+
"pattern": "^[A-Za-z0-9._-]{1,64}$"
|
|
532
|
+
},
|
|
533
|
+
"ElectionId": {
|
|
534
|
+
"title": "ElectionId",
|
|
535
|
+
"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.",
|
|
536
|
+
"type": "string",
|
|
537
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
538
|
+
},
|
|
539
|
+
"DigestMultibase": {
|
|
540
|
+
"title": "DigestMultibase",
|
|
541
|
+
"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`.",
|
|
542
|
+
"type": "string",
|
|
543
|
+
"minLength": 16,
|
|
544
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
545
|
+
"examples": [
|
|
546
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
547
|
+
]
|
|
548
|
+
},
|
|
549
|
+
"PartialDecryption": {
|
|
550
|
+
"title": "PartialDecryption",
|
|
551
|
+
"description": "Trustee `trustee`'s share of one decryption, `d = x_j·a`, with a Chaum–Pedersen proof against its verification key (CONVENTIONS §9.7).",
|
|
307
552
|
"type": "object",
|
|
308
553
|
"additionalProperties": false,
|
|
309
554
|
"required": [
|
|
310
|
-
"
|
|
311
|
-
"
|
|
312
|
-
"
|
|
313
|
-
"issuedAt"
|
|
555
|
+
"target",
|
|
556
|
+
"d",
|
|
557
|
+
"proof"
|
|
314
558
|
],
|
|
315
559
|
"properties": {
|
|
316
|
-
"
|
|
317
|
-
"$ref": "#/$defs/
|
|
560
|
+
"target": {
|
|
561
|
+
"$ref": "#/$defs/DecryptionTarget"
|
|
318
562
|
},
|
|
319
|
-
"
|
|
563
|
+
"d": {
|
|
564
|
+
"$ref": "#/$defs/GroupElement"
|
|
565
|
+
},
|
|
566
|
+
"proof": {
|
|
567
|
+
"$ref": "#/$defs/SigmaProof"
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
},
|
|
571
|
+
"SigmaProof": {
|
|
572
|
+
"title": "SigmaProof",
|
|
573
|
+
"description": "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).",
|
|
574
|
+
"type": "object",
|
|
575
|
+
"additionalProperties": false,
|
|
576
|
+
"required": [
|
|
577
|
+
"c",
|
|
578
|
+
"z"
|
|
579
|
+
],
|
|
580
|
+
"properties": {
|
|
581
|
+
"c": {
|
|
582
|
+
"$ref": "#/$defs/GroupScalar"
|
|
583
|
+
},
|
|
584
|
+
"z": {
|
|
585
|
+
"$ref": "#/$defs/GroupScalar"
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
"GroupScalar": {
|
|
590
|
+
"title": "GroupScalar",
|
|
591
|
+
"description": "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).",
|
|
592
|
+
"type": "string",
|
|
593
|
+
"minLength": 2,
|
|
594
|
+
"maxLength": 64,
|
|
595
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
596
|
+
},
|
|
597
|
+
"GroupElement": {
|
|
598
|
+
"title": "GroupElement",
|
|
599
|
+
"description": "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).",
|
|
600
|
+
"type": "string",
|
|
601
|
+
"minLength": 2,
|
|
602
|
+
"maxLength": 64,
|
|
603
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
604
|
+
},
|
|
605
|
+
"DecryptionTarget": {
|
|
606
|
+
"title": "DecryptionTarget",
|
|
607
|
+
"description": "What a partial decryption decrypts: the sealed cast at a board leaf, or the total of one option of one question.",
|
|
608
|
+
"type": "object",
|
|
609
|
+
"additionalProperties": false,
|
|
610
|
+
"required": [
|
|
611
|
+
"ciphertext"
|
|
612
|
+
],
|
|
613
|
+
"properties": {
|
|
614
|
+
"leafIndex": {
|
|
320
615
|
"type": "integer",
|
|
321
|
-
"minimum": 0
|
|
616
|
+
"minimum": 0,
|
|
617
|
+
"description": "A sealed cast's board leaf."
|
|
322
618
|
},
|
|
323
|
-
"
|
|
324
|
-
"$ref": "#/$defs/
|
|
325
|
-
|
|
619
|
+
"question": {
|
|
620
|
+
"$ref": "#/$defs/Key"
|
|
621
|
+
},
|
|
622
|
+
"option": {
|
|
623
|
+
"$ref": "#/$defs/Key"
|
|
624
|
+
},
|
|
625
|
+
"ciphertext": {
|
|
626
|
+
"$ref": "#/$defs/ElGamalCiphertext"
|
|
627
|
+
}
|
|
628
|
+
},
|
|
629
|
+
"oneOf": [
|
|
630
|
+
{
|
|
631
|
+
"required": [
|
|
632
|
+
"leafIndex"
|
|
633
|
+
]
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
"required": [
|
|
637
|
+
"question",
|
|
638
|
+
"option"
|
|
639
|
+
]
|
|
640
|
+
}
|
|
641
|
+
]
|
|
642
|
+
},
|
|
643
|
+
"ElGamalCiphertext": {
|
|
644
|
+
"title": "ElGamalCiphertext",
|
|
645
|
+
"description": "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).",
|
|
646
|
+
"type": "object",
|
|
647
|
+
"additionalProperties": false,
|
|
648
|
+
"required": [
|
|
649
|
+
"a",
|
|
650
|
+
"b"
|
|
651
|
+
],
|
|
652
|
+
"properties": {
|
|
653
|
+
"a": {
|
|
654
|
+
"$ref": "#/$defs/GroupElement"
|
|
655
|
+
},
|
|
656
|
+
"b": {
|
|
657
|
+
"$ref": "#/$defs/GroupElement"
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
"TrusteeIndex": {
|
|
662
|
+
"title": "TrusteeIndex",
|
|
663
|
+
"description": "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.",
|
|
664
|
+
"type": "integer",
|
|
665
|
+
"minimum": 1,
|
|
666
|
+
"maximum": 64
|
|
667
|
+
},
|
|
668
|
+
"ElectionKey": {
|
|
669
|
+
"title": "ElectionKey",
|
|
670
|
+
"description": "The election key and each trustee's public verification key, computed from the qualified dealings (CONVENTIONS §9.6). Anyone can recompute it from the board.",
|
|
671
|
+
"type": "object",
|
|
672
|
+
"additionalProperties": false,
|
|
673
|
+
"required": [
|
|
674
|
+
"key",
|
|
675
|
+
"qualified",
|
|
676
|
+
"verification"
|
|
677
|
+
],
|
|
678
|
+
"properties": {
|
|
679
|
+
"key": {
|
|
680
|
+
"$ref": "#/$defs/GroupElement"
|
|
681
|
+
},
|
|
682
|
+
"qualified": {
|
|
683
|
+
"type": "array",
|
|
684
|
+
"minItems": 1,
|
|
685
|
+
"maxItems": 64,
|
|
686
|
+
"items": {
|
|
687
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
688
|
+
},
|
|
689
|
+
"description": "The dealers whose dealings the key is formed from."
|
|
690
|
+
},
|
|
691
|
+
"verification": {
|
|
692
|
+
"type": "array",
|
|
693
|
+
"minItems": 2,
|
|
694
|
+
"maxItems": 64,
|
|
695
|
+
"items": {
|
|
696
|
+
"type": "object",
|
|
697
|
+
"additionalProperties": false,
|
|
698
|
+
"required": [
|
|
699
|
+
"trustee",
|
|
700
|
+
"key"
|
|
701
|
+
],
|
|
702
|
+
"properties": {
|
|
703
|
+
"trustee": {
|
|
704
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
705
|
+
},
|
|
706
|
+
"key": {
|
|
707
|
+
"$ref": "#/$defs/GroupElement"
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
"Dealing": {
|
|
715
|
+
"title": "Dealing",
|
|
716
|
+
"description": "A trustee's contribution to the election key: Feldman commitments to its polynomial, a proof of knowledge of the constant term, and one share per trustee sealed to that trustee's transport key (CONVENTIONS §9.6).",
|
|
717
|
+
"type": "object",
|
|
718
|
+
"additionalProperties": false,
|
|
719
|
+
"required": [
|
|
720
|
+
"dealer",
|
|
721
|
+
"commitments",
|
|
722
|
+
"pok",
|
|
723
|
+
"shares"
|
|
724
|
+
],
|
|
725
|
+
"properties": {
|
|
726
|
+
"dealer": {
|
|
727
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
728
|
+
},
|
|
729
|
+
"commitments": {
|
|
730
|
+
"type": "array",
|
|
731
|
+
"minItems": 2,
|
|
732
|
+
"maxItems": 64,
|
|
733
|
+
"items": {
|
|
734
|
+
"$ref": "#/$defs/GroupElement"
|
|
735
|
+
}
|
|
736
|
+
},
|
|
737
|
+
"pok": {
|
|
738
|
+
"$ref": "#/$defs/SigmaProof"
|
|
739
|
+
},
|
|
740
|
+
"shares": {
|
|
741
|
+
"type": "array",
|
|
742
|
+
"minItems": 2,
|
|
743
|
+
"maxItems": 64,
|
|
744
|
+
"items": {
|
|
745
|
+
"$ref": "#/$defs/SealedShare"
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
"SealedShare": {
|
|
751
|
+
"title": "SealedShare",
|
|
752
|
+
"type": "object",
|
|
753
|
+
"additionalProperties": false,
|
|
754
|
+
"required": [
|
|
755
|
+
"recipient",
|
|
756
|
+
"share"
|
|
757
|
+
],
|
|
758
|
+
"properties": {
|
|
759
|
+
"recipient": {
|
|
760
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
761
|
+
},
|
|
762
|
+
"share": {
|
|
763
|
+
"$ref": "#/$defs/SealedPayload"
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
},
|
|
767
|
+
"SealedPayload": {
|
|
768
|
+
"title": "SealedPayload",
|
|
769
|
+
"description": "Bytes sealed to a key: a random group element encrypted as `kem`, and the bytes under ChaCha20-Poly1305 with a key derived from it, multibase base58btc (CONVENTIONS §9.4).",
|
|
770
|
+
"type": "object",
|
|
771
|
+
"additionalProperties": false,
|
|
772
|
+
"required": [
|
|
773
|
+
"kem",
|
|
774
|
+
"body"
|
|
775
|
+
],
|
|
776
|
+
"properties": {
|
|
777
|
+
"kem": {
|
|
778
|
+
"$ref": "#/$defs/ElGamalCiphertext"
|
|
779
|
+
},
|
|
780
|
+
"body": {
|
|
781
|
+
"type": "string",
|
|
782
|
+
"minLength": 2,
|
|
783
|
+
"maxLength": 131072,
|
|
784
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
},
|
|
788
|
+
"TransportKey": {
|
|
789
|
+
"title": "TransportKey",
|
|
790
|
+
"description": "The group element a trustee's shares are sealed to, with a Schnorr proof of knowledge of its discrete log (CONVENTIONS §9.6).",
|
|
791
|
+
"type": "object",
|
|
792
|
+
"additionalProperties": false,
|
|
793
|
+
"required": [
|
|
794
|
+
"trustee",
|
|
795
|
+
"key",
|
|
796
|
+
"pok"
|
|
797
|
+
],
|
|
798
|
+
"properties": {
|
|
799
|
+
"trustee": {
|
|
800
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
801
|
+
},
|
|
802
|
+
"key": {
|
|
803
|
+
"$ref": "#/$defs/GroupElement"
|
|
804
|
+
},
|
|
805
|
+
"pok": {
|
|
806
|
+
"$ref": "#/$defs/SigmaProof"
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
},
|
|
810
|
+
"EncryptedCast": {
|
|
811
|
+
"title": "EncryptedCast",
|
|
812
|
+
"description": "A cast of a sealed or tallied-encrypted election: exactly one of `sealed` (the Ballot's JCS bytes sealed to the election key) or `encrypted`, with the tag and the attestation over the JCS bytes of whichever is present (CONVENTIONS §3.6, §9.5).",
|
|
813
|
+
"type": "object",
|
|
814
|
+
"additionalProperties": false,
|
|
815
|
+
"required": [
|
|
816
|
+
"tag",
|
|
817
|
+
"attestation"
|
|
818
|
+
],
|
|
819
|
+
"properties": {
|
|
820
|
+
"sealed": {
|
|
821
|
+
"$ref": "#/$defs/SealedPayload"
|
|
822
|
+
},
|
|
823
|
+
"encrypted": {
|
|
824
|
+
"$ref": "#/$defs/EncryptedBallot"
|
|
825
|
+
},
|
|
826
|
+
"tag": {
|
|
827
|
+
"$ref": "#/$defs/Multibase"
|
|
828
|
+
},
|
|
829
|
+
"attestation": {
|
|
830
|
+
"$ref": "#/$defs/Multibase"
|
|
831
|
+
}
|
|
832
|
+
},
|
|
833
|
+
"oneOf": [
|
|
834
|
+
{
|
|
835
|
+
"required": [
|
|
836
|
+
"sealed"
|
|
837
|
+
]
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
"required": [
|
|
841
|
+
"encrypted"
|
|
842
|
+
]
|
|
843
|
+
}
|
|
844
|
+
]
|
|
845
|
+
},
|
|
846
|
+
"Multibase": {
|
|
847
|
+
"title": "Multibase",
|
|
848
|
+
"description": "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.",
|
|
849
|
+
"type": "string",
|
|
850
|
+
"maxLength": 16384,
|
|
851
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
852
|
+
},
|
|
853
|
+
"EncryptedBallot": {
|
|
854
|
+
"title": "EncryptedBallot",
|
|
855
|
+
"description": "A tallied-encrypted ballot: one EncryptedQuestion per manifest question, in the manifest's order. Never decrypted (VTI-VOT-064).",
|
|
856
|
+
"type": "object",
|
|
857
|
+
"additionalProperties": false,
|
|
858
|
+
"required": [
|
|
859
|
+
"electionId",
|
|
860
|
+
"manifestDigest",
|
|
861
|
+
"questions"
|
|
862
|
+
],
|
|
863
|
+
"properties": {
|
|
864
|
+
"electionId": {
|
|
865
|
+
"$ref": "#/$defs/ElectionId"
|
|
866
|
+
},
|
|
867
|
+
"manifestDigest": {
|
|
868
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
869
|
+
},
|
|
870
|
+
"questions": {
|
|
871
|
+
"type": "array",
|
|
872
|
+
"minItems": 1,
|
|
873
|
+
"maxItems": 64,
|
|
874
|
+
"items": {
|
|
875
|
+
"$ref": "#/$defs/EncryptedQuestion"
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
},
|
|
880
|
+
"EncryptedQuestion": {
|
|
881
|
+
"title": "EncryptedQuestion",
|
|
882
|
+
"description": "One choice question of a tallied-encrypted ballot: per option, in the manifest's order, an encryption of 0 or 1 with its proof; and a proof that the selections sum to a count the question admits (CONVENTIONS §9.5).",
|
|
883
|
+
"type": "object",
|
|
884
|
+
"additionalProperties": false,
|
|
885
|
+
"required": [
|
|
886
|
+
"question",
|
|
887
|
+
"options",
|
|
888
|
+
"sumProof"
|
|
889
|
+
],
|
|
890
|
+
"properties": {
|
|
891
|
+
"question": {
|
|
892
|
+
"$ref": "#/$defs/Key"
|
|
893
|
+
},
|
|
894
|
+
"options": {
|
|
895
|
+
"type": "array",
|
|
896
|
+
"minItems": 1,
|
|
897
|
+
"maxItems": 64,
|
|
898
|
+
"items": {
|
|
899
|
+
"$ref": "#/$defs/EncryptedOption"
|
|
900
|
+
}
|
|
901
|
+
},
|
|
902
|
+
"sumProof": {
|
|
903
|
+
"$ref": "#/$defs/DisjunctiveProof"
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
},
|
|
907
|
+
"DisjunctiveProof": {
|
|
908
|
+
"title": "DisjunctiveProof",
|
|
909
|
+
"description": "A disjunctive proof that a ciphertext encrypts one value of a public list: one `(c, z)` per value, in the list's order (CONVENTIONS §9.3).",
|
|
910
|
+
"type": "array",
|
|
911
|
+
"minItems": 1,
|
|
912
|
+
"maxItems": 65,
|
|
913
|
+
"items": {
|
|
914
|
+
"$ref": "#/$defs/SigmaProof"
|
|
915
|
+
}
|
|
916
|
+
},
|
|
917
|
+
"EncryptedOption": {
|
|
918
|
+
"title": "EncryptedOption",
|
|
919
|
+
"type": "object",
|
|
920
|
+
"additionalProperties": false,
|
|
921
|
+
"required": [
|
|
922
|
+
"ciphertext",
|
|
923
|
+
"proof"
|
|
924
|
+
],
|
|
925
|
+
"properties": {
|
|
926
|
+
"ciphertext": {
|
|
927
|
+
"$ref": "#/$defs/ElGamalCiphertext"
|
|
928
|
+
},
|
|
929
|
+
"proof": {
|
|
930
|
+
"$ref": "#/$defs/DisjunctiveProof"
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
},
|
|
934
|
+
"ElectionResult": {
|
|
935
|
+
"title": "ElectionResult",
|
|
936
|
+
"description": "An election's result, computable by anyone who can read its board from the board and the registration alone (VTI-VOT-070).",
|
|
937
|
+
"type": "object",
|
|
938
|
+
"additionalProperties": false,
|
|
939
|
+
"required": [
|
|
940
|
+
"electionId",
|
|
941
|
+
"manifestDigest",
|
|
942
|
+
"ballotsCounted",
|
|
943
|
+
"questions",
|
|
944
|
+
"head"
|
|
945
|
+
],
|
|
946
|
+
"properties": {
|
|
947
|
+
"electionId": {
|
|
948
|
+
"$ref": "#/$defs/ElectionId"
|
|
949
|
+
},
|
|
950
|
+
"manifestDigest": {
|
|
951
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
952
|
+
},
|
|
953
|
+
"ballotsCounted": {
|
|
954
|
+
"type": "integer",
|
|
955
|
+
"minimum": 0
|
|
956
|
+
},
|
|
957
|
+
"questions": {
|
|
958
|
+
"type": "array",
|
|
959
|
+
"items": {
|
|
960
|
+
"$ref": "#/$defs/QuestionResult"
|
|
961
|
+
}
|
|
962
|
+
},
|
|
963
|
+
"head": {
|
|
964
|
+
"$ref": "#/$defs/BoardHead",
|
|
965
|
+
"description": "The head of the board as it stood at close: the result counts exactly its entries."
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
},
|
|
969
|
+
"BoardHead": {
|
|
970
|
+
"title": "BoardHead",
|
|
971
|
+
"description": "A board's tree head (RFC 9162 §2.1). A head is signed by being carried in a document the ballot box signs; whoever keeps a head keeps that whole document.",
|
|
972
|
+
"type": "object",
|
|
973
|
+
"additionalProperties": false,
|
|
974
|
+
"required": [
|
|
975
|
+
"electionId",
|
|
976
|
+
"treeSize",
|
|
977
|
+
"rootHash",
|
|
978
|
+
"issuedAt"
|
|
979
|
+
],
|
|
980
|
+
"properties": {
|
|
981
|
+
"electionId": {
|
|
982
|
+
"$ref": "#/$defs/ElectionId"
|
|
983
|
+
},
|
|
984
|
+
"treeSize": {
|
|
985
|
+
"type": "integer",
|
|
986
|
+
"minimum": 0
|
|
987
|
+
},
|
|
988
|
+
"rootHash": {
|
|
989
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
990
|
+
"description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
|
|
991
|
+
},
|
|
992
|
+
"issuedAt": {
|
|
993
|
+
"type": "string",
|
|
994
|
+
"format": "date-time"
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
},
|
|
998
|
+
"QuestionResult": {
|
|
999
|
+
"title": "QuestionResult",
|
|
1000
|
+
"description": "One question's totals. `choice`: selections per option. `ranking`: per option, how many ballots placed it at each position (index 0 = first). `score`: per option, the sum and the number of ballots that scored it. `text`: the answers, in board order, withheld (`withheld: true`) below the manifest's `textReleaseThreshold`. `abstained` counts ballots that left the question unanswered.",
|
|
1001
|
+
"type": "object",
|
|
1002
|
+
"additionalProperties": false,
|
|
1003
|
+
"required": [
|
|
1004
|
+
"question",
|
|
1005
|
+
"abstained"
|
|
1006
|
+
],
|
|
1007
|
+
"properties": {
|
|
1008
|
+
"question": {
|
|
1009
|
+
"$ref": "#/$defs/Key"
|
|
1010
|
+
},
|
|
1011
|
+
"abstained": {
|
|
1012
|
+
"type": "integer",
|
|
1013
|
+
"minimum": 0
|
|
1014
|
+
},
|
|
1015
|
+
"choice": {
|
|
1016
|
+
"type": "object",
|
|
1017
|
+
"propertyNames": {
|
|
1018
|
+
"$ref": "#/$defs/Key"
|
|
1019
|
+
},
|
|
1020
|
+
"additionalProperties": {
|
|
1021
|
+
"type": "integer",
|
|
1022
|
+
"minimum": 0
|
|
1023
|
+
}
|
|
1024
|
+
},
|
|
1025
|
+
"ranking": {
|
|
1026
|
+
"type": "object",
|
|
1027
|
+
"propertyNames": {
|
|
1028
|
+
"$ref": "#/$defs/Key"
|
|
1029
|
+
},
|
|
1030
|
+
"additionalProperties": {
|
|
1031
|
+
"type": "array",
|
|
1032
|
+
"items": {
|
|
1033
|
+
"type": "integer",
|
|
1034
|
+
"minimum": 0
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
},
|
|
1038
|
+
"score": {
|
|
1039
|
+
"type": "object",
|
|
1040
|
+
"propertyNames": {
|
|
1041
|
+
"$ref": "#/$defs/Key"
|
|
1042
|
+
},
|
|
1043
|
+
"additionalProperties": {
|
|
1044
|
+
"type": "object",
|
|
1045
|
+
"additionalProperties": false,
|
|
1046
|
+
"required": [
|
|
1047
|
+
"sum",
|
|
1048
|
+
"count"
|
|
1049
|
+
],
|
|
1050
|
+
"properties": {
|
|
1051
|
+
"sum": {
|
|
1052
|
+
"type": "integer"
|
|
1053
|
+
},
|
|
1054
|
+
"count": {
|
|
1055
|
+
"type": "integer",
|
|
1056
|
+
"minimum": 0
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
},
|
|
1061
|
+
"text": {
|
|
1062
|
+
"type": "array",
|
|
1063
|
+
"items": {
|
|
1064
|
+
"type": "string",
|
|
1065
|
+
"maxLength": 4096
|
|
1066
|
+
}
|
|
1067
|
+
},
|
|
1068
|
+
"withheld": {
|
|
1069
|
+
"type": "boolean"
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
},
|
|
1073
|
+
"Cast": {
|
|
1074
|
+
"title": "Cast",
|
|
1075
|
+
"description": "A ballot and the PCS attestation that admits it (VTI-VOT-030). `attestation` is the suite's canonical encoding of the attestation made for the election point with the ballot context bound in (CONVENTIONS §3); `tag` repeats its tag so a ballot box can refuse a duplicate before the pairing check.",
|
|
1076
|
+
"type": "object",
|
|
1077
|
+
"additionalProperties": false,
|
|
1078
|
+
"required": [
|
|
1079
|
+
"ballot",
|
|
1080
|
+
"tag",
|
|
1081
|
+
"attestation"
|
|
1082
|
+
],
|
|
1083
|
+
"properties": {
|
|
1084
|
+
"ballot": {
|
|
1085
|
+
"$ref": "#/$defs/Ballot"
|
|
1086
|
+
},
|
|
1087
|
+
"tag": {
|
|
1088
|
+
"$ref": "#/$defs/Multibase"
|
|
1089
|
+
},
|
|
1090
|
+
"attestation": {
|
|
1091
|
+
"$ref": "#/$defs/Multibase"
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
} as const;
|
|
1097
|
+
|
|
1098
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
1099
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
1100
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
1101
|
+
"$ref": "#/$defs/Response",
|
|
1102
|
+
"$defs": {
|
|
1103
|
+
"Response": {
|
|
1104
|
+
"$anchor": "response",
|
|
1105
|
+
"title": "Voting — Board Read — response payload",
|
|
1106
|
+
"type": "object",
|
|
1107
|
+
"additionalProperties": false,
|
|
1108
|
+
"required": [
|
|
1109
|
+
"treeSize",
|
|
1110
|
+
"entries"
|
|
1111
|
+
],
|
|
1112
|
+
"properties": {
|
|
1113
|
+
"treeSize": {
|
|
1114
|
+
"type": "integer",
|
|
1115
|
+
"minimum": 0,
|
|
1116
|
+
"description": "The tree size the page was read against. No entry at or beyond it is returned."
|
|
1117
|
+
},
|
|
1118
|
+
"entries": {
|
|
1119
|
+
"type": "array",
|
|
1120
|
+
"maxItems": 1000,
|
|
1121
|
+
"items": {
|
|
1122
|
+
"type": "object",
|
|
1123
|
+
"additionalProperties": false,
|
|
1124
|
+
"required": [
|
|
1125
|
+
"index",
|
|
1126
|
+
"entry"
|
|
1127
|
+
],
|
|
1128
|
+
"properties": {
|
|
1129
|
+
"index": {
|
|
1130
|
+
"type": "integer",
|
|
1131
|
+
"minimum": 0
|
|
1132
|
+
},
|
|
1133
|
+
"entry": {
|
|
1134
|
+
"$ref": "#/$defs/BoardEntry"
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
},
|
|
1138
|
+
"description": "Consecutive entries from `from`, in board order."
|
|
1139
|
+
},
|
|
1140
|
+
"next": {
|
|
1141
|
+
"type": "integer",
|
|
1142
|
+
"minimum": 1,
|
|
1143
|
+
"description": "The `from` of the next page. Absent when the page reaches `treeSize`."
|
|
1144
|
+
},
|
|
1145
|
+
"ext": {
|
|
1146
|
+
"$ref": "#/$defs/Ext"
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
},
|
|
1150
|
+
"Ext": {
|
|
1151
|
+
"title": "Ext",
|
|
1152
|
+
"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.",
|
|
1153
|
+
"type": "object",
|
|
1154
|
+
"minProperties": 1,
|
|
1155
|
+
"additionalProperties": true,
|
|
1156
|
+
"propertyNames": {
|
|
1157
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
1158
|
+
}
|
|
1159
|
+
},
|
|
1160
|
+
"BoardEntry": {
|
|
1161
|
+
"title": "BoardEntry",
|
|
1162
|
+
"description": "One leaf of a board. A leaf's hash is the RFC 9162 leaf hash of the JCS canonicalization of this object. Entries carry no time of arrival: the order is the board's, and a timestamp would hand anyone who reads the board the timing the registrar's log would need to pair a ticket with its cast.",
|
|
1163
|
+
"oneOf": [
|
|
1164
|
+
{
|
|
1165
|
+
"title": "CastEntry",
|
|
1166
|
+
"type": "object",
|
|
1167
|
+
"additionalProperties": false,
|
|
1168
|
+
"required": [
|
|
1169
|
+
"kind",
|
|
1170
|
+
"cast"
|
|
1171
|
+
],
|
|
1172
|
+
"properties": {
|
|
1173
|
+
"kind": {
|
|
1174
|
+
"const": "cast"
|
|
1175
|
+
},
|
|
1176
|
+
"cast": {
|
|
1177
|
+
"$ref": "#/$defs/Cast"
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
},
|
|
1181
|
+
{
|
|
1182
|
+
"title": "ReplacementEntry",
|
|
1183
|
+
"description": "The cast at `replaces` is no longer counted: a later cast under the same tag is.",
|
|
1184
|
+
"type": "object",
|
|
1185
|
+
"additionalProperties": false,
|
|
1186
|
+
"required": [
|
|
1187
|
+
"kind",
|
|
1188
|
+
"tag",
|
|
1189
|
+
"replaces",
|
|
1190
|
+
"by"
|
|
1191
|
+
],
|
|
1192
|
+
"properties": {
|
|
1193
|
+
"kind": {
|
|
1194
|
+
"const": "replaced"
|
|
1195
|
+
},
|
|
1196
|
+
"tag": {
|
|
1197
|
+
"$ref": "#/$defs/Multibase"
|
|
1198
|
+
},
|
|
1199
|
+
"replaces": {
|
|
1200
|
+
"type": "integer",
|
|
1201
|
+
"minimum": 0
|
|
1202
|
+
},
|
|
1203
|
+
"by": {
|
|
1204
|
+
"type": "integer",
|
|
1205
|
+
"minimum": 0
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
},
|
|
1209
|
+
{
|
|
1210
|
+
"title": "LifecycleEntry",
|
|
1211
|
+
"type": "object",
|
|
1212
|
+
"additionalProperties": false,
|
|
1213
|
+
"required": [
|
|
1214
|
+
"kind",
|
|
1215
|
+
"at"
|
|
1216
|
+
],
|
|
1217
|
+
"properties": {
|
|
1218
|
+
"kind": {
|
|
1219
|
+
"enum": [
|
|
1220
|
+
"opened",
|
|
1221
|
+
"closed",
|
|
1222
|
+
"closedEarly",
|
|
1223
|
+
"cancelled"
|
|
1224
|
+
]
|
|
1225
|
+
},
|
|
1226
|
+
"at": {
|
|
1227
|
+
"type": "string",
|
|
1228
|
+
"format": "date-time"
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
},
|
|
1232
|
+
{
|
|
1233
|
+
"title": "ResultEntry",
|
|
1234
|
+
"type": "object",
|
|
1235
|
+
"additionalProperties": false,
|
|
1236
|
+
"required": [
|
|
1237
|
+
"kind",
|
|
1238
|
+
"result"
|
|
1239
|
+
],
|
|
1240
|
+
"properties": {
|
|
1241
|
+
"kind": {
|
|
1242
|
+
"const": "result"
|
|
1243
|
+
},
|
|
1244
|
+
"result": {
|
|
1245
|
+
"$ref": "#/$defs/ElectionResult"
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
},
|
|
1249
|
+
{
|
|
1250
|
+
"title": "EncryptedCastEntry",
|
|
1251
|
+
"type": "object",
|
|
1252
|
+
"additionalProperties": false,
|
|
1253
|
+
"required": [
|
|
1254
|
+
"kind",
|
|
1255
|
+
"cast"
|
|
1256
|
+
],
|
|
1257
|
+
"properties": {
|
|
1258
|
+
"kind": {
|
|
1259
|
+
"const": "encryptedCast"
|
|
1260
|
+
},
|
|
1261
|
+
"cast": {
|
|
1262
|
+
"$ref": "#/$defs/EncryptedCast"
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
},
|
|
1266
|
+
{
|
|
1267
|
+
"title": "TransportKeyEntry",
|
|
1268
|
+
"type": "object",
|
|
1269
|
+
"additionalProperties": false,
|
|
1270
|
+
"required": [
|
|
1271
|
+
"kind",
|
|
1272
|
+
"transportKey"
|
|
1273
|
+
],
|
|
1274
|
+
"properties": {
|
|
1275
|
+
"kind": {
|
|
1276
|
+
"const": "transportKey"
|
|
1277
|
+
},
|
|
1278
|
+
"transportKey": {
|
|
1279
|
+
"$ref": "#/$defs/TransportKey"
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
},
|
|
1283
|
+
{
|
|
1284
|
+
"title": "DealingEntry",
|
|
1285
|
+
"type": "object",
|
|
1286
|
+
"additionalProperties": false,
|
|
1287
|
+
"required": [
|
|
1288
|
+
"kind",
|
|
1289
|
+
"dealing"
|
|
1290
|
+
],
|
|
1291
|
+
"properties": {
|
|
1292
|
+
"kind": {
|
|
1293
|
+
"const": "dealing"
|
|
1294
|
+
},
|
|
1295
|
+
"dealing": {
|
|
1296
|
+
"$ref": "#/$defs/Dealing"
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
"title": "ConfirmationEntry",
|
|
1302
|
+
"type": "object",
|
|
1303
|
+
"additionalProperties": false,
|
|
1304
|
+
"required": [
|
|
1305
|
+
"kind",
|
|
1306
|
+
"trustee",
|
|
1307
|
+
"complaints"
|
|
1308
|
+
],
|
|
1309
|
+
"properties": {
|
|
1310
|
+
"kind": {
|
|
1311
|
+
"const": "confirmation"
|
|
1312
|
+
},
|
|
1313
|
+
"trustee": {
|
|
1314
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
1315
|
+
},
|
|
1316
|
+
"complaints": {
|
|
1317
|
+
"type": "array",
|
|
1318
|
+
"maxItems": 64,
|
|
1319
|
+
"items": {
|
|
1320
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
},
|
|
1325
|
+
{
|
|
1326
|
+
"title": "JustificationEntry",
|
|
1327
|
+
"type": "object",
|
|
1328
|
+
"additionalProperties": false,
|
|
1329
|
+
"required": [
|
|
1330
|
+
"kind",
|
|
1331
|
+
"dealer",
|
|
1332
|
+
"recipient",
|
|
1333
|
+
"share"
|
|
1334
|
+
],
|
|
1335
|
+
"properties": {
|
|
1336
|
+
"kind": {
|
|
1337
|
+
"const": "justification"
|
|
1338
|
+
},
|
|
1339
|
+
"dealer": {
|
|
1340
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
1341
|
+
},
|
|
1342
|
+
"recipient": {
|
|
1343
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
1344
|
+
},
|
|
1345
|
+
"share": {
|
|
1346
|
+
"$ref": "#/$defs/GroupScalar"
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
},
|
|
1350
|
+
{
|
|
1351
|
+
"title": "ElectionKeyEntry",
|
|
1352
|
+
"type": "object",
|
|
1353
|
+
"additionalProperties": false,
|
|
1354
|
+
"required": [
|
|
1355
|
+
"kind",
|
|
1356
|
+
"electionKey"
|
|
1357
|
+
],
|
|
1358
|
+
"properties": {
|
|
1359
|
+
"kind": {
|
|
1360
|
+
"const": "electionKey"
|
|
1361
|
+
},
|
|
1362
|
+
"electionKey": {
|
|
1363
|
+
"$ref": "#/$defs/ElectionKey"
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
},
|
|
1367
|
+
{
|
|
1368
|
+
"title": "PartialDecryptionsEntry",
|
|
1369
|
+
"type": "object",
|
|
1370
|
+
"additionalProperties": false,
|
|
1371
|
+
"required": [
|
|
1372
|
+
"kind",
|
|
1373
|
+
"trustee",
|
|
1374
|
+
"partials"
|
|
1375
|
+
],
|
|
1376
|
+
"properties": {
|
|
1377
|
+
"kind": {
|
|
1378
|
+
"const": "partials"
|
|
1379
|
+
},
|
|
1380
|
+
"trustee": {
|
|
1381
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
1382
|
+
},
|
|
1383
|
+
"partials": {
|
|
1384
|
+
"type": "array",
|
|
1385
|
+
"minItems": 1,
|
|
1386
|
+
"maxItems": 100000,
|
|
1387
|
+
"items": {
|
|
1388
|
+
"$ref": "#/$defs/PartialDecryption"
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
"title": "UnsealedEntry",
|
|
1395
|
+
"type": "object",
|
|
1396
|
+
"additionalProperties": false,
|
|
1397
|
+
"required": [
|
|
1398
|
+
"kind",
|
|
1399
|
+
"leafIndex",
|
|
1400
|
+
"ballot"
|
|
1401
|
+
],
|
|
1402
|
+
"properties": {
|
|
1403
|
+
"kind": {
|
|
1404
|
+
"const": "unsealed"
|
|
1405
|
+
},
|
|
1406
|
+
"leafIndex": {
|
|
1407
|
+
"type": "integer",
|
|
1408
|
+
"minimum": 0
|
|
1409
|
+
},
|
|
1410
|
+
"ballot": {
|
|
1411
|
+
"$ref": "#/$defs/Ballot"
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
},
|
|
1415
|
+
{
|
|
1416
|
+
"title": "SpoiledEntry",
|
|
1417
|
+
"description": "A sealed cast that did not open, or opened to no valid ballot: not counted (CONVENTIONS §9.7).",
|
|
1418
|
+
"type": "object",
|
|
1419
|
+
"additionalProperties": false,
|
|
1420
|
+
"required": [
|
|
1421
|
+
"kind",
|
|
1422
|
+
"leafIndex"
|
|
1423
|
+
],
|
|
1424
|
+
"properties": {
|
|
1425
|
+
"kind": {
|
|
1426
|
+
"const": "spoiled"
|
|
1427
|
+
},
|
|
1428
|
+
"leafIndex": {
|
|
1429
|
+
"type": "integer",
|
|
1430
|
+
"minimum": 0
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
]
|
|
1435
|
+
},
|
|
1436
|
+
"Ballot": {
|
|
1437
|
+
"title": "Ballot",
|
|
1438
|
+
"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.",
|
|
1439
|
+
"type": "object",
|
|
1440
|
+
"additionalProperties": false,
|
|
1441
|
+
"required": [
|
|
1442
|
+
"electionId",
|
|
1443
|
+
"manifestDigest",
|
|
1444
|
+
"answers"
|
|
1445
|
+
],
|
|
1446
|
+
"properties": {
|
|
1447
|
+
"electionId": {
|
|
1448
|
+
"$ref": "#/$defs/ElectionId"
|
|
1449
|
+
},
|
|
1450
|
+
"manifestDigest": {
|
|
1451
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
1452
|
+
},
|
|
1453
|
+
"answers": {
|
|
1454
|
+
"type": "array",
|
|
1455
|
+
"minItems": 1,
|
|
1456
|
+
"maxItems": 128,
|
|
1457
|
+
"items": {
|
|
1458
|
+
"$ref": "#/$defs/Answer"
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
},
|
|
1463
|
+
"Answer": {
|
|
1464
|
+
"title": "Answer",
|
|
1465
|
+
"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.",
|
|
1466
|
+
"type": "object",
|
|
1467
|
+
"additionalProperties": false,
|
|
1468
|
+
"required": [
|
|
1469
|
+
"question"
|
|
1470
|
+
],
|
|
1471
|
+
"minProperties": 2,
|
|
1472
|
+
"maxProperties": 2,
|
|
1473
|
+
"properties": {
|
|
1474
|
+
"question": {
|
|
1475
|
+
"$ref": "#/$defs/Key"
|
|
1476
|
+
},
|
|
1477
|
+
"choice": {
|
|
1478
|
+
"type": "array",
|
|
1479
|
+
"items": {
|
|
1480
|
+
"$ref": "#/$defs/Key"
|
|
1481
|
+
},
|
|
1482
|
+
"uniqueItems": true
|
|
1483
|
+
},
|
|
1484
|
+
"ranking": {
|
|
1485
|
+
"type": "array",
|
|
1486
|
+
"items": {
|
|
1487
|
+
"$ref": "#/$defs/Key"
|
|
1488
|
+
},
|
|
1489
|
+
"uniqueItems": true
|
|
1490
|
+
},
|
|
1491
|
+
"scores": {
|
|
1492
|
+
"type": "object",
|
|
1493
|
+
"propertyNames": {
|
|
1494
|
+
"$ref": "#/$defs/Key"
|
|
1495
|
+
},
|
|
1496
|
+
"additionalProperties": {
|
|
1497
|
+
"type": "integer"
|
|
1498
|
+
}
|
|
326
1499
|
},
|
|
327
|
-
"
|
|
1500
|
+
"text": {
|
|
328
1501
|
"type": "string",
|
|
329
|
-
"
|
|
1502
|
+
"maxLength": 4096
|
|
1503
|
+
},
|
|
1504
|
+
"abstain": {
|
|
1505
|
+
"const": true
|
|
330
1506
|
}
|
|
331
1507
|
}
|
|
332
1508
|
},
|
|
1509
|
+
"Key": {
|
|
1510
|
+
"title": "Key",
|
|
1511
|
+
"description": "A question or option key, unique within its manifest or question.",
|
|
1512
|
+
"type": "string",
|
|
1513
|
+
"pattern": "^[A-Za-z0-9._-]{1,64}$"
|
|
1514
|
+
},
|
|
333
1515
|
"ElectionId": {
|
|
334
1516
|
"title": "ElectionId",
|
|
335
1517
|
"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.",
|
|
@@ -346,107 +1528,282 @@ export const PAYLOAD_SCHEMA = {
|
|
|
346
1528
|
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
347
1529
|
]
|
|
348
1530
|
},
|
|
349
|
-
"
|
|
350
|
-
"title": "
|
|
351
|
-
"description": "
|
|
1531
|
+
"PartialDecryption": {
|
|
1532
|
+
"title": "PartialDecryption",
|
|
1533
|
+
"description": "Trustee `trustee`'s share of one decryption, `d = x_j·a`, with a Chaum–Pedersen proof against its verification key (CONVENTIONS §9.7).",
|
|
352
1534
|
"type": "object",
|
|
353
1535
|
"additionalProperties": false,
|
|
354
1536
|
"required": [
|
|
355
|
-
"
|
|
356
|
-
"
|
|
1537
|
+
"target",
|
|
1538
|
+
"d",
|
|
1539
|
+
"proof"
|
|
1540
|
+
],
|
|
1541
|
+
"properties": {
|
|
1542
|
+
"target": {
|
|
1543
|
+
"$ref": "#/$defs/DecryptionTarget"
|
|
1544
|
+
},
|
|
1545
|
+
"d": {
|
|
1546
|
+
"$ref": "#/$defs/GroupElement"
|
|
1547
|
+
},
|
|
1548
|
+
"proof": {
|
|
1549
|
+
"$ref": "#/$defs/SigmaProof"
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
},
|
|
1553
|
+
"SigmaProof": {
|
|
1554
|
+
"title": "SigmaProof",
|
|
1555
|
+
"description": "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).",
|
|
1556
|
+
"type": "object",
|
|
1557
|
+
"additionalProperties": false,
|
|
1558
|
+
"required": [
|
|
1559
|
+
"c",
|
|
1560
|
+
"z"
|
|
1561
|
+
],
|
|
1562
|
+
"properties": {
|
|
1563
|
+
"c": {
|
|
1564
|
+
"$ref": "#/$defs/GroupScalar"
|
|
1565
|
+
},
|
|
1566
|
+
"z": {
|
|
1567
|
+
"$ref": "#/$defs/GroupScalar"
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
},
|
|
1571
|
+
"GroupScalar": {
|
|
1572
|
+
"title": "GroupScalar",
|
|
1573
|
+
"description": "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).",
|
|
1574
|
+
"type": "string",
|
|
1575
|
+
"minLength": 2,
|
|
1576
|
+
"maxLength": 64,
|
|
1577
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
1578
|
+
},
|
|
1579
|
+
"GroupElement": {
|
|
1580
|
+
"title": "GroupElement",
|
|
1581
|
+
"description": "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).",
|
|
1582
|
+
"type": "string",
|
|
1583
|
+
"minLength": 2,
|
|
1584
|
+
"maxLength": 64,
|
|
1585
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
1586
|
+
},
|
|
1587
|
+
"DecryptionTarget": {
|
|
1588
|
+
"title": "DecryptionTarget",
|
|
1589
|
+
"description": "What a partial decryption decrypts: the sealed cast at a board leaf, or the total of one option of one question.",
|
|
1590
|
+
"type": "object",
|
|
1591
|
+
"additionalProperties": false,
|
|
1592
|
+
"required": [
|
|
1593
|
+
"ciphertext"
|
|
357
1594
|
],
|
|
358
1595
|
"properties": {
|
|
1596
|
+
"leafIndex": {
|
|
1597
|
+
"type": "integer",
|
|
1598
|
+
"minimum": 0,
|
|
1599
|
+
"description": "A sealed cast's board leaf."
|
|
1600
|
+
},
|
|
359
1601
|
"question": {
|
|
360
1602
|
"$ref": "#/$defs/Key"
|
|
361
1603
|
},
|
|
362
|
-
"
|
|
363
|
-
"
|
|
364
|
-
"minimum": 0
|
|
1604
|
+
"option": {
|
|
1605
|
+
"$ref": "#/$defs/Key"
|
|
365
1606
|
},
|
|
366
|
-
"
|
|
367
|
-
"
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
"
|
|
374
|
-
|
|
1607
|
+
"ciphertext": {
|
|
1608
|
+
"$ref": "#/$defs/ElGamalCiphertext"
|
|
1609
|
+
}
|
|
1610
|
+
},
|
|
1611
|
+
"oneOf": [
|
|
1612
|
+
{
|
|
1613
|
+
"required": [
|
|
1614
|
+
"leafIndex"
|
|
1615
|
+
]
|
|
375
1616
|
},
|
|
376
|
-
|
|
377
|
-
"
|
|
378
|
-
|
|
379
|
-
"
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
1617
|
+
{
|
|
1618
|
+
"required": [
|
|
1619
|
+
"question",
|
|
1620
|
+
"option"
|
|
1621
|
+
]
|
|
1622
|
+
}
|
|
1623
|
+
]
|
|
1624
|
+
},
|
|
1625
|
+
"ElGamalCiphertext": {
|
|
1626
|
+
"title": "ElGamalCiphertext",
|
|
1627
|
+
"description": "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).",
|
|
1628
|
+
"type": "object",
|
|
1629
|
+
"additionalProperties": false,
|
|
1630
|
+
"required": [
|
|
1631
|
+
"a",
|
|
1632
|
+
"b"
|
|
1633
|
+
],
|
|
1634
|
+
"properties": {
|
|
1635
|
+
"a": {
|
|
1636
|
+
"$ref": "#/$defs/GroupElement"
|
|
388
1637
|
},
|
|
389
|
-
"
|
|
390
|
-
"
|
|
391
|
-
|
|
392
|
-
|
|
1638
|
+
"b": {
|
|
1639
|
+
"$ref": "#/$defs/GroupElement"
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
},
|
|
1643
|
+
"TrusteeIndex": {
|
|
1644
|
+
"title": "TrusteeIndex",
|
|
1645
|
+
"description": "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.",
|
|
1646
|
+
"type": "integer",
|
|
1647
|
+
"minimum": 1,
|
|
1648
|
+
"maximum": 64
|
|
1649
|
+
},
|
|
1650
|
+
"ElectionKey": {
|
|
1651
|
+
"title": "ElectionKey",
|
|
1652
|
+
"description": "The election key and each trustee's public verification key, computed from the qualified dealings (CONVENTIONS §9.6). Anyone can recompute it from the board.",
|
|
1653
|
+
"type": "object",
|
|
1654
|
+
"additionalProperties": false,
|
|
1655
|
+
"required": [
|
|
1656
|
+
"key",
|
|
1657
|
+
"qualified",
|
|
1658
|
+
"verification"
|
|
1659
|
+
],
|
|
1660
|
+
"properties": {
|
|
1661
|
+
"key": {
|
|
1662
|
+
"$ref": "#/$defs/GroupElement"
|
|
1663
|
+
},
|
|
1664
|
+
"qualified": {
|
|
1665
|
+
"type": "array",
|
|
1666
|
+
"minItems": 1,
|
|
1667
|
+
"maxItems": 64,
|
|
1668
|
+
"items": {
|
|
1669
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
393
1670
|
},
|
|
394
|
-
"
|
|
1671
|
+
"description": "The dealers whose dealings the key is formed from."
|
|
1672
|
+
},
|
|
1673
|
+
"verification": {
|
|
1674
|
+
"type": "array",
|
|
1675
|
+
"minItems": 2,
|
|
1676
|
+
"maxItems": 64,
|
|
1677
|
+
"items": {
|
|
395
1678
|
"type": "object",
|
|
396
1679
|
"additionalProperties": false,
|
|
397
1680
|
"required": [
|
|
398
|
-
"
|
|
399
|
-
"
|
|
1681
|
+
"trustee",
|
|
1682
|
+
"key"
|
|
400
1683
|
],
|
|
401
1684
|
"properties": {
|
|
402
|
-
"
|
|
403
|
-
"
|
|
1685
|
+
"trustee": {
|
|
1686
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
404
1687
|
},
|
|
405
|
-
"
|
|
406
|
-
"
|
|
407
|
-
"minimum": 0
|
|
1688
|
+
"key": {
|
|
1689
|
+
"$ref": "#/$defs/GroupElement"
|
|
408
1690
|
}
|
|
409
1691
|
}
|
|
410
1692
|
}
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
},
|
|
1696
|
+
"Dealing": {
|
|
1697
|
+
"title": "Dealing",
|
|
1698
|
+
"description": "A trustee's contribution to the election key: Feldman commitments to its polynomial, a proof of knowledge of the constant term, and one share per trustee sealed to that trustee's transport key (CONVENTIONS §9.6).",
|
|
1699
|
+
"type": "object",
|
|
1700
|
+
"additionalProperties": false,
|
|
1701
|
+
"required": [
|
|
1702
|
+
"dealer",
|
|
1703
|
+
"commitments",
|
|
1704
|
+
"pok",
|
|
1705
|
+
"shares"
|
|
1706
|
+
],
|
|
1707
|
+
"properties": {
|
|
1708
|
+
"dealer": {
|
|
1709
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
1710
|
+
},
|
|
1711
|
+
"commitments": {
|
|
1712
|
+
"type": "array",
|
|
1713
|
+
"minItems": 2,
|
|
1714
|
+
"maxItems": 64,
|
|
1715
|
+
"items": {
|
|
1716
|
+
"$ref": "#/$defs/GroupElement"
|
|
1717
|
+
}
|
|
411
1718
|
},
|
|
412
|
-
"
|
|
1719
|
+
"pok": {
|
|
1720
|
+
"$ref": "#/$defs/SigmaProof"
|
|
1721
|
+
},
|
|
1722
|
+
"shares": {
|
|
413
1723
|
"type": "array",
|
|
1724
|
+
"minItems": 2,
|
|
1725
|
+
"maxItems": 64,
|
|
414
1726
|
"items": {
|
|
415
|
-
"
|
|
416
|
-
"maxLength": 4096
|
|
1727
|
+
"$ref": "#/$defs/SealedShare"
|
|
417
1728
|
}
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
},
|
|
1732
|
+
"SealedShare": {
|
|
1733
|
+
"title": "SealedShare",
|
|
1734
|
+
"type": "object",
|
|
1735
|
+
"additionalProperties": false,
|
|
1736
|
+
"required": [
|
|
1737
|
+
"recipient",
|
|
1738
|
+
"share"
|
|
1739
|
+
],
|
|
1740
|
+
"properties": {
|
|
1741
|
+
"recipient": {
|
|
1742
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
418
1743
|
},
|
|
419
|
-
"
|
|
420
|
-
"
|
|
1744
|
+
"share": {
|
|
1745
|
+
"$ref": "#/$defs/SealedPayload"
|
|
421
1746
|
}
|
|
422
1747
|
}
|
|
423
1748
|
},
|
|
424
|
-
"
|
|
425
|
-
"title": "
|
|
426
|
-
"description": "
|
|
427
|
-
"type": "
|
|
428
|
-
"
|
|
1749
|
+
"SealedPayload": {
|
|
1750
|
+
"title": "SealedPayload",
|
|
1751
|
+
"description": "Bytes sealed to a key: a random group element encrypted as `kem`, and the bytes under ChaCha20-Poly1305 with a key derived from it, multibase base58btc (CONVENTIONS §9.4).",
|
|
1752
|
+
"type": "object",
|
|
1753
|
+
"additionalProperties": false,
|
|
1754
|
+
"required": [
|
|
1755
|
+
"kem",
|
|
1756
|
+
"body"
|
|
1757
|
+
],
|
|
1758
|
+
"properties": {
|
|
1759
|
+
"kem": {
|
|
1760
|
+
"$ref": "#/$defs/ElGamalCiphertext"
|
|
1761
|
+
},
|
|
1762
|
+
"body": {
|
|
1763
|
+
"type": "string",
|
|
1764
|
+
"minLength": 2,
|
|
1765
|
+
"maxLength": 131072,
|
|
1766
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
429
1769
|
},
|
|
430
|
-
"
|
|
431
|
-
"title": "
|
|
432
|
-
"description": "
|
|
433
|
-
"type": "
|
|
434
|
-
"
|
|
435
|
-
"
|
|
1770
|
+
"TransportKey": {
|
|
1771
|
+
"title": "TransportKey",
|
|
1772
|
+
"description": "The group element a trustee's shares are sealed to, with a Schnorr proof of knowledge of its discrete log (CONVENTIONS §9.6).",
|
|
1773
|
+
"type": "object",
|
|
1774
|
+
"additionalProperties": false,
|
|
1775
|
+
"required": [
|
|
1776
|
+
"trustee",
|
|
1777
|
+
"key",
|
|
1778
|
+
"pok"
|
|
1779
|
+
],
|
|
1780
|
+
"properties": {
|
|
1781
|
+
"trustee": {
|
|
1782
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
1783
|
+
},
|
|
1784
|
+
"key": {
|
|
1785
|
+
"$ref": "#/$defs/GroupElement"
|
|
1786
|
+
},
|
|
1787
|
+
"pok": {
|
|
1788
|
+
"$ref": "#/$defs/SigmaProof"
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
436
1791
|
},
|
|
437
|
-
"
|
|
438
|
-
"title": "
|
|
439
|
-
"description": "A
|
|
1792
|
+
"EncryptedCast": {
|
|
1793
|
+
"title": "EncryptedCast",
|
|
1794
|
+
"description": "A cast of a sealed or tallied-encrypted election: exactly one of `sealed` (the Ballot's JCS bytes sealed to the election key) or `encrypted`, with the tag and the attestation over the JCS bytes of whichever is present (CONVENTIONS §3.6, §9.5).",
|
|
440
1795
|
"type": "object",
|
|
441
1796
|
"additionalProperties": false,
|
|
442
1797
|
"required": [
|
|
443
|
-
"ballot",
|
|
444
1798
|
"tag",
|
|
445
1799
|
"attestation"
|
|
446
1800
|
],
|
|
447
1801
|
"properties": {
|
|
448
|
-
"
|
|
449
|
-
"$ref": "#/$defs/
|
|
1802
|
+
"sealed": {
|
|
1803
|
+
"$ref": "#/$defs/SealedPayload"
|
|
1804
|
+
},
|
|
1805
|
+
"encrypted": {
|
|
1806
|
+
"$ref": "#/$defs/EncryptedBallot"
|
|
450
1807
|
},
|
|
451
1808
|
"tag": {
|
|
452
1809
|
"$ref": "#/$defs/Multibase"
|
|
@@ -454,17 +1811,36 @@ export const PAYLOAD_SCHEMA = {
|
|
|
454
1811
|
"attestation": {
|
|
455
1812
|
"$ref": "#/$defs/Multibase"
|
|
456
1813
|
}
|
|
457
|
-
}
|
|
1814
|
+
},
|
|
1815
|
+
"oneOf": [
|
|
1816
|
+
{
|
|
1817
|
+
"required": [
|
|
1818
|
+
"sealed"
|
|
1819
|
+
]
|
|
1820
|
+
},
|
|
1821
|
+
{
|
|
1822
|
+
"required": [
|
|
1823
|
+
"encrypted"
|
|
1824
|
+
]
|
|
1825
|
+
}
|
|
1826
|
+
]
|
|
458
1827
|
},
|
|
459
|
-
"
|
|
460
|
-
"title": "
|
|
461
|
-
"description": "
|
|
1828
|
+
"Multibase": {
|
|
1829
|
+
"title": "Multibase",
|
|
1830
|
+
"description": "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.",
|
|
1831
|
+
"type": "string",
|
|
1832
|
+
"maxLength": 16384,
|
|
1833
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
1834
|
+
},
|
|
1835
|
+
"EncryptedBallot": {
|
|
1836
|
+
"title": "EncryptedBallot",
|
|
1837
|
+
"description": "A tallied-encrypted ballot: one EncryptedQuestion per manifest question, in the manifest's order. Never decrypted (VTI-VOT-064).",
|
|
462
1838
|
"type": "object",
|
|
463
1839
|
"additionalProperties": false,
|
|
464
1840
|
"required": [
|
|
465
1841
|
"electionId",
|
|
466
1842
|
"manifestDigest",
|
|
467
|
-
"
|
|
1843
|
+
"questions"
|
|
468
1844
|
],
|
|
469
1845
|
"properties": {
|
|
470
1846
|
"electionId": {
|
|
@@ -473,217 +1849,69 @@ export const PAYLOAD_SCHEMA = {
|
|
|
473
1849
|
"manifestDigest": {
|
|
474
1850
|
"$ref": "#/$defs/DigestMultibase"
|
|
475
1851
|
},
|
|
476
|
-
"
|
|
1852
|
+
"questions": {
|
|
477
1853
|
"type": "array",
|
|
478
1854
|
"minItems": 1,
|
|
479
|
-
"maxItems":
|
|
480
|
-
"items": {
|
|
481
|
-
"$ref": "#/$defs/
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
},
|
|
486
|
-
"Answer": {
|
|
487
|
-
"title": "Answer",
|
|
488
|
-
"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.",
|
|
489
|
-
"type": "object",
|
|
490
|
-
"additionalProperties": false,
|
|
491
|
-
"required": [
|
|
492
|
-
"question"
|
|
493
|
-
],
|
|
494
|
-
"minProperties": 2,
|
|
495
|
-
"maxProperties": 2,
|
|
496
|
-
"properties": {
|
|
497
|
-
"question": {
|
|
498
|
-
"$ref": "#/$defs/Key"
|
|
499
|
-
},
|
|
500
|
-
"choice": {
|
|
501
|
-
"type": "array",
|
|
502
|
-
"items": {
|
|
503
|
-
"$ref": "#/$defs/Key"
|
|
504
|
-
},
|
|
505
|
-
"uniqueItems": true
|
|
506
|
-
},
|
|
507
|
-
"ranking": {
|
|
508
|
-
"type": "array",
|
|
509
|
-
"items": {
|
|
510
|
-
"$ref": "#/$defs/Key"
|
|
511
|
-
},
|
|
512
|
-
"uniqueItems": true
|
|
513
|
-
},
|
|
514
|
-
"scores": {
|
|
515
|
-
"type": "object",
|
|
516
|
-
"propertyNames": {
|
|
517
|
-
"$ref": "#/$defs/Key"
|
|
518
|
-
},
|
|
519
|
-
"additionalProperties": {
|
|
520
|
-
"type": "integer"
|
|
521
|
-
}
|
|
522
|
-
},
|
|
523
|
-
"text": {
|
|
524
|
-
"type": "string",
|
|
525
|
-
"maxLength": 4096
|
|
526
|
-
},
|
|
527
|
-
"abstain": {
|
|
528
|
-
"const": true
|
|
1855
|
+
"maxItems": 64,
|
|
1856
|
+
"items": {
|
|
1857
|
+
"$ref": "#/$defs/EncryptedQuestion"
|
|
1858
|
+
}
|
|
529
1859
|
}
|
|
530
1860
|
}
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
536
|
-
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
537
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
538
|
-
"$ref": "#/$defs/Response",
|
|
539
|
-
"$defs": {
|
|
540
|
-
"Response": {
|
|
541
|
-
"$anchor": "response",
|
|
542
|
-
"title": "Voting — Board Read — response payload",
|
|
1861
|
+
},
|
|
1862
|
+
"EncryptedQuestion": {
|
|
1863
|
+
"title": "EncryptedQuestion",
|
|
1864
|
+
"description": "One choice question of a tallied-encrypted ballot: per option, in the manifest's order, an encryption of 0 or 1 with its proof; and a proof that the selections sum to a count the question admits (CONVENTIONS §9.5).",
|
|
543
1865
|
"type": "object",
|
|
544
1866
|
"additionalProperties": false,
|
|
545
1867
|
"required": [
|
|
546
|
-
"
|
|
547
|
-
"
|
|
1868
|
+
"question",
|
|
1869
|
+
"options",
|
|
1870
|
+
"sumProof"
|
|
548
1871
|
],
|
|
549
1872
|
"properties": {
|
|
550
|
-
"
|
|
551
|
-
"
|
|
552
|
-
"minimum": 0,
|
|
553
|
-
"description": "The tree size the page was read against. No entry at or beyond it is returned."
|
|
1873
|
+
"question": {
|
|
1874
|
+
"$ref": "#/$defs/Key"
|
|
554
1875
|
},
|
|
555
|
-
"
|
|
1876
|
+
"options": {
|
|
556
1877
|
"type": "array",
|
|
557
|
-
"
|
|
1878
|
+
"minItems": 1,
|
|
1879
|
+
"maxItems": 64,
|
|
558
1880
|
"items": {
|
|
559
|
-
"
|
|
560
|
-
|
|
561
|
-
"required": [
|
|
562
|
-
"index",
|
|
563
|
-
"entry"
|
|
564
|
-
],
|
|
565
|
-
"properties": {
|
|
566
|
-
"index": {
|
|
567
|
-
"type": "integer",
|
|
568
|
-
"minimum": 0
|
|
569
|
-
},
|
|
570
|
-
"entry": {
|
|
571
|
-
"$ref": "#/$defs/BoardEntry"
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
},
|
|
575
|
-
"description": "Consecutive entries from `from`, in board order."
|
|
576
|
-
},
|
|
577
|
-
"next": {
|
|
578
|
-
"type": "integer",
|
|
579
|
-
"minimum": 1,
|
|
580
|
-
"description": "The `from` of the next page. Absent when the page reaches `treeSize`."
|
|
1881
|
+
"$ref": "#/$defs/EncryptedOption"
|
|
1882
|
+
}
|
|
581
1883
|
},
|
|
582
|
-
"
|
|
583
|
-
"$ref": "#/$defs/
|
|
1884
|
+
"sumProof": {
|
|
1885
|
+
"$ref": "#/$defs/DisjunctiveProof"
|
|
584
1886
|
}
|
|
585
1887
|
}
|
|
586
1888
|
},
|
|
587
|
-
"
|
|
588
|
-
"title": "
|
|
589
|
-
"description": "
|
|
590
|
-
"type": "
|
|
591
|
-
"
|
|
592
|
-
"
|
|
593
|
-
"
|
|
594
|
-
"
|
|
1889
|
+
"DisjunctiveProof": {
|
|
1890
|
+
"title": "DisjunctiveProof",
|
|
1891
|
+
"description": "A disjunctive proof that a ciphertext encrypts one value of a public list: one `(c, z)` per value, in the list's order (CONVENTIONS §9.3).",
|
|
1892
|
+
"type": "array",
|
|
1893
|
+
"minItems": 1,
|
|
1894
|
+
"maxItems": 65,
|
|
1895
|
+
"items": {
|
|
1896
|
+
"$ref": "#/$defs/SigmaProof"
|
|
595
1897
|
}
|
|
596
1898
|
},
|
|
597
|
-
"
|
|
598
|
-
"title": "
|
|
599
|
-
"
|
|
600
|
-
"
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
],
|
|
609
|
-
"properties": {
|
|
610
|
-
"kind": {
|
|
611
|
-
"const": "cast"
|
|
612
|
-
},
|
|
613
|
-
"cast": {
|
|
614
|
-
"$ref": "#/$defs/Cast"
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
},
|
|
618
|
-
{
|
|
619
|
-
"title": "ReplacementEntry",
|
|
620
|
-
"description": "The cast at `replaces` is no longer counted: a later cast under the same tag is.",
|
|
621
|
-
"type": "object",
|
|
622
|
-
"additionalProperties": false,
|
|
623
|
-
"required": [
|
|
624
|
-
"kind",
|
|
625
|
-
"tag",
|
|
626
|
-
"replaces",
|
|
627
|
-
"by"
|
|
628
|
-
],
|
|
629
|
-
"properties": {
|
|
630
|
-
"kind": {
|
|
631
|
-
"const": "replaced"
|
|
632
|
-
},
|
|
633
|
-
"tag": {
|
|
634
|
-
"$ref": "#/$defs/Multibase"
|
|
635
|
-
},
|
|
636
|
-
"replaces": {
|
|
637
|
-
"type": "integer",
|
|
638
|
-
"minimum": 0
|
|
639
|
-
},
|
|
640
|
-
"by": {
|
|
641
|
-
"type": "integer",
|
|
642
|
-
"minimum": 0
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
},
|
|
646
|
-
{
|
|
647
|
-
"title": "LifecycleEntry",
|
|
648
|
-
"type": "object",
|
|
649
|
-
"additionalProperties": false,
|
|
650
|
-
"required": [
|
|
651
|
-
"kind",
|
|
652
|
-
"at"
|
|
653
|
-
],
|
|
654
|
-
"properties": {
|
|
655
|
-
"kind": {
|
|
656
|
-
"enum": [
|
|
657
|
-
"opened",
|
|
658
|
-
"closed",
|
|
659
|
-
"closedEarly",
|
|
660
|
-
"cancelled"
|
|
661
|
-
]
|
|
662
|
-
},
|
|
663
|
-
"at": {
|
|
664
|
-
"type": "string",
|
|
665
|
-
"format": "date-time"
|
|
666
|
-
}
|
|
667
|
-
}
|
|
1899
|
+
"EncryptedOption": {
|
|
1900
|
+
"title": "EncryptedOption",
|
|
1901
|
+
"type": "object",
|
|
1902
|
+
"additionalProperties": false,
|
|
1903
|
+
"required": [
|
|
1904
|
+
"ciphertext",
|
|
1905
|
+
"proof"
|
|
1906
|
+
],
|
|
1907
|
+
"properties": {
|
|
1908
|
+
"ciphertext": {
|
|
1909
|
+
"$ref": "#/$defs/ElGamalCiphertext"
|
|
668
1910
|
},
|
|
669
|
-
{
|
|
670
|
-
"
|
|
671
|
-
"type": "object",
|
|
672
|
-
"additionalProperties": false,
|
|
673
|
-
"required": [
|
|
674
|
-
"kind",
|
|
675
|
-
"result"
|
|
676
|
-
],
|
|
677
|
-
"properties": {
|
|
678
|
-
"kind": {
|
|
679
|
-
"const": "result"
|
|
680
|
-
},
|
|
681
|
-
"result": {
|
|
682
|
-
"$ref": "#/$defs/ElectionResult"
|
|
683
|
-
}
|
|
684
|
-
}
|
|
1911
|
+
"proof": {
|
|
1912
|
+
"$ref": "#/$defs/DisjunctiveProof"
|
|
685
1913
|
}
|
|
686
|
-
|
|
1914
|
+
}
|
|
687
1915
|
},
|
|
688
1916
|
"ElectionResult": {
|
|
689
1917
|
"title": "ElectionResult",
|
|
@@ -749,22 +1977,6 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
749
1977
|
}
|
|
750
1978
|
}
|
|
751
1979
|
},
|
|
752
|
-
"ElectionId": {
|
|
753
|
-
"title": "ElectionId",
|
|
754
|
-
"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.",
|
|
755
|
-
"type": "string",
|
|
756
|
-
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
757
|
-
},
|
|
758
|
-
"DigestMultibase": {
|
|
759
|
-
"title": "DigestMultibase",
|
|
760
|
-
"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`.",
|
|
761
|
-
"type": "string",
|
|
762
|
-
"minLength": 16,
|
|
763
|
-
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
764
|
-
"examples": [
|
|
765
|
-
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
766
|
-
]
|
|
767
|
-
},
|
|
768
1980
|
"QuestionResult": {
|
|
769
1981
|
"title": "QuestionResult",
|
|
770
1982
|
"description": "One question's totals. `choice`: selections per option. `ranking`: per option, how many ballots placed it at each position (index 0 = first). `score`: per option, the sum and the number of ballots that scored it. `text`: the answers, in board order, withheld (`withheld: true`) below the manifest's `textReleaseThreshold`. `abstained` counts ballots that left the question unanswered.",
|
|
@@ -840,19 +2052,6 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
840
2052
|
}
|
|
841
2053
|
}
|
|
842
2054
|
},
|
|
843
|
-
"Key": {
|
|
844
|
-
"title": "Key",
|
|
845
|
-
"description": "A question or option key, unique within its manifest or question.",
|
|
846
|
-
"type": "string",
|
|
847
|
-
"pattern": "^[A-Za-z0-9._-]{1,64}$"
|
|
848
|
-
},
|
|
849
|
-
"Multibase": {
|
|
850
|
-
"title": "Multibase",
|
|
851
|
-
"description": "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.",
|
|
852
|
-
"type": "string",
|
|
853
|
-
"maxLength": 16384,
|
|
854
|
-
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
855
|
-
},
|
|
856
2055
|
"Cast": {
|
|
857
2056
|
"title": "Cast",
|
|
858
2057
|
"description": "A ballot and the PCS attestation that admits it (VTI-VOT-030). `attestation` is the suite's canonical encoding of the attestation made for the election point with the ballot context bound in (CONVENTIONS §3); `tag` repeats its tag so a ballot box can refuse a duplicate before the pairing check.",
|
|
@@ -874,79 +2073,6 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
874
2073
|
"$ref": "#/$defs/Multibase"
|
|
875
2074
|
}
|
|
876
2075
|
}
|
|
877
|
-
},
|
|
878
|
-
"Ballot": {
|
|
879
|
-
"title": "Ballot",
|
|
880
|
-
"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.",
|
|
881
|
-
"type": "object",
|
|
882
|
-
"additionalProperties": false,
|
|
883
|
-
"required": [
|
|
884
|
-
"electionId",
|
|
885
|
-
"manifestDigest",
|
|
886
|
-
"answers"
|
|
887
|
-
],
|
|
888
|
-
"properties": {
|
|
889
|
-
"electionId": {
|
|
890
|
-
"$ref": "#/$defs/ElectionId"
|
|
891
|
-
},
|
|
892
|
-
"manifestDigest": {
|
|
893
|
-
"$ref": "#/$defs/DigestMultibase"
|
|
894
|
-
},
|
|
895
|
-
"answers": {
|
|
896
|
-
"type": "array",
|
|
897
|
-
"minItems": 1,
|
|
898
|
-
"maxItems": 128,
|
|
899
|
-
"items": {
|
|
900
|
-
"$ref": "#/$defs/Answer"
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
},
|
|
905
|
-
"Answer": {
|
|
906
|
-
"title": "Answer",
|
|
907
|
-
"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.",
|
|
908
|
-
"type": "object",
|
|
909
|
-
"additionalProperties": false,
|
|
910
|
-
"required": [
|
|
911
|
-
"question"
|
|
912
|
-
],
|
|
913
|
-
"minProperties": 2,
|
|
914
|
-
"maxProperties": 2,
|
|
915
|
-
"properties": {
|
|
916
|
-
"question": {
|
|
917
|
-
"$ref": "#/$defs/Key"
|
|
918
|
-
},
|
|
919
|
-
"choice": {
|
|
920
|
-
"type": "array",
|
|
921
|
-
"items": {
|
|
922
|
-
"$ref": "#/$defs/Key"
|
|
923
|
-
},
|
|
924
|
-
"uniqueItems": true
|
|
925
|
-
},
|
|
926
|
-
"ranking": {
|
|
927
|
-
"type": "array",
|
|
928
|
-
"items": {
|
|
929
|
-
"$ref": "#/$defs/Key"
|
|
930
|
-
},
|
|
931
|
-
"uniqueItems": true
|
|
932
|
-
},
|
|
933
|
-
"scores": {
|
|
934
|
-
"type": "object",
|
|
935
|
-
"propertyNames": {
|
|
936
|
-
"$ref": "#/$defs/Key"
|
|
937
|
-
},
|
|
938
|
-
"additionalProperties": {
|
|
939
|
-
"type": "integer"
|
|
940
|
-
}
|
|
941
|
-
},
|
|
942
|
-
"text": {
|
|
943
|
-
"type": "string",
|
|
944
|
-
"maxLength": 4096
|
|
945
|
-
},
|
|
946
|
-
"abstain": {
|
|
947
|
-
"const": true
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
2076
|
}
|
|
951
2077
|
}
|
|
952
2078
|
} as const;
|