@openvtc/trust-tasks 0.28.6 → 0.28.7

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 (187) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/_shared/components.d.ts +45 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +42 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +42 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/voting/_shared/0.3/voting.d.ts +16 -0
  9. package/dist/voting/_shared/0.3/voting.d.ts.map +1 -0
  10. package/dist/voting/_shared/0.3/voting.js +6 -0
  11. package/dist/voting/_shared/0.3/voting.js.map +1 -0
  12. package/dist/voting/election/register/0.1/payload.d.ts +4 -4
  13. package/dist/voting/election/register/0.1/payload.js +1 -1
  14. package/dist/voting/election/register/0.2/payload.d.ts +13 -2
  15. package/dist/voting/election/register/0.2/payload.d.ts.map +1 -1
  16. package/dist/voting/election/register/0.2/payload.js +1 -1
  17. package/dist/voting/election/register/0.2/payload.js.map +1 -1
  18. package/dist/voting/election/register/0.3/payload.d.ts +1934 -0
  19. package/dist/voting/election/register/0.3/payload.d.ts.map +1 -0
  20. package/dist/voting/election/register/0.3/payload.js +1180 -0
  21. package/dist/voting/election/register/0.3/payload.js.map +1 -0
  22. package/dist/voting/election/show/0.1/payload.d.ts +4 -4
  23. package/dist/voting/election/show/0.1/payload.js +1 -1
  24. package/dist/voting/election/show/0.2/payload.d.ts +13 -2
  25. package/dist/voting/election/show/0.2/payload.d.ts.map +1 -1
  26. package/dist/voting/election/show/0.2/payload.js +1 -1
  27. package/dist/voting/election/show/0.2/payload.js.map +1 -1
  28. package/dist/voting/election/show/0.3/payload.d.ts +1838 -0
  29. package/dist/voting/election/show/0.3/payload.d.ts.map +1 -0
  30. package/dist/voting/election/show/0.3/payload.js +1126 -0
  31. package/dist/voting/election/show/0.3/payload.js.map +1 -0
  32. package/dist/vta/pcs/trustee/deal/0.2/payload.d.ts +4 -4
  33. package/dist/vta/pcs/trustee/deal/0.2/payload.js +1 -1
  34. package/dist/vta/pcs/trustee/deal/0.3/payload.d.ts +13 -2
  35. package/dist/vta/pcs/trustee/deal/0.3/payload.d.ts.map +1 -1
  36. package/dist/vta/pcs/trustee/deal/0.3/payload.js +1 -1
  37. package/dist/vta/pcs/trustee/deal/0.3/payload.js.map +1 -1
  38. package/dist/vta/pcs/trustee/deal/0.4/payload.d.ts +1846 -0
  39. package/dist/vta/pcs/trustee/deal/0.4/payload.d.ts.map +1 -0
  40. package/dist/vta/pcs/trustee/deal/0.4/payload.js +1091 -0
  41. package/dist/vta/pcs/trustee/deal/0.4/payload.js.map +1 -0
  42. package/dist/vta/pcs/trustee/enrol/0.1/payload.d.ts +4 -4
  43. package/dist/vta/pcs/trustee/enrol/0.1/payload.js +1 -1
  44. package/dist/vta/pcs/trustee/enrol/0.2/payload.d.ts +13 -2
  45. package/dist/vta/pcs/trustee/enrol/0.2/payload.d.ts.map +1 -1
  46. package/dist/vta/pcs/trustee/enrol/0.2/payload.js +1 -1
  47. package/dist/vta/pcs/trustee/enrol/0.2/payload.js.map +1 -1
  48. package/dist/vta/pcs/trustee/enrol/0.3/payload.d.ts +1770 -0
  49. package/dist/vta/pcs/trustee/enrol/0.3/payload.d.ts.map +1 -0
  50. package/dist/vta/pcs/trustee/enrol/0.3/payload.js +1054 -0
  51. package/dist/vta/pcs/trustee/enrol/0.3/payload.js.map +1 -0
  52. package/dist/vta/pcs/trustee/justify/0.2/payload.d.ts +4 -4
  53. package/dist/vta/pcs/trustee/justify/0.2/payload.js +1 -1
  54. package/dist/vta/pcs/trustee/justify/0.3/payload.d.ts +13 -2
  55. package/dist/vta/pcs/trustee/justify/0.3/payload.d.ts.map +1 -1
  56. package/dist/vta/pcs/trustee/justify/0.3/payload.js +1 -1
  57. package/dist/vta/pcs/trustee/justify/0.3/payload.js.map +1 -1
  58. package/dist/vta/pcs/trustee/justify/0.4/payload.d.ts +1881 -0
  59. package/dist/vta/pcs/trustee/justify/0.4/payload.d.ts.map +1 -0
  60. package/dist/vta/pcs/trustee/justify/0.4/payload.js +1109 -0
  61. package/dist/vta/pcs/trustee/justify/0.4/payload.js.map +1 -0
  62. package/dist/vta/pcs/trustee/keys/0.2/payload.d.ts +4 -4
  63. package/dist/vta/pcs/trustee/keys/0.2/payload.js +1 -1
  64. package/dist/vta/pcs/trustee/keys/0.3/payload.d.ts +13 -2
  65. package/dist/vta/pcs/trustee/keys/0.3/payload.d.ts.map +1 -1
  66. package/dist/vta/pcs/trustee/keys/0.3/payload.js +1 -1
  67. package/dist/vta/pcs/trustee/keys/0.3/payload.js.map +1 -1
  68. package/dist/vta/pcs/trustee/keys/0.4/payload.d.ts +1926 -0
  69. package/dist/vta/pcs/trustee/keys/0.4/payload.d.ts.map +1 -0
  70. package/dist/vta/pcs/trustee/keys/0.4/payload.js +1129 -0
  71. package/dist/vta/pcs/trustee/keys/0.4/payload.js.map +1 -0
  72. package/dist/vta/pcs/trustee/read/0.1/payload.d.ts +4 -4
  73. package/dist/vta/pcs/trustee/read/0.1/payload.js +1 -1
  74. package/dist/vta/pcs/trustee/read/0.2/payload.d.ts +14 -2
  75. package/dist/vta/pcs/trustee/read/0.2/payload.d.ts.map +1 -1
  76. package/dist/vta/pcs/trustee/read/0.2/payload.js +1 -1
  77. package/dist/vta/pcs/trustee/read/0.2/payload.js.map +1 -1
  78. package/dist/vta/pcs/trustee/read/0.3/payload.d.ts +540 -0
  79. package/dist/vta/pcs/trustee/read/0.3/payload.d.ts.map +1 -0
  80. package/dist/vta/pcs/trustee/read/0.3/payload.js +304 -0
  81. package/dist/vta/pcs/trustee/read/0.3/payload.js.map +1 -0
  82. package/dist/vta/pcs/vote/0.1/payload.d.ts +4 -4
  83. package/dist/vta/pcs/vote/0.1/payload.js +1 -1
  84. package/dist/vta/pcs/vote/0.2/payload.d.ts +13 -2
  85. package/dist/vta/pcs/vote/0.2/payload.d.ts.map +1 -1
  86. package/dist/vta/pcs/vote/0.2/payload.js +1 -1
  87. package/dist/vta/pcs/vote/0.2/payload.js.map +1 -1
  88. package/dist/vta/pcs/vote/0.3/payload.d.ts +2222 -0
  89. package/dist/vta/pcs/vote/0.3/payload.d.ts.map +1 -0
  90. package/dist/vta/pcs/vote/0.3/payload.js +1296 -0
  91. package/dist/vta/pcs/vote/0.3/payload.js.map +1 -0
  92. package/dist/vta/pcs/vote-encrypted/0.2/payload.d.ts +4 -4
  93. package/dist/vta/pcs/vote-encrypted/0.2/payload.js +1 -1
  94. package/dist/vta/pcs/vote-encrypted/0.3/payload.d.ts +13 -2
  95. package/dist/vta/pcs/vote-encrypted/0.3/payload.d.ts.map +1 -1
  96. package/dist/vta/pcs/vote-encrypted/0.3/payload.js +1 -1
  97. package/dist/vta/pcs/vote-encrypted/0.3/payload.js.map +1 -1
  98. package/dist/vta/pcs/vote-encrypted/0.4/payload.d.ts +2242 -0
  99. package/dist/vta/pcs/vote-encrypted/0.4/payload.d.ts.map +1 -0
  100. package/dist/vta/pcs/vote-encrypted/0.4/payload.js +1314 -0
  101. package/dist/vta/pcs/vote-encrypted/0.4/payload.js.map +1 -0
  102. package/dist/vta/pcs/voter/read/0.1/payload.d.ts +4 -4
  103. package/dist/vta/pcs/voter/read/0.1/payload.js +1 -1
  104. package/dist/vta/pcs/voter/read/0.2/payload.d.ts +14 -2
  105. package/dist/vta/pcs/voter/read/0.2/payload.d.ts.map +1 -1
  106. package/dist/vta/pcs/voter/read/0.2/payload.js +1 -1
  107. package/dist/vta/pcs/voter/read/0.2/payload.js.map +1 -1
  108. package/dist/vta/pcs/voter/read/0.3/payload.d.ts +503 -0
  109. package/dist/vta/pcs/voter/read/0.3/payload.d.ts.map +1 -0
  110. package/dist/vta/pcs/voter/read/0.3/payload.js +285 -0
  111. package/dist/vta/pcs/voter/read/0.3/payload.js.map +1 -0
  112. package/dist/vta/pcs/voter/register/0.1/payload.d.ts +4 -4
  113. package/dist/vta/pcs/voter/register/0.1/payload.js +1 -1
  114. package/dist/vta/pcs/voter/register/0.2/payload.d.ts +14 -2
  115. package/dist/vta/pcs/voter/register/0.2/payload.d.ts.map +1 -1
  116. package/dist/vta/pcs/voter/register/0.2/payload.js +1 -1
  117. package/dist/vta/pcs/voter/register/0.2/payload.js.map +1 -1
  118. package/dist/vta/pcs/voter/register/0.3/payload.d.ts +2176 -0
  119. package/dist/vta/pcs/voter/register/0.3/payload.d.ts.map +1 -0
  120. package/dist/vta/pcs/voter/register/0.3/payload.js +1262 -0
  121. package/dist/vta/pcs/voter/register/0.3/payload.js.map +1 -0
  122. package/dist/vtc/elections/create/0.1/payload.d.ts +4 -4
  123. package/dist/vtc/elections/create/0.1/payload.js +1 -1
  124. package/dist/vtc/elections/create/0.2/payload.d.ts +4 -4
  125. package/dist/vtc/elections/create/0.2/payload.js +1 -1
  126. package/dist/vtc/elections/create/0.3/payload.d.ts +14 -2
  127. package/dist/vtc/elections/create/0.3/payload.d.ts.map +1 -1
  128. package/dist/vtc/elections/create/0.3/payload.js +1 -1
  129. package/dist/vtc/elections/create/0.3/payload.js.map +1 -1
  130. package/dist/vtc/elections/create/0.4/payload.d.ts +1670 -0
  131. package/dist/vtc/elections/create/0.4/payload.d.ts.map +1 -0
  132. package/dist/vtc/elections/create/0.4/payload.js +1008 -0
  133. package/dist/vtc/elections/create/0.4/payload.js.map +1 -0
  134. package/dist/vtc/elections/show/0.1/payload.d.ts +4 -4
  135. package/dist/vtc/elections/show/0.1/payload.js +1 -1
  136. package/dist/vtc/elections/show/0.2/payload.d.ts +14 -2
  137. package/dist/vtc/elections/show/0.2/payload.d.ts.map +1 -1
  138. package/dist/vtc/elections/show/0.2/payload.js +1 -1
  139. package/dist/vtc/elections/show/0.2/payload.js.map +1 -1
  140. package/dist/vtc/elections/show/0.3/payload.d.ts +3022 -0
  141. package/dist/vtc/elections/show/0.3/payload.d.ts.map +1 -0
  142. package/dist/vtc/elections/show/0.3/payload.js +1765 -0
  143. package/dist/vtc/elections/show/0.3/payload.js.map +1 -0
  144. package/package.json +1 -1
  145. package/src/_shared/components.ts +45 -0
  146. package/src/index.ts +42 -0
  147. package/src/voting/_shared/0.3/voting.ts +17 -0
  148. package/src/voting/election/register/0.1/payload.ts +5 -5
  149. package/src/voting/election/register/0.2/payload.ts +14 -3
  150. package/src/voting/election/register/0.3/payload.ts +1223 -0
  151. package/src/voting/election/show/0.1/payload.ts +5 -5
  152. package/src/voting/election/show/0.2/payload.ts +14 -3
  153. package/src/voting/election/show/0.3/payload.ts +1165 -0
  154. package/src/vta/pcs/trustee/deal/0.2/payload.ts +5 -5
  155. package/src/vta/pcs/trustee/deal/0.3/payload.ts +14 -3
  156. package/src/vta/pcs/trustee/deal/0.4/payload.ts +1164 -0
  157. package/src/vta/pcs/trustee/enrol/0.1/payload.ts +5 -5
  158. package/src/vta/pcs/trustee/enrol/0.2/payload.ts +14 -3
  159. package/src/vta/pcs/trustee/enrol/0.3/payload.ts +1123 -0
  160. package/src/vta/pcs/trustee/justify/0.2/payload.ts +5 -5
  161. package/src/vta/pcs/trustee/justify/0.3/payload.ts +14 -3
  162. package/src/vta/pcs/trustee/justify/0.4/payload.ts +1183 -0
  163. package/src/vta/pcs/trustee/keys/0.2/payload.ts +5 -5
  164. package/src/vta/pcs/trustee/keys/0.3/payload.ts +14 -3
  165. package/src/vta/pcs/trustee/keys/0.4/payload.ts +1210 -0
  166. package/src/vta/pcs/trustee/read/0.1/payload.ts +5 -5
  167. package/src/vta/pcs/trustee/read/0.2/payload.ts +15 -3
  168. package/src/vta/pcs/trustee/read/0.3/payload.ts +385 -0
  169. package/src/vta/pcs/vote/0.1/payload.ts +5 -5
  170. package/src/vta/pcs/vote/0.2/payload.ts +14 -3
  171. package/src/vta/pcs/vote/0.3/payload.ts +1381 -0
  172. package/src/vta/pcs/vote-encrypted/0.2/payload.ts +5 -5
  173. package/src/vta/pcs/vote-encrypted/0.3/payload.ts +14 -3
  174. package/src/vta/pcs/vote-encrypted/0.4/payload.ts +1385 -0
  175. package/src/vta/pcs/voter/read/0.1/payload.ts +5 -5
  176. package/src/vta/pcs/voter/read/0.2/payload.ts +15 -3
  177. package/src/vta/pcs/voter/read/0.3/payload.ts +363 -0
  178. package/src/vta/pcs/voter/register/0.1/payload.ts +5 -5
  179. package/src/vta/pcs/voter/register/0.2/payload.ts +15 -3
  180. package/src/vta/pcs/voter/register/0.3/payload.ts +1372 -0
  181. package/src/vtc/elections/create/0.1/payload.ts +5 -5
  182. package/src/vtc/elections/create/0.2/payload.ts +5 -5
  183. package/src/vtc/elections/create/0.3/payload.ts +15 -3
  184. package/src/vtc/elections/create/0.4/payload.ts +1057 -0
  185. package/src/vtc/elections/show/0.1/payload.ts +5 -5
  186. package/src/vtc/elections/show/0.2/payload.ts +15 -3
  187. package/src/vtc/elections/show/0.3/payload.ts +1865 -0
@@ -0,0 +1,2222 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/pcs/vote/0.3/payload.schema.json
4
+ */
5
+ import type { Answer, Ballot, BoardVisibility, ChoiceQuestion, DigestMultibase, ElectionId, Ext, Key_VotingV0_1 as Key, Manifest_VotingV0_3 as Manifest, Multibase_VotingV0_1 as Multibase, Question, QuestionOption, RankingQuestion, Revote, RollRule, ScoreQuestion, SecrecyLevel, TextQuestion, Trustees, VotingParameters } from "../../../../_shared/components.js";
6
+ /**
7
+ * A voter's client hands its VTA a ballot; the VTA checks it against the election's manifest, makes the ticket's attestation over it, and returns the complete voting/ballot/cast document, signed by a did:key used for this cast alone, for the client to send.
8
+ */
9
+ export interface VTAPCSVotePayload {
10
+ /**
11
+ * The context the voter belongs to.
12
+ */
13
+ contextId: string;
14
+ /**
15
+ * The community's DID. MUST equal the manifest's `community`.
16
+ */
17
+ community: string;
18
+ /**
19
+ * The community's published voting parameters. Its `votingKey` MUST be the one the ticket was issued under.
20
+ */
21
+ parameters: VotingParameters;
22
+ /**
23
+ * The election's manifest, exactly as registered. The engine recomputes its digest and checks it against the one it recorded at voter/register.
24
+ */
25
+ manifest: Manifest;
26
+ /**
27
+ * The voter's ballot. The cast binds its RFC 8785 (JCS) canonicalization.
28
+ */
29
+ ballot: Ballot;
30
+ ext?: Ext;
31
+ }
32
+ export interface VTAPCSVoteResponsePayload {
33
+ castDocument: CastDocument;
34
+ /**
35
+ * The cast's tag (the election's nullifier for this ticket), as the cast carries it. The same for every cast this ticket makes in this election.
36
+ */
37
+ tag: string;
38
+ ext?: Ext;
39
+ }
40
+ /**
41
+ * A complete, signed voting/ballot/cast/0.1 request document, ready to send to the ballot box. Its payload is validated by that specification's schema; the members fixed here are the ones this task guarantees.
42
+ */
43
+ export interface CastDocument {
44
+ /**
45
+ * A random (version 4) UUID URN, generated for this cast and derived from nothing else.
46
+ */
47
+ id: string;
48
+ type: "https://trusttasks.org/spec/voting/ballot/cast/0.1#request";
49
+ /**
50
+ * The did:key generated for this cast alone (VTI-VOT-003).
51
+ */
52
+ issuer: string;
53
+ /**
54
+ * The manifest's `ballotBox`.
55
+ */
56
+ recipient: string;
57
+ issuedAt: string;
58
+ /**
59
+ * When present, the manifest's `votingClosesAt`.
60
+ */
61
+ expiresAt?: string;
62
+ /**
63
+ * The voting/ballot/cast/0.1 request payload — `community`, `electionId` and the Cast the engine built — and nothing else.
64
+ */
65
+ payload: {};
66
+ /**
67
+ * The Data Integrity proof made with the cast's one-time key.
68
+ */
69
+ proof: {};
70
+ }
71
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
72
+ export type { Answer, Ballot, BoardVisibility, ChoiceQuestion, DigestMultibase, ElectionId, Ext, Key, Manifest, Multibase, Question, QuestionOption, RankingQuestion, Revote, RollRule, ScoreQuestion, SecrecyLevel, TextQuestion, Trustees, VotingParameters };
73
+ /** Trust Task type URI. */
74
+ export declare const TYPE_URI: "https://trusttasks.org/spec/vta/pcs/vote/0.3";
75
+ /**
76
+ * The earlier version of this specification that this one declares it
77
+ * extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
78
+ * `null`. Only the direct declaration — follow the chain with
79
+ * `extendsChain` / `readForSpec`.
80
+ */
81
+ export declare const EXTENDS: string | null;
82
+ /**
83
+ * Why this version is deprecated, or `null` while it is current. A
84
+ * superseded or retired version is still supported, and is withdrawn from
85
+ * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
86
+ * Versions").
87
+ */
88
+ export declare const DEPRECATION: string | null;
89
+ /** Stable alias for this specification's request payload shape. */
90
+ export type Payload = VTAPCSVotePayload;
91
+ /** Trust Task response type URI (request type URI + "#response"). */
92
+ export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/vta/pcs/vote/0.3#response";
93
+ /** Stable alias for this specification's success-response payload shape. */
94
+ export type Response = VTAPCSVoteResponsePayload;
95
+ /**
96
+ * This specification's payload schema, as a value.
97
+ *
98
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
99
+ * rather than only as a `.json` file because TypeScript types are erased
100
+ * at runtime: without a schema a consumer has nothing to validate, and
101
+ * every REQUIRED payload member is optional in practice. Cross-file
102
+ * `$ref`s are already inlined, so it needs no resolver.
103
+ */
104
+ export declare const PAYLOAD_SCHEMA: {
105
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
106
+ readonly $id: "https://trusttasks.org/spec/vta/pcs/vote/0.3";
107
+ readonly title: "VTA PCS — Vote — payload";
108
+ readonly description: "A voter's client hands its VTA a ballot; the VTA checks it against the election's manifest, makes the ticket's attestation over it, and returns the complete voting/ballot/cast document, signed by a did:key used for this cast alone, for the client to send.";
109
+ readonly type: "object";
110
+ readonly additionalProperties: false;
111
+ readonly required: readonly ["contextId", "community", "parameters", "manifest", "ballot"];
112
+ readonly properties: {
113
+ readonly contextId: {
114
+ readonly type: "string";
115
+ readonly minLength: 1;
116
+ readonly maxLength: 256;
117
+ readonly description: "The context the voter belongs to.";
118
+ };
119
+ readonly community: {
120
+ readonly type: "string";
121
+ readonly minLength: 1;
122
+ readonly maxLength: 2048;
123
+ readonly description: "The community's DID. MUST equal the manifest's `community`.";
124
+ };
125
+ readonly parameters: {
126
+ readonly $ref: "#/$defs/VotingParameters";
127
+ readonly description: "The community's published voting parameters. Its `votingKey` MUST be the one the ticket was issued under.";
128
+ };
129
+ readonly manifest: {
130
+ readonly $ref: "#/$defs/Manifest";
131
+ readonly description: "The election's manifest, exactly as registered. The engine recomputes its digest and checks it against the one it recorded at voter/register.";
132
+ };
133
+ readonly ballot: {
134
+ readonly $ref: "#/$defs/Ballot";
135
+ readonly description: "The voter's ballot. The cast binds its RFC 8785 (JCS) canonicalization.";
136
+ };
137
+ readonly ext: {
138
+ readonly $ref: "#/$defs/Ext";
139
+ };
140
+ };
141
+ readonly $defs: {
142
+ readonly CastDocument: {
143
+ readonly title: "CastDocument";
144
+ readonly description: "A complete, signed voting/ballot/cast/0.1 request document, ready to send to the ballot box. Its payload is validated by that specification's schema; the members fixed here are the ones this task guarantees.";
145
+ readonly type: "object";
146
+ readonly required: readonly ["id", "type", "issuer", "recipient", "issuedAt", "payload", "proof"];
147
+ readonly properties: {
148
+ readonly id: {
149
+ readonly type: "string";
150
+ readonly pattern: "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$";
151
+ readonly description: "A random (version 4) UUID URN, generated for this cast and derived from nothing else.";
152
+ };
153
+ readonly type: {
154
+ readonly const: "https://trusttasks.org/spec/voting/ballot/cast/0.1#request";
155
+ };
156
+ readonly issuer: {
157
+ readonly type: "string";
158
+ readonly maxLength: 256;
159
+ readonly pattern: "^did:key:z[1-9A-HJ-NP-Za-km-z]+$";
160
+ readonly description: "The did:key generated for this cast alone (VTI-VOT-003).";
161
+ };
162
+ readonly recipient: {
163
+ readonly type: "string";
164
+ readonly minLength: 1;
165
+ readonly maxLength: 2048;
166
+ readonly description: "The manifest's `ballotBox`.";
167
+ };
168
+ readonly issuedAt: {
169
+ readonly type: "string";
170
+ readonly format: "date-time";
171
+ };
172
+ readonly expiresAt: {
173
+ readonly type: "string";
174
+ readonly format: "date-time";
175
+ readonly description: "When present, the manifest's `votingClosesAt`.";
176
+ };
177
+ readonly payload: {
178
+ readonly type: "object";
179
+ readonly description: "The voting/ballot/cast/0.1 request payload — `community`, `electionId` and the Cast the engine built — and nothing else.";
180
+ };
181
+ readonly proof: {
182
+ readonly type: "object";
183
+ readonly description: "The Data Integrity proof made with the cast's one-time key.";
184
+ };
185
+ };
186
+ };
187
+ readonly Response: {
188
+ readonly $anchor: "response";
189
+ readonly title: "VTA PCS — Vote — response payload";
190
+ readonly type: "object";
191
+ readonly additionalProperties: false;
192
+ readonly required: readonly ["castDocument", "tag"];
193
+ readonly properties: {
194
+ readonly castDocument: {
195
+ readonly $ref: "#/$defs/CastDocument";
196
+ };
197
+ readonly tag: {
198
+ readonly type: "string";
199
+ readonly maxLength: 4096;
200
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
201
+ readonly description: "The cast's tag (the election's nullifier for this ticket), as the cast carries it. The same for every cast this ticket makes in this election.";
202
+ };
203
+ readonly ext: {
204
+ readonly $ref: "#/$defs/Ext";
205
+ };
206
+ };
207
+ };
208
+ readonly Ext: {
209
+ readonly title: "Ext";
210
+ 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.";
211
+ readonly type: "object";
212
+ readonly minProperties: 1;
213
+ readonly additionalProperties: true;
214
+ readonly propertyNames: {
215
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
216
+ };
217
+ };
218
+ readonly Ballot: {
219
+ readonly title: "Ballot";
220
+ 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.";
221
+ readonly type: "object";
222
+ readonly additionalProperties: false;
223
+ readonly required: readonly ["electionId", "manifestDigest", "answers"];
224
+ readonly properties: {
225
+ readonly electionId: {
226
+ readonly $ref: "#/$defs/ElectionId";
227
+ };
228
+ readonly manifestDigest: {
229
+ readonly $ref: "#/$defs/DigestMultibase";
230
+ };
231
+ readonly answers: {
232
+ readonly type: "array";
233
+ readonly minItems: 1;
234
+ readonly maxItems: 128;
235
+ readonly items: {
236
+ readonly $ref: "#/$defs/Answer";
237
+ };
238
+ };
239
+ };
240
+ };
241
+ readonly Answer: {
242
+ readonly title: "Answer";
243
+ 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.";
244
+ readonly type: "object";
245
+ readonly additionalProperties: false;
246
+ readonly required: readonly ["question"];
247
+ readonly minProperties: 2;
248
+ readonly maxProperties: 2;
249
+ readonly properties: {
250
+ readonly question: {
251
+ readonly $ref: "#/$defs/Key";
252
+ };
253
+ readonly choice: {
254
+ readonly type: "array";
255
+ readonly items: {
256
+ readonly $ref: "#/$defs/Key";
257
+ };
258
+ readonly uniqueItems: true;
259
+ };
260
+ readonly ranking: {
261
+ readonly type: "array";
262
+ readonly items: {
263
+ readonly $ref: "#/$defs/Key";
264
+ };
265
+ readonly uniqueItems: true;
266
+ };
267
+ readonly scores: {
268
+ readonly type: "object";
269
+ readonly propertyNames: {
270
+ readonly $ref: "#/$defs/Key";
271
+ };
272
+ readonly additionalProperties: {
273
+ readonly type: "integer";
274
+ };
275
+ };
276
+ readonly text: {
277
+ readonly type: "string";
278
+ readonly maxLength: 4096;
279
+ };
280
+ readonly abstain: {
281
+ readonly const: true;
282
+ };
283
+ };
284
+ };
285
+ readonly Key: {
286
+ readonly title: "Key";
287
+ readonly description: "A question or option key, unique within its manifest or question.";
288
+ readonly type: "string";
289
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
290
+ };
291
+ readonly ElectionId: {
292
+ readonly title: "ElectionId";
293
+ 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.";
294
+ readonly type: "string";
295
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
296
+ };
297
+ readonly DigestMultibase: {
298
+ readonly title: "DigestMultibase";
299
+ 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`.";
300
+ readonly type: "string";
301
+ readonly minLength: 16;
302
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
303
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
304
+ };
305
+ readonly Manifest: {
306
+ readonly title: "Manifest";
307
+ readonly description: "What an election asks and how it is decided (VTI-VOT-010). Its digest (`manifestDigest`) is the SHA-256 multihash of its RFC 8785 (JCS) canonicalization, and every cast is bound to it (VTI-VOT-011).";
308
+ readonly type: "object";
309
+ readonly additionalProperties: false;
310
+ readonly required: readonly ["electionId", "community", "questions", "secrecy", "roll", "registrationOpensAt", "votingOpensAt", "votingClosesAt", "revote", "board", "ballotBox", "binding", "allowEarlyClose", "resultsBeforeClose", "textReleaseThreshold"];
311
+ readonly properties: {
312
+ readonly electionId: {
313
+ readonly $ref: "#/$defs/ElectionId";
314
+ };
315
+ readonly community: {
316
+ readonly type: "string";
317
+ readonly minLength: 1;
318
+ readonly maxLength: 2048;
319
+ readonly description: "The community's DID.";
320
+ };
321
+ readonly title: {
322
+ readonly type: "string";
323
+ readonly maxLength: 512;
324
+ };
325
+ readonly description: {
326
+ readonly type: "string";
327
+ readonly maxLength: 8192;
328
+ };
329
+ readonly questions: {
330
+ readonly type: "array";
331
+ readonly minItems: 1;
332
+ readonly maxItems: 128;
333
+ readonly items: {
334
+ readonly $ref: "#/$defs/Question";
335
+ };
336
+ };
337
+ readonly secrecy: {
338
+ readonly $ref: "#/$defs/SecrecyLevel";
339
+ };
340
+ readonly roll: {
341
+ readonly $ref: "#/$defs/RollRule";
342
+ };
343
+ readonly registrationOpensAt: {
344
+ readonly type: "string";
345
+ readonly format: "date-time";
346
+ };
347
+ readonly votingOpensAt: {
348
+ readonly type: "string";
349
+ readonly format: "date-time";
350
+ };
351
+ readonly votingClosesAt: {
352
+ readonly type: "string";
353
+ readonly format: "date-time";
354
+ };
355
+ readonly revote: {
356
+ readonly $ref: "#/$defs/Revote";
357
+ };
358
+ readonly board: {
359
+ readonly type: "object";
360
+ readonly additionalProperties: false;
361
+ readonly required: readonly ["visibility", "auditors"];
362
+ readonly properties: {
363
+ readonly visibility: {
364
+ readonly $ref: "#/$defs/BoardVisibility";
365
+ };
366
+ readonly auditors: {
367
+ readonly type: "array";
368
+ readonly items: {
369
+ readonly type: "string";
370
+ readonly minLength: 1;
371
+ readonly maxLength: 2048;
372
+ };
373
+ readonly uniqueItems: true;
374
+ };
375
+ };
376
+ };
377
+ readonly ballotBox: {
378
+ readonly type: "string";
379
+ readonly minLength: 1;
380
+ readonly maxLength: 2048;
381
+ readonly description: "The DID of the voting service that holds the board.";
382
+ };
383
+ readonly trustees: {
384
+ readonly $ref: "#/$defs/Trustees";
385
+ };
386
+ readonly binding: {
387
+ readonly type: "boolean";
388
+ readonly description: "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081).";
389
+ };
390
+ readonly allowEarlyClose: {
391
+ readonly type: "boolean";
392
+ };
393
+ readonly resultsBeforeClose: {
394
+ readonly type: "boolean";
395
+ readonly description: "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061).";
396
+ };
397
+ readonly textReleaseThreshold: {
398
+ readonly type: "integer";
399
+ readonly minimum: 1;
400
+ readonly description: "Counted ballots required before any text answer is disclosed (VTI-VOT-065). At least 1, and SHOULD be at least 10: a written answer can identify its author by what it says or how it is phrased, and the fewer the ballots released together, the easier that is. Where it is below 10, the disclosure a member is shown before they request a ticket MUST say so, and MUST say that a written answer may identify its author (VTI-VOT-090).";
401
+ };
402
+ };
403
+ };
404
+ readonly Trustees: {
405
+ readonly title: "Trustees";
406
+ readonly description: "The trustees of a sealed or tallied-encrypted election and the number of them decryption needs (VTI-VOT-062). Neither the community nor the ballot box may be one.";
407
+ readonly type: "object";
408
+ readonly additionalProperties: false;
409
+ readonly required: readonly ["dids", "threshold"];
410
+ readonly properties: {
411
+ readonly dids: {
412
+ readonly type: "array";
413
+ readonly minItems: 2;
414
+ readonly items: {
415
+ readonly type: "string";
416
+ readonly minLength: 1;
417
+ readonly maxLength: 2048;
418
+ };
419
+ readonly uniqueItems: true;
420
+ };
421
+ readonly threshold: {
422
+ readonly type: "integer";
423
+ readonly minimum: 2;
424
+ };
425
+ };
426
+ };
427
+ readonly BoardVisibility: {
428
+ readonly title: "BoardVisibility";
429
+ readonly description: "`public`: anyone reads the board. `private`: the community, the auditors the manifest names and, for one cast's inclusion, the holder of its receipt (VTI-VOT-052).";
430
+ readonly type: "string";
431
+ readonly enum: readonly ["public", "private"];
432
+ };
433
+ readonly Revote: {
434
+ readonly title: "Revote";
435
+ readonly description: "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).";
436
+ readonly type: "string";
437
+ readonly enum: readonly ["replace", "refuse"];
438
+ };
439
+ readonly RollRule: {
440
+ readonly title: "RollRule";
441
+ readonly description: "Who may be issued a ticket (VTI-VOT-021): the community's active members, its active members and the parties `listed` names, or only the parties `listed` names.";
442
+ readonly type: "object";
443
+ readonly additionalProperties: false;
444
+ readonly required: readonly ["rule"];
445
+ readonly properties: {
446
+ readonly rule: {
447
+ readonly type: "string";
448
+ readonly enum: readonly ["members", "membersAndListed", "listed"];
449
+ };
450
+ readonly listed: {
451
+ readonly type: "array";
452
+ readonly items: {
453
+ readonly type: "string";
454
+ readonly minLength: 1;
455
+ readonly maxLength: 2048;
456
+ readonly description: "A DID enfranchised by name.";
457
+ };
458
+ readonly uniqueItems: true;
459
+ };
460
+ };
461
+ };
462
+ readonly SecrecyLevel: {
463
+ readonly title: "SecrecyLevel";
464
+ readonly description: "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060). The encrypted levels are cast with `voting/ballot/cast-encrypted/0.1`, under an election key the trustees generate with `voting/trustees/*` (CONVENTIONS §9).";
465
+ readonly type: "string";
466
+ readonly enum: readonly ["open", "sealed", "talliedEncrypted"];
467
+ };
468
+ readonly Question: {
469
+ readonly title: "Question";
470
+ readonly description: "One question. Tagged union over `type`.";
471
+ readonly oneOf: readonly [{
472
+ readonly title: "ChoiceQuestion";
473
+ readonly description: "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.";
474
+ readonly type: "object";
475
+ readonly additionalProperties: false;
476
+ readonly required: readonly ["key", "type", "options", "minSelections", "maxSelections", "optional"];
477
+ readonly properties: {
478
+ readonly key: {
479
+ readonly $ref: "#/$defs/Key";
480
+ };
481
+ readonly type: {
482
+ readonly const: "choice";
483
+ };
484
+ readonly text: {
485
+ readonly type: "string";
486
+ readonly maxLength: 2048;
487
+ };
488
+ readonly options: {
489
+ readonly type: "array";
490
+ readonly minItems: 2;
491
+ readonly maxItems: 256;
492
+ readonly items: {
493
+ readonly $ref: "#/$defs/QuestionOption";
494
+ };
495
+ };
496
+ readonly minSelections: {
497
+ readonly type: "integer";
498
+ readonly minimum: 0;
499
+ };
500
+ readonly maxSelections: {
501
+ readonly type: "integer";
502
+ readonly minimum: 1;
503
+ };
504
+ readonly optional: {
505
+ readonly type: "boolean";
506
+ };
507
+ };
508
+ }, {
509
+ readonly title: "RankingQuestion";
510
+ readonly description: "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.";
511
+ readonly type: "object";
512
+ readonly additionalProperties: false;
513
+ readonly required: readonly ["key", "type", "options", "partial", "optional"];
514
+ readonly properties: {
515
+ readonly key: {
516
+ readonly $ref: "#/$defs/Key";
517
+ };
518
+ readonly type: {
519
+ readonly const: "ranking";
520
+ };
521
+ readonly text: {
522
+ readonly type: "string";
523
+ readonly maxLength: 2048;
524
+ };
525
+ readonly options: {
526
+ readonly type: "array";
527
+ readonly minItems: 2;
528
+ readonly maxItems: 64;
529
+ readonly items: {
530
+ readonly $ref: "#/$defs/QuestionOption";
531
+ };
532
+ };
533
+ readonly partial: {
534
+ readonly type: "boolean";
535
+ };
536
+ readonly optional: {
537
+ readonly type: "boolean";
538
+ };
539
+ };
540
+ }, {
541
+ readonly title: "ScoreQuestion";
542
+ readonly description: "Give each option an integer score within [min, max].";
543
+ readonly type: "object";
544
+ readonly additionalProperties: false;
545
+ readonly required: readonly ["key", "type", "options", "min", "max", "optional"];
546
+ readonly properties: {
547
+ readonly key: {
548
+ readonly $ref: "#/$defs/Key";
549
+ };
550
+ readonly type: {
551
+ readonly const: "score";
552
+ };
553
+ readonly text: {
554
+ readonly type: "string";
555
+ readonly maxLength: 2048;
556
+ };
557
+ readonly options: {
558
+ readonly type: "array";
559
+ readonly minItems: 1;
560
+ readonly maxItems: 256;
561
+ readonly items: {
562
+ readonly $ref: "#/$defs/QuestionOption";
563
+ };
564
+ };
565
+ readonly min: {
566
+ readonly type: "integer";
567
+ };
568
+ readonly max: {
569
+ readonly type: "integer";
570
+ };
571
+ readonly optional: {
572
+ readonly type: "boolean";
573
+ };
574
+ };
575
+ }, {
576
+ readonly title: "TextQuestion";
577
+ readonly description: "Free text of at most `maxLength` characters.";
578
+ readonly type: "object";
579
+ readonly additionalProperties: false;
580
+ readonly required: readonly ["key", "type", "maxLength", "optional"];
581
+ readonly properties: {
582
+ readonly key: {
583
+ readonly $ref: "#/$defs/Key";
584
+ };
585
+ readonly type: {
586
+ readonly const: "text";
587
+ };
588
+ readonly text: {
589
+ readonly type: "string";
590
+ readonly maxLength: 2048;
591
+ };
592
+ readonly maxLength: {
593
+ readonly type: "integer";
594
+ readonly minimum: 1;
595
+ readonly maximum: 4096;
596
+ };
597
+ readonly optional: {
598
+ readonly type: "boolean";
599
+ };
600
+ };
601
+ }];
602
+ };
603
+ readonly QuestionOption: {
604
+ readonly title: "QuestionOption";
605
+ readonly type: "object";
606
+ readonly additionalProperties: false;
607
+ readonly required: readonly ["key"];
608
+ readonly properties: {
609
+ readonly key: {
610
+ readonly $ref: "#/$defs/Key";
611
+ };
612
+ readonly label: {
613
+ readonly type: "string";
614
+ readonly maxLength: 512;
615
+ readonly description: "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014).";
616
+ };
617
+ };
618
+ };
619
+ readonly VotingParameters: {
620
+ readonly title: "VotingParameters";
621
+ readonly description: "The community's published voting parameters: the PCS suite and the voting verification key tickets are issued under (VTI-VOT-020). Distinct from its hidden-vetting helper key.";
622
+ readonly type: "object";
623
+ readonly additionalProperties: false;
624
+ readonly required: readonly ["suite", "votingKey"];
625
+ readonly properties: {
626
+ readonly suite: {
627
+ readonly type: "string";
628
+ readonly const: "ps-ddh-bls12381";
629
+ };
630
+ readonly votingKey: {
631
+ readonly $ref: "#/$defs/Multibase";
632
+ };
633
+ };
634
+ };
635
+ readonly Multibase: {
636
+ readonly title: "Multibase";
637
+ readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
638
+ readonly type: "string";
639
+ readonly maxLength: 16384;
640
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
641
+ };
642
+ };
643
+ };
644
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
645
+ export declare const RESPONSE_PAYLOAD_SCHEMA: {
646
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
647
+ readonly $ref: "#/$defs/Response";
648
+ readonly $defs: {
649
+ readonly CastDocument: {
650
+ readonly title: "CastDocument";
651
+ readonly description: "A complete, signed voting/ballot/cast/0.1 request document, ready to send to the ballot box. Its payload is validated by that specification's schema; the members fixed here are the ones this task guarantees.";
652
+ readonly type: "object";
653
+ readonly required: readonly ["id", "type", "issuer", "recipient", "issuedAt", "payload", "proof"];
654
+ readonly properties: {
655
+ readonly id: {
656
+ readonly type: "string";
657
+ readonly pattern: "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$";
658
+ readonly description: "A random (version 4) UUID URN, generated for this cast and derived from nothing else.";
659
+ };
660
+ readonly type: {
661
+ readonly const: "https://trusttasks.org/spec/voting/ballot/cast/0.1#request";
662
+ };
663
+ readonly issuer: {
664
+ readonly type: "string";
665
+ readonly maxLength: 256;
666
+ readonly pattern: "^did:key:z[1-9A-HJ-NP-Za-km-z]+$";
667
+ readonly description: "The did:key generated for this cast alone (VTI-VOT-003).";
668
+ };
669
+ readonly recipient: {
670
+ readonly type: "string";
671
+ readonly minLength: 1;
672
+ readonly maxLength: 2048;
673
+ readonly description: "The manifest's `ballotBox`.";
674
+ };
675
+ readonly issuedAt: {
676
+ readonly type: "string";
677
+ readonly format: "date-time";
678
+ };
679
+ readonly expiresAt: {
680
+ readonly type: "string";
681
+ readonly format: "date-time";
682
+ readonly description: "When present, the manifest's `votingClosesAt`.";
683
+ };
684
+ readonly payload: {
685
+ readonly type: "object";
686
+ readonly description: "The voting/ballot/cast/0.1 request payload — `community`, `electionId` and the Cast the engine built — and nothing else.";
687
+ };
688
+ readonly proof: {
689
+ readonly type: "object";
690
+ readonly description: "The Data Integrity proof made with the cast's one-time key.";
691
+ };
692
+ };
693
+ };
694
+ readonly Response: {
695
+ readonly $anchor: "response";
696
+ readonly title: "VTA PCS — Vote — response payload";
697
+ readonly type: "object";
698
+ readonly additionalProperties: false;
699
+ readonly required: readonly ["castDocument", "tag"];
700
+ readonly properties: {
701
+ readonly castDocument: {
702
+ readonly $ref: "#/$defs/CastDocument";
703
+ };
704
+ readonly tag: {
705
+ readonly type: "string";
706
+ readonly maxLength: 4096;
707
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
708
+ readonly description: "The cast's tag (the election's nullifier for this ticket), as the cast carries it. The same for every cast this ticket makes in this election.";
709
+ };
710
+ readonly ext: {
711
+ readonly $ref: "#/$defs/Ext";
712
+ };
713
+ };
714
+ };
715
+ readonly Ext: {
716
+ readonly title: "Ext";
717
+ 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.";
718
+ readonly type: "object";
719
+ readonly minProperties: 1;
720
+ readonly additionalProperties: true;
721
+ readonly propertyNames: {
722
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
723
+ };
724
+ };
725
+ readonly Ballot: {
726
+ readonly title: "Ballot";
727
+ 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.";
728
+ readonly type: "object";
729
+ readonly additionalProperties: false;
730
+ readonly required: readonly ["electionId", "manifestDigest", "answers"];
731
+ readonly properties: {
732
+ readonly electionId: {
733
+ readonly $ref: "#/$defs/ElectionId";
734
+ };
735
+ readonly manifestDigest: {
736
+ readonly $ref: "#/$defs/DigestMultibase";
737
+ };
738
+ readonly answers: {
739
+ readonly type: "array";
740
+ readonly minItems: 1;
741
+ readonly maxItems: 128;
742
+ readonly items: {
743
+ readonly $ref: "#/$defs/Answer";
744
+ };
745
+ };
746
+ };
747
+ };
748
+ readonly Answer: {
749
+ readonly title: "Answer";
750
+ 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.";
751
+ readonly type: "object";
752
+ readonly additionalProperties: false;
753
+ readonly required: readonly ["question"];
754
+ readonly minProperties: 2;
755
+ readonly maxProperties: 2;
756
+ readonly properties: {
757
+ readonly question: {
758
+ readonly $ref: "#/$defs/Key";
759
+ };
760
+ readonly choice: {
761
+ readonly type: "array";
762
+ readonly items: {
763
+ readonly $ref: "#/$defs/Key";
764
+ };
765
+ readonly uniqueItems: true;
766
+ };
767
+ readonly ranking: {
768
+ readonly type: "array";
769
+ readonly items: {
770
+ readonly $ref: "#/$defs/Key";
771
+ };
772
+ readonly uniqueItems: true;
773
+ };
774
+ readonly scores: {
775
+ readonly type: "object";
776
+ readonly propertyNames: {
777
+ readonly $ref: "#/$defs/Key";
778
+ };
779
+ readonly additionalProperties: {
780
+ readonly type: "integer";
781
+ };
782
+ };
783
+ readonly text: {
784
+ readonly type: "string";
785
+ readonly maxLength: 4096;
786
+ };
787
+ readonly abstain: {
788
+ readonly const: true;
789
+ };
790
+ };
791
+ };
792
+ readonly Key: {
793
+ readonly title: "Key";
794
+ readonly description: "A question or option key, unique within its manifest or question.";
795
+ readonly type: "string";
796
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
797
+ };
798
+ readonly ElectionId: {
799
+ readonly title: "ElectionId";
800
+ 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.";
801
+ readonly type: "string";
802
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
803
+ };
804
+ readonly DigestMultibase: {
805
+ readonly title: "DigestMultibase";
806
+ 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`.";
807
+ readonly type: "string";
808
+ readonly minLength: 16;
809
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
810
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
811
+ };
812
+ readonly Manifest: {
813
+ readonly title: "Manifest";
814
+ readonly description: "What an election asks and how it is decided (VTI-VOT-010). Its digest (`manifestDigest`) is the SHA-256 multihash of its RFC 8785 (JCS) canonicalization, and every cast is bound to it (VTI-VOT-011).";
815
+ readonly type: "object";
816
+ readonly additionalProperties: false;
817
+ readonly required: readonly ["electionId", "community", "questions", "secrecy", "roll", "registrationOpensAt", "votingOpensAt", "votingClosesAt", "revote", "board", "ballotBox", "binding", "allowEarlyClose", "resultsBeforeClose", "textReleaseThreshold"];
818
+ readonly properties: {
819
+ readonly electionId: {
820
+ readonly $ref: "#/$defs/ElectionId";
821
+ };
822
+ readonly community: {
823
+ readonly type: "string";
824
+ readonly minLength: 1;
825
+ readonly maxLength: 2048;
826
+ readonly description: "The community's DID.";
827
+ };
828
+ readonly title: {
829
+ readonly type: "string";
830
+ readonly maxLength: 512;
831
+ };
832
+ readonly description: {
833
+ readonly type: "string";
834
+ readonly maxLength: 8192;
835
+ };
836
+ readonly questions: {
837
+ readonly type: "array";
838
+ readonly minItems: 1;
839
+ readonly maxItems: 128;
840
+ readonly items: {
841
+ readonly $ref: "#/$defs/Question";
842
+ };
843
+ };
844
+ readonly secrecy: {
845
+ readonly $ref: "#/$defs/SecrecyLevel";
846
+ };
847
+ readonly roll: {
848
+ readonly $ref: "#/$defs/RollRule";
849
+ };
850
+ readonly registrationOpensAt: {
851
+ readonly type: "string";
852
+ readonly format: "date-time";
853
+ };
854
+ readonly votingOpensAt: {
855
+ readonly type: "string";
856
+ readonly format: "date-time";
857
+ };
858
+ readonly votingClosesAt: {
859
+ readonly type: "string";
860
+ readonly format: "date-time";
861
+ };
862
+ readonly revote: {
863
+ readonly $ref: "#/$defs/Revote";
864
+ };
865
+ readonly board: {
866
+ readonly type: "object";
867
+ readonly additionalProperties: false;
868
+ readonly required: readonly ["visibility", "auditors"];
869
+ readonly properties: {
870
+ readonly visibility: {
871
+ readonly $ref: "#/$defs/BoardVisibility";
872
+ };
873
+ readonly auditors: {
874
+ readonly type: "array";
875
+ readonly items: {
876
+ readonly type: "string";
877
+ readonly minLength: 1;
878
+ readonly maxLength: 2048;
879
+ };
880
+ readonly uniqueItems: true;
881
+ };
882
+ };
883
+ };
884
+ readonly ballotBox: {
885
+ readonly type: "string";
886
+ readonly minLength: 1;
887
+ readonly maxLength: 2048;
888
+ readonly description: "The DID of the voting service that holds the board.";
889
+ };
890
+ readonly trustees: {
891
+ readonly $ref: "#/$defs/Trustees";
892
+ };
893
+ readonly binding: {
894
+ readonly type: "boolean";
895
+ readonly description: "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081).";
896
+ };
897
+ readonly allowEarlyClose: {
898
+ readonly type: "boolean";
899
+ };
900
+ readonly resultsBeforeClose: {
901
+ readonly type: "boolean";
902
+ readonly description: "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061).";
903
+ };
904
+ readonly textReleaseThreshold: {
905
+ readonly type: "integer";
906
+ readonly minimum: 1;
907
+ readonly description: "Counted ballots required before any text answer is disclosed (VTI-VOT-065). At least 1, and SHOULD be at least 10: a written answer can identify its author by what it says or how it is phrased, and the fewer the ballots released together, the easier that is. Where it is below 10, the disclosure a member is shown before they request a ticket MUST say so, and MUST say that a written answer may identify its author (VTI-VOT-090).";
908
+ };
909
+ };
910
+ };
911
+ readonly Trustees: {
912
+ readonly title: "Trustees";
913
+ readonly description: "The trustees of a sealed or tallied-encrypted election and the number of them decryption needs (VTI-VOT-062). Neither the community nor the ballot box may be one.";
914
+ readonly type: "object";
915
+ readonly additionalProperties: false;
916
+ readonly required: readonly ["dids", "threshold"];
917
+ readonly properties: {
918
+ readonly dids: {
919
+ readonly type: "array";
920
+ readonly minItems: 2;
921
+ readonly items: {
922
+ readonly type: "string";
923
+ readonly minLength: 1;
924
+ readonly maxLength: 2048;
925
+ };
926
+ readonly uniqueItems: true;
927
+ };
928
+ readonly threshold: {
929
+ readonly type: "integer";
930
+ readonly minimum: 2;
931
+ };
932
+ };
933
+ };
934
+ readonly BoardVisibility: {
935
+ readonly title: "BoardVisibility";
936
+ readonly description: "`public`: anyone reads the board. `private`: the community, the auditors the manifest names and, for one cast's inclusion, the holder of its receipt (VTI-VOT-052).";
937
+ readonly type: "string";
938
+ readonly enum: readonly ["public", "private"];
939
+ };
940
+ readonly Revote: {
941
+ readonly title: "Revote";
942
+ readonly description: "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).";
943
+ readonly type: "string";
944
+ readonly enum: readonly ["replace", "refuse"];
945
+ };
946
+ readonly RollRule: {
947
+ readonly title: "RollRule";
948
+ readonly description: "Who may be issued a ticket (VTI-VOT-021): the community's active members, its active members and the parties `listed` names, or only the parties `listed` names.";
949
+ readonly type: "object";
950
+ readonly additionalProperties: false;
951
+ readonly required: readonly ["rule"];
952
+ readonly properties: {
953
+ readonly rule: {
954
+ readonly type: "string";
955
+ readonly enum: readonly ["members", "membersAndListed", "listed"];
956
+ };
957
+ readonly listed: {
958
+ readonly type: "array";
959
+ readonly items: {
960
+ readonly type: "string";
961
+ readonly minLength: 1;
962
+ readonly maxLength: 2048;
963
+ readonly description: "A DID enfranchised by name.";
964
+ };
965
+ readonly uniqueItems: true;
966
+ };
967
+ };
968
+ };
969
+ readonly SecrecyLevel: {
970
+ readonly title: "SecrecyLevel";
971
+ readonly description: "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060). The encrypted levels are cast with `voting/ballot/cast-encrypted/0.1`, under an election key the trustees generate with `voting/trustees/*` (CONVENTIONS §9).";
972
+ readonly type: "string";
973
+ readonly enum: readonly ["open", "sealed", "talliedEncrypted"];
974
+ };
975
+ readonly Question: {
976
+ readonly title: "Question";
977
+ readonly description: "One question. Tagged union over `type`.";
978
+ readonly oneOf: readonly [{
979
+ readonly title: "ChoiceQuestion";
980
+ readonly description: "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.";
981
+ readonly type: "object";
982
+ readonly additionalProperties: false;
983
+ readonly required: readonly ["key", "type", "options", "minSelections", "maxSelections", "optional"];
984
+ readonly properties: {
985
+ readonly key: {
986
+ readonly $ref: "#/$defs/Key";
987
+ };
988
+ readonly type: {
989
+ readonly const: "choice";
990
+ };
991
+ readonly text: {
992
+ readonly type: "string";
993
+ readonly maxLength: 2048;
994
+ };
995
+ readonly options: {
996
+ readonly type: "array";
997
+ readonly minItems: 2;
998
+ readonly maxItems: 256;
999
+ readonly items: {
1000
+ readonly $ref: "#/$defs/QuestionOption";
1001
+ };
1002
+ };
1003
+ readonly minSelections: {
1004
+ readonly type: "integer";
1005
+ readonly minimum: 0;
1006
+ };
1007
+ readonly maxSelections: {
1008
+ readonly type: "integer";
1009
+ readonly minimum: 1;
1010
+ };
1011
+ readonly optional: {
1012
+ readonly type: "boolean";
1013
+ };
1014
+ };
1015
+ }, {
1016
+ readonly title: "RankingQuestion";
1017
+ readonly description: "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.";
1018
+ readonly type: "object";
1019
+ readonly additionalProperties: false;
1020
+ readonly required: readonly ["key", "type", "options", "partial", "optional"];
1021
+ readonly properties: {
1022
+ readonly key: {
1023
+ readonly $ref: "#/$defs/Key";
1024
+ };
1025
+ readonly type: {
1026
+ readonly const: "ranking";
1027
+ };
1028
+ readonly text: {
1029
+ readonly type: "string";
1030
+ readonly maxLength: 2048;
1031
+ };
1032
+ readonly options: {
1033
+ readonly type: "array";
1034
+ readonly minItems: 2;
1035
+ readonly maxItems: 64;
1036
+ readonly items: {
1037
+ readonly $ref: "#/$defs/QuestionOption";
1038
+ };
1039
+ };
1040
+ readonly partial: {
1041
+ readonly type: "boolean";
1042
+ };
1043
+ readonly optional: {
1044
+ readonly type: "boolean";
1045
+ };
1046
+ };
1047
+ }, {
1048
+ readonly title: "ScoreQuestion";
1049
+ readonly description: "Give each option an integer score within [min, max].";
1050
+ readonly type: "object";
1051
+ readonly additionalProperties: false;
1052
+ readonly required: readonly ["key", "type", "options", "min", "max", "optional"];
1053
+ readonly properties: {
1054
+ readonly key: {
1055
+ readonly $ref: "#/$defs/Key";
1056
+ };
1057
+ readonly type: {
1058
+ readonly const: "score";
1059
+ };
1060
+ readonly text: {
1061
+ readonly type: "string";
1062
+ readonly maxLength: 2048;
1063
+ };
1064
+ readonly options: {
1065
+ readonly type: "array";
1066
+ readonly minItems: 1;
1067
+ readonly maxItems: 256;
1068
+ readonly items: {
1069
+ readonly $ref: "#/$defs/QuestionOption";
1070
+ };
1071
+ };
1072
+ readonly min: {
1073
+ readonly type: "integer";
1074
+ };
1075
+ readonly max: {
1076
+ readonly type: "integer";
1077
+ };
1078
+ readonly optional: {
1079
+ readonly type: "boolean";
1080
+ };
1081
+ };
1082
+ }, {
1083
+ readonly title: "TextQuestion";
1084
+ readonly description: "Free text of at most `maxLength` characters.";
1085
+ readonly type: "object";
1086
+ readonly additionalProperties: false;
1087
+ readonly required: readonly ["key", "type", "maxLength", "optional"];
1088
+ readonly properties: {
1089
+ readonly key: {
1090
+ readonly $ref: "#/$defs/Key";
1091
+ };
1092
+ readonly type: {
1093
+ readonly const: "text";
1094
+ };
1095
+ readonly text: {
1096
+ readonly type: "string";
1097
+ readonly maxLength: 2048;
1098
+ };
1099
+ readonly maxLength: {
1100
+ readonly type: "integer";
1101
+ readonly minimum: 1;
1102
+ readonly maximum: 4096;
1103
+ };
1104
+ readonly optional: {
1105
+ readonly type: "boolean";
1106
+ };
1107
+ };
1108
+ }];
1109
+ };
1110
+ readonly QuestionOption: {
1111
+ readonly title: "QuestionOption";
1112
+ readonly type: "object";
1113
+ readonly additionalProperties: false;
1114
+ readonly required: readonly ["key"];
1115
+ readonly properties: {
1116
+ readonly key: {
1117
+ readonly $ref: "#/$defs/Key";
1118
+ };
1119
+ readonly label: {
1120
+ readonly type: "string";
1121
+ readonly maxLength: 512;
1122
+ readonly description: "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014).";
1123
+ };
1124
+ };
1125
+ };
1126
+ readonly VotingParameters: {
1127
+ readonly title: "VotingParameters";
1128
+ readonly description: "The community's published voting parameters: the PCS suite and the voting verification key tickets are issued under (VTI-VOT-020). Distinct from its hidden-vetting helper key.";
1129
+ readonly type: "object";
1130
+ readonly additionalProperties: false;
1131
+ readonly required: readonly ["suite", "votingKey"];
1132
+ readonly properties: {
1133
+ readonly suite: {
1134
+ readonly type: "string";
1135
+ readonly const: "ps-ddh-bls12381";
1136
+ };
1137
+ readonly votingKey: {
1138
+ readonly $ref: "#/$defs/Multibase";
1139
+ };
1140
+ };
1141
+ };
1142
+ readonly Multibase: {
1143
+ readonly title: "Multibase";
1144
+ readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
1145
+ readonly type: "string";
1146
+ readonly maxLength: 16384;
1147
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
1148
+ };
1149
+ };
1150
+ };
1151
+ /**
1152
+ * SPEC.md §7.2 policy for the request variant, from this specification's
1153
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
1154
+ * per-specification and cannot be derived from the document alone, and
1155
+ * item 2 needs the schema this carries.
1156
+ */
1157
+ export declare const SPEC: {
1158
+ readonly typeUri: "https://trusttasks.org/spec/vta/pcs/vote/0.3";
1159
+ readonly isBearer: false;
1160
+ readonly isProofRequired: true;
1161
+ readonly isRecipientRequired: true;
1162
+ readonly isIssuedAtRequired: true;
1163
+ readonly payloadSchema: {
1164
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
1165
+ readonly $id: "https://trusttasks.org/spec/vta/pcs/vote/0.3";
1166
+ readonly title: "VTA PCS — Vote — payload";
1167
+ readonly description: "A voter's client hands its VTA a ballot; the VTA checks it against the election's manifest, makes the ticket's attestation over it, and returns the complete voting/ballot/cast document, signed by a did:key used for this cast alone, for the client to send.";
1168
+ readonly type: "object";
1169
+ readonly additionalProperties: false;
1170
+ readonly required: readonly ["contextId", "community", "parameters", "manifest", "ballot"];
1171
+ readonly properties: {
1172
+ readonly contextId: {
1173
+ readonly type: "string";
1174
+ readonly minLength: 1;
1175
+ readonly maxLength: 256;
1176
+ readonly description: "The context the voter belongs to.";
1177
+ };
1178
+ readonly community: {
1179
+ readonly type: "string";
1180
+ readonly minLength: 1;
1181
+ readonly maxLength: 2048;
1182
+ readonly description: "The community's DID. MUST equal the manifest's `community`.";
1183
+ };
1184
+ readonly parameters: {
1185
+ readonly $ref: "#/$defs/VotingParameters";
1186
+ readonly description: "The community's published voting parameters. Its `votingKey` MUST be the one the ticket was issued under.";
1187
+ };
1188
+ readonly manifest: {
1189
+ readonly $ref: "#/$defs/Manifest";
1190
+ readonly description: "The election's manifest, exactly as registered. The engine recomputes its digest and checks it against the one it recorded at voter/register.";
1191
+ };
1192
+ readonly ballot: {
1193
+ readonly $ref: "#/$defs/Ballot";
1194
+ readonly description: "The voter's ballot. The cast binds its RFC 8785 (JCS) canonicalization.";
1195
+ };
1196
+ readonly ext: {
1197
+ readonly $ref: "#/$defs/Ext";
1198
+ };
1199
+ };
1200
+ readonly $defs: {
1201
+ readonly CastDocument: {
1202
+ readonly title: "CastDocument";
1203
+ readonly description: "A complete, signed voting/ballot/cast/0.1 request document, ready to send to the ballot box. Its payload is validated by that specification's schema; the members fixed here are the ones this task guarantees.";
1204
+ readonly type: "object";
1205
+ readonly required: readonly ["id", "type", "issuer", "recipient", "issuedAt", "payload", "proof"];
1206
+ readonly properties: {
1207
+ readonly id: {
1208
+ readonly type: "string";
1209
+ readonly pattern: "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$";
1210
+ readonly description: "A random (version 4) UUID URN, generated for this cast and derived from nothing else.";
1211
+ };
1212
+ readonly type: {
1213
+ readonly const: "https://trusttasks.org/spec/voting/ballot/cast/0.1#request";
1214
+ };
1215
+ readonly issuer: {
1216
+ readonly type: "string";
1217
+ readonly maxLength: 256;
1218
+ readonly pattern: "^did:key:z[1-9A-HJ-NP-Za-km-z]+$";
1219
+ readonly description: "The did:key generated for this cast alone (VTI-VOT-003).";
1220
+ };
1221
+ readonly recipient: {
1222
+ readonly type: "string";
1223
+ readonly minLength: 1;
1224
+ readonly maxLength: 2048;
1225
+ readonly description: "The manifest's `ballotBox`.";
1226
+ };
1227
+ readonly issuedAt: {
1228
+ readonly type: "string";
1229
+ readonly format: "date-time";
1230
+ };
1231
+ readonly expiresAt: {
1232
+ readonly type: "string";
1233
+ readonly format: "date-time";
1234
+ readonly description: "When present, the manifest's `votingClosesAt`.";
1235
+ };
1236
+ readonly payload: {
1237
+ readonly type: "object";
1238
+ readonly description: "The voting/ballot/cast/0.1 request payload — `community`, `electionId` and the Cast the engine built — and nothing else.";
1239
+ };
1240
+ readonly proof: {
1241
+ readonly type: "object";
1242
+ readonly description: "The Data Integrity proof made with the cast's one-time key.";
1243
+ };
1244
+ };
1245
+ };
1246
+ readonly Response: {
1247
+ readonly $anchor: "response";
1248
+ readonly title: "VTA PCS — Vote — response payload";
1249
+ readonly type: "object";
1250
+ readonly additionalProperties: false;
1251
+ readonly required: readonly ["castDocument", "tag"];
1252
+ readonly properties: {
1253
+ readonly castDocument: {
1254
+ readonly $ref: "#/$defs/CastDocument";
1255
+ };
1256
+ readonly tag: {
1257
+ readonly type: "string";
1258
+ readonly maxLength: 4096;
1259
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
1260
+ readonly description: "The cast's tag (the election's nullifier for this ticket), as the cast carries it. The same for every cast this ticket makes in this election.";
1261
+ };
1262
+ readonly ext: {
1263
+ readonly $ref: "#/$defs/Ext";
1264
+ };
1265
+ };
1266
+ };
1267
+ readonly Ext: {
1268
+ readonly title: "Ext";
1269
+ 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.";
1270
+ readonly type: "object";
1271
+ readonly minProperties: 1;
1272
+ readonly additionalProperties: true;
1273
+ readonly propertyNames: {
1274
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
1275
+ };
1276
+ };
1277
+ readonly Ballot: {
1278
+ readonly title: "Ballot";
1279
+ 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.";
1280
+ readonly type: "object";
1281
+ readonly additionalProperties: false;
1282
+ readonly required: readonly ["electionId", "manifestDigest", "answers"];
1283
+ readonly properties: {
1284
+ readonly electionId: {
1285
+ readonly $ref: "#/$defs/ElectionId";
1286
+ };
1287
+ readonly manifestDigest: {
1288
+ readonly $ref: "#/$defs/DigestMultibase";
1289
+ };
1290
+ readonly answers: {
1291
+ readonly type: "array";
1292
+ readonly minItems: 1;
1293
+ readonly maxItems: 128;
1294
+ readonly items: {
1295
+ readonly $ref: "#/$defs/Answer";
1296
+ };
1297
+ };
1298
+ };
1299
+ };
1300
+ readonly Answer: {
1301
+ readonly title: "Answer";
1302
+ 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.";
1303
+ readonly type: "object";
1304
+ readonly additionalProperties: false;
1305
+ readonly required: readonly ["question"];
1306
+ readonly minProperties: 2;
1307
+ readonly maxProperties: 2;
1308
+ readonly properties: {
1309
+ readonly question: {
1310
+ readonly $ref: "#/$defs/Key";
1311
+ };
1312
+ readonly choice: {
1313
+ readonly type: "array";
1314
+ readonly items: {
1315
+ readonly $ref: "#/$defs/Key";
1316
+ };
1317
+ readonly uniqueItems: true;
1318
+ };
1319
+ readonly ranking: {
1320
+ readonly type: "array";
1321
+ readonly items: {
1322
+ readonly $ref: "#/$defs/Key";
1323
+ };
1324
+ readonly uniqueItems: true;
1325
+ };
1326
+ readonly scores: {
1327
+ readonly type: "object";
1328
+ readonly propertyNames: {
1329
+ readonly $ref: "#/$defs/Key";
1330
+ };
1331
+ readonly additionalProperties: {
1332
+ readonly type: "integer";
1333
+ };
1334
+ };
1335
+ readonly text: {
1336
+ readonly type: "string";
1337
+ readonly maxLength: 4096;
1338
+ };
1339
+ readonly abstain: {
1340
+ readonly const: true;
1341
+ };
1342
+ };
1343
+ };
1344
+ readonly Key: {
1345
+ readonly title: "Key";
1346
+ readonly description: "A question or option key, unique within its manifest or question.";
1347
+ readonly type: "string";
1348
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
1349
+ };
1350
+ readonly ElectionId: {
1351
+ readonly title: "ElectionId";
1352
+ 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.";
1353
+ readonly type: "string";
1354
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
1355
+ };
1356
+ readonly DigestMultibase: {
1357
+ readonly title: "DigestMultibase";
1358
+ 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`.";
1359
+ readonly type: "string";
1360
+ readonly minLength: 16;
1361
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
1362
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
1363
+ };
1364
+ readonly Manifest: {
1365
+ readonly title: "Manifest";
1366
+ readonly description: "What an election asks and how it is decided (VTI-VOT-010). Its digest (`manifestDigest`) is the SHA-256 multihash of its RFC 8785 (JCS) canonicalization, and every cast is bound to it (VTI-VOT-011).";
1367
+ readonly type: "object";
1368
+ readonly additionalProperties: false;
1369
+ readonly required: readonly ["electionId", "community", "questions", "secrecy", "roll", "registrationOpensAt", "votingOpensAt", "votingClosesAt", "revote", "board", "ballotBox", "binding", "allowEarlyClose", "resultsBeforeClose", "textReleaseThreshold"];
1370
+ readonly properties: {
1371
+ readonly electionId: {
1372
+ readonly $ref: "#/$defs/ElectionId";
1373
+ };
1374
+ readonly community: {
1375
+ readonly type: "string";
1376
+ readonly minLength: 1;
1377
+ readonly maxLength: 2048;
1378
+ readonly description: "The community's DID.";
1379
+ };
1380
+ readonly title: {
1381
+ readonly type: "string";
1382
+ readonly maxLength: 512;
1383
+ };
1384
+ readonly description: {
1385
+ readonly type: "string";
1386
+ readonly maxLength: 8192;
1387
+ };
1388
+ readonly questions: {
1389
+ readonly type: "array";
1390
+ readonly minItems: 1;
1391
+ readonly maxItems: 128;
1392
+ readonly items: {
1393
+ readonly $ref: "#/$defs/Question";
1394
+ };
1395
+ };
1396
+ readonly secrecy: {
1397
+ readonly $ref: "#/$defs/SecrecyLevel";
1398
+ };
1399
+ readonly roll: {
1400
+ readonly $ref: "#/$defs/RollRule";
1401
+ };
1402
+ readonly registrationOpensAt: {
1403
+ readonly type: "string";
1404
+ readonly format: "date-time";
1405
+ };
1406
+ readonly votingOpensAt: {
1407
+ readonly type: "string";
1408
+ readonly format: "date-time";
1409
+ };
1410
+ readonly votingClosesAt: {
1411
+ readonly type: "string";
1412
+ readonly format: "date-time";
1413
+ };
1414
+ readonly revote: {
1415
+ readonly $ref: "#/$defs/Revote";
1416
+ };
1417
+ readonly board: {
1418
+ readonly type: "object";
1419
+ readonly additionalProperties: false;
1420
+ readonly required: readonly ["visibility", "auditors"];
1421
+ readonly properties: {
1422
+ readonly visibility: {
1423
+ readonly $ref: "#/$defs/BoardVisibility";
1424
+ };
1425
+ readonly auditors: {
1426
+ readonly type: "array";
1427
+ readonly items: {
1428
+ readonly type: "string";
1429
+ readonly minLength: 1;
1430
+ readonly maxLength: 2048;
1431
+ };
1432
+ readonly uniqueItems: true;
1433
+ };
1434
+ };
1435
+ };
1436
+ readonly ballotBox: {
1437
+ readonly type: "string";
1438
+ readonly minLength: 1;
1439
+ readonly maxLength: 2048;
1440
+ readonly description: "The DID of the voting service that holds the board.";
1441
+ };
1442
+ readonly trustees: {
1443
+ readonly $ref: "#/$defs/Trustees";
1444
+ };
1445
+ readonly binding: {
1446
+ readonly type: "boolean";
1447
+ readonly description: "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081).";
1448
+ };
1449
+ readonly allowEarlyClose: {
1450
+ readonly type: "boolean";
1451
+ };
1452
+ readonly resultsBeforeClose: {
1453
+ readonly type: "boolean";
1454
+ readonly description: "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061).";
1455
+ };
1456
+ readonly textReleaseThreshold: {
1457
+ readonly type: "integer";
1458
+ readonly minimum: 1;
1459
+ readonly description: "Counted ballots required before any text answer is disclosed (VTI-VOT-065). At least 1, and SHOULD be at least 10: a written answer can identify its author by what it says or how it is phrased, and the fewer the ballots released together, the easier that is. Where it is below 10, the disclosure a member is shown before they request a ticket MUST say so, and MUST say that a written answer may identify its author (VTI-VOT-090).";
1460
+ };
1461
+ };
1462
+ };
1463
+ readonly Trustees: {
1464
+ readonly title: "Trustees";
1465
+ readonly description: "The trustees of a sealed or tallied-encrypted election and the number of them decryption needs (VTI-VOT-062). Neither the community nor the ballot box may be one.";
1466
+ readonly type: "object";
1467
+ readonly additionalProperties: false;
1468
+ readonly required: readonly ["dids", "threshold"];
1469
+ readonly properties: {
1470
+ readonly dids: {
1471
+ readonly type: "array";
1472
+ readonly minItems: 2;
1473
+ readonly items: {
1474
+ readonly type: "string";
1475
+ readonly minLength: 1;
1476
+ readonly maxLength: 2048;
1477
+ };
1478
+ readonly uniqueItems: true;
1479
+ };
1480
+ readonly threshold: {
1481
+ readonly type: "integer";
1482
+ readonly minimum: 2;
1483
+ };
1484
+ };
1485
+ };
1486
+ readonly BoardVisibility: {
1487
+ readonly title: "BoardVisibility";
1488
+ readonly description: "`public`: anyone reads the board. `private`: the community, the auditors the manifest names and, for one cast's inclusion, the holder of its receipt (VTI-VOT-052).";
1489
+ readonly type: "string";
1490
+ readonly enum: readonly ["public", "private"];
1491
+ };
1492
+ readonly Revote: {
1493
+ readonly title: "Revote";
1494
+ readonly description: "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).";
1495
+ readonly type: "string";
1496
+ readonly enum: readonly ["replace", "refuse"];
1497
+ };
1498
+ readonly RollRule: {
1499
+ readonly title: "RollRule";
1500
+ readonly description: "Who may be issued a ticket (VTI-VOT-021): the community's active members, its active members and the parties `listed` names, or only the parties `listed` names.";
1501
+ readonly type: "object";
1502
+ readonly additionalProperties: false;
1503
+ readonly required: readonly ["rule"];
1504
+ readonly properties: {
1505
+ readonly rule: {
1506
+ readonly type: "string";
1507
+ readonly enum: readonly ["members", "membersAndListed", "listed"];
1508
+ };
1509
+ readonly listed: {
1510
+ readonly type: "array";
1511
+ readonly items: {
1512
+ readonly type: "string";
1513
+ readonly minLength: 1;
1514
+ readonly maxLength: 2048;
1515
+ readonly description: "A DID enfranchised by name.";
1516
+ };
1517
+ readonly uniqueItems: true;
1518
+ };
1519
+ };
1520
+ };
1521
+ readonly SecrecyLevel: {
1522
+ readonly title: "SecrecyLevel";
1523
+ readonly description: "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060). The encrypted levels are cast with `voting/ballot/cast-encrypted/0.1`, under an election key the trustees generate with `voting/trustees/*` (CONVENTIONS §9).";
1524
+ readonly type: "string";
1525
+ readonly enum: readonly ["open", "sealed", "talliedEncrypted"];
1526
+ };
1527
+ readonly Question: {
1528
+ readonly title: "Question";
1529
+ readonly description: "One question. Tagged union over `type`.";
1530
+ readonly oneOf: readonly [{
1531
+ readonly title: "ChoiceQuestion";
1532
+ readonly description: "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.";
1533
+ readonly type: "object";
1534
+ readonly additionalProperties: false;
1535
+ readonly required: readonly ["key", "type", "options", "minSelections", "maxSelections", "optional"];
1536
+ readonly properties: {
1537
+ readonly key: {
1538
+ readonly $ref: "#/$defs/Key";
1539
+ };
1540
+ readonly type: {
1541
+ readonly const: "choice";
1542
+ };
1543
+ readonly text: {
1544
+ readonly type: "string";
1545
+ readonly maxLength: 2048;
1546
+ };
1547
+ readonly options: {
1548
+ readonly type: "array";
1549
+ readonly minItems: 2;
1550
+ readonly maxItems: 256;
1551
+ readonly items: {
1552
+ readonly $ref: "#/$defs/QuestionOption";
1553
+ };
1554
+ };
1555
+ readonly minSelections: {
1556
+ readonly type: "integer";
1557
+ readonly minimum: 0;
1558
+ };
1559
+ readonly maxSelections: {
1560
+ readonly type: "integer";
1561
+ readonly minimum: 1;
1562
+ };
1563
+ readonly optional: {
1564
+ readonly type: "boolean";
1565
+ };
1566
+ };
1567
+ }, {
1568
+ readonly title: "RankingQuestion";
1569
+ readonly description: "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.";
1570
+ readonly type: "object";
1571
+ readonly additionalProperties: false;
1572
+ readonly required: readonly ["key", "type", "options", "partial", "optional"];
1573
+ readonly properties: {
1574
+ readonly key: {
1575
+ readonly $ref: "#/$defs/Key";
1576
+ };
1577
+ readonly type: {
1578
+ readonly const: "ranking";
1579
+ };
1580
+ readonly text: {
1581
+ readonly type: "string";
1582
+ readonly maxLength: 2048;
1583
+ };
1584
+ readonly options: {
1585
+ readonly type: "array";
1586
+ readonly minItems: 2;
1587
+ readonly maxItems: 64;
1588
+ readonly items: {
1589
+ readonly $ref: "#/$defs/QuestionOption";
1590
+ };
1591
+ };
1592
+ readonly partial: {
1593
+ readonly type: "boolean";
1594
+ };
1595
+ readonly optional: {
1596
+ readonly type: "boolean";
1597
+ };
1598
+ };
1599
+ }, {
1600
+ readonly title: "ScoreQuestion";
1601
+ readonly description: "Give each option an integer score within [min, max].";
1602
+ readonly type: "object";
1603
+ readonly additionalProperties: false;
1604
+ readonly required: readonly ["key", "type", "options", "min", "max", "optional"];
1605
+ readonly properties: {
1606
+ readonly key: {
1607
+ readonly $ref: "#/$defs/Key";
1608
+ };
1609
+ readonly type: {
1610
+ readonly const: "score";
1611
+ };
1612
+ readonly text: {
1613
+ readonly type: "string";
1614
+ readonly maxLength: 2048;
1615
+ };
1616
+ readonly options: {
1617
+ readonly type: "array";
1618
+ readonly minItems: 1;
1619
+ readonly maxItems: 256;
1620
+ readonly items: {
1621
+ readonly $ref: "#/$defs/QuestionOption";
1622
+ };
1623
+ };
1624
+ readonly min: {
1625
+ readonly type: "integer";
1626
+ };
1627
+ readonly max: {
1628
+ readonly type: "integer";
1629
+ };
1630
+ readonly optional: {
1631
+ readonly type: "boolean";
1632
+ };
1633
+ };
1634
+ }, {
1635
+ readonly title: "TextQuestion";
1636
+ readonly description: "Free text of at most `maxLength` characters.";
1637
+ readonly type: "object";
1638
+ readonly additionalProperties: false;
1639
+ readonly required: readonly ["key", "type", "maxLength", "optional"];
1640
+ readonly properties: {
1641
+ readonly key: {
1642
+ readonly $ref: "#/$defs/Key";
1643
+ };
1644
+ readonly type: {
1645
+ readonly const: "text";
1646
+ };
1647
+ readonly text: {
1648
+ readonly type: "string";
1649
+ readonly maxLength: 2048;
1650
+ };
1651
+ readonly maxLength: {
1652
+ readonly type: "integer";
1653
+ readonly minimum: 1;
1654
+ readonly maximum: 4096;
1655
+ };
1656
+ readonly optional: {
1657
+ readonly type: "boolean";
1658
+ };
1659
+ };
1660
+ }];
1661
+ };
1662
+ readonly QuestionOption: {
1663
+ readonly title: "QuestionOption";
1664
+ readonly type: "object";
1665
+ readonly additionalProperties: false;
1666
+ readonly required: readonly ["key"];
1667
+ readonly properties: {
1668
+ readonly key: {
1669
+ readonly $ref: "#/$defs/Key";
1670
+ };
1671
+ readonly label: {
1672
+ readonly type: "string";
1673
+ readonly maxLength: 512;
1674
+ readonly description: "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014).";
1675
+ };
1676
+ };
1677
+ };
1678
+ readonly VotingParameters: {
1679
+ readonly title: "VotingParameters";
1680
+ readonly description: "The community's published voting parameters: the PCS suite and the voting verification key tickets are issued under (VTI-VOT-020). Distinct from its hidden-vetting helper key.";
1681
+ readonly type: "object";
1682
+ readonly additionalProperties: false;
1683
+ readonly required: readonly ["suite", "votingKey"];
1684
+ readonly properties: {
1685
+ readonly suite: {
1686
+ readonly type: "string";
1687
+ readonly const: "ps-ddh-bls12381";
1688
+ };
1689
+ readonly votingKey: {
1690
+ readonly $ref: "#/$defs/Multibase";
1691
+ };
1692
+ };
1693
+ };
1694
+ readonly Multibase: {
1695
+ readonly title: "Multibase";
1696
+ readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
1697
+ readonly type: "string";
1698
+ readonly maxLength: 16384;
1699
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
1700
+ };
1701
+ };
1702
+ };
1703
+ };
1704
+ /**
1705
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
1706
+ * tracks the *issuer* party's requirement because a response swaps the
1707
+ * parties (§7.3 item 5).
1708
+ */
1709
+ export declare const RESPONSE_SPEC: {
1710
+ readonly typeUri: "https://trusttasks.org/spec/vta/pcs/vote/0.3#response";
1711
+ readonly isBearer: false;
1712
+ readonly isProofRequired: false;
1713
+ readonly isRecipientRequired: true;
1714
+ readonly isIssuedAtRequired: true;
1715
+ readonly payloadSchema: {
1716
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
1717
+ readonly $ref: "#/$defs/Response";
1718
+ readonly $defs: {
1719
+ readonly CastDocument: {
1720
+ readonly title: "CastDocument";
1721
+ readonly description: "A complete, signed voting/ballot/cast/0.1 request document, ready to send to the ballot box. Its payload is validated by that specification's schema; the members fixed here are the ones this task guarantees.";
1722
+ readonly type: "object";
1723
+ readonly required: readonly ["id", "type", "issuer", "recipient", "issuedAt", "payload", "proof"];
1724
+ readonly properties: {
1725
+ readonly id: {
1726
+ readonly type: "string";
1727
+ readonly pattern: "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$";
1728
+ readonly description: "A random (version 4) UUID URN, generated for this cast and derived from nothing else.";
1729
+ };
1730
+ readonly type: {
1731
+ readonly const: "https://trusttasks.org/spec/voting/ballot/cast/0.1#request";
1732
+ };
1733
+ readonly issuer: {
1734
+ readonly type: "string";
1735
+ readonly maxLength: 256;
1736
+ readonly pattern: "^did:key:z[1-9A-HJ-NP-Za-km-z]+$";
1737
+ readonly description: "The did:key generated for this cast alone (VTI-VOT-003).";
1738
+ };
1739
+ readonly recipient: {
1740
+ readonly type: "string";
1741
+ readonly minLength: 1;
1742
+ readonly maxLength: 2048;
1743
+ readonly description: "The manifest's `ballotBox`.";
1744
+ };
1745
+ readonly issuedAt: {
1746
+ readonly type: "string";
1747
+ readonly format: "date-time";
1748
+ };
1749
+ readonly expiresAt: {
1750
+ readonly type: "string";
1751
+ readonly format: "date-time";
1752
+ readonly description: "When present, the manifest's `votingClosesAt`.";
1753
+ };
1754
+ readonly payload: {
1755
+ readonly type: "object";
1756
+ readonly description: "The voting/ballot/cast/0.1 request payload — `community`, `electionId` and the Cast the engine built — and nothing else.";
1757
+ };
1758
+ readonly proof: {
1759
+ readonly type: "object";
1760
+ readonly description: "The Data Integrity proof made with the cast's one-time key.";
1761
+ };
1762
+ };
1763
+ };
1764
+ readonly Response: {
1765
+ readonly $anchor: "response";
1766
+ readonly title: "VTA PCS — Vote — response payload";
1767
+ readonly type: "object";
1768
+ readonly additionalProperties: false;
1769
+ readonly required: readonly ["castDocument", "tag"];
1770
+ readonly properties: {
1771
+ readonly castDocument: {
1772
+ readonly $ref: "#/$defs/CastDocument";
1773
+ };
1774
+ readonly tag: {
1775
+ readonly type: "string";
1776
+ readonly maxLength: 4096;
1777
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
1778
+ readonly description: "The cast's tag (the election's nullifier for this ticket), as the cast carries it. The same for every cast this ticket makes in this election.";
1779
+ };
1780
+ readonly ext: {
1781
+ readonly $ref: "#/$defs/Ext";
1782
+ };
1783
+ };
1784
+ };
1785
+ readonly Ext: {
1786
+ readonly title: "Ext";
1787
+ 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.";
1788
+ readonly type: "object";
1789
+ readonly minProperties: 1;
1790
+ readonly additionalProperties: true;
1791
+ readonly propertyNames: {
1792
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
1793
+ };
1794
+ };
1795
+ readonly Ballot: {
1796
+ readonly title: "Ballot";
1797
+ 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.";
1798
+ readonly type: "object";
1799
+ readonly additionalProperties: false;
1800
+ readonly required: readonly ["electionId", "manifestDigest", "answers"];
1801
+ readonly properties: {
1802
+ readonly electionId: {
1803
+ readonly $ref: "#/$defs/ElectionId";
1804
+ };
1805
+ readonly manifestDigest: {
1806
+ readonly $ref: "#/$defs/DigestMultibase";
1807
+ };
1808
+ readonly answers: {
1809
+ readonly type: "array";
1810
+ readonly minItems: 1;
1811
+ readonly maxItems: 128;
1812
+ readonly items: {
1813
+ readonly $ref: "#/$defs/Answer";
1814
+ };
1815
+ };
1816
+ };
1817
+ };
1818
+ readonly Answer: {
1819
+ readonly title: "Answer";
1820
+ 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.";
1821
+ readonly type: "object";
1822
+ readonly additionalProperties: false;
1823
+ readonly required: readonly ["question"];
1824
+ readonly minProperties: 2;
1825
+ readonly maxProperties: 2;
1826
+ readonly properties: {
1827
+ readonly question: {
1828
+ readonly $ref: "#/$defs/Key";
1829
+ };
1830
+ readonly choice: {
1831
+ readonly type: "array";
1832
+ readonly items: {
1833
+ readonly $ref: "#/$defs/Key";
1834
+ };
1835
+ readonly uniqueItems: true;
1836
+ };
1837
+ readonly ranking: {
1838
+ readonly type: "array";
1839
+ readonly items: {
1840
+ readonly $ref: "#/$defs/Key";
1841
+ };
1842
+ readonly uniqueItems: true;
1843
+ };
1844
+ readonly scores: {
1845
+ readonly type: "object";
1846
+ readonly propertyNames: {
1847
+ readonly $ref: "#/$defs/Key";
1848
+ };
1849
+ readonly additionalProperties: {
1850
+ readonly type: "integer";
1851
+ };
1852
+ };
1853
+ readonly text: {
1854
+ readonly type: "string";
1855
+ readonly maxLength: 4096;
1856
+ };
1857
+ readonly abstain: {
1858
+ readonly const: true;
1859
+ };
1860
+ };
1861
+ };
1862
+ readonly Key: {
1863
+ readonly title: "Key";
1864
+ readonly description: "A question or option key, unique within its manifest or question.";
1865
+ readonly type: "string";
1866
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
1867
+ };
1868
+ readonly ElectionId: {
1869
+ readonly title: "ElectionId";
1870
+ 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.";
1871
+ readonly type: "string";
1872
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
1873
+ };
1874
+ readonly DigestMultibase: {
1875
+ readonly title: "DigestMultibase";
1876
+ 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`.";
1877
+ readonly type: "string";
1878
+ readonly minLength: 16;
1879
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
1880
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
1881
+ };
1882
+ readonly Manifest: {
1883
+ readonly title: "Manifest";
1884
+ readonly description: "What an election asks and how it is decided (VTI-VOT-010). Its digest (`manifestDigest`) is the SHA-256 multihash of its RFC 8785 (JCS) canonicalization, and every cast is bound to it (VTI-VOT-011).";
1885
+ readonly type: "object";
1886
+ readonly additionalProperties: false;
1887
+ readonly required: readonly ["electionId", "community", "questions", "secrecy", "roll", "registrationOpensAt", "votingOpensAt", "votingClosesAt", "revote", "board", "ballotBox", "binding", "allowEarlyClose", "resultsBeforeClose", "textReleaseThreshold"];
1888
+ readonly properties: {
1889
+ readonly electionId: {
1890
+ readonly $ref: "#/$defs/ElectionId";
1891
+ };
1892
+ readonly community: {
1893
+ readonly type: "string";
1894
+ readonly minLength: 1;
1895
+ readonly maxLength: 2048;
1896
+ readonly description: "The community's DID.";
1897
+ };
1898
+ readonly title: {
1899
+ readonly type: "string";
1900
+ readonly maxLength: 512;
1901
+ };
1902
+ readonly description: {
1903
+ readonly type: "string";
1904
+ readonly maxLength: 8192;
1905
+ };
1906
+ readonly questions: {
1907
+ readonly type: "array";
1908
+ readonly minItems: 1;
1909
+ readonly maxItems: 128;
1910
+ readonly items: {
1911
+ readonly $ref: "#/$defs/Question";
1912
+ };
1913
+ };
1914
+ readonly secrecy: {
1915
+ readonly $ref: "#/$defs/SecrecyLevel";
1916
+ };
1917
+ readonly roll: {
1918
+ readonly $ref: "#/$defs/RollRule";
1919
+ };
1920
+ readonly registrationOpensAt: {
1921
+ readonly type: "string";
1922
+ readonly format: "date-time";
1923
+ };
1924
+ readonly votingOpensAt: {
1925
+ readonly type: "string";
1926
+ readonly format: "date-time";
1927
+ };
1928
+ readonly votingClosesAt: {
1929
+ readonly type: "string";
1930
+ readonly format: "date-time";
1931
+ };
1932
+ readonly revote: {
1933
+ readonly $ref: "#/$defs/Revote";
1934
+ };
1935
+ readonly board: {
1936
+ readonly type: "object";
1937
+ readonly additionalProperties: false;
1938
+ readonly required: readonly ["visibility", "auditors"];
1939
+ readonly properties: {
1940
+ readonly visibility: {
1941
+ readonly $ref: "#/$defs/BoardVisibility";
1942
+ };
1943
+ readonly auditors: {
1944
+ readonly type: "array";
1945
+ readonly items: {
1946
+ readonly type: "string";
1947
+ readonly minLength: 1;
1948
+ readonly maxLength: 2048;
1949
+ };
1950
+ readonly uniqueItems: true;
1951
+ };
1952
+ };
1953
+ };
1954
+ readonly ballotBox: {
1955
+ readonly type: "string";
1956
+ readonly minLength: 1;
1957
+ readonly maxLength: 2048;
1958
+ readonly description: "The DID of the voting service that holds the board.";
1959
+ };
1960
+ readonly trustees: {
1961
+ readonly $ref: "#/$defs/Trustees";
1962
+ };
1963
+ readonly binding: {
1964
+ readonly type: "boolean";
1965
+ readonly description: "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081).";
1966
+ };
1967
+ readonly allowEarlyClose: {
1968
+ readonly type: "boolean";
1969
+ };
1970
+ readonly resultsBeforeClose: {
1971
+ readonly type: "boolean";
1972
+ readonly description: "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061).";
1973
+ };
1974
+ readonly textReleaseThreshold: {
1975
+ readonly type: "integer";
1976
+ readonly minimum: 1;
1977
+ readonly description: "Counted ballots required before any text answer is disclosed (VTI-VOT-065). At least 1, and SHOULD be at least 10: a written answer can identify its author by what it says or how it is phrased, and the fewer the ballots released together, the easier that is. Where it is below 10, the disclosure a member is shown before they request a ticket MUST say so, and MUST say that a written answer may identify its author (VTI-VOT-090).";
1978
+ };
1979
+ };
1980
+ };
1981
+ readonly Trustees: {
1982
+ readonly title: "Trustees";
1983
+ readonly description: "The trustees of a sealed or tallied-encrypted election and the number of them decryption needs (VTI-VOT-062). Neither the community nor the ballot box may be one.";
1984
+ readonly type: "object";
1985
+ readonly additionalProperties: false;
1986
+ readonly required: readonly ["dids", "threshold"];
1987
+ readonly properties: {
1988
+ readonly dids: {
1989
+ readonly type: "array";
1990
+ readonly minItems: 2;
1991
+ readonly items: {
1992
+ readonly type: "string";
1993
+ readonly minLength: 1;
1994
+ readonly maxLength: 2048;
1995
+ };
1996
+ readonly uniqueItems: true;
1997
+ };
1998
+ readonly threshold: {
1999
+ readonly type: "integer";
2000
+ readonly minimum: 2;
2001
+ };
2002
+ };
2003
+ };
2004
+ readonly BoardVisibility: {
2005
+ readonly title: "BoardVisibility";
2006
+ readonly description: "`public`: anyone reads the board. `private`: the community, the auditors the manifest names and, for one cast's inclusion, the holder of its receipt (VTI-VOT-052).";
2007
+ readonly type: "string";
2008
+ readonly enum: readonly ["public", "private"];
2009
+ };
2010
+ readonly Revote: {
2011
+ readonly title: "Revote";
2012
+ readonly description: "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).";
2013
+ readonly type: "string";
2014
+ readonly enum: readonly ["replace", "refuse"];
2015
+ };
2016
+ readonly RollRule: {
2017
+ readonly title: "RollRule";
2018
+ readonly description: "Who may be issued a ticket (VTI-VOT-021): the community's active members, its active members and the parties `listed` names, or only the parties `listed` names.";
2019
+ readonly type: "object";
2020
+ readonly additionalProperties: false;
2021
+ readonly required: readonly ["rule"];
2022
+ readonly properties: {
2023
+ readonly rule: {
2024
+ readonly type: "string";
2025
+ readonly enum: readonly ["members", "membersAndListed", "listed"];
2026
+ };
2027
+ readonly listed: {
2028
+ readonly type: "array";
2029
+ readonly items: {
2030
+ readonly type: "string";
2031
+ readonly minLength: 1;
2032
+ readonly maxLength: 2048;
2033
+ readonly description: "A DID enfranchised by name.";
2034
+ };
2035
+ readonly uniqueItems: true;
2036
+ };
2037
+ };
2038
+ };
2039
+ readonly SecrecyLevel: {
2040
+ readonly title: "SecrecyLevel";
2041
+ readonly description: "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060). The encrypted levels are cast with `voting/ballot/cast-encrypted/0.1`, under an election key the trustees generate with `voting/trustees/*` (CONVENTIONS §9).";
2042
+ readonly type: "string";
2043
+ readonly enum: readonly ["open", "sealed", "talliedEncrypted"];
2044
+ };
2045
+ readonly Question: {
2046
+ readonly title: "Question";
2047
+ readonly description: "One question. Tagged union over `type`.";
2048
+ readonly oneOf: readonly [{
2049
+ readonly title: "ChoiceQuestion";
2050
+ readonly description: "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.";
2051
+ readonly type: "object";
2052
+ readonly additionalProperties: false;
2053
+ readonly required: readonly ["key", "type", "options", "minSelections", "maxSelections", "optional"];
2054
+ readonly properties: {
2055
+ readonly key: {
2056
+ readonly $ref: "#/$defs/Key";
2057
+ };
2058
+ readonly type: {
2059
+ readonly const: "choice";
2060
+ };
2061
+ readonly text: {
2062
+ readonly type: "string";
2063
+ readonly maxLength: 2048;
2064
+ };
2065
+ readonly options: {
2066
+ readonly type: "array";
2067
+ readonly minItems: 2;
2068
+ readonly maxItems: 256;
2069
+ readonly items: {
2070
+ readonly $ref: "#/$defs/QuestionOption";
2071
+ };
2072
+ };
2073
+ readonly minSelections: {
2074
+ readonly type: "integer";
2075
+ readonly minimum: 0;
2076
+ };
2077
+ readonly maxSelections: {
2078
+ readonly type: "integer";
2079
+ readonly minimum: 1;
2080
+ };
2081
+ readonly optional: {
2082
+ readonly type: "boolean";
2083
+ };
2084
+ };
2085
+ }, {
2086
+ readonly title: "RankingQuestion";
2087
+ readonly description: "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.";
2088
+ readonly type: "object";
2089
+ readonly additionalProperties: false;
2090
+ readonly required: readonly ["key", "type", "options", "partial", "optional"];
2091
+ readonly properties: {
2092
+ readonly key: {
2093
+ readonly $ref: "#/$defs/Key";
2094
+ };
2095
+ readonly type: {
2096
+ readonly const: "ranking";
2097
+ };
2098
+ readonly text: {
2099
+ readonly type: "string";
2100
+ readonly maxLength: 2048;
2101
+ };
2102
+ readonly options: {
2103
+ readonly type: "array";
2104
+ readonly minItems: 2;
2105
+ readonly maxItems: 64;
2106
+ readonly items: {
2107
+ readonly $ref: "#/$defs/QuestionOption";
2108
+ };
2109
+ };
2110
+ readonly partial: {
2111
+ readonly type: "boolean";
2112
+ };
2113
+ readonly optional: {
2114
+ readonly type: "boolean";
2115
+ };
2116
+ };
2117
+ }, {
2118
+ readonly title: "ScoreQuestion";
2119
+ readonly description: "Give each option an integer score within [min, max].";
2120
+ readonly type: "object";
2121
+ readonly additionalProperties: false;
2122
+ readonly required: readonly ["key", "type", "options", "min", "max", "optional"];
2123
+ readonly properties: {
2124
+ readonly key: {
2125
+ readonly $ref: "#/$defs/Key";
2126
+ };
2127
+ readonly type: {
2128
+ readonly const: "score";
2129
+ };
2130
+ readonly text: {
2131
+ readonly type: "string";
2132
+ readonly maxLength: 2048;
2133
+ };
2134
+ readonly options: {
2135
+ readonly type: "array";
2136
+ readonly minItems: 1;
2137
+ readonly maxItems: 256;
2138
+ readonly items: {
2139
+ readonly $ref: "#/$defs/QuestionOption";
2140
+ };
2141
+ };
2142
+ readonly min: {
2143
+ readonly type: "integer";
2144
+ };
2145
+ readonly max: {
2146
+ readonly type: "integer";
2147
+ };
2148
+ readonly optional: {
2149
+ readonly type: "boolean";
2150
+ };
2151
+ };
2152
+ }, {
2153
+ readonly title: "TextQuestion";
2154
+ readonly description: "Free text of at most `maxLength` characters.";
2155
+ readonly type: "object";
2156
+ readonly additionalProperties: false;
2157
+ readonly required: readonly ["key", "type", "maxLength", "optional"];
2158
+ readonly properties: {
2159
+ readonly key: {
2160
+ readonly $ref: "#/$defs/Key";
2161
+ };
2162
+ readonly type: {
2163
+ readonly const: "text";
2164
+ };
2165
+ readonly text: {
2166
+ readonly type: "string";
2167
+ readonly maxLength: 2048;
2168
+ };
2169
+ readonly maxLength: {
2170
+ readonly type: "integer";
2171
+ readonly minimum: 1;
2172
+ readonly maximum: 4096;
2173
+ };
2174
+ readonly optional: {
2175
+ readonly type: "boolean";
2176
+ };
2177
+ };
2178
+ }];
2179
+ };
2180
+ readonly QuestionOption: {
2181
+ readonly title: "QuestionOption";
2182
+ readonly type: "object";
2183
+ readonly additionalProperties: false;
2184
+ readonly required: readonly ["key"];
2185
+ readonly properties: {
2186
+ readonly key: {
2187
+ readonly $ref: "#/$defs/Key";
2188
+ };
2189
+ readonly label: {
2190
+ readonly type: "string";
2191
+ readonly maxLength: 512;
2192
+ readonly description: "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014).";
2193
+ };
2194
+ };
2195
+ };
2196
+ readonly VotingParameters: {
2197
+ readonly title: "VotingParameters";
2198
+ readonly description: "The community's published voting parameters: the PCS suite and the voting verification key tickets are issued under (VTI-VOT-020). Distinct from its hidden-vetting helper key.";
2199
+ readonly type: "object";
2200
+ readonly additionalProperties: false;
2201
+ readonly required: readonly ["suite", "votingKey"];
2202
+ readonly properties: {
2203
+ readonly suite: {
2204
+ readonly type: "string";
2205
+ readonly const: "ps-ddh-bls12381";
2206
+ };
2207
+ readonly votingKey: {
2208
+ readonly $ref: "#/$defs/Multibase";
2209
+ };
2210
+ };
2211
+ };
2212
+ readonly Multibase: {
2213
+ readonly title: "Multibase";
2214
+ readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
2215
+ readonly type: "string";
2216
+ readonly maxLength: 16384;
2217
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
2218
+ };
2219
+ };
2220
+ };
2221
+ };
2222
+ //# sourceMappingURL=payload.d.ts.map