@openvtc/trust-tasks 0.26.20 → 0.26.21

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