@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.
Files changed (127) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/_shared/components.d.ts +207 -4
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/device/list/0.1/payload.d.ts +4 -4
  5. package/dist/device/list/0.1/payload.d.ts.map +1 -1
  6. package/dist/device/list/0.1/payload.js +4 -2
  7. package/dist/device/list/0.1/payload.js.map +1 -1
  8. package/dist/device/list/0.2/payload.d.ts +4 -4
  9. package/dist/device/list/0.2/payload.d.ts.map +1 -1
  10. package/dist/device/list/0.2/payload.js +4 -2
  11. package/dist/device/list/0.2/payload.js.map +1 -1
  12. package/dist/device/register/0.1/payload.d.ts +4 -4
  13. package/dist/device/register/0.1/payload.d.ts.map +1 -1
  14. package/dist/device/register/0.1/payload.js +4 -2
  15. package/dist/device/register/0.1/payload.js.map +1 -1
  16. package/dist/device/register/0.2/payload.d.ts +4 -4
  17. package/dist/device/register/0.2/payload.d.ts.map +1 -1
  18. package/dist/device/register/0.2/payload.js +4 -2
  19. package/dist/device/register/0.2/payload.js.map +1 -1
  20. package/dist/index.d.ts +13 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +13 -0
  23. package/dist/index.js.map +1 -1
  24. package/dist/voting/_shared/0.1/voting.d.ts +1 -1
  25. package/dist/voting/_shared/0.1/voting.d.ts.map +1 -1
  26. package/dist/voting/ballot/cast-encrypted/0.1/payload.d.ts +1166 -0
  27. package/dist/voting/ballot/cast-encrypted/0.1/payload.d.ts.map +1 -0
  28. package/dist/voting/ballot/cast-encrypted/0.1/payload.js +690 -0
  29. package/dist/voting/ballot/cast-encrypted/0.1/payload.js.map +1 -0
  30. package/dist/voting/board/read/0.1/payload.d.ts +2555 -719
  31. package/dist/voting/board/read/0.1/payload.d.ts.map +1 -1
  32. package/dist/voting/board/read/0.1/payload.js +1517 -391
  33. package/dist/voting/board/read/0.1/payload.js.map +1 -1
  34. package/dist/voting/election/register/0.1/payload.d.ts +4 -4
  35. package/dist/voting/election/register/0.1/payload.js +2 -2
  36. package/dist/voting/election/register/0.1/payload.js.map +1 -1
  37. package/dist/voting/election/show/0.1/payload.d.ts +4 -4
  38. package/dist/voting/election/show/0.1/payload.js +2 -2
  39. package/dist/voting/election/show/0.1/payload.js.map +1 -1
  40. package/dist/voting/trustees/confirm/0.1/payload.d.ts +620 -0
  41. package/dist/voting/trustees/confirm/0.1/payload.d.ts.map +1 -0
  42. package/dist/voting/trustees/confirm/0.1/payload.js +388 -0
  43. package/dist/voting/trustees/confirm/0.1/payload.js.map +1 -0
  44. package/dist/voting/trustees/deal/0.1/payload.d.ts +1032 -0
  45. package/dist/voting/trustees/deal/0.1/payload.d.ts.map +1 -0
  46. package/dist/voting/trustees/deal/0.1/payload.js +630 -0
  47. package/dist/voting/trustees/deal/0.1/payload.js.map +1 -0
  48. package/dist/voting/trustees/decrypt/0.1/payload.d.ts +1009 -0
  49. package/dist/voting/trustees/decrypt/0.1/payload.d.ts.map +1 -0
  50. package/dist/voting/trustees/decrypt/0.1/payload.js +623 -0
  51. package/dist/voting/trustees/decrypt/0.1/payload.js.map +1 -0
  52. package/dist/voting/trustees/enrol/0.1/payload.d.ts +792 -0
  53. package/dist/voting/trustees/enrol/0.1/payload.d.ts.map +1 -0
  54. package/dist/voting/trustees/enrol/0.1/payload.js +490 -0
  55. package/dist/voting/trustees/enrol/0.1/payload.js.map +1 -0
  56. package/dist/voting/trustees/justify/0.1/payload.d.ts +642 -0
  57. package/dist/voting/trustees/justify/0.1/payload.d.ts.map +1 -0
  58. package/dist/voting/trustees/justify/0.1/payload.js +402 -0
  59. package/dist/voting/trustees/justify/0.1/payload.js.map +1 -0
  60. package/dist/voting/trustees/status/0.1/payload.d.ts +1411 -0
  61. package/dist/voting/trustees/status/0.1/payload.d.ts.map +1 -0
  62. package/dist/voting/trustees/status/0.1/payload.js +822 -0
  63. package/dist/voting/trustees/status/0.1/payload.js.map +1 -0
  64. package/dist/vta/pcs/trustee/deal/0.1/payload.d.ts +2005 -0
  65. package/dist/vta/pcs/trustee/deal/0.1/payload.d.ts.map +1 -0
  66. package/dist/vta/pcs/trustee/deal/0.1/payload.js +1176 -0
  67. package/dist/vta/pcs/trustee/deal/0.1/payload.js.map +1 -0
  68. package/dist/vta/pcs/trustee/decrypt/0.1/payload.d.ts +736 -0
  69. package/dist/vta/pcs/trustee/decrypt/0.1/payload.d.ts.map +1 -0
  70. package/dist/vta/pcs/trustee/decrypt/0.1/payload.js +412 -0
  71. package/dist/vta/pcs/trustee/decrypt/0.1/payload.js.map +1 -0
  72. package/dist/vta/pcs/trustee/enrol/0.1/payload.d.ts +1756 -0
  73. package/dist/vta/pcs/trustee/enrol/0.1/payload.d.ts.map +1 -0
  74. package/dist/vta/pcs/trustee/enrol/0.1/payload.js +1040 -0
  75. package/dist/vta/pcs/trustee/enrol/0.1/payload.js.map +1 -0
  76. package/dist/vta/pcs/trustee/justify/0.1/payload.d.ts +504 -0
  77. package/dist/vta/pcs/trustee/justify/0.1/payload.d.ts.map +1 -0
  78. package/dist/vta/pcs/trustee/justify/0.1/payload.js +274 -0
  79. package/dist/vta/pcs/trustee/justify/0.1/payload.js.map +1 -0
  80. package/dist/vta/pcs/trustee/keys/0.1/payload.d.ts +2501 -0
  81. package/dist/vta/pcs/trustee/keys/0.1/payload.d.ts.map +1 -0
  82. package/dist/vta/pcs/trustee/keys/0.1/payload.js +1455 -0
  83. package/dist/vta/pcs/trustee/keys/0.1/payload.js.map +1 -0
  84. package/dist/vta/pcs/vote/0.1/payload.d.ts +4 -4
  85. package/dist/vta/pcs/vote/0.1/payload.js +2 -2
  86. package/dist/vta/pcs/vote/0.1/payload.js.map +1 -1
  87. package/dist/vta/pcs/vote-encrypted/0.1/payload.d.ts +2375 -0
  88. package/dist/vta/pcs/vote-encrypted/0.1/payload.d.ts.map +1 -0
  89. package/dist/vta/pcs/vote-encrypted/0.1/payload.js +1389 -0
  90. package/dist/vta/pcs/vote-encrypted/0.1/payload.js.map +1 -0
  91. package/dist/vta/pcs/voter/register/0.1/payload.d.ts +4 -4
  92. package/dist/vta/pcs/voter/register/0.1/payload.js +2 -2
  93. package/dist/vta/pcs/voter/register/0.1/payload.js.map +1 -1
  94. package/dist/vtc/elections/create/0.1/payload.d.ts +4 -4
  95. package/dist/vtc/elections/create/0.1/payload.js +2 -2
  96. package/dist/vtc/elections/create/0.1/payload.js.map +1 -1
  97. package/dist/vtc/elections/show/0.1/payload.d.ts +4 -4
  98. package/dist/vtc/elections/show/0.1/payload.js +2 -2
  99. package/dist/vtc/elections/show/0.1/payload.js.map +1 -1
  100. package/package.json +1 -1
  101. package/src/_shared/components.ts +222 -4
  102. package/src/device/list/0.1/payload.ts +4 -2
  103. package/src/device/list/0.2/payload.ts +4 -2
  104. package/src/device/register/0.1/payload.ts +4 -2
  105. package/src/device/register/0.2/payload.ts +4 -2
  106. package/src/index.ts +13 -0
  107. package/src/voting/_shared/0.1/voting.ts +1 -1
  108. package/src/voting/ballot/cast-encrypted/0.1/payload.ts +735 -0
  109. package/src/voting/board/read/0.1/payload.ts +1519 -393
  110. package/src/voting/election/register/0.1/payload.ts +2 -2
  111. package/src/voting/election/show/0.1/payload.ts +2 -2
  112. package/src/voting/trustees/confirm/0.1/payload.ts +429 -0
  113. package/src/voting/trustees/deal/0.1/payload.ts +665 -0
  114. package/src/voting/trustees/decrypt/0.1/payload.ts +663 -0
  115. package/src/voting/trustees/enrol/0.1/payload.ts +525 -0
  116. package/src/voting/trustees/justify/0.1/payload.ts +439 -0
  117. package/src/voting/trustees/status/0.1/payload.ts +890 -0
  118. package/src/vta/pcs/trustee/deal/0.1/payload.ts +1250 -0
  119. package/src/vta/pcs/trustee/decrypt/0.1/payload.ts +489 -0
  120. package/src/vta/pcs/trustee/enrol/0.1/payload.ts +1107 -0
  121. package/src/vta/pcs/trustee/justify/0.1/payload.ts +341 -0
  122. package/src/vta/pcs/trustee/keys/0.1/payload.ts +1545 -0
  123. package/src/vta/pcs/vote/0.1/payload.ts +2 -2
  124. package/src/vta/pcs/vote-encrypted/0.1/payload.ts +1455 -0
  125. package/src/vta/pcs/voter/register/0.1/payload.ts +2 -2
  126. package/src/vtc/elections/create/0.1/payload.ts +2 -2
  127. package/src/vtc/elections/show/0.1/payload.ts +2 -2
@@ -2,7 +2,7 @@
2
2
  * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
3
  * Source: specs/voting/board/read/0.1/payload.schema.json
4
4
  */
5
- 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";
5
+ 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";
6
6
  /**
7
7
  * Reads a range of an election board's entries, against the current head or against an earlier tree size.
8
8
  */
@@ -47,7 +47,7 @@ export interface VotingBoardReadResponsePayload {
47
47
  ext?: Ext;
48
48
  }
49
49
  /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
50
- export type { Answer, Ballot, BoardEntry, BoardHead, Cast, CastEntry, DigestMultibase, ElectionId, ElectionResult, Ext, Key, LifecycleEntry, Multibase, QuestionResult, ReplacementEntry, ResultEntry };
50
+ 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 };
51
51
  /** Trust Task type URI. */
52
52
  export declare const TYPE_URI: "https://trusttasks.org/spec/voting/board/read/0.1";
53
53
  /** Stable alias for this specification's request payload shape. */
@@ -220,174 +220,151 @@ export declare const PAYLOAD_SCHEMA: {
220
220
  readonly $ref: "#/$defs/ElectionResult";
221
221
  };
222
222
  };
223
- }];
224
- };
225
- readonly ElectionResult: {
226
- readonly title: "ElectionResult";
227
- readonly description: "An election's result, computable by anyone who can read its board from the board and the registration alone (VTI-VOT-070).";
228
- readonly type: "object";
229
- readonly additionalProperties: false;
230
- readonly required: readonly ["electionId", "manifestDigest", "ballotsCounted", "questions", "head"];
231
- readonly properties: {
232
- readonly electionId: {
233
- readonly $ref: "#/$defs/ElectionId";
234
- };
235
- readonly manifestDigest: {
236
- readonly $ref: "#/$defs/DigestMultibase";
237
- };
238
- readonly ballotsCounted: {
239
- readonly type: "integer";
240
- readonly minimum: 0;
241
- };
242
- readonly questions: {
243
- readonly type: "array";
244
- readonly items: {
245
- readonly $ref: "#/$defs/QuestionResult";
223
+ }, {
224
+ readonly title: "EncryptedCastEntry";
225
+ readonly type: "object";
226
+ readonly additionalProperties: false;
227
+ readonly required: readonly ["kind", "cast"];
228
+ readonly properties: {
229
+ readonly kind: {
230
+ readonly const: "encryptedCast";
231
+ };
232
+ readonly cast: {
233
+ readonly $ref: "#/$defs/EncryptedCast";
246
234
  };
247
235
  };
248
- readonly head: {
249
- readonly $ref: "#/$defs/BoardHead";
250
- readonly description: "The head of the board as it stood at close: the result counts exactly its entries.";
251
- };
252
- };
253
- };
254
- readonly BoardHead: {
255
- readonly title: "BoardHead";
256
- readonly 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.";
257
- readonly type: "object";
258
- readonly additionalProperties: false;
259
- readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
260
- readonly properties: {
261
- readonly electionId: {
262
- readonly $ref: "#/$defs/ElectionId";
263
- };
264
- readonly treeSize: {
265
- readonly type: "integer";
266
- readonly minimum: 0;
267
- };
268
- readonly rootHash: {
269
- readonly $ref: "#/$defs/DigestMultibase";
270
- readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
271
- };
272
- readonly issuedAt: {
273
- readonly type: "string";
274
- readonly format: "date-time";
275
- };
276
- };
277
- };
278
- readonly ElectionId: {
279
- readonly title: "ElectionId";
280
- readonly 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.";
281
- readonly type: "string";
282
- readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
283
- };
284
- readonly DigestMultibase: {
285
- readonly title: "DigestMultibase";
286
- readonly 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`.";
287
- readonly type: "string";
288
- readonly minLength: 16;
289
- readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
290
- readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
291
- };
292
- readonly QuestionResult: {
293
- readonly title: "QuestionResult";
294
- readonly 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.";
295
- readonly type: "object";
296
- readonly additionalProperties: false;
297
- readonly required: readonly ["question", "abstained"];
298
- readonly properties: {
299
- readonly question: {
300
- readonly $ref: "#/$defs/Key";
301
- };
302
- readonly abstained: {
303
- readonly type: "integer";
304
- readonly minimum: 0;
236
+ }, {
237
+ readonly title: "TransportKeyEntry";
238
+ readonly type: "object";
239
+ readonly additionalProperties: false;
240
+ readonly required: readonly ["kind", "transportKey"];
241
+ readonly properties: {
242
+ readonly kind: {
243
+ readonly const: "transportKey";
244
+ };
245
+ readonly transportKey: {
246
+ readonly $ref: "#/$defs/TransportKey";
247
+ };
305
248
  };
306
- readonly choice: {
307
- readonly type: "object";
308
- readonly propertyNames: {
309
- readonly $ref: "#/$defs/Key";
249
+ }, {
250
+ readonly title: "DealingEntry";
251
+ readonly type: "object";
252
+ readonly additionalProperties: false;
253
+ readonly required: readonly ["kind", "dealing"];
254
+ readonly properties: {
255
+ readonly kind: {
256
+ readonly const: "dealing";
310
257
  };
311
- readonly additionalProperties: {
312
- readonly type: "integer";
313
- readonly minimum: 0;
258
+ readonly dealing: {
259
+ readonly $ref: "#/$defs/Dealing";
314
260
  };
315
261
  };
316
- readonly ranking: {
317
- readonly type: "object";
318
- readonly propertyNames: {
319
- readonly $ref: "#/$defs/Key";
262
+ }, {
263
+ readonly title: "ConfirmationEntry";
264
+ readonly type: "object";
265
+ readonly additionalProperties: false;
266
+ readonly required: readonly ["kind", "trustee", "complaints"];
267
+ readonly properties: {
268
+ readonly kind: {
269
+ readonly const: "confirmation";
320
270
  };
321
- readonly additionalProperties: {
271
+ readonly trustee: {
272
+ readonly $ref: "#/$defs/TrusteeIndex";
273
+ };
274
+ readonly complaints: {
322
275
  readonly type: "array";
276
+ readonly maxItems: 64;
323
277
  readonly items: {
324
- readonly type: "integer";
325
- readonly minimum: 0;
278
+ readonly $ref: "#/$defs/TrusteeIndex";
326
279
  };
327
280
  };
328
281
  };
329
- readonly score: {
330
- readonly type: "object";
331
- readonly propertyNames: {
332
- readonly $ref: "#/$defs/Key";
282
+ }, {
283
+ readonly title: "JustificationEntry";
284
+ readonly type: "object";
285
+ readonly additionalProperties: false;
286
+ readonly required: readonly ["kind", "dealer", "recipient", "share"];
287
+ readonly properties: {
288
+ readonly kind: {
289
+ readonly const: "justification";
333
290
  };
334
- readonly additionalProperties: {
335
- readonly type: "object";
336
- readonly additionalProperties: false;
337
- readonly required: readonly ["sum", "count"];
338
- readonly properties: {
339
- readonly sum: {
340
- readonly type: "integer";
341
- };
342
- readonly count: {
343
- readonly type: "integer";
344
- readonly minimum: 0;
345
- };
346
- };
291
+ readonly dealer: {
292
+ readonly $ref: "#/$defs/TrusteeIndex";
347
293
  };
348
- };
349
- readonly text: {
350
- readonly type: "array";
351
- readonly items: {
352
- readonly type: "string";
353
- readonly maxLength: 4096;
294
+ readonly recipient: {
295
+ readonly $ref: "#/$defs/TrusteeIndex";
296
+ };
297
+ readonly share: {
298
+ readonly $ref: "#/$defs/GroupScalar";
354
299
  };
355
300
  };
356
- readonly withheld: {
357
- readonly type: "boolean";
301
+ }, {
302
+ readonly title: "ElectionKeyEntry";
303
+ readonly type: "object";
304
+ readonly additionalProperties: false;
305
+ readonly required: readonly ["kind", "electionKey"];
306
+ readonly properties: {
307
+ readonly kind: {
308
+ readonly const: "electionKey";
309
+ };
310
+ readonly electionKey: {
311
+ readonly $ref: "#/$defs/ElectionKey";
312
+ };
358
313
  };
359
- };
360
- };
361
- readonly Key: {
362
- readonly title: "Key";
363
- readonly description: "A question or option key, unique within its manifest or question.";
364
- readonly type: "string";
365
- readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
366
- };
367
- readonly Multibase: {
368
- readonly title: "Multibase";
369
- readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
370
- readonly type: "string";
371
- readonly maxLength: 16384;
372
- readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
373
- };
374
- readonly Cast: {
375
- readonly title: "Cast";
376
- readonly 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.";
377
- readonly type: "object";
378
- readonly additionalProperties: false;
379
- readonly required: readonly ["ballot", "tag", "attestation"];
380
- readonly properties: {
381
- readonly ballot: {
382
- readonly $ref: "#/$defs/Ballot";
314
+ }, {
315
+ readonly title: "PartialDecryptionsEntry";
316
+ readonly type: "object";
317
+ readonly additionalProperties: false;
318
+ readonly required: readonly ["kind", "trustee", "partials"];
319
+ readonly properties: {
320
+ readonly kind: {
321
+ readonly const: "partials";
322
+ };
323
+ readonly trustee: {
324
+ readonly $ref: "#/$defs/TrusteeIndex";
325
+ };
326
+ readonly partials: {
327
+ readonly type: "array";
328
+ readonly minItems: 1;
329
+ readonly maxItems: 100000;
330
+ readonly items: {
331
+ readonly $ref: "#/$defs/PartialDecryption";
332
+ };
333
+ };
383
334
  };
384
- readonly tag: {
385
- readonly $ref: "#/$defs/Multibase";
335
+ }, {
336
+ readonly title: "UnsealedEntry";
337
+ readonly type: "object";
338
+ readonly additionalProperties: false;
339
+ readonly required: readonly ["kind", "leafIndex", "ballot"];
340
+ readonly properties: {
341
+ readonly kind: {
342
+ readonly const: "unsealed";
343
+ };
344
+ readonly leafIndex: {
345
+ readonly type: "integer";
346
+ readonly minimum: 0;
347
+ };
348
+ readonly ballot: {
349
+ readonly $ref: "#/$defs/Ballot";
350
+ };
386
351
  };
387
- readonly attestation: {
388
- readonly $ref: "#/$defs/Multibase";
352
+ }, {
353
+ readonly title: "SpoiledEntry";
354
+ readonly description: "A sealed cast that did not open, or opened to no valid ballot: not counted (CONVENTIONS §9.7).";
355
+ readonly type: "object";
356
+ readonly additionalProperties: false;
357
+ readonly required: readonly ["kind", "leafIndex"];
358
+ readonly properties: {
359
+ readonly kind: {
360
+ readonly const: "spoiled";
361
+ };
362
+ readonly leafIndex: {
363
+ readonly type: "integer";
364
+ readonly minimum: 0;
365
+ };
389
366
  };
390
- };
367
+ }];
391
368
  };
392
369
  readonly Ballot: {
393
370
  readonly title: "Ballot";
@@ -456,130 +433,347 @@ export declare const PAYLOAD_SCHEMA: {
456
433
  };
457
434
  };
458
435
  };
459
- };
460
- };
461
- /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
462
- export declare const RESPONSE_PAYLOAD_SCHEMA: {
463
- readonly $schema: "https://json-schema.org/draft/2020-12/schema";
464
- readonly $ref: "#/$defs/Response";
465
- readonly $defs: {
466
- readonly Response: {
467
- readonly $anchor: "response";
468
- readonly title: "Voting — Board Read — response payload";
436
+ readonly Key: {
437
+ readonly title: "Key";
438
+ readonly description: "A question or option key, unique within its manifest or question.";
439
+ readonly type: "string";
440
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
441
+ };
442
+ readonly ElectionId: {
443
+ readonly title: "ElectionId";
444
+ readonly 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.";
445
+ readonly type: "string";
446
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
447
+ };
448
+ readonly DigestMultibase: {
449
+ readonly title: "DigestMultibase";
450
+ readonly 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`.";
451
+ readonly type: "string";
452
+ readonly minLength: 16;
453
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
454
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
455
+ };
456
+ readonly PartialDecryption: {
457
+ readonly title: "PartialDecryption";
458
+ readonly description: "Trustee `trustee`'s share of one decryption, `d = x_j·a`, with a Chaum–Pedersen proof against its verification key (CONVENTIONS §9.7).";
469
459
  readonly type: "object";
470
460
  readonly additionalProperties: false;
471
- readonly required: readonly ["treeSize", "entries"];
461
+ readonly required: readonly ["target", "d", "proof"];
472
462
  readonly properties: {
473
- readonly treeSize: {
474
- readonly type: "integer";
475
- readonly minimum: 0;
476
- readonly description: "The tree size the page was read against. No entry at or beyond it is returned.";
463
+ readonly target: {
464
+ readonly $ref: "#/$defs/DecryptionTarget";
477
465
  };
478
- readonly entries: {
466
+ readonly d: {
467
+ readonly $ref: "#/$defs/GroupElement";
468
+ };
469
+ readonly proof: {
470
+ readonly $ref: "#/$defs/SigmaProof";
471
+ };
472
+ };
473
+ };
474
+ readonly SigmaProof: {
475
+ readonly title: "SigmaProof";
476
+ readonly description: "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).";
477
+ readonly type: "object";
478
+ readonly additionalProperties: false;
479
+ readonly required: readonly ["c", "z"];
480
+ readonly properties: {
481
+ readonly c: {
482
+ readonly $ref: "#/$defs/GroupScalar";
483
+ };
484
+ readonly z: {
485
+ readonly $ref: "#/$defs/GroupScalar";
486
+ };
487
+ };
488
+ };
489
+ readonly GroupScalar: {
490
+ readonly title: "GroupScalar";
491
+ readonly description: "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).";
492
+ readonly type: "string";
493
+ readonly minLength: 2;
494
+ readonly maxLength: 64;
495
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
496
+ };
497
+ readonly GroupElement: {
498
+ readonly title: "GroupElement";
499
+ readonly description: "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).";
500
+ readonly type: "string";
501
+ readonly minLength: 2;
502
+ readonly maxLength: 64;
503
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
504
+ };
505
+ readonly DecryptionTarget: {
506
+ readonly title: "DecryptionTarget";
507
+ readonly description: "What a partial decryption decrypts: the sealed cast at a board leaf, or the total of one option of one question.";
508
+ readonly type: "object";
509
+ readonly additionalProperties: false;
510
+ readonly required: readonly ["ciphertext"];
511
+ readonly properties: {
512
+ readonly leafIndex: {
513
+ readonly type: "integer";
514
+ readonly minimum: 0;
515
+ readonly description: "A sealed cast's board leaf.";
516
+ };
517
+ readonly question: {
518
+ readonly $ref: "#/$defs/Key";
519
+ };
520
+ readonly option: {
521
+ readonly $ref: "#/$defs/Key";
522
+ };
523
+ readonly ciphertext: {
524
+ readonly $ref: "#/$defs/ElGamalCiphertext";
525
+ };
526
+ };
527
+ readonly oneOf: readonly [{
528
+ readonly required: readonly ["leafIndex"];
529
+ }, {
530
+ readonly required: readonly ["question", "option"];
531
+ }];
532
+ };
533
+ readonly ElGamalCiphertext: {
534
+ readonly title: "ElGamalCiphertext";
535
+ readonly description: "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).";
536
+ readonly type: "object";
537
+ readonly additionalProperties: false;
538
+ readonly required: readonly ["a", "b"];
539
+ readonly properties: {
540
+ readonly a: {
541
+ readonly $ref: "#/$defs/GroupElement";
542
+ };
543
+ readonly b: {
544
+ readonly $ref: "#/$defs/GroupElement";
545
+ };
546
+ };
547
+ };
548
+ readonly TrusteeIndex: {
549
+ readonly title: "TrusteeIndex";
550
+ readonly description: "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.";
551
+ readonly type: "integer";
552
+ readonly minimum: 1;
553
+ readonly maximum: 64;
554
+ };
555
+ readonly ElectionKey: {
556
+ readonly title: "ElectionKey";
557
+ readonly 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.";
558
+ readonly type: "object";
559
+ readonly additionalProperties: false;
560
+ readonly required: readonly ["key", "qualified", "verification"];
561
+ readonly properties: {
562
+ readonly key: {
563
+ readonly $ref: "#/$defs/GroupElement";
564
+ };
565
+ readonly qualified: {
479
566
  readonly type: "array";
480
- readonly maxItems: 1000;
567
+ readonly minItems: 1;
568
+ readonly maxItems: 64;
569
+ readonly items: {
570
+ readonly $ref: "#/$defs/TrusteeIndex";
571
+ };
572
+ readonly description: "The dealers whose dealings the key is formed from.";
573
+ };
574
+ readonly verification: {
575
+ readonly type: "array";
576
+ readonly minItems: 2;
577
+ readonly maxItems: 64;
481
578
  readonly items: {
482
579
  readonly type: "object";
483
580
  readonly additionalProperties: false;
484
- readonly required: readonly ["index", "entry"];
581
+ readonly required: readonly ["trustee", "key"];
485
582
  readonly properties: {
486
- readonly index: {
487
- readonly type: "integer";
488
- readonly minimum: 0;
583
+ readonly trustee: {
584
+ readonly $ref: "#/$defs/TrusteeIndex";
489
585
  };
490
- readonly entry: {
491
- readonly $ref: "#/$defs/BoardEntry";
586
+ readonly key: {
587
+ readonly $ref: "#/$defs/GroupElement";
492
588
  };
493
589
  };
494
590
  };
495
- readonly description: "Consecutive entries from `from`, in board order.";
496
591
  };
497
- readonly next: {
498
- readonly type: "integer";
499
- readonly minimum: 1;
500
- readonly description: "The `from` of the next page. Absent when the page reaches `treeSize`.";
592
+ };
593
+ };
594
+ readonly Dealing: {
595
+ readonly title: "Dealing";
596
+ readonly 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).";
597
+ readonly type: "object";
598
+ readonly additionalProperties: false;
599
+ readonly required: readonly ["dealer", "commitments", "pok", "shares"];
600
+ readonly properties: {
601
+ readonly dealer: {
602
+ readonly $ref: "#/$defs/TrusteeIndex";
501
603
  };
502
- readonly ext: {
503
- readonly $ref: "#/$defs/Ext";
604
+ readonly commitments: {
605
+ readonly type: "array";
606
+ readonly minItems: 2;
607
+ readonly maxItems: 64;
608
+ readonly items: {
609
+ readonly $ref: "#/$defs/GroupElement";
610
+ };
611
+ };
612
+ readonly pok: {
613
+ readonly $ref: "#/$defs/SigmaProof";
614
+ };
615
+ readonly shares: {
616
+ readonly type: "array";
617
+ readonly minItems: 2;
618
+ readonly maxItems: 64;
619
+ readonly items: {
620
+ readonly $ref: "#/$defs/SealedShare";
621
+ };
504
622
  };
505
623
  };
506
624
  };
507
- readonly Ext: {
508
- readonly title: "Ext";
509
- readonly 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.";
625
+ readonly SealedShare: {
626
+ readonly title: "SealedShare";
510
627
  readonly type: "object";
511
- readonly minProperties: 1;
512
- readonly additionalProperties: true;
513
- readonly propertyNames: {
514
- readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
628
+ readonly additionalProperties: false;
629
+ readonly required: readonly ["recipient", "share"];
630
+ readonly properties: {
631
+ readonly recipient: {
632
+ readonly $ref: "#/$defs/TrusteeIndex";
633
+ };
634
+ readonly share: {
635
+ readonly $ref: "#/$defs/SealedPayload";
636
+ };
515
637
  };
516
638
  };
517
- readonly BoardEntry: {
518
- readonly title: "BoardEntry";
519
- readonly 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.";
520
- readonly oneOf: readonly [{
521
- readonly title: "CastEntry";
522
- readonly type: "object";
523
- readonly additionalProperties: false;
524
- readonly required: readonly ["kind", "cast"];
525
- readonly properties: {
526
- readonly kind: {
527
- readonly const: "cast";
528
- };
529
- readonly cast: {
530
- readonly $ref: "#/$defs/Cast";
531
- };
639
+ readonly SealedPayload: {
640
+ readonly title: "SealedPayload";
641
+ readonly 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).";
642
+ readonly type: "object";
643
+ readonly additionalProperties: false;
644
+ readonly required: readonly ["kem", "body"];
645
+ readonly properties: {
646
+ readonly kem: {
647
+ readonly $ref: "#/$defs/ElGamalCiphertext";
532
648
  };
533
- }, {
534
- readonly title: "ReplacementEntry";
535
- readonly description: "The cast at `replaces` is no longer counted: a later cast under the same tag is.";
536
- readonly type: "object";
537
- readonly additionalProperties: false;
538
- readonly required: readonly ["kind", "tag", "replaces", "by"];
539
- readonly properties: {
540
- readonly kind: {
541
- readonly const: "replaced";
542
- };
543
- readonly tag: {
544
- readonly $ref: "#/$defs/Multibase";
545
- };
546
- readonly replaces: {
547
- readonly type: "integer";
548
- readonly minimum: 0;
549
- };
550
- readonly by: {
551
- readonly type: "integer";
552
- readonly minimum: 0;
553
- };
649
+ readonly body: {
650
+ readonly type: "string";
651
+ readonly minLength: 2;
652
+ readonly maxLength: 131072;
653
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
554
654
  };
555
- }, {
556
- readonly title: "LifecycleEntry";
557
- readonly type: "object";
558
- readonly additionalProperties: false;
559
- readonly required: readonly ["kind", "at"];
560
- readonly properties: {
561
- readonly kind: {
562
- readonly enum: readonly ["opened", "closed", "closedEarly", "cancelled"];
563
- };
564
- readonly at: {
565
- readonly type: "string";
566
- readonly format: "date-time";
567
- };
655
+ };
656
+ };
657
+ readonly TransportKey: {
658
+ readonly title: "TransportKey";
659
+ readonly description: "The group element a trustee's shares are sealed to, with a Schnorr proof of knowledge of its discrete log (CONVENTIONS §9.6).";
660
+ readonly type: "object";
661
+ readonly additionalProperties: false;
662
+ readonly required: readonly ["trustee", "key", "pok"];
663
+ readonly properties: {
664
+ readonly trustee: {
665
+ readonly $ref: "#/$defs/TrusteeIndex";
666
+ };
667
+ readonly key: {
668
+ readonly $ref: "#/$defs/GroupElement";
669
+ };
670
+ readonly pok: {
671
+ readonly $ref: "#/$defs/SigmaProof";
672
+ };
673
+ };
674
+ };
675
+ readonly EncryptedCast: {
676
+ readonly title: "EncryptedCast";
677
+ readonly 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).";
678
+ readonly type: "object";
679
+ readonly additionalProperties: false;
680
+ readonly required: readonly ["tag", "attestation"];
681
+ readonly properties: {
682
+ readonly sealed: {
683
+ readonly $ref: "#/$defs/SealedPayload";
684
+ };
685
+ readonly encrypted: {
686
+ readonly $ref: "#/$defs/EncryptedBallot";
687
+ };
688
+ readonly tag: {
689
+ readonly $ref: "#/$defs/Multibase";
690
+ };
691
+ readonly attestation: {
692
+ readonly $ref: "#/$defs/Multibase";
568
693
  };
694
+ };
695
+ readonly oneOf: readonly [{
696
+ readonly required: readonly ["sealed"];
569
697
  }, {
570
- readonly title: "ResultEntry";
571
- readonly type: "object";
572
- readonly additionalProperties: false;
573
- readonly required: readonly ["kind", "result"];
574
- readonly properties: {
575
- readonly kind: {
576
- readonly const: "result";
698
+ readonly required: readonly ["encrypted"];
699
+ }];
700
+ };
701
+ readonly Multibase: {
702
+ readonly title: "Multibase";
703
+ readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
704
+ readonly type: "string";
705
+ readonly maxLength: 16384;
706
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
707
+ };
708
+ readonly EncryptedBallot: {
709
+ readonly title: "EncryptedBallot";
710
+ readonly description: "A tallied-encrypted ballot: one EncryptedQuestion per manifest question, in the manifest's order. Never decrypted (VTI-VOT-064).";
711
+ readonly type: "object";
712
+ readonly additionalProperties: false;
713
+ readonly required: readonly ["electionId", "manifestDigest", "questions"];
714
+ readonly properties: {
715
+ readonly electionId: {
716
+ readonly $ref: "#/$defs/ElectionId";
717
+ };
718
+ readonly manifestDigest: {
719
+ readonly $ref: "#/$defs/DigestMultibase";
720
+ };
721
+ readonly questions: {
722
+ readonly type: "array";
723
+ readonly minItems: 1;
724
+ readonly maxItems: 64;
725
+ readonly items: {
726
+ readonly $ref: "#/$defs/EncryptedQuestion";
577
727
  };
578
- readonly result: {
579
- readonly $ref: "#/$defs/ElectionResult";
728
+ };
729
+ };
730
+ };
731
+ readonly EncryptedQuestion: {
732
+ readonly title: "EncryptedQuestion";
733
+ readonly 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).";
734
+ readonly type: "object";
735
+ readonly additionalProperties: false;
736
+ readonly required: readonly ["question", "options", "sumProof"];
737
+ readonly properties: {
738
+ readonly question: {
739
+ readonly $ref: "#/$defs/Key";
740
+ };
741
+ readonly options: {
742
+ readonly type: "array";
743
+ readonly minItems: 1;
744
+ readonly maxItems: 64;
745
+ readonly items: {
746
+ readonly $ref: "#/$defs/EncryptedOption";
580
747
  };
581
748
  };
582
- }];
749
+ readonly sumProof: {
750
+ readonly $ref: "#/$defs/DisjunctiveProof";
751
+ };
752
+ };
753
+ };
754
+ readonly DisjunctiveProof: {
755
+ readonly title: "DisjunctiveProof";
756
+ readonly 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).";
757
+ readonly type: "array";
758
+ readonly minItems: 1;
759
+ readonly maxItems: 65;
760
+ readonly items: {
761
+ readonly $ref: "#/$defs/SigmaProof";
762
+ };
763
+ };
764
+ readonly EncryptedOption: {
765
+ readonly title: "EncryptedOption";
766
+ readonly type: "object";
767
+ readonly additionalProperties: false;
768
+ readonly required: readonly ["ciphertext", "proof"];
769
+ readonly properties: {
770
+ readonly ciphertext: {
771
+ readonly $ref: "#/$defs/ElGamalCiphertext";
772
+ };
773
+ readonly proof: {
774
+ readonly $ref: "#/$defs/DisjunctiveProof";
775
+ };
776
+ };
583
777
  };
584
778
  readonly ElectionResult: {
585
779
  readonly title: "ElectionResult";
@@ -634,20 +828,6 @@ export declare const RESPONSE_PAYLOAD_SCHEMA: {
634
828
  };
635
829
  };
636
830
  };
637
- readonly ElectionId: {
638
- readonly title: "ElectionId";
639
- readonly 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.";
640
- readonly type: "string";
641
- readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
642
- };
643
- readonly DigestMultibase: {
644
- readonly title: "DigestMultibase";
645
- readonly 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`.";
646
- readonly type: "string";
647
- readonly minLength: 16;
648
- readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
649
- readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
650
- };
651
831
  readonly QuestionResult: {
652
832
  readonly title: "QuestionResult";
653
833
  readonly 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.";
@@ -717,19 +897,6 @@ export declare const RESPONSE_PAYLOAD_SCHEMA: {
717
897
  };
718
898
  };
719
899
  };
720
- readonly Key: {
721
- readonly title: "Key";
722
- readonly description: "A question or option key, unique within its manifest or question.";
723
- readonly type: "string";
724
- readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
725
- };
726
- readonly Multibase: {
727
- readonly title: "Multibase";
728
- readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
729
- readonly type: "string";
730
- readonly maxLength: 16384;
731
- readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
732
- };
733
900
  readonly Cast: {
734
901
  readonly title: "Cast";
735
902
  readonly 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.";
@@ -748,13 +915,282 @@ export declare const RESPONSE_PAYLOAD_SCHEMA: {
748
915
  };
749
916
  };
750
917
  };
751
- readonly Ballot: {
752
- readonly title: "Ballot";
753
- readonly 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.";
754
- readonly type: "object";
755
- readonly additionalProperties: false;
756
- readonly required: readonly ["electionId", "manifestDigest", "answers"];
757
- readonly properties: {
918
+ };
919
+ };
920
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
921
+ export declare const RESPONSE_PAYLOAD_SCHEMA: {
922
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
923
+ readonly $ref: "#/$defs/Response";
924
+ readonly $defs: {
925
+ readonly Response: {
926
+ readonly $anchor: "response";
927
+ readonly title: "Voting — Board Read — response payload";
928
+ readonly type: "object";
929
+ readonly additionalProperties: false;
930
+ readonly required: readonly ["treeSize", "entries"];
931
+ readonly properties: {
932
+ readonly treeSize: {
933
+ readonly type: "integer";
934
+ readonly minimum: 0;
935
+ readonly description: "The tree size the page was read against. No entry at or beyond it is returned.";
936
+ };
937
+ readonly entries: {
938
+ readonly type: "array";
939
+ readonly maxItems: 1000;
940
+ readonly items: {
941
+ readonly type: "object";
942
+ readonly additionalProperties: false;
943
+ readonly required: readonly ["index", "entry"];
944
+ readonly properties: {
945
+ readonly index: {
946
+ readonly type: "integer";
947
+ readonly minimum: 0;
948
+ };
949
+ readonly entry: {
950
+ readonly $ref: "#/$defs/BoardEntry";
951
+ };
952
+ };
953
+ };
954
+ readonly description: "Consecutive entries from `from`, in board order.";
955
+ };
956
+ readonly next: {
957
+ readonly type: "integer";
958
+ readonly minimum: 1;
959
+ readonly description: "The `from` of the next page. Absent when the page reaches `treeSize`.";
960
+ };
961
+ readonly ext: {
962
+ readonly $ref: "#/$defs/Ext";
963
+ };
964
+ };
965
+ };
966
+ readonly Ext: {
967
+ readonly title: "Ext";
968
+ readonly 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.";
969
+ readonly type: "object";
970
+ readonly minProperties: 1;
971
+ readonly additionalProperties: true;
972
+ readonly propertyNames: {
973
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
974
+ };
975
+ };
976
+ readonly BoardEntry: {
977
+ readonly title: "BoardEntry";
978
+ readonly 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.";
979
+ readonly oneOf: readonly [{
980
+ readonly title: "CastEntry";
981
+ readonly type: "object";
982
+ readonly additionalProperties: false;
983
+ readonly required: readonly ["kind", "cast"];
984
+ readonly properties: {
985
+ readonly kind: {
986
+ readonly const: "cast";
987
+ };
988
+ readonly cast: {
989
+ readonly $ref: "#/$defs/Cast";
990
+ };
991
+ };
992
+ }, {
993
+ readonly title: "ReplacementEntry";
994
+ readonly description: "The cast at `replaces` is no longer counted: a later cast under the same tag is.";
995
+ readonly type: "object";
996
+ readonly additionalProperties: false;
997
+ readonly required: readonly ["kind", "tag", "replaces", "by"];
998
+ readonly properties: {
999
+ readonly kind: {
1000
+ readonly const: "replaced";
1001
+ };
1002
+ readonly tag: {
1003
+ readonly $ref: "#/$defs/Multibase";
1004
+ };
1005
+ readonly replaces: {
1006
+ readonly type: "integer";
1007
+ readonly minimum: 0;
1008
+ };
1009
+ readonly by: {
1010
+ readonly type: "integer";
1011
+ readonly minimum: 0;
1012
+ };
1013
+ };
1014
+ }, {
1015
+ readonly title: "LifecycleEntry";
1016
+ readonly type: "object";
1017
+ readonly additionalProperties: false;
1018
+ readonly required: readonly ["kind", "at"];
1019
+ readonly properties: {
1020
+ readonly kind: {
1021
+ readonly enum: readonly ["opened", "closed", "closedEarly", "cancelled"];
1022
+ };
1023
+ readonly at: {
1024
+ readonly type: "string";
1025
+ readonly format: "date-time";
1026
+ };
1027
+ };
1028
+ }, {
1029
+ readonly title: "ResultEntry";
1030
+ readonly type: "object";
1031
+ readonly additionalProperties: false;
1032
+ readonly required: readonly ["kind", "result"];
1033
+ readonly properties: {
1034
+ readonly kind: {
1035
+ readonly const: "result";
1036
+ };
1037
+ readonly result: {
1038
+ readonly $ref: "#/$defs/ElectionResult";
1039
+ };
1040
+ };
1041
+ }, {
1042
+ readonly title: "EncryptedCastEntry";
1043
+ readonly type: "object";
1044
+ readonly additionalProperties: false;
1045
+ readonly required: readonly ["kind", "cast"];
1046
+ readonly properties: {
1047
+ readonly kind: {
1048
+ readonly const: "encryptedCast";
1049
+ };
1050
+ readonly cast: {
1051
+ readonly $ref: "#/$defs/EncryptedCast";
1052
+ };
1053
+ };
1054
+ }, {
1055
+ readonly title: "TransportKeyEntry";
1056
+ readonly type: "object";
1057
+ readonly additionalProperties: false;
1058
+ readonly required: readonly ["kind", "transportKey"];
1059
+ readonly properties: {
1060
+ readonly kind: {
1061
+ readonly const: "transportKey";
1062
+ };
1063
+ readonly transportKey: {
1064
+ readonly $ref: "#/$defs/TransportKey";
1065
+ };
1066
+ };
1067
+ }, {
1068
+ readonly title: "DealingEntry";
1069
+ readonly type: "object";
1070
+ readonly additionalProperties: false;
1071
+ readonly required: readonly ["kind", "dealing"];
1072
+ readonly properties: {
1073
+ readonly kind: {
1074
+ readonly const: "dealing";
1075
+ };
1076
+ readonly dealing: {
1077
+ readonly $ref: "#/$defs/Dealing";
1078
+ };
1079
+ };
1080
+ }, {
1081
+ readonly title: "ConfirmationEntry";
1082
+ readonly type: "object";
1083
+ readonly additionalProperties: false;
1084
+ readonly required: readonly ["kind", "trustee", "complaints"];
1085
+ readonly properties: {
1086
+ readonly kind: {
1087
+ readonly const: "confirmation";
1088
+ };
1089
+ readonly trustee: {
1090
+ readonly $ref: "#/$defs/TrusteeIndex";
1091
+ };
1092
+ readonly complaints: {
1093
+ readonly type: "array";
1094
+ readonly maxItems: 64;
1095
+ readonly items: {
1096
+ readonly $ref: "#/$defs/TrusteeIndex";
1097
+ };
1098
+ };
1099
+ };
1100
+ }, {
1101
+ readonly title: "JustificationEntry";
1102
+ readonly type: "object";
1103
+ readonly additionalProperties: false;
1104
+ readonly required: readonly ["kind", "dealer", "recipient", "share"];
1105
+ readonly properties: {
1106
+ readonly kind: {
1107
+ readonly const: "justification";
1108
+ };
1109
+ readonly dealer: {
1110
+ readonly $ref: "#/$defs/TrusteeIndex";
1111
+ };
1112
+ readonly recipient: {
1113
+ readonly $ref: "#/$defs/TrusteeIndex";
1114
+ };
1115
+ readonly share: {
1116
+ readonly $ref: "#/$defs/GroupScalar";
1117
+ };
1118
+ };
1119
+ }, {
1120
+ readonly title: "ElectionKeyEntry";
1121
+ readonly type: "object";
1122
+ readonly additionalProperties: false;
1123
+ readonly required: readonly ["kind", "electionKey"];
1124
+ readonly properties: {
1125
+ readonly kind: {
1126
+ readonly const: "electionKey";
1127
+ };
1128
+ readonly electionKey: {
1129
+ readonly $ref: "#/$defs/ElectionKey";
1130
+ };
1131
+ };
1132
+ }, {
1133
+ readonly title: "PartialDecryptionsEntry";
1134
+ readonly type: "object";
1135
+ readonly additionalProperties: false;
1136
+ readonly required: readonly ["kind", "trustee", "partials"];
1137
+ readonly properties: {
1138
+ readonly kind: {
1139
+ readonly const: "partials";
1140
+ };
1141
+ readonly trustee: {
1142
+ readonly $ref: "#/$defs/TrusteeIndex";
1143
+ };
1144
+ readonly partials: {
1145
+ readonly type: "array";
1146
+ readonly minItems: 1;
1147
+ readonly maxItems: 100000;
1148
+ readonly items: {
1149
+ readonly $ref: "#/$defs/PartialDecryption";
1150
+ };
1151
+ };
1152
+ };
1153
+ }, {
1154
+ readonly title: "UnsealedEntry";
1155
+ readonly type: "object";
1156
+ readonly additionalProperties: false;
1157
+ readonly required: readonly ["kind", "leafIndex", "ballot"];
1158
+ readonly properties: {
1159
+ readonly kind: {
1160
+ readonly const: "unsealed";
1161
+ };
1162
+ readonly leafIndex: {
1163
+ readonly type: "integer";
1164
+ readonly minimum: 0;
1165
+ };
1166
+ readonly ballot: {
1167
+ readonly $ref: "#/$defs/Ballot";
1168
+ };
1169
+ };
1170
+ }, {
1171
+ readonly title: "SpoiledEntry";
1172
+ readonly description: "A sealed cast that did not open, or opened to no valid ballot: not counted (CONVENTIONS §9.7).";
1173
+ readonly type: "object";
1174
+ readonly additionalProperties: false;
1175
+ readonly required: readonly ["kind", "leafIndex"];
1176
+ readonly properties: {
1177
+ readonly kind: {
1178
+ readonly const: "spoiled";
1179
+ };
1180
+ readonly leafIndex: {
1181
+ readonly type: "integer";
1182
+ readonly minimum: 0;
1183
+ };
1184
+ };
1185
+ }];
1186
+ };
1187
+ readonly Ballot: {
1188
+ readonly title: "Ballot";
1189
+ readonly 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.";
1190
+ readonly type: "object";
1191
+ readonly additionalProperties: false;
1192
+ readonly required: readonly ["electionId", "manifestDigest", "answers"];
1193
+ readonly properties: {
758
1194
  readonly electionId: {
759
1195
  readonly $ref: "#/$defs/ElectionId";
760
1196
  };
@@ -770,103 +1206,1414 @@ export declare const RESPONSE_PAYLOAD_SCHEMA: {
770
1206
  };
771
1207
  };
772
1208
  };
773
- };
774
- readonly Answer: {
775
- readonly title: "Answer";
776
- readonly 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.";
777
- readonly type: "object";
778
- readonly additionalProperties: false;
779
- readonly required: readonly ["question"];
780
- readonly minProperties: 2;
781
- readonly maxProperties: 2;
782
- readonly properties: {
783
- readonly question: {
784
- readonly $ref: "#/$defs/Key";
785
- };
786
- readonly choice: {
787
- readonly type: "array";
788
- readonly items: {
1209
+ };
1210
+ readonly Answer: {
1211
+ readonly title: "Answer";
1212
+ readonly 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.";
1213
+ readonly type: "object";
1214
+ readonly additionalProperties: false;
1215
+ readonly required: readonly ["question"];
1216
+ readonly minProperties: 2;
1217
+ readonly maxProperties: 2;
1218
+ readonly properties: {
1219
+ readonly question: {
1220
+ readonly $ref: "#/$defs/Key";
1221
+ };
1222
+ readonly choice: {
1223
+ readonly type: "array";
1224
+ readonly items: {
1225
+ readonly $ref: "#/$defs/Key";
1226
+ };
1227
+ readonly uniqueItems: true;
1228
+ };
1229
+ readonly ranking: {
1230
+ readonly type: "array";
1231
+ readonly items: {
1232
+ readonly $ref: "#/$defs/Key";
1233
+ };
1234
+ readonly uniqueItems: true;
1235
+ };
1236
+ readonly scores: {
1237
+ readonly type: "object";
1238
+ readonly propertyNames: {
1239
+ readonly $ref: "#/$defs/Key";
1240
+ };
1241
+ readonly additionalProperties: {
1242
+ readonly type: "integer";
1243
+ };
1244
+ };
1245
+ readonly text: {
1246
+ readonly type: "string";
1247
+ readonly maxLength: 4096;
1248
+ };
1249
+ readonly abstain: {
1250
+ readonly const: true;
1251
+ };
1252
+ };
1253
+ };
1254
+ readonly Key: {
1255
+ readonly title: "Key";
1256
+ readonly description: "A question or option key, unique within its manifest or question.";
1257
+ readonly type: "string";
1258
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
1259
+ };
1260
+ readonly ElectionId: {
1261
+ readonly title: "ElectionId";
1262
+ readonly 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.";
1263
+ readonly type: "string";
1264
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
1265
+ };
1266
+ readonly DigestMultibase: {
1267
+ readonly title: "DigestMultibase";
1268
+ readonly 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`.";
1269
+ readonly type: "string";
1270
+ readonly minLength: 16;
1271
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
1272
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
1273
+ };
1274
+ readonly PartialDecryption: {
1275
+ readonly title: "PartialDecryption";
1276
+ readonly description: "Trustee `trustee`'s share of one decryption, `d = x_j·a`, with a Chaum–Pedersen proof against its verification key (CONVENTIONS §9.7).";
1277
+ readonly type: "object";
1278
+ readonly additionalProperties: false;
1279
+ readonly required: readonly ["target", "d", "proof"];
1280
+ readonly properties: {
1281
+ readonly target: {
1282
+ readonly $ref: "#/$defs/DecryptionTarget";
1283
+ };
1284
+ readonly d: {
1285
+ readonly $ref: "#/$defs/GroupElement";
1286
+ };
1287
+ readonly proof: {
1288
+ readonly $ref: "#/$defs/SigmaProof";
1289
+ };
1290
+ };
1291
+ };
1292
+ readonly SigmaProof: {
1293
+ readonly title: "SigmaProof";
1294
+ readonly description: "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).";
1295
+ readonly type: "object";
1296
+ readonly additionalProperties: false;
1297
+ readonly required: readonly ["c", "z"];
1298
+ readonly properties: {
1299
+ readonly c: {
1300
+ readonly $ref: "#/$defs/GroupScalar";
1301
+ };
1302
+ readonly z: {
1303
+ readonly $ref: "#/$defs/GroupScalar";
1304
+ };
1305
+ };
1306
+ };
1307
+ readonly GroupScalar: {
1308
+ readonly title: "GroupScalar";
1309
+ readonly description: "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).";
1310
+ readonly type: "string";
1311
+ readonly minLength: 2;
1312
+ readonly maxLength: 64;
1313
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
1314
+ };
1315
+ readonly GroupElement: {
1316
+ readonly title: "GroupElement";
1317
+ readonly description: "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).";
1318
+ readonly type: "string";
1319
+ readonly minLength: 2;
1320
+ readonly maxLength: 64;
1321
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
1322
+ };
1323
+ readonly DecryptionTarget: {
1324
+ readonly title: "DecryptionTarget";
1325
+ readonly description: "What a partial decryption decrypts: the sealed cast at a board leaf, or the total of one option of one question.";
1326
+ readonly type: "object";
1327
+ readonly additionalProperties: false;
1328
+ readonly required: readonly ["ciphertext"];
1329
+ readonly properties: {
1330
+ readonly leafIndex: {
1331
+ readonly type: "integer";
1332
+ readonly minimum: 0;
1333
+ readonly description: "A sealed cast's board leaf.";
1334
+ };
1335
+ readonly question: {
1336
+ readonly $ref: "#/$defs/Key";
1337
+ };
1338
+ readonly option: {
1339
+ readonly $ref: "#/$defs/Key";
1340
+ };
1341
+ readonly ciphertext: {
1342
+ readonly $ref: "#/$defs/ElGamalCiphertext";
1343
+ };
1344
+ };
1345
+ readonly oneOf: readonly [{
1346
+ readonly required: readonly ["leafIndex"];
1347
+ }, {
1348
+ readonly required: readonly ["question", "option"];
1349
+ }];
1350
+ };
1351
+ readonly ElGamalCiphertext: {
1352
+ readonly title: "ElGamalCiphertext";
1353
+ readonly description: "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).";
1354
+ readonly type: "object";
1355
+ readonly additionalProperties: false;
1356
+ readonly required: readonly ["a", "b"];
1357
+ readonly properties: {
1358
+ readonly a: {
1359
+ readonly $ref: "#/$defs/GroupElement";
1360
+ };
1361
+ readonly b: {
1362
+ readonly $ref: "#/$defs/GroupElement";
1363
+ };
1364
+ };
1365
+ };
1366
+ readonly TrusteeIndex: {
1367
+ readonly title: "TrusteeIndex";
1368
+ readonly description: "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.";
1369
+ readonly type: "integer";
1370
+ readonly minimum: 1;
1371
+ readonly maximum: 64;
1372
+ };
1373
+ readonly ElectionKey: {
1374
+ readonly title: "ElectionKey";
1375
+ readonly 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.";
1376
+ readonly type: "object";
1377
+ readonly additionalProperties: false;
1378
+ readonly required: readonly ["key", "qualified", "verification"];
1379
+ readonly properties: {
1380
+ readonly key: {
1381
+ readonly $ref: "#/$defs/GroupElement";
1382
+ };
1383
+ readonly qualified: {
1384
+ readonly type: "array";
1385
+ readonly minItems: 1;
1386
+ readonly maxItems: 64;
1387
+ readonly items: {
1388
+ readonly $ref: "#/$defs/TrusteeIndex";
1389
+ };
1390
+ readonly description: "The dealers whose dealings the key is formed from.";
1391
+ };
1392
+ readonly verification: {
1393
+ readonly type: "array";
1394
+ readonly minItems: 2;
1395
+ readonly maxItems: 64;
1396
+ readonly items: {
1397
+ readonly type: "object";
1398
+ readonly additionalProperties: false;
1399
+ readonly required: readonly ["trustee", "key"];
1400
+ readonly properties: {
1401
+ readonly trustee: {
1402
+ readonly $ref: "#/$defs/TrusteeIndex";
1403
+ };
1404
+ readonly key: {
1405
+ readonly $ref: "#/$defs/GroupElement";
1406
+ };
1407
+ };
1408
+ };
1409
+ };
1410
+ };
1411
+ };
1412
+ readonly Dealing: {
1413
+ readonly title: "Dealing";
1414
+ readonly 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).";
1415
+ readonly type: "object";
1416
+ readonly additionalProperties: false;
1417
+ readonly required: readonly ["dealer", "commitments", "pok", "shares"];
1418
+ readonly properties: {
1419
+ readonly dealer: {
1420
+ readonly $ref: "#/$defs/TrusteeIndex";
1421
+ };
1422
+ readonly commitments: {
1423
+ readonly type: "array";
1424
+ readonly minItems: 2;
1425
+ readonly maxItems: 64;
1426
+ readonly items: {
1427
+ readonly $ref: "#/$defs/GroupElement";
1428
+ };
1429
+ };
1430
+ readonly pok: {
1431
+ readonly $ref: "#/$defs/SigmaProof";
1432
+ };
1433
+ readonly shares: {
1434
+ readonly type: "array";
1435
+ readonly minItems: 2;
1436
+ readonly maxItems: 64;
1437
+ readonly items: {
1438
+ readonly $ref: "#/$defs/SealedShare";
1439
+ };
1440
+ };
1441
+ };
1442
+ };
1443
+ readonly SealedShare: {
1444
+ readonly title: "SealedShare";
1445
+ readonly type: "object";
1446
+ readonly additionalProperties: false;
1447
+ readonly required: readonly ["recipient", "share"];
1448
+ readonly properties: {
1449
+ readonly recipient: {
1450
+ readonly $ref: "#/$defs/TrusteeIndex";
1451
+ };
1452
+ readonly share: {
1453
+ readonly $ref: "#/$defs/SealedPayload";
1454
+ };
1455
+ };
1456
+ };
1457
+ readonly SealedPayload: {
1458
+ readonly title: "SealedPayload";
1459
+ readonly 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).";
1460
+ readonly type: "object";
1461
+ readonly additionalProperties: false;
1462
+ readonly required: readonly ["kem", "body"];
1463
+ readonly properties: {
1464
+ readonly kem: {
1465
+ readonly $ref: "#/$defs/ElGamalCiphertext";
1466
+ };
1467
+ readonly body: {
1468
+ readonly type: "string";
1469
+ readonly minLength: 2;
1470
+ readonly maxLength: 131072;
1471
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
1472
+ };
1473
+ };
1474
+ };
1475
+ readonly TransportKey: {
1476
+ readonly title: "TransportKey";
1477
+ readonly description: "The group element a trustee's shares are sealed to, with a Schnorr proof of knowledge of its discrete log (CONVENTIONS §9.6).";
1478
+ readonly type: "object";
1479
+ readonly additionalProperties: false;
1480
+ readonly required: readonly ["trustee", "key", "pok"];
1481
+ readonly properties: {
1482
+ readonly trustee: {
1483
+ readonly $ref: "#/$defs/TrusteeIndex";
1484
+ };
1485
+ readonly key: {
1486
+ readonly $ref: "#/$defs/GroupElement";
1487
+ };
1488
+ readonly pok: {
1489
+ readonly $ref: "#/$defs/SigmaProof";
1490
+ };
1491
+ };
1492
+ };
1493
+ readonly EncryptedCast: {
1494
+ readonly title: "EncryptedCast";
1495
+ readonly 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).";
1496
+ readonly type: "object";
1497
+ readonly additionalProperties: false;
1498
+ readonly required: readonly ["tag", "attestation"];
1499
+ readonly properties: {
1500
+ readonly sealed: {
1501
+ readonly $ref: "#/$defs/SealedPayload";
1502
+ };
1503
+ readonly encrypted: {
1504
+ readonly $ref: "#/$defs/EncryptedBallot";
1505
+ };
1506
+ readonly tag: {
1507
+ readonly $ref: "#/$defs/Multibase";
1508
+ };
1509
+ readonly attestation: {
1510
+ readonly $ref: "#/$defs/Multibase";
1511
+ };
1512
+ };
1513
+ readonly oneOf: readonly [{
1514
+ readonly required: readonly ["sealed"];
1515
+ }, {
1516
+ readonly required: readonly ["encrypted"];
1517
+ }];
1518
+ };
1519
+ readonly Multibase: {
1520
+ readonly title: "Multibase";
1521
+ readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
1522
+ readonly type: "string";
1523
+ readonly maxLength: 16384;
1524
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
1525
+ };
1526
+ readonly EncryptedBallot: {
1527
+ readonly title: "EncryptedBallot";
1528
+ readonly description: "A tallied-encrypted ballot: one EncryptedQuestion per manifest question, in the manifest's order. Never decrypted (VTI-VOT-064).";
1529
+ readonly type: "object";
1530
+ readonly additionalProperties: false;
1531
+ readonly required: readonly ["electionId", "manifestDigest", "questions"];
1532
+ readonly properties: {
1533
+ readonly electionId: {
1534
+ readonly $ref: "#/$defs/ElectionId";
1535
+ };
1536
+ readonly manifestDigest: {
1537
+ readonly $ref: "#/$defs/DigestMultibase";
1538
+ };
1539
+ readonly questions: {
1540
+ readonly type: "array";
1541
+ readonly minItems: 1;
1542
+ readonly maxItems: 64;
1543
+ readonly items: {
1544
+ readonly $ref: "#/$defs/EncryptedQuestion";
1545
+ };
1546
+ };
1547
+ };
1548
+ };
1549
+ readonly EncryptedQuestion: {
1550
+ readonly title: "EncryptedQuestion";
1551
+ readonly 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).";
1552
+ readonly type: "object";
1553
+ readonly additionalProperties: false;
1554
+ readonly required: readonly ["question", "options", "sumProof"];
1555
+ readonly properties: {
1556
+ readonly question: {
1557
+ readonly $ref: "#/$defs/Key";
1558
+ };
1559
+ readonly options: {
1560
+ readonly type: "array";
1561
+ readonly minItems: 1;
1562
+ readonly maxItems: 64;
1563
+ readonly items: {
1564
+ readonly $ref: "#/$defs/EncryptedOption";
1565
+ };
1566
+ };
1567
+ readonly sumProof: {
1568
+ readonly $ref: "#/$defs/DisjunctiveProof";
1569
+ };
1570
+ };
1571
+ };
1572
+ readonly DisjunctiveProof: {
1573
+ readonly title: "DisjunctiveProof";
1574
+ readonly 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).";
1575
+ readonly type: "array";
1576
+ readonly minItems: 1;
1577
+ readonly maxItems: 65;
1578
+ readonly items: {
1579
+ readonly $ref: "#/$defs/SigmaProof";
1580
+ };
1581
+ };
1582
+ readonly EncryptedOption: {
1583
+ readonly title: "EncryptedOption";
1584
+ readonly type: "object";
1585
+ readonly additionalProperties: false;
1586
+ readonly required: readonly ["ciphertext", "proof"];
1587
+ readonly properties: {
1588
+ readonly ciphertext: {
1589
+ readonly $ref: "#/$defs/ElGamalCiphertext";
1590
+ };
1591
+ readonly proof: {
1592
+ readonly $ref: "#/$defs/DisjunctiveProof";
1593
+ };
1594
+ };
1595
+ };
1596
+ readonly ElectionResult: {
1597
+ readonly title: "ElectionResult";
1598
+ readonly description: "An election's result, computable by anyone who can read its board from the board and the registration alone (VTI-VOT-070).";
1599
+ readonly type: "object";
1600
+ readonly additionalProperties: false;
1601
+ readonly required: readonly ["electionId", "manifestDigest", "ballotsCounted", "questions", "head"];
1602
+ readonly properties: {
1603
+ readonly electionId: {
1604
+ readonly $ref: "#/$defs/ElectionId";
1605
+ };
1606
+ readonly manifestDigest: {
1607
+ readonly $ref: "#/$defs/DigestMultibase";
1608
+ };
1609
+ readonly ballotsCounted: {
1610
+ readonly type: "integer";
1611
+ readonly minimum: 0;
1612
+ };
1613
+ readonly questions: {
1614
+ readonly type: "array";
1615
+ readonly items: {
1616
+ readonly $ref: "#/$defs/QuestionResult";
1617
+ };
1618
+ };
1619
+ readonly head: {
1620
+ readonly $ref: "#/$defs/BoardHead";
1621
+ readonly description: "The head of the board as it stood at close: the result counts exactly its entries.";
1622
+ };
1623
+ };
1624
+ };
1625
+ readonly BoardHead: {
1626
+ readonly title: "BoardHead";
1627
+ readonly 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.";
1628
+ readonly type: "object";
1629
+ readonly additionalProperties: false;
1630
+ readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
1631
+ readonly properties: {
1632
+ readonly electionId: {
1633
+ readonly $ref: "#/$defs/ElectionId";
1634
+ };
1635
+ readonly treeSize: {
1636
+ readonly type: "integer";
1637
+ readonly minimum: 0;
1638
+ };
1639
+ readonly rootHash: {
1640
+ readonly $ref: "#/$defs/DigestMultibase";
1641
+ readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
1642
+ };
1643
+ readonly issuedAt: {
1644
+ readonly type: "string";
1645
+ readonly format: "date-time";
1646
+ };
1647
+ };
1648
+ };
1649
+ readonly QuestionResult: {
1650
+ readonly title: "QuestionResult";
1651
+ readonly 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.";
1652
+ readonly type: "object";
1653
+ readonly additionalProperties: false;
1654
+ readonly required: readonly ["question", "abstained"];
1655
+ readonly properties: {
1656
+ readonly question: {
1657
+ readonly $ref: "#/$defs/Key";
1658
+ };
1659
+ readonly abstained: {
1660
+ readonly type: "integer";
1661
+ readonly minimum: 0;
1662
+ };
1663
+ readonly choice: {
1664
+ readonly type: "object";
1665
+ readonly propertyNames: {
1666
+ readonly $ref: "#/$defs/Key";
1667
+ };
1668
+ readonly additionalProperties: {
1669
+ readonly type: "integer";
1670
+ readonly minimum: 0;
1671
+ };
1672
+ };
1673
+ readonly ranking: {
1674
+ readonly type: "object";
1675
+ readonly propertyNames: {
1676
+ readonly $ref: "#/$defs/Key";
1677
+ };
1678
+ readonly additionalProperties: {
1679
+ readonly type: "array";
1680
+ readonly items: {
1681
+ readonly type: "integer";
1682
+ readonly minimum: 0;
1683
+ };
1684
+ };
1685
+ };
1686
+ readonly score: {
1687
+ readonly type: "object";
1688
+ readonly propertyNames: {
1689
+ readonly $ref: "#/$defs/Key";
1690
+ };
1691
+ readonly additionalProperties: {
1692
+ readonly type: "object";
1693
+ readonly additionalProperties: false;
1694
+ readonly required: readonly ["sum", "count"];
1695
+ readonly properties: {
1696
+ readonly sum: {
1697
+ readonly type: "integer";
1698
+ };
1699
+ readonly count: {
1700
+ readonly type: "integer";
1701
+ readonly minimum: 0;
1702
+ };
1703
+ };
1704
+ };
1705
+ };
1706
+ readonly text: {
1707
+ readonly type: "array";
1708
+ readonly items: {
1709
+ readonly type: "string";
1710
+ readonly maxLength: 4096;
1711
+ };
1712
+ };
1713
+ readonly withheld: {
1714
+ readonly type: "boolean";
1715
+ };
1716
+ };
1717
+ };
1718
+ readonly Cast: {
1719
+ readonly title: "Cast";
1720
+ readonly 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.";
1721
+ readonly type: "object";
1722
+ readonly additionalProperties: false;
1723
+ readonly required: readonly ["ballot", "tag", "attestation"];
1724
+ readonly properties: {
1725
+ readonly ballot: {
1726
+ readonly $ref: "#/$defs/Ballot";
1727
+ };
1728
+ readonly tag: {
1729
+ readonly $ref: "#/$defs/Multibase";
1730
+ };
1731
+ readonly attestation: {
1732
+ readonly $ref: "#/$defs/Multibase";
1733
+ };
1734
+ };
1735
+ };
1736
+ };
1737
+ };
1738
+ /**
1739
+ * SPEC.md §7.2 policy for the request variant, from this specification's
1740
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
1741
+ * per-specification and cannot be derived from the document alone, and
1742
+ * item 2 needs the schema this carries.
1743
+ */
1744
+ export declare const SPEC: {
1745
+ readonly typeUri: "https://trusttasks.org/spec/voting/board/read/0.1";
1746
+ readonly isBearer: false;
1747
+ readonly isProofRequired: false;
1748
+ readonly isRecipientRequired: true;
1749
+ readonly isIssuedAtRequired: false;
1750
+ readonly payloadSchema: {
1751
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
1752
+ readonly $id: "https://trusttasks.org/spec/voting/board/read/0.1";
1753
+ readonly title: "Voting — Board Read — payload";
1754
+ readonly description: "Reads a range of an election board's entries, against the current head or against an earlier tree size.";
1755
+ readonly type: "object";
1756
+ readonly additionalProperties: false;
1757
+ readonly required: readonly ["community", "electionId", "from", "limit"];
1758
+ readonly properties: {
1759
+ readonly community: {
1760
+ readonly type: "string";
1761
+ readonly minLength: 1;
1762
+ readonly maxLength: 2048;
1763
+ readonly description: "The community's DID.";
1764
+ };
1765
+ readonly electionId: {
1766
+ readonly $ref: "#/$defs/ElectionId";
1767
+ };
1768
+ readonly from: {
1769
+ readonly type: "integer";
1770
+ readonly minimum: 0;
1771
+ readonly description: "The index of the first entry to return.";
1772
+ };
1773
+ readonly limit: {
1774
+ readonly type: "integer";
1775
+ readonly minimum: 1;
1776
+ readonly maximum: 1000;
1777
+ readonly description: "The most entries to return.";
1778
+ };
1779
+ readonly treeSize: {
1780
+ readonly type: "integer";
1781
+ readonly minimum: 0;
1782
+ readonly description: "Read against the board as it stood at this size — the size of a head the reader holds. At most the current size. Absent: the current size.";
1783
+ };
1784
+ readonly ext: {
1785
+ readonly $ref: "#/$defs/Ext";
1786
+ };
1787
+ };
1788
+ readonly $defs: {
1789
+ readonly Response: {
1790
+ readonly $anchor: "response";
1791
+ readonly title: "Voting — Board Read — response payload";
1792
+ readonly type: "object";
1793
+ readonly additionalProperties: false;
1794
+ readonly required: readonly ["treeSize", "entries"];
1795
+ readonly properties: {
1796
+ readonly treeSize: {
1797
+ readonly type: "integer";
1798
+ readonly minimum: 0;
1799
+ readonly description: "The tree size the page was read against. No entry at or beyond it is returned.";
1800
+ };
1801
+ readonly entries: {
1802
+ readonly type: "array";
1803
+ readonly maxItems: 1000;
1804
+ readonly items: {
1805
+ readonly type: "object";
1806
+ readonly additionalProperties: false;
1807
+ readonly required: readonly ["index", "entry"];
1808
+ readonly properties: {
1809
+ readonly index: {
1810
+ readonly type: "integer";
1811
+ readonly minimum: 0;
1812
+ };
1813
+ readonly entry: {
1814
+ readonly $ref: "#/$defs/BoardEntry";
1815
+ };
1816
+ };
1817
+ };
1818
+ readonly description: "Consecutive entries from `from`, in board order.";
1819
+ };
1820
+ readonly next: {
1821
+ readonly type: "integer";
1822
+ readonly minimum: 1;
1823
+ readonly description: "The `from` of the next page. Absent when the page reaches `treeSize`.";
1824
+ };
1825
+ readonly ext: {
1826
+ readonly $ref: "#/$defs/Ext";
1827
+ };
1828
+ };
1829
+ };
1830
+ readonly Ext: {
1831
+ readonly title: "Ext";
1832
+ readonly 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.";
1833
+ readonly type: "object";
1834
+ readonly minProperties: 1;
1835
+ readonly additionalProperties: true;
1836
+ readonly propertyNames: {
1837
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
1838
+ };
1839
+ };
1840
+ readonly BoardEntry: {
1841
+ readonly title: "BoardEntry";
1842
+ readonly 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.";
1843
+ readonly oneOf: readonly [{
1844
+ readonly title: "CastEntry";
1845
+ readonly type: "object";
1846
+ readonly additionalProperties: false;
1847
+ readonly required: readonly ["kind", "cast"];
1848
+ readonly properties: {
1849
+ readonly kind: {
1850
+ readonly const: "cast";
1851
+ };
1852
+ readonly cast: {
1853
+ readonly $ref: "#/$defs/Cast";
1854
+ };
1855
+ };
1856
+ }, {
1857
+ readonly title: "ReplacementEntry";
1858
+ readonly description: "The cast at `replaces` is no longer counted: a later cast under the same tag is.";
1859
+ readonly type: "object";
1860
+ readonly additionalProperties: false;
1861
+ readonly required: readonly ["kind", "tag", "replaces", "by"];
1862
+ readonly properties: {
1863
+ readonly kind: {
1864
+ readonly const: "replaced";
1865
+ };
1866
+ readonly tag: {
1867
+ readonly $ref: "#/$defs/Multibase";
1868
+ };
1869
+ readonly replaces: {
1870
+ readonly type: "integer";
1871
+ readonly minimum: 0;
1872
+ };
1873
+ readonly by: {
1874
+ readonly type: "integer";
1875
+ readonly minimum: 0;
1876
+ };
1877
+ };
1878
+ }, {
1879
+ readonly title: "LifecycleEntry";
1880
+ readonly type: "object";
1881
+ readonly additionalProperties: false;
1882
+ readonly required: readonly ["kind", "at"];
1883
+ readonly properties: {
1884
+ readonly kind: {
1885
+ readonly enum: readonly ["opened", "closed", "closedEarly", "cancelled"];
1886
+ };
1887
+ readonly at: {
1888
+ readonly type: "string";
1889
+ readonly format: "date-time";
1890
+ };
1891
+ };
1892
+ }, {
1893
+ readonly title: "ResultEntry";
1894
+ readonly type: "object";
1895
+ readonly additionalProperties: false;
1896
+ readonly required: readonly ["kind", "result"];
1897
+ readonly properties: {
1898
+ readonly kind: {
1899
+ readonly const: "result";
1900
+ };
1901
+ readonly result: {
1902
+ readonly $ref: "#/$defs/ElectionResult";
1903
+ };
1904
+ };
1905
+ }, {
1906
+ readonly title: "EncryptedCastEntry";
1907
+ readonly type: "object";
1908
+ readonly additionalProperties: false;
1909
+ readonly required: readonly ["kind", "cast"];
1910
+ readonly properties: {
1911
+ readonly kind: {
1912
+ readonly const: "encryptedCast";
1913
+ };
1914
+ readonly cast: {
1915
+ readonly $ref: "#/$defs/EncryptedCast";
1916
+ };
1917
+ };
1918
+ }, {
1919
+ readonly title: "TransportKeyEntry";
1920
+ readonly type: "object";
1921
+ readonly additionalProperties: false;
1922
+ readonly required: readonly ["kind", "transportKey"];
1923
+ readonly properties: {
1924
+ readonly kind: {
1925
+ readonly const: "transportKey";
1926
+ };
1927
+ readonly transportKey: {
1928
+ readonly $ref: "#/$defs/TransportKey";
1929
+ };
1930
+ };
1931
+ }, {
1932
+ readonly title: "DealingEntry";
1933
+ readonly type: "object";
1934
+ readonly additionalProperties: false;
1935
+ readonly required: readonly ["kind", "dealing"];
1936
+ readonly properties: {
1937
+ readonly kind: {
1938
+ readonly const: "dealing";
1939
+ };
1940
+ readonly dealing: {
1941
+ readonly $ref: "#/$defs/Dealing";
1942
+ };
1943
+ };
1944
+ }, {
1945
+ readonly title: "ConfirmationEntry";
1946
+ readonly type: "object";
1947
+ readonly additionalProperties: false;
1948
+ readonly required: readonly ["kind", "trustee", "complaints"];
1949
+ readonly properties: {
1950
+ readonly kind: {
1951
+ readonly const: "confirmation";
1952
+ };
1953
+ readonly trustee: {
1954
+ readonly $ref: "#/$defs/TrusteeIndex";
1955
+ };
1956
+ readonly complaints: {
1957
+ readonly type: "array";
1958
+ readonly maxItems: 64;
1959
+ readonly items: {
1960
+ readonly $ref: "#/$defs/TrusteeIndex";
1961
+ };
1962
+ };
1963
+ };
1964
+ }, {
1965
+ readonly title: "JustificationEntry";
1966
+ readonly type: "object";
1967
+ readonly additionalProperties: false;
1968
+ readonly required: readonly ["kind", "dealer", "recipient", "share"];
1969
+ readonly properties: {
1970
+ readonly kind: {
1971
+ readonly const: "justification";
1972
+ };
1973
+ readonly dealer: {
1974
+ readonly $ref: "#/$defs/TrusteeIndex";
1975
+ };
1976
+ readonly recipient: {
1977
+ readonly $ref: "#/$defs/TrusteeIndex";
1978
+ };
1979
+ readonly share: {
1980
+ readonly $ref: "#/$defs/GroupScalar";
1981
+ };
1982
+ };
1983
+ }, {
1984
+ readonly title: "ElectionKeyEntry";
1985
+ readonly type: "object";
1986
+ readonly additionalProperties: false;
1987
+ readonly required: readonly ["kind", "electionKey"];
1988
+ readonly properties: {
1989
+ readonly kind: {
1990
+ readonly const: "electionKey";
1991
+ };
1992
+ readonly electionKey: {
1993
+ readonly $ref: "#/$defs/ElectionKey";
1994
+ };
1995
+ };
1996
+ }, {
1997
+ readonly title: "PartialDecryptionsEntry";
1998
+ readonly type: "object";
1999
+ readonly additionalProperties: false;
2000
+ readonly required: readonly ["kind", "trustee", "partials"];
2001
+ readonly properties: {
2002
+ readonly kind: {
2003
+ readonly const: "partials";
2004
+ };
2005
+ readonly trustee: {
2006
+ readonly $ref: "#/$defs/TrusteeIndex";
2007
+ };
2008
+ readonly partials: {
2009
+ readonly type: "array";
2010
+ readonly minItems: 1;
2011
+ readonly maxItems: 100000;
2012
+ readonly items: {
2013
+ readonly $ref: "#/$defs/PartialDecryption";
2014
+ };
2015
+ };
2016
+ };
2017
+ }, {
2018
+ readonly title: "UnsealedEntry";
2019
+ readonly type: "object";
2020
+ readonly additionalProperties: false;
2021
+ readonly required: readonly ["kind", "leafIndex", "ballot"];
2022
+ readonly properties: {
2023
+ readonly kind: {
2024
+ readonly const: "unsealed";
2025
+ };
2026
+ readonly leafIndex: {
2027
+ readonly type: "integer";
2028
+ readonly minimum: 0;
2029
+ };
2030
+ readonly ballot: {
2031
+ readonly $ref: "#/$defs/Ballot";
2032
+ };
2033
+ };
2034
+ }, {
2035
+ readonly title: "SpoiledEntry";
2036
+ readonly description: "A sealed cast that did not open, or opened to no valid ballot: not counted (CONVENTIONS §9.7).";
2037
+ readonly type: "object";
2038
+ readonly additionalProperties: false;
2039
+ readonly required: readonly ["kind", "leafIndex"];
2040
+ readonly properties: {
2041
+ readonly kind: {
2042
+ readonly const: "spoiled";
2043
+ };
2044
+ readonly leafIndex: {
2045
+ readonly type: "integer";
2046
+ readonly minimum: 0;
2047
+ };
2048
+ };
2049
+ }];
2050
+ };
2051
+ readonly Ballot: {
2052
+ readonly title: "Ballot";
2053
+ readonly 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.";
2054
+ readonly type: "object";
2055
+ readonly additionalProperties: false;
2056
+ readonly required: readonly ["electionId", "manifestDigest", "answers"];
2057
+ readonly properties: {
2058
+ readonly electionId: {
2059
+ readonly $ref: "#/$defs/ElectionId";
2060
+ };
2061
+ readonly manifestDigest: {
2062
+ readonly $ref: "#/$defs/DigestMultibase";
2063
+ };
2064
+ readonly answers: {
2065
+ readonly type: "array";
2066
+ readonly minItems: 1;
2067
+ readonly maxItems: 128;
2068
+ readonly items: {
2069
+ readonly $ref: "#/$defs/Answer";
2070
+ };
2071
+ };
2072
+ };
2073
+ };
2074
+ readonly Answer: {
2075
+ readonly title: "Answer";
2076
+ readonly 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.";
2077
+ readonly type: "object";
2078
+ readonly additionalProperties: false;
2079
+ readonly required: readonly ["question"];
2080
+ readonly minProperties: 2;
2081
+ readonly maxProperties: 2;
2082
+ readonly properties: {
2083
+ readonly question: {
2084
+ readonly $ref: "#/$defs/Key";
2085
+ };
2086
+ readonly choice: {
2087
+ readonly type: "array";
2088
+ readonly items: {
2089
+ readonly $ref: "#/$defs/Key";
2090
+ };
2091
+ readonly uniqueItems: true;
2092
+ };
2093
+ readonly ranking: {
2094
+ readonly type: "array";
2095
+ readonly items: {
2096
+ readonly $ref: "#/$defs/Key";
2097
+ };
2098
+ readonly uniqueItems: true;
2099
+ };
2100
+ readonly scores: {
2101
+ readonly type: "object";
2102
+ readonly propertyNames: {
2103
+ readonly $ref: "#/$defs/Key";
2104
+ };
2105
+ readonly additionalProperties: {
2106
+ readonly type: "integer";
2107
+ };
2108
+ };
2109
+ readonly text: {
2110
+ readonly type: "string";
2111
+ readonly maxLength: 4096;
2112
+ };
2113
+ readonly abstain: {
2114
+ readonly const: true;
2115
+ };
2116
+ };
2117
+ };
2118
+ readonly Key: {
2119
+ readonly title: "Key";
2120
+ readonly description: "A question or option key, unique within its manifest or question.";
2121
+ readonly type: "string";
2122
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
2123
+ };
2124
+ readonly ElectionId: {
2125
+ readonly title: "ElectionId";
2126
+ readonly 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.";
2127
+ readonly type: "string";
2128
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
2129
+ };
2130
+ readonly DigestMultibase: {
2131
+ readonly title: "DigestMultibase";
2132
+ readonly 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`.";
2133
+ readonly type: "string";
2134
+ readonly minLength: 16;
2135
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
2136
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
2137
+ };
2138
+ readonly PartialDecryption: {
2139
+ readonly title: "PartialDecryption";
2140
+ readonly description: "Trustee `trustee`'s share of one decryption, `d = x_j·a`, with a Chaum–Pedersen proof against its verification key (CONVENTIONS §9.7).";
2141
+ readonly type: "object";
2142
+ readonly additionalProperties: false;
2143
+ readonly required: readonly ["target", "d", "proof"];
2144
+ readonly properties: {
2145
+ readonly target: {
2146
+ readonly $ref: "#/$defs/DecryptionTarget";
2147
+ };
2148
+ readonly d: {
2149
+ readonly $ref: "#/$defs/GroupElement";
2150
+ };
2151
+ readonly proof: {
2152
+ readonly $ref: "#/$defs/SigmaProof";
2153
+ };
2154
+ };
2155
+ };
2156
+ readonly SigmaProof: {
2157
+ readonly title: "SigmaProof";
2158
+ readonly description: "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).";
2159
+ readonly type: "object";
2160
+ readonly additionalProperties: false;
2161
+ readonly required: readonly ["c", "z"];
2162
+ readonly properties: {
2163
+ readonly c: {
2164
+ readonly $ref: "#/$defs/GroupScalar";
2165
+ };
2166
+ readonly z: {
2167
+ readonly $ref: "#/$defs/GroupScalar";
2168
+ };
2169
+ };
2170
+ };
2171
+ readonly GroupScalar: {
2172
+ readonly title: "GroupScalar";
2173
+ readonly description: "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).";
2174
+ readonly type: "string";
2175
+ readonly minLength: 2;
2176
+ readonly maxLength: 64;
2177
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
2178
+ };
2179
+ readonly GroupElement: {
2180
+ readonly title: "GroupElement";
2181
+ readonly description: "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).";
2182
+ readonly type: "string";
2183
+ readonly minLength: 2;
2184
+ readonly maxLength: 64;
2185
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
2186
+ };
2187
+ readonly DecryptionTarget: {
2188
+ readonly title: "DecryptionTarget";
2189
+ readonly description: "What a partial decryption decrypts: the sealed cast at a board leaf, or the total of one option of one question.";
2190
+ readonly type: "object";
2191
+ readonly additionalProperties: false;
2192
+ readonly required: readonly ["ciphertext"];
2193
+ readonly properties: {
2194
+ readonly leafIndex: {
2195
+ readonly type: "integer";
2196
+ readonly minimum: 0;
2197
+ readonly description: "A sealed cast's board leaf.";
2198
+ };
2199
+ readonly question: {
2200
+ readonly $ref: "#/$defs/Key";
2201
+ };
2202
+ readonly option: {
2203
+ readonly $ref: "#/$defs/Key";
2204
+ };
2205
+ readonly ciphertext: {
2206
+ readonly $ref: "#/$defs/ElGamalCiphertext";
2207
+ };
2208
+ };
2209
+ readonly oneOf: readonly [{
2210
+ readonly required: readonly ["leafIndex"];
2211
+ }, {
2212
+ readonly required: readonly ["question", "option"];
2213
+ }];
2214
+ };
2215
+ readonly ElGamalCiphertext: {
2216
+ readonly title: "ElGamalCiphertext";
2217
+ readonly description: "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).";
2218
+ readonly type: "object";
2219
+ readonly additionalProperties: false;
2220
+ readonly required: readonly ["a", "b"];
2221
+ readonly properties: {
2222
+ readonly a: {
2223
+ readonly $ref: "#/$defs/GroupElement";
2224
+ };
2225
+ readonly b: {
2226
+ readonly $ref: "#/$defs/GroupElement";
2227
+ };
2228
+ };
2229
+ };
2230
+ readonly TrusteeIndex: {
2231
+ readonly title: "TrusteeIndex";
2232
+ readonly description: "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.";
2233
+ readonly type: "integer";
2234
+ readonly minimum: 1;
2235
+ readonly maximum: 64;
2236
+ };
2237
+ readonly ElectionKey: {
2238
+ readonly title: "ElectionKey";
2239
+ readonly 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.";
2240
+ readonly type: "object";
2241
+ readonly additionalProperties: false;
2242
+ readonly required: readonly ["key", "qualified", "verification"];
2243
+ readonly properties: {
2244
+ readonly key: {
2245
+ readonly $ref: "#/$defs/GroupElement";
2246
+ };
2247
+ readonly qualified: {
2248
+ readonly type: "array";
2249
+ readonly minItems: 1;
2250
+ readonly maxItems: 64;
2251
+ readonly items: {
2252
+ readonly $ref: "#/$defs/TrusteeIndex";
2253
+ };
2254
+ readonly description: "The dealers whose dealings the key is formed from.";
2255
+ };
2256
+ readonly verification: {
2257
+ readonly type: "array";
2258
+ readonly minItems: 2;
2259
+ readonly maxItems: 64;
2260
+ readonly items: {
2261
+ readonly type: "object";
2262
+ readonly additionalProperties: false;
2263
+ readonly required: readonly ["trustee", "key"];
2264
+ readonly properties: {
2265
+ readonly trustee: {
2266
+ readonly $ref: "#/$defs/TrusteeIndex";
2267
+ };
2268
+ readonly key: {
2269
+ readonly $ref: "#/$defs/GroupElement";
2270
+ };
2271
+ };
2272
+ };
2273
+ };
2274
+ };
2275
+ };
2276
+ readonly Dealing: {
2277
+ readonly title: "Dealing";
2278
+ readonly 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).";
2279
+ readonly type: "object";
2280
+ readonly additionalProperties: false;
2281
+ readonly required: readonly ["dealer", "commitments", "pok", "shares"];
2282
+ readonly properties: {
2283
+ readonly dealer: {
2284
+ readonly $ref: "#/$defs/TrusteeIndex";
2285
+ };
2286
+ readonly commitments: {
2287
+ readonly type: "array";
2288
+ readonly minItems: 2;
2289
+ readonly maxItems: 64;
2290
+ readonly items: {
2291
+ readonly $ref: "#/$defs/GroupElement";
2292
+ };
2293
+ };
2294
+ readonly pok: {
2295
+ readonly $ref: "#/$defs/SigmaProof";
2296
+ };
2297
+ readonly shares: {
2298
+ readonly type: "array";
2299
+ readonly minItems: 2;
2300
+ readonly maxItems: 64;
2301
+ readonly items: {
2302
+ readonly $ref: "#/$defs/SealedShare";
2303
+ };
2304
+ };
2305
+ };
2306
+ };
2307
+ readonly SealedShare: {
2308
+ readonly title: "SealedShare";
2309
+ readonly type: "object";
2310
+ readonly additionalProperties: false;
2311
+ readonly required: readonly ["recipient", "share"];
2312
+ readonly properties: {
2313
+ readonly recipient: {
2314
+ readonly $ref: "#/$defs/TrusteeIndex";
2315
+ };
2316
+ readonly share: {
2317
+ readonly $ref: "#/$defs/SealedPayload";
2318
+ };
2319
+ };
2320
+ };
2321
+ readonly SealedPayload: {
2322
+ readonly title: "SealedPayload";
2323
+ readonly 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).";
2324
+ readonly type: "object";
2325
+ readonly additionalProperties: false;
2326
+ readonly required: readonly ["kem", "body"];
2327
+ readonly properties: {
2328
+ readonly kem: {
2329
+ readonly $ref: "#/$defs/ElGamalCiphertext";
2330
+ };
2331
+ readonly body: {
2332
+ readonly type: "string";
2333
+ readonly minLength: 2;
2334
+ readonly maxLength: 131072;
2335
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
2336
+ };
2337
+ };
2338
+ };
2339
+ readonly TransportKey: {
2340
+ readonly title: "TransportKey";
2341
+ readonly description: "The group element a trustee's shares are sealed to, with a Schnorr proof of knowledge of its discrete log (CONVENTIONS §9.6).";
2342
+ readonly type: "object";
2343
+ readonly additionalProperties: false;
2344
+ readonly required: readonly ["trustee", "key", "pok"];
2345
+ readonly properties: {
2346
+ readonly trustee: {
2347
+ readonly $ref: "#/$defs/TrusteeIndex";
2348
+ };
2349
+ readonly key: {
2350
+ readonly $ref: "#/$defs/GroupElement";
2351
+ };
2352
+ readonly pok: {
2353
+ readonly $ref: "#/$defs/SigmaProof";
2354
+ };
2355
+ };
2356
+ };
2357
+ readonly EncryptedCast: {
2358
+ readonly title: "EncryptedCast";
2359
+ readonly 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).";
2360
+ readonly type: "object";
2361
+ readonly additionalProperties: false;
2362
+ readonly required: readonly ["tag", "attestation"];
2363
+ readonly properties: {
2364
+ readonly sealed: {
2365
+ readonly $ref: "#/$defs/SealedPayload";
2366
+ };
2367
+ readonly encrypted: {
2368
+ readonly $ref: "#/$defs/EncryptedBallot";
2369
+ };
2370
+ readonly tag: {
2371
+ readonly $ref: "#/$defs/Multibase";
2372
+ };
2373
+ readonly attestation: {
2374
+ readonly $ref: "#/$defs/Multibase";
2375
+ };
2376
+ };
2377
+ readonly oneOf: readonly [{
2378
+ readonly required: readonly ["sealed"];
2379
+ }, {
2380
+ readonly required: readonly ["encrypted"];
2381
+ }];
2382
+ };
2383
+ readonly Multibase: {
2384
+ readonly title: "Multibase";
2385
+ readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
2386
+ readonly type: "string";
2387
+ readonly maxLength: 16384;
2388
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
2389
+ };
2390
+ readonly EncryptedBallot: {
2391
+ readonly title: "EncryptedBallot";
2392
+ readonly description: "A tallied-encrypted ballot: one EncryptedQuestion per manifest question, in the manifest's order. Never decrypted (VTI-VOT-064).";
2393
+ readonly type: "object";
2394
+ readonly additionalProperties: false;
2395
+ readonly required: readonly ["electionId", "manifestDigest", "questions"];
2396
+ readonly properties: {
2397
+ readonly electionId: {
2398
+ readonly $ref: "#/$defs/ElectionId";
2399
+ };
2400
+ readonly manifestDigest: {
2401
+ readonly $ref: "#/$defs/DigestMultibase";
2402
+ };
2403
+ readonly questions: {
2404
+ readonly type: "array";
2405
+ readonly minItems: 1;
2406
+ readonly maxItems: 64;
2407
+ readonly items: {
2408
+ readonly $ref: "#/$defs/EncryptedQuestion";
2409
+ };
2410
+ };
2411
+ };
2412
+ };
2413
+ readonly EncryptedQuestion: {
2414
+ readonly title: "EncryptedQuestion";
2415
+ readonly 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).";
2416
+ readonly type: "object";
2417
+ readonly additionalProperties: false;
2418
+ readonly required: readonly ["question", "options", "sumProof"];
2419
+ readonly properties: {
2420
+ readonly question: {
2421
+ readonly $ref: "#/$defs/Key";
2422
+ };
2423
+ readonly options: {
2424
+ readonly type: "array";
2425
+ readonly minItems: 1;
2426
+ readonly maxItems: 64;
2427
+ readonly items: {
2428
+ readonly $ref: "#/$defs/EncryptedOption";
2429
+ };
2430
+ };
2431
+ readonly sumProof: {
2432
+ readonly $ref: "#/$defs/DisjunctiveProof";
2433
+ };
2434
+ };
2435
+ };
2436
+ readonly DisjunctiveProof: {
2437
+ readonly title: "DisjunctiveProof";
2438
+ readonly 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).";
2439
+ readonly type: "array";
2440
+ readonly minItems: 1;
2441
+ readonly maxItems: 65;
2442
+ readonly items: {
2443
+ readonly $ref: "#/$defs/SigmaProof";
2444
+ };
2445
+ };
2446
+ readonly EncryptedOption: {
2447
+ readonly title: "EncryptedOption";
2448
+ readonly type: "object";
2449
+ readonly additionalProperties: false;
2450
+ readonly required: readonly ["ciphertext", "proof"];
2451
+ readonly properties: {
2452
+ readonly ciphertext: {
2453
+ readonly $ref: "#/$defs/ElGamalCiphertext";
2454
+ };
2455
+ readonly proof: {
2456
+ readonly $ref: "#/$defs/DisjunctiveProof";
2457
+ };
2458
+ };
2459
+ };
2460
+ readonly ElectionResult: {
2461
+ readonly title: "ElectionResult";
2462
+ readonly description: "An election's result, computable by anyone who can read its board from the board and the registration alone (VTI-VOT-070).";
2463
+ readonly type: "object";
2464
+ readonly additionalProperties: false;
2465
+ readonly required: readonly ["electionId", "manifestDigest", "ballotsCounted", "questions", "head"];
2466
+ readonly properties: {
2467
+ readonly electionId: {
2468
+ readonly $ref: "#/$defs/ElectionId";
2469
+ };
2470
+ readonly manifestDigest: {
2471
+ readonly $ref: "#/$defs/DigestMultibase";
2472
+ };
2473
+ readonly ballotsCounted: {
2474
+ readonly type: "integer";
2475
+ readonly minimum: 0;
2476
+ };
2477
+ readonly questions: {
2478
+ readonly type: "array";
2479
+ readonly items: {
2480
+ readonly $ref: "#/$defs/QuestionResult";
2481
+ };
2482
+ };
2483
+ readonly head: {
2484
+ readonly $ref: "#/$defs/BoardHead";
2485
+ readonly description: "The head of the board as it stood at close: the result counts exactly its entries.";
2486
+ };
2487
+ };
2488
+ };
2489
+ readonly BoardHead: {
2490
+ readonly title: "BoardHead";
2491
+ readonly 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.";
2492
+ readonly type: "object";
2493
+ readonly additionalProperties: false;
2494
+ readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
2495
+ readonly properties: {
2496
+ readonly electionId: {
2497
+ readonly $ref: "#/$defs/ElectionId";
2498
+ };
2499
+ readonly treeSize: {
2500
+ readonly type: "integer";
2501
+ readonly minimum: 0;
2502
+ };
2503
+ readonly rootHash: {
2504
+ readonly $ref: "#/$defs/DigestMultibase";
2505
+ readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
2506
+ };
2507
+ readonly issuedAt: {
2508
+ readonly type: "string";
2509
+ readonly format: "date-time";
2510
+ };
2511
+ };
2512
+ };
2513
+ readonly QuestionResult: {
2514
+ readonly title: "QuestionResult";
2515
+ readonly 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.";
2516
+ readonly type: "object";
2517
+ readonly additionalProperties: false;
2518
+ readonly required: readonly ["question", "abstained"];
2519
+ readonly properties: {
2520
+ readonly question: {
789
2521
  readonly $ref: "#/$defs/Key";
790
2522
  };
791
- readonly uniqueItems: true;
792
- };
793
- readonly ranking: {
794
- readonly type: "array";
795
- readonly items: {
796
- readonly $ref: "#/$defs/Key";
2523
+ readonly abstained: {
2524
+ readonly type: "integer";
2525
+ readonly minimum: 0;
797
2526
  };
798
- readonly uniqueItems: true;
799
- };
800
- readonly scores: {
801
- readonly type: "object";
802
- readonly propertyNames: {
803
- readonly $ref: "#/$defs/Key";
2527
+ readonly choice: {
2528
+ readonly type: "object";
2529
+ readonly propertyNames: {
2530
+ readonly $ref: "#/$defs/Key";
2531
+ };
2532
+ readonly additionalProperties: {
2533
+ readonly type: "integer";
2534
+ readonly minimum: 0;
2535
+ };
804
2536
  };
805
- readonly additionalProperties: {
806
- readonly type: "integer";
2537
+ readonly ranking: {
2538
+ readonly type: "object";
2539
+ readonly propertyNames: {
2540
+ readonly $ref: "#/$defs/Key";
2541
+ };
2542
+ readonly additionalProperties: {
2543
+ readonly type: "array";
2544
+ readonly items: {
2545
+ readonly type: "integer";
2546
+ readonly minimum: 0;
2547
+ };
2548
+ };
2549
+ };
2550
+ readonly score: {
2551
+ readonly type: "object";
2552
+ readonly propertyNames: {
2553
+ readonly $ref: "#/$defs/Key";
2554
+ };
2555
+ readonly additionalProperties: {
2556
+ readonly type: "object";
2557
+ readonly additionalProperties: false;
2558
+ readonly required: readonly ["sum", "count"];
2559
+ readonly properties: {
2560
+ readonly sum: {
2561
+ readonly type: "integer";
2562
+ };
2563
+ readonly count: {
2564
+ readonly type: "integer";
2565
+ readonly minimum: 0;
2566
+ };
2567
+ };
2568
+ };
2569
+ };
2570
+ readonly text: {
2571
+ readonly type: "array";
2572
+ readonly items: {
2573
+ readonly type: "string";
2574
+ readonly maxLength: 4096;
2575
+ };
2576
+ };
2577
+ readonly withheld: {
2578
+ readonly type: "boolean";
807
2579
  };
808
2580
  };
809
- readonly text: {
810
- readonly type: "string";
811
- readonly maxLength: 4096;
812
- };
813
- readonly abstain: {
814
- readonly const: true;
2581
+ };
2582
+ readonly Cast: {
2583
+ readonly title: "Cast";
2584
+ readonly 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.";
2585
+ readonly type: "object";
2586
+ readonly additionalProperties: false;
2587
+ readonly required: readonly ["ballot", "tag", "attestation"];
2588
+ readonly properties: {
2589
+ readonly ballot: {
2590
+ readonly $ref: "#/$defs/Ballot";
2591
+ };
2592
+ readonly tag: {
2593
+ readonly $ref: "#/$defs/Multibase";
2594
+ };
2595
+ readonly attestation: {
2596
+ readonly $ref: "#/$defs/Multibase";
2597
+ };
815
2598
  };
816
2599
  };
817
2600
  };
818
2601
  };
819
2602
  };
820
2603
  /**
821
- * SPEC.md §7.2 policy for the request variant, from this specification's
822
- * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
823
- * per-specification and cannot be derived from the document alone, and
824
- * item 2 needs the schema this carries.
2604
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
2605
+ * tracks the *issuer* party's requirement because a response swaps the
2606
+ * parties (§7.3 item 5).
825
2607
  */
826
- export declare const SPEC: {
827
- readonly typeUri: "https://trusttasks.org/spec/voting/board/read/0.1";
2608
+ export declare const RESPONSE_SPEC: {
2609
+ readonly typeUri: "https://trusttasks.org/spec/voting/board/read/0.1#response";
828
2610
  readonly isBearer: false;
829
2611
  readonly isProofRequired: false;
830
- readonly isRecipientRequired: true;
2612
+ readonly isRecipientRequired: false;
831
2613
  readonly isIssuedAtRequired: false;
832
2614
  readonly payloadSchema: {
833
2615
  readonly $schema: "https://json-schema.org/draft/2020-12/schema";
834
- readonly $id: "https://trusttasks.org/spec/voting/board/read/0.1";
835
- readonly title: "Voting — Board Read — payload";
836
- readonly description: "Reads a range of an election board's entries, against the current head or against an earlier tree size.";
837
- readonly type: "object";
838
- readonly additionalProperties: false;
839
- readonly required: readonly ["community", "electionId", "from", "limit"];
840
- readonly properties: {
841
- readonly community: {
842
- readonly type: "string";
843
- readonly minLength: 1;
844
- readonly maxLength: 2048;
845
- readonly description: "The community's DID.";
846
- };
847
- readonly electionId: {
848
- readonly $ref: "#/$defs/ElectionId";
849
- };
850
- readonly from: {
851
- readonly type: "integer";
852
- readonly minimum: 0;
853
- readonly description: "The index of the first entry to return.";
854
- };
855
- readonly limit: {
856
- readonly type: "integer";
857
- readonly minimum: 1;
858
- readonly maximum: 1000;
859
- readonly description: "The most entries to return.";
860
- };
861
- readonly treeSize: {
862
- readonly type: "integer";
863
- readonly minimum: 0;
864
- readonly description: "Read against the board as it stood at this size — the size of a head the reader holds. At most the current size. Absent: the current size.";
865
- };
866
- readonly ext: {
867
- readonly $ref: "#/$defs/Ext";
868
- };
869
- };
2616
+ readonly $ref: "#/$defs/Response";
870
2617
  readonly $defs: {
871
2618
  readonly Response: {
872
2619
  readonly $anchor: "response";
@@ -978,20 +2725,164 @@ export declare const SPEC: {
978
2725
  readonly required: readonly ["kind", "result"];
979
2726
  readonly properties: {
980
2727
  readonly kind: {
981
- readonly const: "result";
2728
+ readonly const: "result";
2729
+ };
2730
+ readonly result: {
2731
+ readonly $ref: "#/$defs/ElectionResult";
2732
+ };
2733
+ };
2734
+ }, {
2735
+ readonly title: "EncryptedCastEntry";
2736
+ readonly type: "object";
2737
+ readonly additionalProperties: false;
2738
+ readonly required: readonly ["kind", "cast"];
2739
+ readonly properties: {
2740
+ readonly kind: {
2741
+ readonly const: "encryptedCast";
2742
+ };
2743
+ readonly cast: {
2744
+ readonly $ref: "#/$defs/EncryptedCast";
2745
+ };
2746
+ };
2747
+ }, {
2748
+ readonly title: "TransportKeyEntry";
2749
+ readonly type: "object";
2750
+ readonly additionalProperties: false;
2751
+ readonly required: readonly ["kind", "transportKey"];
2752
+ readonly properties: {
2753
+ readonly kind: {
2754
+ readonly const: "transportKey";
2755
+ };
2756
+ readonly transportKey: {
2757
+ readonly $ref: "#/$defs/TransportKey";
2758
+ };
2759
+ };
2760
+ }, {
2761
+ readonly title: "DealingEntry";
2762
+ readonly type: "object";
2763
+ readonly additionalProperties: false;
2764
+ readonly required: readonly ["kind", "dealing"];
2765
+ readonly properties: {
2766
+ readonly kind: {
2767
+ readonly const: "dealing";
2768
+ };
2769
+ readonly dealing: {
2770
+ readonly $ref: "#/$defs/Dealing";
2771
+ };
2772
+ };
2773
+ }, {
2774
+ readonly title: "ConfirmationEntry";
2775
+ readonly type: "object";
2776
+ readonly additionalProperties: false;
2777
+ readonly required: readonly ["kind", "trustee", "complaints"];
2778
+ readonly properties: {
2779
+ readonly kind: {
2780
+ readonly const: "confirmation";
2781
+ };
2782
+ readonly trustee: {
2783
+ readonly $ref: "#/$defs/TrusteeIndex";
2784
+ };
2785
+ readonly complaints: {
2786
+ readonly type: "array";
2787
+ readonly maxItems: 64;
2788
+ readonly items: {
2789
+ readonly $ref: "#/$defs/TrusteeIndex";
2790
+ };
2791
+ };
2792
+ };
2793
+ }, {
2794
+ readonly title: "JustificationEntry";
2795
+ readonly type: "object";
2796
+ readonly additionalProperties: false;
2797
+ readonly required: readonly ["kind", "dealer", "recipient", "share"];
2798
+ readonly properties: {
2799
+ readonly kind: {
2800
+ readonly const: "justification";
2801
+ };
2802
+ readonly dealer: {
2803
+ readonly $ref: "#/$defs/TrusteeIndex";
2804
+ };
2805
+ readonly recipient: {
2806
+ readonly $ref: "#/$defs/TrusteeIndex";
2807
+ };
2808
+ readonly share: {
2809
+ readonly $ref: "#/$defs/GroupScalar";
2810
+ };
2811
+ };
2812
+ }, {
2813
+ readonly title: "ElectionKeyEntry";
2814
+ readonly type: "object";
2815
+ readonly additionalProperties: false;
2816
+ readonly required: readonly ["kind", "electionKey"];
2817
+ readonly properties: {
2818
+ readonly kind: {
2819
+ readonly const: "electionKey";
2820
+ };
2821
+ readonly electionKey: {
2822
+ readonly $ref: "#/$defs/ElectionKey";
2823
+ };
2824
+ };
2825
+ }, {
2826
+ readonly title: "PartialDecryptionsEntry";
2827
+ readonly type: "object";
2828
+ readonly additionalProperties: false;
2829
+ readonly required: readonly ["kind", "trustee", "partials"];
2830
+ readonly properties: {
2831
+ readonly kind: {
2832
+ readonly const: "partials";
2833
+ };
2834
+ readonly trustee: {
2835
+ readonly $ref: "#/$defs/TrusteeIndex";
2836
+ };
2837
+ readonly partials: {
2838
+ readonly type: "array";
2839
+ readonly minItems: 1;
2840
+ readonly maxItems: 100000;
2841
+ readonly items: {
2842
+ readonly $ref: "#/$defs/PartialDecryption";
2843
+ };
2844
+ };
2845
+ };
2846
+ }, {
2847
+ readonly title: "UnsealedEntry";
2848
+ readonly type: "object";
2849
+ readonly additionalProperties: false;
2850
+ readonly required: readonly ["kind", "leafIndex", "ballot"];
2851
+ readonly properties: {
2852
+ readonly kind: {
2853
+ readonly const: "unsealed";
2854
+ };
2855
+ readonly leafIndex: {
2856
+ readonly type: "integer";
2857
+ readonly minimum: 0;
2858
+ };
2859
+ readonly ballot: {
2860
+ readonly $ref: "#/$defs/Ballot";
2861
+ };
2862
+ };
2863
+ }, {
2864
+ readonly title: "SpoiledEntry";
2865
+ readonly description: "A sealed cast that did not open, or opened to no valid ballot: not counted (CONVENTIONS §9.7).";
2866
+ readonly type: "object";
2867
+ readonly additionalProperties: false;
2868
+ readonly required: readonly ["kind", "leafIndex"];
2869
+ readonly properties: {
2870
+ readonly kind: {
2871
+ readonly const: "spoiled";
982
2872
  };
983
- readonly result: {
984
- readonly $ref: "#/$defs/ElectionResult";
2873
+ readonly leafIndex: {
2874
+ readonly type: "integer";
2875
+ readonly minimum: 0;
985
2876
  };
986
2877
  };
987
2878
  }];
988
2879
  };
989
- readonly ElectionResult: {
990
- readonly title: "ElectionResult";
991
- readonly description: "An election's result, computable by anyone who can read its board from the board and the registration alone (VTI-VOT-070).";
2880
+ readonly Ballot: {
2881
+ readonly title: "Ballot";
2882
+ readonly 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.";
992
2883
  readonly type: "object";
993
2884
  readonly additionalProperties: false;
994
- readonly required: readonly ["electionId", "manifestDigest", "ballotsCounted", "questions", "head"];
2885
+ readonly required: readonly ["electionId", "manifestDigest", "answers"];
995
2886
  readonly properties: {
996
2887
  readonly electionId: {
997
2888
  readonly $ref: "#/$defs/ElectionId";
@@ -999,46 +2890,66 @@ export declare const SPEC: {
999
2890
  readonly manifestDigest: {
1000
2891
  readonly $ref: "#/$defs/DigestMultibase";
1001
2892
  };
1002
- readonly ballotsCounted: {
1003
- readonly type: "integer";
1004
- readonly minimum: 0;
1005
- };
1006
- readonly questions: {
2893
+ readonly answers: {
1007
2894
  readonly type: "array";
2895
+ readonly minItems: 1;
2896
+ readonly maxItems: 128;
1008
2897
  readonly items: {
1009
- readonly $ref: "#/$defs/QuestionResult";
2898
+ readonly $ref: "#/$defs/Answer";
1010
2899
  };
1011
2900
  };
1012
- readonly head: {
1013
- readonly $ref: "#/$defs/BoardHead";
1014
- readonly description: "The head of the board as it stood at close: the result counts exactly its entries.";
1015
- };
1016
2901
  };
1017
2902
  };
1018
- readonly BoardHead: {
1019
- readonly title: "BoardHead";
1020
- readonly 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.";
2903
+ readonly Answer: {
2904
+ readonly title: "Answer";
2905
+ readonly 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.";
1021
2906
  readonly type: "object";
1022
2907
  readonly additionalProperties: false;
1023
- readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
2908
+ readonly required: readonly ["question"];
2909
+ readonly minProperties: 2;
2910
+ readonly maxProperties: 2;
1024
2911
  readonly properties: {
1025
- readonly electionId: {
1026
- readonly $ref: "#/$defs/ElectionId";
2912
+ readonly question: {
2913
+ readonly $ref: "#/$defs/Key";
1027
2914
  };
1028
- readonly treeSize: {
1029
- readonly type: "integer";
1030
- readonly minimum: 0;
2915
+ readonly choice: {
2916
+ readonly type: "array";
2917
+ readonly items: {
2918
+ readonly $ref: "#/$defs/Key";
2919
+ };
2920
+ readonly uniqueItems: true;
1031
2921
  };
1032
- readonly rootHash: {
1033
- readonly $ref: "#/$defs/DigestMultibase";
1034
- readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
2922
+ readonly ranking: {
2923
+ readonly type: "array";
2924
+ readonly items: {
2925
+ readonly $ref: "#/$defs/Key";
2926
+ };
2927
+ readonly uniqueItems: true;
1035
2928
  };
1036
- readonly issuedAt: {
2929
+ readonly scores: {
2930
+ readonly type: "object";
2931
+ readonly propertyNames: {
2932
+ readonly $ref: "#/$defs/Key";
2933
+ };
2934
+ readonly additionalProperties: {
2935
+ readonly type: "integer";
2936
+ };
2937
+ };
2938
+ readonly text: {
1037
2939
  readonly type: "string";
1038
- readonly format: "date-time";
2940
+ readonly maxLength: 4096;
2941
+ };
2942
+ readonly abstain: {
2943
+ readonly const: true;
1039
2944
  };
1040
2945
  };
1041
2946
  };
2947
+ readonly Key: {
2948
+ readonly title: "Key";
2949
+ readonly description: "A question or option key, unique within its manifest or question.";
2950
+ readonly type: "string";
2951
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
2952
+ };
1042
2953
  readonly ElectionId: {
1043
2954
  readonly title: "ElectionId";
1044
2955
  readonly 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.";
@@ -1053,308 +2964,327 @@ export declare const SPEC: {
1053
2964
  readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
1054
2965
  readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
1055
2966
  };
1056
- readonly QuestionResult: {
1057
- readonly title: "QuestionResult";
1058
- readonly 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.";
2967
+ readonly PartialDecryption: {
2968
+ readonly title: "PartialDecryption";
2969
+ readonly description: "Trustee `trustee`'s share of one decryption, `d = x_j·a`, with a Chaum–Pedersen proof against its verification key (CONVENTIONS §9.7).";
1059
2970
  readonly type: "object";
1060
2971
  readonly additionalProperties: false;
1061
- readonly required: readonly ["question", "abstained"];
2972
+ readonly required: readonly ["target", "d", "proof"];
1062
2973
  readonly properties: {
1063
- readonly question: {
1064
- readonly $ref: "#/$defs/Key";
2974
+ readonly target: {
2975
+ readonly $ref: "#/$defs/DecryptionTarget";
1065
2976
  };
1066
- readonly abstained: {
2977
+ readonly d: {
2978
+ readonly $ref: "#/$defs/GroupElement";
2979
+ };
2980
+ readonly proof: {
2981
+ readonly $ref: "#/$defs/SigmaProof";
2982
+ };
2983
+ };
2984
+ };
2985
+ readonly SigmaProof: {
2986
+ readonly title: "SigmaProof";
2987
+ readonly description: "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).";
2988
+ readonly type: "object";
2989
+ readonly additionalProperties: false;
2990
+ readonly required: readonly ["c", "z"];
2991
+ readonly properties: {
2992
+ readonly c: {
2993
+ readonly $ref: "#/$defs/GroupScalar";
2994
+ };
2995
+ readonly z: {
2996
+ readonly $ref: "#/$defs/GroupScalar";
2997
+ };
2998
+ };
2999
+ };
3000
+ readonly GroupScalar: {
3001
+ readonly title: "GroupScalar";
3002
+ readonly description: "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).";
3003
+ readonly type: "string";
3004
+ readonly minLength: 2;
3005
+ readonly maxLength: 64;
3006
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
3007
+ };
3008
+ readonly GroupElement: {
3009
+ readonly title: "GroupElement";
3010
+ readonly description: "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).";
3011
+ readonly type: "string";
3012
+ readonly minLength: 2;
3013
+ readonly maxLength: 64;
3014
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
3015
+ };
3016
+ readonly DecryptionTarget: {
3017
+ readonly title: "DecryptionTarget";
3018
+ readonly description: "What a partial decryption decrypts: the sealed cast at a board leaf, or the total of one option of one question.";
3019
+ readonly type: "object";
3020
+ readonly additionalProperties: false;
3021
+ readonly required: readonly ["ciphertext"];
3022
+ readonly properties: {
3023
+ readonly leafIndex: {
1067
3024
  readonly type: "integer";
1068
3025
  readonly minimum: 0;
3026
+ readonly description: "A sealed cast's board leaf.";
1069
3027
  };
1070
- readonly choice: {
1071
- readonly type: "object";
1072
- readonly propertyNames: {
1073
- readonly $ref: "#/$defs/Key";
1074
- };
1075
- readonly additionalProperties: {
1076
- readonly type: "integer";
1077
- readonly minimum: 0;
1078
- };
3028
+ readonly question: {
3029
+ readonly $ref: "#/$defs/Key";
1079
3030
  };
1080
- readonly ranking: {
1081
- readonly type: "object";
1082
- readonly propertyNames: {
1083
- readonly $ref: "#/$defs/Key";
1084
- };
1085
- readonly additionalProperties: {
1086
- readonly type: "array";
1087
- readonly items: {
1088
- readonly type: "integer";
1089
- readonly minimum: 0;
1090
- };
1091
- };
3031
+ readonly option: {
3032
+ readonly $ref: "#/$defs/Key";
1092
3033
  };
1093
- readonly score: {
1094
- readonly type: "object";
1095
- readonly propertyNames: {
1096
- readonly $ref: "#/$defs/Key";
3034
+ readonly ciphertext: {
3035
+ readonly $ref: "#/$defs/ElGamalCiphertext";
3036
+ };
3037
+ };
3038
+ readonly oneOf: readonly [{
3039
+ readonly required: readonly ["leafIndex"];
3040
+ }, {
3041
+ readonly required: readonly ["question", "option"];
3042
+ }];
3043
+ };
3044
+ readonly ElGamalCiphertext: {
3045
+ readonly title: "ElGamalCiphertext";
3046
+ readonly description: "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).";
3047
+ readonly type: "object";
3048
+ readonly additionalProperties: false;
3049
+ readonly required: readonly ["a", "b"];
3050
+ readonly properties: {
3051
+ readonly a: {
3052
+ readonly $ref: "#/$defs/GroupElement";
3053
+ };
3054
+ readonly b: {
3055
+ readonly $ref: "#/$defs/GroupElement";
3056
+ };
3057
+ };
3058
+ };
3059
+ readonly TrusteeIndex: {
3060
+ readonly title: "TrusteeIndex";
3061
+ readonly description: "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.";
3062
+ readonly type: "integer";
3063
+ readonly minimum: 1;
3064
+ readonly maximum: 64;
3065
+ };
3066
+ readonly ElectionKey: {
3067
+ readonly title: "ElectionKey";
3068
+ readonly 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.";
3069
+ readonly type: "object";
3070
+ readonly additionalProperties: false;
3071
+ readonly required: readonly ["key", "qualified", "verification"];
3072
+ readonly properties: {
3073
+ readonly key: {
3074
+ readonly $ref: "#/$defs/GroupElement";
3075
+ };
3076
+ readonly qualified: {
3077
+ readonly type: "array";
3078
+ readonly minItems: 1;
3079
+ readonly maxItems: 64;
3080
+ readonly items: {
3081
+ readonly $ref: "#/$defs/TrusteeIndex";
1097
3082
  };
1098
- readonly additionalProperties: {
3083
+ readonly description: "The dealers whose dealings the key is formed from.";
3084
+ };
3085
+ readonly verification: {
3086
+ readonly type: "array";
3087
+ readonly minItems: 2;
3088
+ readonly maxItems: 64;
3089
+ readonly items: {
1099
3090
  readonly type: "object";
1100
3091
  readonly additionalProperties: false;
1101
- readonly required: readonly ["sum", "count"];
3092
+ readonly required: readonly ["trustee", "key"];
1102
3093
  readonly properties: {
1103
- readonly sum: {
1104
- readonly type: "integer";
3094
+ readonly trustee: {
3095
+ readonly $ref: "#/$defs/TrusteeIndex";
1105
3096
  };
1106
- readonly count: {
1107
- readonly type: "integer";
1108
- readonly minimum: 0;
3097
+ readonly key: {
3098
+ readonly $ref: "#/$defs/GroupElement";
1109
3099
  };
1110
3100
  };
1111
3101
  };
1112
3102
  };
1113
- readonly text: {
3103
+ };
3104
+ };
3105
+ readonly Dealing: {
3106
+ readonly title: "Dealing";
3107
+ readonly 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).";
3108
+ readonly type: "object";
3109
+ readonly additionalProperties: false;
3110
+ readonly required: readonly ["dealer", "commitments", "pok", "shares"];
3111
+ readonly properties: {
3112
+ readonly dealer: {
3113
+ readonly $ref: "#/$defs/TrusteeIndex";
3114
+ };
3115
+ readonly commitments: {
1114
3116
  readonly type: "array";
3117
+ readonly minItems: 2;
3118
+ readonly maxItems: 64;
1115
3119
  readonly items: {
1116
- readonly type: "string";
1117
- readonly maxLength: 4096;
3120
+ readonly $ref: "#/$defs/GroupElement";
1118
3121
  };
1119
3122
  };
1120
- readonly withheld: {
1121
- readonly type: "boolean";
3123
+ readonly pok: {
3124
+ readonly $ref: "#/$defs/SigmaProof";
3125
+ };
3126
+ readonly shares: {
3127
+ readonly type: "array";
3128
+ readonly minItems: 2;
3129
+ readonly maxItems: 64;
3130
+ readonly items: {
3131
+ readonly $ref: "#/$defs/SealedShare";
3132
+ };
1122
3133
  };
1123
3134
  };
1124
3135
  };
1125
- readonly Key: {
1126
- readonly title: "Key";
1127
- readonly description: "A question or option key, unique within its manifest or question.";
1128
- readonly type: "string";
1129
- readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
1130
- };
1131
- readonly Multibase: {
1132
- readonly title: "Multibase";
1133
- readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
1134
- readonly type: "string";
1135
- readonly maxLength: 16384;
1136
- readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
1137
- };
1138
- readonly Cast: {
1139
- readonly title: "Cast";
1140
- readonly 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.";
3136
+ readonly SealedShare: {
3137
+ readonly title: "SealedShare";
1141
3138
  readonly type: "object";
1142
3139
  readonly additionalProperties: false;
1143
- readonly required: readonly ["ballot", "tag", "attestation"];
3140
+ readonly required: readonly ["recipient", "share"];
1144
3141
  readonly properties: {
1145
- readonly ballot: {
1146
- readonly $ref: "#/$defs/Ballot";
3142
+ readonly recipient: {
3143
+ readonly $ref: "#/$defs/TrusteeIndex";
1147
3144
  };
1148
- readonly tag: {
1149
- readonly $ref: "#/$defs/Multibase";
3145
+ readonly share: {
3146
+ readonly $ref: "#/$defs/SealedPayload";
1150
3147
  };
1151
- readonly attestation: {
1152
- readonly $ref: "#/$defs/Multibase";
3148
+ };
3149
+ };
3150
+ readonly SealedPayload: {
3151
+ readonly title: "SealedPayload";
3152
+ readonly 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).";
3153
+ readonly type: "object";
3154
+ readonly additionalProperties: false;
3155
+ readonly required: readonly ["kem", "body"];
3156
+ readonly properties: {
3157
+ readonly kem: {
3158
+ readonly $ref: "#/$defs/ElGamalCiphertext";
3159
+ };
3160
+ readonly body: {
3161
+ readonly type: "string";
3162
+ readonly minLength: 2;
3163
+ readonly maxLength: 131072;
3164
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
1153
3165
  };
1154
3166
  };
1155
3167
  };
1156
- readonly Ballot: {
1157
- readonly title: "Ballot";
1158
- readonly 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.";
3168
+ readonly TransportKey: {
3169
+ readonly title: "TransportKey";
3170
+ readonly description: "The group element a trustee's shares are sealed to, with a Schnorr proof of knowledge of its discrete log (CONVENTIONS §9.6).";
1159
3171
  readonly type: "object";
1160
3172
  readonly additionalProperties: false;
1161
- readonly required: readonly ["electionId", "manifestDigest", "answers"];
3173
+ readonly required: readonly ["trustee", "key", "pok"];
1162
3174
  readonly properties: {
1163
- readonly electionId: {
1164
- readonly $ref: "#/$defs/ElectionId";
3175
+ readonly trustee: {
3176
+ readonly $ref: "#/$defs/TrusteeIndex";
1165
3177
  };
1166
- readonly manifestDigest: {
1167
- readonly $ref: "#/$defs/DigestMultibase";
3178
+ readonly key: {
3179
+ readonly $ref: "#/$defs/GroupElement";
1168
3180
  };
1169
- readonly answers: {
1170
- readonly type: "array";
1171
- readonly minItems: 1;
1172
- readonly maxItems: 128;
1173
- readonly items: {
1174
- readonly $ref: "#/$defs/Answer";
1175
- };
3181
+ readonly pok: {
3182
+ readonly $ref: "#/$defs/SigmaProof";
1176
3183
  };
1177
3184
  };
1178
3185
  };
1179
- readonly Answer: {
1180
- readonly title: "Answer";
1181
- readonly 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.";
3186
+ readonly EncryptedCast: {
3187
+ readonly title: "EncryptedCast";
3188
+ readonly 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).";
1182
3189
  readonly type: "object";
1183
3190
  readonly additionalProperties: false;
1184
- readonly required: readonly ["question"];
1185
- readonly minProperties: 2;
1186
- readonly maxProperties: 2;
3191
+ readonly required: readonly ["tag", "attestation"];
3192
+ readonly properties: {
3193
+ readonly sealed: {
3194
+ readonly $ref: "#/$defs/SealedPayload";
3195
+ };
3196
+ readonly encrypted: {
3197
+ readonly $ref: "#/$defs/EncryptedBallot";
3198
+ };
3199
+ readonly tag: {
3200
+ readonly $ref: "#/$defs/Multibase";
3201
+ };
3202
+ readonly attestation: {
3203
+ readonly $ref: "#/$defs/Multibase";
3204
+ };
3205
+ };
3206
+ readonly oneOf: readonly [{
3207
+ readonly required: readonly ["sealed"];
3208
+ }, {
3209
+ readonly required: readonly ["encrypted"];
3210
+ }];
3211
+ };
3212
+ readonly Multibase: {
3213
+ readonly title: "Multibase";
3214
+ readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
3215
+ readonly type: "string";
3216
+ readonly maxLength: 16384;
3217
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
3218
+ };
3219
+ readonly EncryptedBallot: {
3220
+ readonly title: "EncryptedBallot";
3221
+ readonly description: "A tallied-encrypted ballot: one EncryptedQuestion per manifest question, in the manifest's order. Never decrypted (VTI-VOT-064).";
3222
+ readonly type: "object";
3223
+ readonly additionalProperties: false;
3224
+ readonly required: readonly ["electionId", "manifestDigest", "questions"];
1187
3225
  readonly properties: {
1188
- readonly question: {
1189
- readonly $ref: "#/$defs/Key";
3226
+ readonly electionId: {
3227
+ readonly $ref: "#/$defs/ElectionId";
1190
3228
  };
1191
- readonly choice: {
1192
- readonly type: "array";
1193
- readonly items: {
1194
- readonly $ref: "#/$defs/Key";
1195
- };
1196
- readonly uniqueItems: true;
3229
+ readonly manifestDigest: {
3230
+ readonly $ref: "#/$defs/DigestMultibase";
1197
3231
  };
1198
- readonly ranking: {
3232
+ readonly questions: {
1199
3233
  readonly type: "array";
3234
+ readonly minItems: 1;
3235
+ readonly maxItems: 64;
1200
3236
  readonly items: {
1201
- readonly $ref: "#/$defs/Key";
1202
- };
1203
- readonly uniqueItems: true;
1204
- };
1205
- readonly scores: {
1206
- readonly type: "object";
1207
- readonly propertyNames: {
1208
- readonly $ref: "#/$defs/Key";
1209
- };
1210
- readonly additionalProperties: {
1211
- readonly type: "integer";
3237
+ readonly $ref: "#/$defs/EncryptedQuestion";
1212
3238
  };
1213
3239
  };
1214
- readonly text: {
1215
- readonly type: "string";
1216
- readonly maxLength: 4096;
1217
- };
1218
- readonly abstain: {
1219
- readonly const: true;
1220
- };
1221
3240
  };
1222
3241
  };
1223
- };
1224
- };
1225
- };
1226
- /**
1227
- * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
1228
- * tracks the *issuer* party's requirement because a response swaps the
1229
- * parties (§7.3 item 5).
1230
- */
1231
- export declare const RESPONSE_SPEC: {
1232
- readonly typeUri: "https://trusttasks.org/spec/voting/board/read/0.1#response";
1233
- readonly isBearer: false;
1234
- readonly isProofRequired: false;
1235
- readonly isRecipientRequired: false;
1236
- readonly isIssuedAtRequired: false;
1237
- readonly payloadSchema: {
1238
- readonly $schema: "https://json-schema.org/draft/2020-12/schema";
1239
- readonly $ref: "#/$defs/Response";
1240
- readonly $defs: {
1241
- readonly Response: {
1242
- readonly $anchor: "response";
1243
- readonly title: "Voting — Board Read — response payload";
3242
+ readonly EncryptedQuestion: {
3243
+ readonly title: "EncryptedQuestion";
3244
+ readonly 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).";
1244
3245
  readonly type: "object";
1245
3246
  readonly additionalProperties: false;
1246
- readonly required: readonly ["treeSize", "entries"];
3247
+ readonly required: readonly ["question", "options", "sumProof"];
1247
3248
  readonly properties: {
1248
- readonly treeSize: {
1249
- readonly type: "integer";
1250
- readonly minimum: 0;
1251
- readonly description: "The tree size the page was read against. No entry at or beyond it is returned.";
3249
+ readonly question: {
3250
+ readonly $ref: "#/$defs/Key";
1252
3251
  };
1253
- readonly entries: {
3252
+ readonly options: {
1254
3253
  readonly type: "array";
1255
- readonly maxItems: 1000;
3254
+ readonly minItems: 1;
3255
+ readonly maxItems: 64;
1256
3256
  readonly items: {
1257
- readonly type: "object";
1258
- readonly additionalProperties: false;
1259
- readonly required: readonly ["index", "entry"];
1260
- readonly properties: {
1261
- readonly index: {
1262
- readonly type: "integer";
1263
- readonly minimum: 0;
1264
- };
1265
- readonly entry: {
1266
- readonly $ref: "#/$defs/BoardEntry";
1267
- };
1268
- };
3257
+ readonly $ref: "#/$defs/EncryptedOption";
1269
3258
  };
1270
- readonly description: "Consecutive entries from `from`, in board order.";
1271
- };
1272
- readonly next: {
1273
- readonly type: "integer";
1274
- readonly minimum: 1;
1275
- readonly description: "The `from` of the next page. Absent when the page reaches `treeSize`.";
1276
3259
  };
1277
- readonly ext: {
1278
- readonly $ref: "#/$defs/Ext";
3260
+ readonly sumProof: {
3261
+ readonly $ref: "#/$defs/DisjunctiveProof";
1279
3262
  };
1280
3263
  };
1281
3264
  };
1282
- readonly Ext: {
1283
- readonly title: "Ext";
1284
- readonly 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.";
1285
- readonly type: "object";
1286
- readonly minProperties: 1;
1287
- readonly additionalProperties: true;
1288
- readonly propertyNames: {
1289
- readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
3265
+ readonly DisjunctiveProof: {
3266
+ readonly title: "DisjunctiveProof";
3267
+ readonly 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).";
3268
+ readonly type: "array";
3269
+ readonly minItems: 1;
3270
+ readonly maxItems: 65;
3271
+ readonly items: {
3272
+ readonly $ref: "#/$defs/SigmaProof";
1290
3273
  };
1291
3274
  };
1292
- readonly BoardEntry: {
1293
- readonly title: "BoardEntry";
1294
- readonly 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.";
1295
- readonly oneOf: readonly [{
1296
- readonly title: "CastEntry";
1297
- readonly type: "object";
1298
- readonly additionalProperties: false;
1299
- readonly required: readonly ["kind", "cast"];
1300
- readonly properties: {
1301
- readonly kind: {
1302
- readonly const: "cast";
1303
- };
1304
- readonly cast: {
1305
- readonly $ref: "#/$defs/Cast";
1306
- };
1307
- };
1308
- }, {
1309
- readonly title: "ReplacementEntry";
1310
- readonly description: "The cast at `replaces` is no longer counted: a later cast under the same tag is.";
1311
- readonly type: "object";
1312
- readonly additionalProperties: false;
1313
- readonly required: readonly ["kind", "tag", "replaces", "by"];
1314
- readonly properties: {
1315
- readonly kind: {
1316
- readonly const: "replaced";
1317
- };
1318
- readonly tag: {
1319
- readonly $ref: "#/$defs/Multibase";
1320
- };
1321
- readonly replaces: {
1322
- readonly type: "integer";
1323
- readonly minimum: 0;
1324
- };
1325
- readonly by: {
1326
- readonly type: "integer";
1327
- readonly minimum: 0;
1328
- };
1329
- };
1330
- }, {
1331
- readonly title: "LifecycleEntry";
1332
- readonly type: "object";
1333
- readonly additionalProperties: false;
1334
- readonly required: readonly ["kind", "at"];
1335
- readonly properties: {
1336
- readonly kind: {
1337
- readonly enum: readonly ["opened", "closed", "closedEarly", "cancelled"];
1338
- };
1339
- readonly at: {
1340
- readonly type: "string";
1341
- readonly format: "date-time";
1342
- };
3275
+ readonly EncryptedOption: {
3276
+ readonly title: "EncryptedOption";
3277
+ readonly type: "object";
3278
+ readonly additionalProperties: false;
3279
+ readonly required: readonly ["ciphertext", "proof"];
3280
+ readonly properties: {
3281
+ readonly ciphertext: {
3282
+ readonly $ref: "#/$defs/ElGamalCiphertext";
1343
3283
  };
1344
- }, {
1345
- readonly title: "ResultEntry";
1346
- readonly type: "object";
1347
- readonly additionalProperties: false;
1348
- readonly required: readonly ["kind", "result"];
1349
- readonly properties: {
1350
- readonly kind: {
1351
- readonly const: "result";
1352
- };
1353
- readonly result: {
1354
- readonly $ref: "#/$defs/ElectionResult";
1355
- };
3284
+ readonly proof: {
3285
+ readonly $ref: "#/$defs/DisjunctiveProof";
1356
3286
  };
1357
- }];
3287
+ };
1358
3288
  };
1359
3289
  readonly ElectionResult: {
1360
3290
  readonly title: "ElectionResult";
@@ -1409,20 +3339,6 @@ export declare const RESPONSE_SPEC: {
1409
3339
  };
1410
3340
  };
1411
3341
  };
1412
- readonly ElectionId: {
1413
- readonly title: "ElectionId";
1414
- readonly 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.";
1415
- readonly type: "string";
1416
- readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
1417
- };
1418
- readonly DigestMultibase: {
1419
- readonly title: "DigestMultibase";
1420
- readonly 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`.";
1421
- readonly type: "string";
1422
- readonly minLength: 16;
1423
- readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
1424
- readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
1425
- };
1426
3342
  readonly QuestionResult: {
1427
3343
  readonly title: "QuestionResult";
1428
3344
  readonly 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.";
@@ -1492,19 +3408,6 @@ export declare const RESPONSE_SPEC: {
1492
3408
  };
1493
3409
  };
1494
3410
  };
1495
- readonly Key: {
1496
- readonly title: "Key";
1497
- readonly description: "A question or option key, unique within its manifest or question.";
1498
- readonly type: "string";
1499
- readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
1500
- };
1501
- readonly Multibase: {
1502
- readonly title: "Multibase";
1503
- readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
1504
- readonly type: "string";
1505
- readonly maxLength: 16384;
1506
- readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
1507
- };
1508
3411
  readonly Cast: {
1509
3412
  readonly title: "Cast";
1510
3413
  readonly 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.";
@@ -1523,73 +3426,6 @@ export declare const RESPONSE_SPEC: {
1523
3426
  };
1524
3427
  };
1525
3428
  };
1526
- readonly Ballot: {
1527
- readonly title: "Ballot";
1528
- readonly 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.";
1529
- readonly type: "object";
1530
- readonly additionalProperties: false;
1531
- readonly required: readonly ["electionId", "manifestDigest", "answers"];
1532
- readonly properties: {
1533
- readonly electionId: {
1534
- readonly $ref: "#/$defs/ElectionId";
1535
- };
1536
- readonly manifestDigest: {
1537
- readonly $ref: "#/$defs/DigestMultibase";
1538
- };
1539
- readonly answers: {
1540
- readonly type: "array";
1541
- readonly minItems: 1;
1542
- readonly maxItems: 128;
1543
- readonly items: {
1544
- readonly $ref: "#/$defs/Answer";
1545
- };
1546
- };
1547
- };
1548
- };
1549
- readonly Answer: {
1550
- readonly title: "Answer";
1551
- readonly 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.";
1552
- readonly type: "object";
1553
- readonly additionalProperties: false;
1554
- readonly required: readonly ["question"];
1555
- readonly minProperties: 2;
1556
- readonly maxProperties: 2;
1557
- readonly properties: {
1558
- readonly question: {
1559
- readonly $ref: "#/$defs/Key";
1560
- };
1561
- readonly choice: {
1562
- readonly type: "array";
1563
- readonly items: {
1564
- readonly $ref: "#/$defs/Key";
1565
- };
1566
- readonly uniqueItems: true;
1567
- };
1568
- readonly ranking: {
1569
- readonly type: "array";
1570
- readonly items: {
1571
- readonly $ref: "#/$defs/Key";
1572
- };
1573
- readonly uniqueItems: true;
1574
- };
1575
- readonly scores: {
1576
- readonly type: "object";
1577
- readonly propertyNames: {
1578
- readonly $ref: "#/$defs/Key";
1579
- };
1580
- readonly additionalProperties: {
1581
- readonly type: "integer";
1582
- };
1583
- };
1584
- readonly text: {
1585
- readonly type: "string";
1586
- readonly maxLength: 4096;
1587
- };
1588
- readonly abstain: {
1589
- readonly const: true;
1590
- };
1591
- };
1592
- };
1593
3429
  };
1594
3430
  };
1595
3431
  };