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