@openvtc/trust-tasks 0.26.25 → 0.26.27

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 (133) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/dist/_shared/components.d.ts +207 -4
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/device/list/0.1/payload.d.ts +4 -4
  5. package/dist/device/list/0.1/payload.d.ts.map +1 -1
  6. package/dist/device/list/0.1/payload.js +4 -2
  7. package/dist/device/list/0.1/payload.js.map +1 -1
  8. package/dist/device/list/0.2/payload.d.ts +4 -4
  9. package/dist/device/list/0.2/payload.d.ts.map +1 -1
  10. package/dist/device/list/0.2/payload.js +4 -2
  11. package/dist/device/list/0.2/payload.js.map +1 -1
  12. package/dist/device/register/0.1/payload.d.ts +4 -4
  13. package/dist/device/register/0.1/payload.d.ts.map +1 -1
  14. package/dist/device/register/0.1/payload.js +4 -2
  15. package/dist/device/register/0.1/payload.js.map +1 -1
  16. package/dist/device/register/0.2/payload.d.ts +4 -4
  17. package/dist/device/register/0.2/payload.d.ts.map +1 -1
  18. package/dist/device/register/0.2/payload.js +4 -2
  19. package/dist/device/register/0.2/payload.js.map +1 -1
  20. package/dist/index.d.ts +14 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +14 -0
  23. package/dist/index.js.map +1 -1
  24. package/dist/voting/_shared/0.1/voting.d.ts +1 -1
  25. package/dist/voting/_shared/0.1/voting.d.ts.map +1 -1
  26. package/dist/voting/ballot/cast-encrypted/0.1/payload.d.ts +1166 -0
  27. package/dist/voting/ballot/cast-encrypted/0.1/payload.d.ts.map +1 -0
  28. package/dist/voting/ballot/cast-encrypted/0.1/payload.js +690 -0
  29. package/dist/voting/ballot/cast-encrypted/0.1/payload.js.map +1 -0
  30. package/dist/voting/board/read/0.1/payload.d.ts +2555 -719
  31. package/dist/voting/board/read/0.1/payload.d.ts.map +1 -1
  32. package/dist/voting/board/read/0.1/payload.js +1517 -391
  33. package/dist/voting/board/read/0.1/payload.js.map +1 -1
  34. package/dist/voting/election/register/0.1/payload.d.ts +4 -4
  35. package/dist/voting/election/register/0.1/payload.js +2 -2
  36. package/dist/voting/election/register/0.1/payload.js.map +1 -1
  37. package/dist/voting/election/show/0.1/payload.d.ts +4 -4
  38. package/dist/voting/election/show/0.1/payload.js +2 -2
  39. package/dist/voting/election/show/0.1/payload.js.map +1 -1
  40. package/dist/voting/trustees/confirm/0.1/payload.d.ts +620 -0
  41. package/dist/voting/trustees/confirm/0.1/payload.d.ts.map +1 -0
  42. package/dist/voting/trustees/confirm/0.1/payload.js +388 -0
  43. package/dist/voting/trustees/confirm/0.1/payload.js.map +1 -0
  44. package/dist/voting/trustees/deal/0.1/payload.d.ts +1032 -0
  45. package/dist/voting/trustees/deal/0.1/payload.d.ts.map +1 -0
  46. package/dist/voting/trustees/deal/0.1/payload.js +630 -0
  47. package/dist/voting/trustees/deal/0.1/payload.js.map +1 -0
  48. package/dist/voting/trustees/decrypt/0.1/payload.d.ts +1009 -0
  49. package/dist/voting/trustees/decrypt/0.1/payload.d.ts.map +1 -0
  50. package/dist/voting/trustees/decrypt/0.1/payload.js +623 -0
  51. package/dist/voting/trustees/decrypt/0.1/payload.js.map +1 -0
  52. package/dist/voting/trustees/enrol/0.1/payload.d.ts +792 -0
  53. package/dist/voting/trustees/enrol/0.1/payload.d.ts.map +1 -0
  54. package/dist/voting/trustees/enrol/0.1/payload.js +490 -0
  55. package/dist/voting/trustees/enrol/0.1/payload.js.map +1 -0
  56. package/dist/voting/trustees/justify/0.1/payload.d.ts +642 -0
  57. package/dist/voting/trustees/justify/0.1/payload.d.ts.map +1 -0
  58. package/dist/voting/trustees/justify/0.1/payload.js +402 -0
  59. package/dist/voting/trustees/justify/0.1/payload.js.map +1 -0
  60. package/dist/voting/trustees/status/0.1/payload.d.ts +1411 -0
  61. package/dist/voting/trustees/status/0.1/payload.d.ts.map +1 -0
  62. package/dist/voting/trustees/status/0.1/payload.js +822 -0
  63. package/dist/voting/trustees/status/0.1/payload.js.map +1 -0
  64. package/dist/vta/pcs/trustee/deal/0.1/payload.d.ts +2005 -0
  65. package/dist/vta/pcs/trustee/deal/0.1/payload.d.ts.map +1 -0
  66. package/dist/vta/pcs/trustee/deal/0.1/payload.js +1176 -0
  67. package/dist/vta/pcs/trustee/deal/0.1/payload.js.map +1 -0
  68. package/dist/vta/pcs/trustee/decrypt/0.1/payload.d.ts +736 -0
  69. package/dist/vta/pcs/trustee/decrypt/0.1/payload.d.ts.map +1 -0
  70. package/dist/vta/pcs/trustee/decrypt/0.1/payload.js +412 -0
  71. package/dist/vta/pcs/trustee/decrypt/0.1/payload.js.map +1 -0
  72. package/dist/vta/pcs/trustee/enrol/0.1/payload.d.ts +1756 -0
  73. package/dist/vta/pcs/trustee/enrol/0.1/payload.d.ts.map +1 -0
  74. package/dist/vta/pcs/trustee/enrol/0.1/payload.js +1040 -0
  75. package/dist/vta/pcs/trustee/enrol/0.1/payload.js.map +1 -0
  76. package/dist/vta/pcs/trustee/justify/0.1/payload.d.ts +504 -0
  77. package/dist/vta/pcs/trustee/justify/0.1/payload.d.ts.map +1 -0
  78. package/dist/vta/pcs/trustee/justify/0.1/payload.js +274 -0
  79. package/dist/vta/pcs/trustee/justify/0.1/payload.js.map +1 -0
  80. package/dist/vta/pcs/trustee/keys/0.1/payload.d.ts +2501 -0
  81. package/dist/vta/pcs/trustee/keys/0.1/payload.d.ts.map +1 -0
  82. package/dist/vta/pcs/trustee/keys/0.1/payload.js +1455 -0
  83. package/dist/vta/pcs/trustee/keys/0.1/payload.js.map +1 -0
  84. package/dist/vta/pcs/vote/0.1/payload.d.ts +4 -4
  85. package/dist/vta/pcs/vote/0.1/payload.js +2 -2
  86. package/dist/vta/pcs/vote/0.1/payload.js.map +1 -1
  87. package/dist/vta/pcs/vote-encrypted/0.1/payload.d.ts +2375 -0
  88. package/dist/vta/pcs/vote-encrypted/0.1/payload.d.ts.map +1 -0
  89. package/dist/vta/pcs/vote-encrypted/0.1/payload.js +1389 -0
  90. package/dist/vta/pcs/vote-encrypted/0.1/payload.js.map +1 -0
  91. package/dist/vta/pcs/voter/register/0.1/payload.d.ts +4 -4
  92. package/dist/vta/pcs/voter/register/0.1/payload.js +2 -2
  93. package/dist/vta/pcs/voter/register/0.1/payload.js.map +1 -1
  94. package/dist/vtc/config/did-hosting/list/0.1/payload.d.ts +339 -0
  95. package/dist/vtc/config/did-hosting/list/0.1/payload.d.ts.map +1 -0
  96. package/dist/vtc/config/did-hosting/list/0.1/payload.js +185 -0
  97. package/dist/vtc/config/did-hosting/list/0.1/payload.js.map +1 -0
  98. package/dist/vtc/elections/create/0.1/payload.d.ts +4 -4
  99. package/dist/vtc/elections/create/0.1/payload.js +2 -2
  100. package/dist/vtc/elections/create/0.1/payload.js.map +1 -1
  101. package/dist/vtc/elections/show/0.1/payload.d.ts +242 -6
  102. package/dist/vtc/elections/show/0.1/payload.d.ts.map +1 -1
  103. package/dist/vtc/elections/show/0.1/payload.js +132 -2
  104. package/dist/vtc/elections/show/0.1/payload.js.map +1 -1
  105. package/package.json +1 -1
  106. package/src/_shared/components.ts +222 -4
  107. package/src/device/list/0.1/payload.ts +4 -2
  108. package/src/device/list/0.2/payload.ts +4 -2
  109. package/src/device/register/0.1/payload.ts +4 -2
  110. package/src/device/register/0.2/payload.ts +4 -2
  111. package/src/index.ts +14 -0
  112. package/src/voting/_shared/0.1/voting.ts +1 -1
  113. package/src/voting/ballot/cast-encrypted/0.1/payload.ts +735 -0
  114. package/src/voting/board/read/0.1/payload.ts +1519 -393
  115. package/src/voting/election/register/0.1/payload.ts +2 -2
  116. package/src/voting/election/show/0.1/payload.ts +2 -2
  117. package/src/voting/trustees/confirm/0.1/payload.ts +429 -0
  118. package/src/voting/trustees/deal/0.1/payload.ts +665 -0
  119. package/src/voting/trustees/decrypt/0.1/payload.ts +663 -0
  120. package/src/voting/trustees/enrol/0.1/payload.ts +525 -0
  121. package/src/voting/trustees/justify/0.1/payload.ts +439 -0
  122. package/src/voting/trustees/status/0.1/payload.ts +890 -0
  123. package/src/vta/pcs/trustee/deal/0.1/payload.ts +1250 -0
  124. package/src/vta/pcs/trustee/decrypt/0.1/payload.ts +489 -0
  125. package/src/vta/pcs/trustee/enrol/0.1/payload.ts +1107 -0
  126. package/src/vta/pcs/trustee/justify/0.1/payload.ts +341 -0
  127. package/src/vta/pcs/trustee/keys/0.1/payload.ts +1545 -0
  128. package/src/vta/pcs/vote/0.1/payload.ts +2 -2
  129. package/src/vta/pcs/vote-encrypted/0.1/payload.ts +1455 -0
  130. package/src/vta/pcs/voter/register/0.1/payload.ts +2 -2
  131. package/src/vtc/config/did-hosting/list/0.1/payload.ts +233 -0
  132. package/src/vtc/elections/create/0.1/payload.ts +2 -2
  133. package/src/vtc/elections/show/0.1/payload.ts +138 -4
@@ -518,7 +518,7 @@ export const PAYLOAD_SCHEMA = {
518
518
  },
519
519
  "SecrecyLevel": {
520
520
  "title": "SecrecyLevel",
521
- "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.",
521
+ "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).",
522
522
  "type": "string",
523
523
  "enum": [
524
524
  "open",
@@ -1100,7 +1100,7 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
1100
1100
  },
1101
1101
  "SecrecyLevel": {
1102
1102
  "title": "SecrecyLevel",
1103
- "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.",
1103
+ "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).",
1104
1104
  "type": "string",
1105
1105
  "enum": [
1106
1106
  "open",
@@ -0,0 +1,233 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/config/did-hosting/list/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * List the did:webvh hosting servers the community's VTA can publish its identities through. The outer document members are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface VTCConfigDIDHostingListPayload {
13
+ ext?: Ext;
14
+ }
15
+ /**
16
+ * The success response to a vtc/config/did-hosting/list/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/config/did-hosting/list/0.1#response.
17
+ */
18
+ export interface VTCConfigDIDHostingListResponsePayload {
19
+ /**
20
+ * @maxItems 256
21
+ */
22
+ servers: HostingServer[];
23
+ ext?: Ext;
24
+ }
25
+ /**
26
+ * A did:webvh hosting server registered at the community's VTA, as that VTA reports it. Carries no credential.
27
+ */
28
+ export interface HostingServer {
29
+ /**
30
+ * The server's id at the VTA: the value that names it in the community's configuration.
31
+ */
32
+ id: string;
33
+ /**
34
+ * The server's own DID.
35
+ */
36
+ did: string;
37
+ label?: string;
38
+ }
39
+
40
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
41
+ export type { Ext };
42
+
43
+ /** Trust Task type URI. */
44
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/config/did-hosting/list/0.1" as const;
45
+
46
+ /** Stable alias for this specification's request payload shape. */
47
+ export type Payload = VTCConfigDIDHostingListPayload;
48
+
49
+ /** Trust Task response type URI (request type URI + "#response"). */
50
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/config/did-hosting/list/0.1#response" as const;
51
+
52
+ /** Stable alias for this specification's success-response payload shape. */
53
+ export type Response = VTCConfigDIDHostingListResponsePayload;
54
+
55
+ /**
56
+ * This specification's payload schema, as a value.
57
+ *
58
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
59
+ * rather than only as a `.json` file because TypeScript types are erased
60
+ * at runtime: without a schema a consumer has nothing to validate, and
61
+ * every REQUIRED payload member is optional in practice. Cross-file
62
+ * `$ref`s are already inlined, so it needs no resolver.
63
+ */
64
+ export const PAYLOAD_SCHEMA = {
65
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
66
+ "$id": "https://trusttasks.org/spec/vtc/config/did-hosting/list/0.1",
67
+ "title": "VTC Config — DID Hosting — List — payload",
68
+ "description": "List the did:webvh hosting servers the community's VTA can publish its identities through. The outer document members are owned by the framework — SPEC §6.3.",
69
+ "type": "object",
70
+ "additionalProperties": false,
71
+ "properties": {
72
+ "ext": {
73
+ "$ref": "#/$defs/Ext"
74
+ }
75
+ },
76
+ "$defs": {
77
+ "HostingServer": {
78
+ "title": "HostingServer",
79
+ "description": "A did:webvh hosting server registered at the community's VTA, as that VTA reports it. Carries no credential.",
80
+ "type": "object",
81
+ "additionalProperties": false,
82
+ "required": [
83
+ "id",
84
+ "did"
85
+ ],
86
+ "properties": {
87
+ "id": {
88
+ "type": "string",
89
+ "pattern": "^[A-Za-z0-9._:-]{1,128}$",
90
+ "description": "The server's id at the VTA: the value that names it in the community's configuration."
91
+ },
92
+ "did": {
93
+ "type": "string",
94
+ "pattern": "^did:",
95
+ "maxLength": 2048,
96
+ "description": "The server's own DID."
97
+ },
98
+ "label": {
99
+ "type": "string",
100
+ "maxLength": 256
101
+ }
102
+ }
103
+ },
104
+ "Response": {
105
+ "$anchor": "response",
106
+ "title": "VTC Config — DID Hosting — List — response payload",
107
+ "description": "The success response to a vtc/config/did-hosting/list/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/config/did-hosting/list/0.1#response.",
108
+ "type": "object",
109
+ "additionalProperties": false,
110
+ "required": [
111
+ "servers"
112
+ ],
113
+ "properties": {
114
+ "servers": {
115
+ "type": "array",
116
+ "maxItems": 256,
117
+ "items": {
118
+ "$ref": "#/$defs/HostingServer"
119
+ }
120
+ },
121
+ "ext": {
122
+ "$ref": "#/$defs/Ext"
123
+ }
124
+ }
125
+ },
126
+ "Ext": {
127
+ "title": "Ext",
128
+ "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.",
129
+ "type": "object",
130
+ "minProperties": 1,
131
+ "additionalProperties": true,
132
+ "propertyNames": {
133
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
134
+ }
135
+ }
136
+ }
137
+ } as const;
138
+
139
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
140
+ export const RESPONSE_PAYLOAD_SCHEMA = {
141
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
142
+ "$ref": "#/$defs/Response",
143
+ "$defs": {
144
+ "HostingServer": {
145
+ "title": "HostingServer",
146
+ "description": "A did:webvh hosting server registered at the community's VTA, as that VTA reports it. Carries no credential.",
147
+ "type": "object",
148
+ "additionalProperties": false,
149
+ "required": [
150
+ "id",
151
+ "did"
152
+ ],
153
+ "properties": {
154
+ "id": {
155
+ "type": "string",
156
+ "pattern": "^[A-Za-z0-9._:-]{1,128}$",
157
+ "description": "The server's id at the VTA: the value that names it in the community's configuration."
158
+ },
159
+ "did": {
160
+ "type": "string",
161
+ "pattern": "^did:",
162
+ "maxLength": 2048,
163
+ "description": "The server's own DID."
164
+ },
165
+ "label": {
166
+ "type": "string",
167
+ "maxLength": 256
168
+ }
169
+ }
170
+ },
171
+ "Response": {
172
+ "$anchor": "response",
173
+ "title": "VTC Config — DID Hosting — List — response payload",
174
+ "description": "The success response to a vtc/config/did-hosting/list/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/config/did-hosting/list/0.1#response.",
175
+ "type": "object",
176
+ "additionalProperties": false,
177
+ "required": [
178
+ "servers"
179
+ ],
180
+ "properties": {
181
+ "servers": {
182
+ "type": "array",
183
+ "maxItems": 256,
184
+ "items": {
185
+ "$ref": "#/$defs/HostingServer"
186
+ }
187
+ },
188
+ "ext": {
189
+ "$ref": "#/$defs/Ext"
190
+ }
191
+ }
192
+ },
193
+ "Ext": {
194
+ "title": "Ext",
195
+ "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.",
196
+ "type": "object",
197
+ "minProperties": 1,
198
+ "additionalProperties": true,
199
+ "propertyNames": {
200
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
201
+ }
202
+ }
203
+ }
204
+ } as const;
205
+
206
+ /**
207
+ * SPEC.md §7.2 policy for the request variant, from this specification's
208
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
209
+ * per-specification and cannot be derived from the document alone, and
210
+ * item 2 needs the schema this carries.
211
+ */
212
+ export const SPEC = {
213
+ typeUri: TYPE_URI,
214
+ isBearer: false,
215
+ isProofRequired: true,
216
+ isRecipientRequired: true,
217
+ isIssuedAtRequired: true,
218
+ payloadSchema: PAYLOAD_SCHEMA,
219
+ } as const;
220
+
221
+ /**
222
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
223
+ * tracks the *issuer* party's requirement because a response swaps the
224
+ * parties (§7.3 item 5).
225
+ */
226
+ export const RESPONSE_SPEC = {
227
+ typeUri: RESPONSE_TYPE_URI,
228
+ isBearer: false,
229
+ isProofRequired: true,
230
+ isRecipientRequired: true,
231
+ isIssuedAtRequired: true,
232
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
233
+ } as const;
@@ -343,7 +343,7 @@ export const PAYLOAD_SCHEMA = {
343
343
  },
344
344
  "SecrecyLevel": {
345
345
  "title": "SecrecyLevel",
346
- "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.",
346
+ "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).",
347
347
  "type": "string",
348
348
  "enum": [
349
349
  "open",
@@ -811,7 +811,7 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
811
811
  },
812
812
  "SecrecyLevel": {
813
813
  "title": "SecrecyLevel",
814
- "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.",
814
+ "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).",
815
815
  "type": "string",
816
816
  "enum": [
817
817
  "open",
@@ -3,7 +3,7 @@
3
3
  * Source: specs/vtc/elections/show/0.1/payload.schema.json
4
4
  */
5
5
 
6
- import type { BoardHead, BoardVisibility, ChoiceQuestion, DigestMultibase, Disclosure, ElectionId, ElectionResult, Ext, Key_VotingV0_1 as Key, Manifest, Multibase_VotingV0_1 as Multibase, Question, QuestionOption, QuestionResult, RankingQuestion, Revote, RollRule, ScoreQuestion, SecrecyLevel, TextQuestion, Trustees, VotingParameters } from "../../../../_shared/components.js";
6
+ import type { BoardHead, BoardVisibility, ChoiceQuestion, DigestMultibase, Disclosure, ElectionId, ElectionKey, ElectionResult, Ext, GroupElement, Key_VotingV0_1 as Key, Manifest, Multibase_VotingV0_1 as Multibase, Question, QuestionOption, QuestionResult, RankingQuestion, Revote, RollRule, ScoreQuestion, SecrecyLevel, TextQuestion, TrusteeIndex, Trustees, VotingParameters } from "../../../../_shared/components.js";
7
7
 
8
8
 
9
9
  /**
@@ -54,6 +54,10 @@ export interface VTCElectionsShowResponsePayload {
54
54
  * How many tickets the community has issued for the election. Present only to a caller holding vtc.elections.manage.
55
55
  */
56
56
  ticketsIssued?: number;
57
+ /**
58
+ * The key a sealed or tallied-encrypted election's ballots are encrypted under, once its trustees have formed it (CONVENTIONS §9.6).
59
+ */
60
+ electionKey?: ElectionKey;
57
61
  certified?: Certification;
58
62
  ext?: Ext;
59
63
  }
@@ -80,7 +84,7 @@ export interface Certification {
80
84
  }
81
85
 
82
86
  /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
83
- export type { BoardHead, BoardVisibility, ChoiceQuestion, DigestMultibase, Disclosure, ElectionId, ElectionResult, Ext, Key, Manifest, Multibase, Question, QuestionOption, QuestionResult, RankingQuestion, Revote, RollRule, ScoreQuestion, SecrecyLevel, TextQuestion, Trustees, VotingParameters };
87
+ export type { BoardHead, BoardVisibility, ChoiceQuestion, DigestMultibase, Disclosure, ElectionId, ElectionKey, ElectionResult, Ext, GroupElement, Key, Manifest, Multibase, Question, QuestionOption, QuestionResult, RankingQuestion, Revote, RollRule, ScoreQuestion, SecrecyLevel, TextQuestion, TrusteeIndex, Trustees, VotingParameters };
84
88
 
85
89
  /** Trust Task type URI. */
86
90
  export const TYPE_URI = "https://trusttasks.org/spec/vtc/elections/show/0.1" as const;
@@ -231,6 +235,10 @@ export const PAYLOAD_SCHEMA = {
231
235
  "minimum": 0,
232
236
  "description": "How many tickets the community has issued for the election. Present only to a caller holding vtc.elections.manage."
233
237
  },
238
+ "electionKey": {
239
+ "$ref": "#/$defs/ElectionKey",
240
+ "description": "The key a sealed or tallied-encrypted election's ballots are encrypted under, once its trustees have formed it (CONVENTIONS §9.6)."
241
+ },
234
242
  "certified": {
235
243
  "$ref": "#/$defs/Certification",
236
244
  "description": "Present once the community has certified the result."
@@ -250,6 +258,67 @@ export const PAYLOAD_SCHEMA = {
250
258
  "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
251
259
  }
252
260
  },
261
+ "ElectionKey": {
262
+ "title": "ElectionKey",
263
+ "description": "The election key and each trustee's public verification key, computed from the qualified dealings (CONVENTIONS §9.6). Anyone can recompute it from the board.",
264
+ "type": "object",
265
+ "additionalProperties": false,
266
+ "required": [
267
+ "key",
268
+ "qualified",
269
+ "verification"
270
+ ],
271
+ "properties": {
272
+ "key": {
273
+ "$ref": "#/$defs/GroupElement"
274
+ },
275
+ "qualified": {
276
+ "type": "array",
277
+ "minItems": 1,
278
+ "maxItems": 64,
279
+ "items": {
280
+ "$ref": "#/$defs/TrusteeIndex"
281
+ },
282
+ "description": "The dealers whose dealings the key is formed from."
283
+ },
284
+ "verification": {
285
+ "type": "array",
286
+ "minItems": 2,
287
+ "maxItems": 64,
288
+ "items": {
289
+ "type": "object",
290
+ "additionalProperties": false,
291
+ "required": [
292
+ "trustee",
293
+ "key"
294
+ ],
295
+ "properties": {
296
+ "trustee": {
297
+ "$ref": "#/$defs/TrusteeIndex"
298
+ },
299
+ "key": {
300
+ "$ref": "#/$defs/GroupElement"
301
+ }
302
+ }
303
+ }
304
+ }
305
+ }
306
+ },
307
+ "GroupElement": {
308
+ "title": "GroupElement",
309
+ "description": "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).",
310
+ "type": "string",
311
+ "minLength": 2,
312
+ "maxLength": 64,
313
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
314
+ },
315
+ "TrusteeIndex": {
316
+ "title": "TrusteeIndex",
317
+ "description": "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.",
318
+ "type": "integer",
319
+ "minimum": 1,
320
+ "maximum": 64
321
+ },
253
322
  "Disclosure": {
254
323
  "title": "Disclosure",
255
324
  "description": "The statement a community publishes, and shows a member before they request a ticket, about how one election is run (VTI-VOT-090). Generated from the election's manifest and the community's configuration, never written by hand.",
@@ -534,7 +603,7 @@ export const PAYLOAD_SCHEMA = {
534
603
  },
535
604
  "SecrecyLevel": {
536
605
  "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). 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.",
606
+ "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
607
  "type": "string",
539
608
  "enum": [
540
609
  "open",
@@ -993,6 +1062,10 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
993
1062
  "minimum": 0,
994
1063
  "description": "How many tickets the community has issued for the election. Present only to a caller holding vtc.elections.manage."
995
1064
  },
1065
+ "electionKey": {
1066
+ "$ref": "#/$defs/ElectionKey",
1067
+ "description": "The key a sealed or tallied-encrypted election's ballots are encrypted under, once its trustees have formed it (CONVENTIONS §9.6)."
1068
+ },
996
1069
  "certified": {
997
1070
  "$ref": "#/$defs/Certification",
998
1071
  "description": "Present once the community has certified the result."
@@ -1012,6 +1085,67 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
1012
1085
  "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
1013
1086
  }
1014
1087
  },
1088
+ "ElectionKey": {
1089
+ "title": "ElectionKey",
1090
+ "description": "The election key and each trustee's public verification key, computed from the qualified dealings (CONVENTIONS §9.6). Anyone can recompute it from the board.",
1091
+ "type": "object",
1092
+ "additionalProperties": false,
1093
+ "required": [
1094
+ "key",
1095
+ "qualified",
1096
+ "verification"
1097
+ ],
1098
+ "properties": {
1099
+ "key": {
1100
+ "$ref": "#/$defs/GroupElement"
1101
+ },
1102
+ "qualified": {
1103
+ "type": "array",
1104
+ "minItems": 1,
1105
+ "maxItems": 64,
1106
+ "items": {
1107
+ "$ref": "#/$defs/TrusteeIndex"
1108
+ },
1109
+ "description": "The dealers whose dealings the key is formed from."
1110
+ },
1111
+ "verification": {
1112
+ "type": "array",
1113
+ "minItems": 2,
1114
+ "maxItems": 64,
1115
+ "items": {
1116
+ "type": "object",
1117
+ "additionalProperties": false,
1118
+ "required": [
1119
+ "trustee",
1120
+ "key"
1121
+ ],
1122
+ "properties": {
1123
+ "trustee": {
1124
+ "$ref": "#/$defs/TrusteeIndex"
1125
+ },
1126
+ "key": {
1127
+ "$ref": "#/$defs/GroupElement"
1128
+ }
1129
+ }
1130
+ }
1131
+ }
1132
+ }
1133
+ },
1134
+ "GroupElement": {
1135
+ "title": "GroupElement",
1136
+ "description": "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).",
1137
+ "type": "string",
1138
+ "minLength": 2,
1139
+ "maxLength": 64,
1140
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
1141
+ },
1142
+ "TrusteeIndex": {
1143
+ "title": "TrusteeIndex",
1144
+ "description": "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.",
1145
+ "type": "integer",
1146
+ "minimum": 1,
1147
+ "maximum": 64
1148
+ },
1015
1149
  "Disclosure": {
1016
1150
  "title": "Disclosure",
1017
1151
  "description": "The statement a community publishes, and shows a member before they request a ticket, about how one election is run (VTI-VOT-090). Generated from the election's manifest and the community's configuration, never written by hand.",
@@ -1296,7 +1430,7 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
1296
1430
  },
1297
1431
  "SecrecyLevel": {
1298
1432
  "title": "SecrecyLevel",
1299
- "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.",
1433
+ "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).",
1300
1434
  "type": "string",
1301
1435
  "enum": [
1302
1436
  "open",