@openvtc/trust-tasks 0.26.24 → 0.26.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/dist/_shared/components.d.ts +248 -5
  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 +15 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +15 -0
  23. package/dist/index.js.map +1 -1
  24. package/dist/rooms/keys/act/0.6/payload.d.ts +546 -0
  25. package/dist/rooms/keys/act/0.6/payload.d.ts.map +1 -0
  26. package/dist/rooms/keys/act/0.6/payload.js +305 -0
  27. package/dist/rooms/keys/act/0.6/payload.js.map +1 -0
  28. package/dist/voting/_shared/0.1/voting.d.ts +1 -1
  29. package/dist/voting/_shared/0.1/voting.d.ts.map +1 -1
  30. package/dist/voting/ballot/cast-encrypted/0.1/payload.d.ts +1166 -0
  31. package/dist/voting/ballot/cast-encrypted/0.1/payload.d.ts.map +1 -0
  32. package/dist/voting/ballot/cast-encrypted/0.1/payload.js +690 -0
  33. package/dist/voting/ballot/cast-encrypted/0.1/payload.js.map +1 -0
  34. package/dist/voting/board/read/0.1/payload.d.ts +2555 -719
  35. package/dist/voting/board/read/0.1/payload.d.ts.map +1 -1
  36. package/dist/voting/board/read/0.1/payload.js +1517 -391
  37. package/dist/voting/board/read/0.1/payload.js.map +1 -1
  38. package/dist/voting/election/register/0.1/payload.d.ts +4 -4
  39. package/dist/voting/election/register/0.1/payload.js +2 -2
  40. package/dist/voting/election/register/0.1/payload.js.map +1 -1
  41. package/dist/voting/election/show/0.1/payload.d.ts +4 -4
  42. package/dist/voting/election/show/0.1/payload.js +2 -2
  43. package/dist/voting/election/show/0.1/payload.js.map +1 -1
  44. package/dist/voting/trustees/confirm/0.1/payload.d.ts +620 -0
  45. package/dist/voting/trustees/confirm/0.1/payload.d.ts.map +1 -0
  46. package/dist/voting/trustees/confirm/0.1/payload.js +388 -0
  47. package/dist/voting/trustees/confirm/0.1/payload.js.map +1 -0
  48. package/dist/voting/trustees/deal/0.1/payload.d.ts +1032 -0
  49. package/dist/voting/trustees/deal/0.1/payload.d.ts.map +1 -0
  50. package/dist/voting/trustees/deal/0.1/payload.js +630 -0
  51. package/dist/voting/trustees/deal/0.1/payload.js.map +1 -0
  52. package/dist/voting/trustees/decrypt/0.1/payload.d.ts +1009 -0
  53. package/dist/voting/trustees/decrypt/0.1/payload.d.ts.map +1 -0
  54. package/dist/voting/trustees/decrypt/0.1/payload.js +623 -0
  55. package/dist/voting/trustees/decrypt/0.1/payload.js.map +1 -0
  56. package/dist/voting/trustees/enrol/0.1/payload.d.ts +792 -0
  57. package/dist/voting/trustees/enrol/0.1/payload.d.ts.map +1 -0
  58. package/dist/voting/trustees/enrol/0.1/payload.js +490 -0
  59. package/dist/voting/trustees/enrol/0.1/payload.js.map +1 -0
  60. package/dist/voting/trustees/justify/0.1/payload.d.ts +642 -0
  61. package/dist/voting/trustees/justify/0.1/payload.d.ts.map +1 -0
  62. package/dist/voting/trustees/justify/0.1/payload.js +402 -0
  63. package/dist/voting/trustees/justify/0.1/payload.js.map +1 -0
  64. package/dist/voting/trustees/status/0.1/payload.d.ts +1411 -0
  65. package/dist/voting/trustees/status/0.1/payload.d.ts.map +1 -0
  66. package/dist/voting/trustees/status/0.1/payload.js +822 -0
  67. package/dist/voting/trustees/status/0.1/payload.js.map +1 -0
  68. package/dist/vta/pcs/trustee/deal/0.1/payload.d.ts +2005 -0
  69. package/dist/vta/pcs/trustee/deal/0.1/payload.d.ts.map +1 -0
  70. package/dist/vta/pcs/trustee/deal/0.1/payload.js +1176 -0
  71. package/dist/vta/pcs/trustee/deal/0.1/payload.js.map +1 -0
  72. package/dist/vta/pcs/trustee/decrypt/0.1/payload.d.ts +736 -0
  73. package/dist/vta/pcs/trustee/decrypt/0.1/payload.d.ts.map +1 -0
  74. package/dist/vta/pcs/trustee/decrypt/0.1/payload.js +412 -0
  75. package/dist/vta/pcs/trustee/decrypt/0.1/payload.js.map +1 -0
  76. package/dist/vta/pcs/trustee/enrol/0.1/payload.d.ts +1756 -0
  77. package/dist/vta/pcs/trustee/enrol/0.1/payload.d.ts.map +1 -0
  78. package/dist/vta/pcs/trustee/enrol/0.1/payload.js +1040 -0
  79. package/dist/vta/pcs/trustee/enrol/0.1/payload.js.map +1 -0
  80. package/dist/vta/pcs/trustee/justify/0.1/payload.d.ts +504 -0
  81. package/dist/vta/pcs/trustee/justify/0.1/payload.d.ts.map +1 -0
  82. package/dist/vta/pcs/trustee/justify/0.1/payload.js +274 -0
  83. package/dist/vta/pcs/trustee/justify/0.1/payload.js.map +1 -0
  84. package/dist/vta/pcs/trustee/keys/0.1/payload.d.ts +2501 -0
  85. package/dist/vta/pcs/trustee/keys/0.1/payload.d.ts.map +1 -0
  86. package/dist/vta/pcs/trustee/keys/0.1/payload.js +1455 -0
  87. package/dist/vta/pcs/trustee/keys/0.1/payload.js.map +1 -0
  88. package/dist/vta/pcs/vote/0.1/payload.d.ts +4 -4
  89. package/dist/vta/pcs/vote/0.1/payload.js +2 -2
  90. package/dist/vta/pcs/vote/0.1/payload.js.map +1 -1
  91. package/dist/vta/pcs/vote-encrypted/0.1/payload.d.ts +2375 -0
  92. package/dist/vta/pcs/vote-encrypted/0.1/payload.d.ts.map +1 -0
  93. package/dist/vta/pcs/vote-encrypted/0.1/payload.js +1389 -0
  94. package/dist/vta/pcs/vote-encrypted/0.1/payload.js.map +1 -0
  95. package/dist/vta/pcs/voter/register/0.1/payload.d.ts +4 -4
  96. package/dist/vta/pcs/voter/register/0.1/payload.js +2 -2
  97. package/dist/vta/pcs/voter/register/0.1/payload.js.map +1 -1
  98. package/dist/vtc/_shared/0.1/community-room.d.ts +1 -1
  99. package/dist/vtc/_shared/0.1/community-room.d.ts.map +1 -1
  100. package/dist/vtc/elections/create/0.1/payload.d.ts +4 -4
  101. package/dist/vtc/elections/create/0.1/payload.js +2 -2
  102. package/dist/vtc/elections/create/0.1/payload.js.map +1 -1
  103. package/dist/vtc/elections/show/0.1/payload.d.ts +4 -4
  104. package/dist/vtc/elections/show/0.1/payload.js +2 -2
  105. package/dist/vtc/elections/show/0.1/payload.js.map +1 -1
  106. package/dist/vtc/groups/bindings/add/0.1/payload.d.ts +4 -4
  107. package/dist/vtc/groups/bindings/add/0.1/payload.js +2 -2
  108. package/dist/vtc/groups/bindings/add/0.1/payload.js.map +1 -1
  109. package/dist/vtc/groups/bindings/list/0.1/payload.d.ts +4 -4
  110. package/dist/vtc/groups/bindings/list/0.1/payload.js +2 -2
  111. package/dist/vtc/groups/bindings/list/0.1/payload.js.map +1 -1
  112. package/dist/vtc/rooms/offers/list/0.3/payload.d.ts +1058 -0
  113. package/dist/vtc/rooms/offers/list/0.3/payload.d.ts.map +1 -0
  114. package/dist/vtc/rooms/offers/list/0.3/payload.js +614 -0
  115. package/dist/vtc/rooms/offers/list/0.3/payload.js.map +1 -0
  116. package/package.json +1 -1
  117. package/src/_shared/components.ts +263 -5
  118. package/src/device/list/0.1/payload.ts +4 -2
  119. package/src/device/list/0.2/payload.ts +4 -2
  120. package/src/device/register/0.1/payload.ts +4 -2
  121. package/src/device/register/0.2/payload.ts +4 -2
  122. package/src/index.ts +15 -0
  123. package/src/rooms/keys/act/0.6/payload.ts +380 -0
  124. package/src/voting/_shared/0.1/voting.ts +1 -1
  125. package/src/voting/ballot/cast-encrypted/0.1/payload.ts +735 -0
  126. package/src/voting/board/read/0.1/payload.ts +1519 -393
  127. package/src/voting/election/register/0.1/payload.ts +2 -2
  128. package/src/voting/election/show/0.1/payload.ts +2 -2
  129. package/src/voting/trustees/confirm/0.1/payload.ts +429 -0
  130. package/src/voting/trustees/deal/0.1/payload.ts +665 -0
  131. package/src/voting/trustees/decrypt/0.1/payload.ts +663 -0
  132. package/src/voting/trustees/enrol/0.1/payload.ts +525 -0
  133. package/src/voting/trustees/justify/0.1/payload.ts +439 -0
  134. package/src/voting/trustees/status/0.1/payload.ts +890 -0
  135. package/src/vta/pcs/trustee/deal/0.1/payload.ts +1250 -0
  136. package/src/vta/pcs/trustee/decrypt/0.1/payload.ts +489 -0
  137. package/src/vta/pcs/trustee/enrol/0.1/payload.ts +1107 -0
  138. package/src/vta/pcs/trustee/justify/0.1/payload.ts +341 -0
  139. package/src/vta/pcs/trustee/keys/0.1/payload.ts +1545 -0
  140. package/src/vta/pcs/vote/0.1/payload.ts +2 -2
  141. package/src/vta/pcs/vote-encrypted/0.1/payload.ts +1455 -0
  142. package/src/vta/pcs/voter/register/0.1/payload.ts +2 -2
  143. package/src/vtc/_shared/0.1/community-room.ts +1 -1
  144. package/src/vtc/elections/create/0.1/payload.ts +2 -2
  145. package/src/vtc/elections/show/0.1/payload.ts +2 -2
  146. package/src/vtc/groups/bindings/add/0.1/payload.ts +2 -2
  147. package/src/vtc/groups/bindings/list/0.1/payload.ts +2 -2
  148. package/src/vtc/rooms/offers/list/0.3/payload.ts +663 -0
@@ -0,0 +1,822 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/voting/trustees/status/0.1/payload.schema.json
4
+ */
5
+ /** Trust Task type URI. */
6
+ export const TYPE_URI = "https://trusttasks.org/spec/voting/trustees/status/0.1";
7
+ /** Trust Task response type URI (request type URI + "#response"). */
8
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/voting/trustees/status/0.1#response";
9
+ /**
10
+ * This specification's payload schema, as a value.
11
+ *
12
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
13
+ * rather than only as a `.json` file because TypeScript types are erased
14
+ * at runtime: without a schema a consumer has nothing to validate, and
15
+ * every REQUIRED payload member is optional in practice. Cross-file
16
+ * `$ref`s are already inlined, so it needs no resolver.
17
+ */
18
+ export const PAYLOAD_SCHEMA = {
19
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
20
+ "$id": "https://trusttasks.org/spec/voting/trustees/status/0.1",
21
+ "title": "Voting — Trustees — Status — payload",
22
+ "description": "Where an election's trustee ceremony stands: transport keys, dealings, complaints, the election key, and what remains to decrypt.",
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": [
26
+ "community",
27
+ "electionId"
28
+ ],
29
+ "properties": {
30
+ "community": {
31
+ "type": "string",
32
+ "minLength": 1,
33
+ "maxLength": 2048,
34
+ "description": "The community's DID: the registrar that registered the election."
35
+ },
36
+ "electionId": {
37
+ "$ref": "#/$defs/ElectionId"
38
+ },
39
+ "ext": {
40
+ "$ref": "#/$defs/Ext"
41
+ }
42
+ },
43
+ "$defs": {
44
+ "Response": {
45
+ "$anchor": "response",
46
+ "title": "Voting — Trustees — Status — response payload",
47
+ "type": "object",
48
+ "additionalProperties": false,
49
+ "required": [
50
+ "phase",
51
+ "threshold",
52
+ "transportKeys",
53
+ "dealings",
54
+ "complaints",
55
+ "confirmed",
56
+ "targets",
57
+ "decrypted"
58
+ ],
59
+ "properties": {
60
+ "phase": {
61
+ "$ref": "#/$defs/TrusteePhase"
62
+ },
63
+ "threshold": {
64
+ "type": "integer",
65
+ "minimum": 2,
66
+ "maximum": 64
67
+ },
68
+ "transportKeys": {
69
+ "type": "array",
70
+ "maxItems": 64,
71
+ "items": {
72
+ "$ref": "#/$defs/TransportKey"
73
+ }
74
+ },
75
+ "dealings": {
76
+ "type": "array",
77
+ "maxItems": 64,
78
+ "items": {
79
+ "$ref": "#/$defs/Dealing"
80
+ }
81
+ },
82
+ "complaints": {
83
+ "type": "array",
84
+ "maxItems": 4096,
85
+ "items": {
86
+ "type": "object",
87
+ "additionalProperties": false,
88
+ "required": [
89
+ "dealer",
90
+ "recipient",
91
+ "justified"
92
+ ],
93
+ "properties": {
94
+ "dealer": {
95
+ "$ref": "#/$defs/TrusteeIndex"
96
+ },
97
+ "recipient": {
98
+ "$ref": "#/$defs/TrusteeIndex"
99
+ },
100
+ "justified": {
101
+ "type": "boolean"
102
+ },
103
+ "share": {
104
+ "$ref": "#/$defs/GroupScalar"
105
+ }
106
+ }
107
+ }
108
+ },
109
+ "confirmed": {
110
+ "type": "array",
111
+ "maxItems": 64,
112
+ "items": {
113
+ "$ref": "#/$defs/TrusteeIndex"
114
+ }
115
+ },
116
+ "electionKey": {
117
+ "$ref": "#/$defs/ElectionKey"
118
+ },
119
+ "targets": {
120
+ "type": "array",
121
+ "maxItems": 100000,
122
+ "items": {
123
+ "$ref": "#/$defs/DecryptionTarget"
124
+ },
125
+ "description": "What remains to be decrypted, once voting has closed."
126
+ },
127
+ "decrypted": {
128
+ "type": "array",
129
+ "maxItems": 64,
130
+ "items": {
131
+ "$ref": "#/$defs/TrusteeIndex"
132
+ },
133
+ "description": "The trustees whose partials have been accepted."
134
+ },
135
+ "ext": {
136
+ "$ref": "#/$defs/Ext"
137
+ }
138
+ }
139
+ },
140
+ "Ext": {
141
+ "title": "Ext",
142
+ "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.",
143
+ "type": "object",
144
+ "minProperties": 1,
145
+ "additionalProperties": true,
146
+ "propertyNames": {
147
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
148
+ }
149
+ },
150
+ "TrusteeIndex": {
151
+ "title": "TrusteeIndex",
152
+ "description": "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.",
153
+ "type": "integer",
154
+ "minimum": 1,
155
+ "maximum": 64
156
+ },
157
+ "DecryptionTarget": {
158
+ "title": "DecryptionTarget",
159
+ "description": "What a partial decryption decrypts: the sealed cast at a board leaf, or the total of one option of one question.",
160
+ "type": "object",
161
+ "additionalProperties": false,
162
+ "required": [
163
+ "ciphertext"
164
+ ],
165
+ "properties": {
166
+ "leafIndex": {
167
+ "type": "integer",
168
+ "minimum": 0,
169
+ "description": "A sealed cast's board leaf."
170
+ },
171
+ "question": {
172
+ "$ref": "#/$defs/Key"
173
+ },
174
+ "option": {
175
+ "$ref": "#/$defs/Key"
176
+ },
177
+ "ciphertext": {
178
+ "$ref": "#/$defs/ElGamalCiphertext"
179
+ }
180
+ },
181
+ "oneOf": [
182
+ {
183
+ "required": [
184
+ "leafIndex"
185
+ ]
186
+ },
187
+ {
188
+ "required": [
189
+ "question",
190
+ "option"
191
+ ]
192
+ }
193
+ ]
194
+ },
195
+ "ElGamalCiphertext": {
196
+ "title": "ElGamalCiphertext",
197
+ "description": "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).",
198
+ "type": "object",
199
+ "additionalProperties": false,
200
+ "required": [
201
+ "a",
202
+ "b"
203
+ ],
204
+ "properties": {
205
+ "a": {
206
+ "$ref": "#/$defs/GroupElement"
207
+ },
208
+ "b": {
209
+ "$ref": "#/$defs/GroupElement"
210
+ }
211
+ }
212
+ },
213
+ "GroupElement": {
214
+ "title": "GroupElement",
215
+ "description": "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).",
216
+ "type": "string",
217
+ "minLength": 2,
218
+ "maxLength": 64,
219
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
220
+ },
221
+ "Key": {
222
+ "title": "Key",
223
+ "description": "A question or option key, unique within its manifest or question.",
224
+ "type": "string",
225
+ "pattern": "^[A-Za-z0-9._-]{1,64}$"
226
+ },
227
+ "ElectionKey": {
228
+ "title": "ElectionKey",
229
+ "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.",
230
+ "type": "object",
231
+ "additionalProperties": false,
232
+ "required": [
233
+ "key",
234
+ "qualified",
235
+ "verification"
236
+ ],
237
+ "properties": {
238
+ "key": {
239
+ "$ref": "#/$defs/GroupElement"
240
+ },
241
+ "qualified": {
242
+ "type": "array",
243
+ "minItems": 1,
244
+ "maxItems": 64,
245
+ "items": {
246
+ "$ref": "#/$defs/TrusteeIndex"
247
+ },
248
+ "description": "The dealers whose dealings the key is formed from."
249
+ },
250
+ "verification": {
251
+ "type": "array",
252
+ "minItems": 2,
253
+ "maxItems": 64,
254
+ "items": {
255
+ "type": "object",
256
+ "additionalProperties": false,
257
+ "required": [
258
+ "trustee",
259
+ "key"
260
+ ],
261
+ "properties": {
262
+ "trustee": {
263
+ "$ref": "#/$defs/TrusteeIndex"
264
+ },
265
+ "key": {
266
+ "$ref": "#/$defs/GroupElement"
267
+ }
268
+ }
269
+ }
270
+ }
271
+ }
272
+ },
273
+ "GroupScalar": {
274
+ "title": "GroupScalar",
275
+ "description": "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).",
276
+ "type": "string",
277
+ "minLength": 2,
278
+ "maxLength": 64,
279
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
280
+ },
281
+ "Dealing": {
282
+ "title": "Dealing",
283
+ "description": "A trustee's contribution to the election key: Feldman commitments to its polynomial, a proof of knowledge of the constant term, and one share per trustee sealed to that trustee's transport key (CONVENTIONS §9.6).",
284
+ "type": "object",
285
+ "additionalProperties": false,
286
+ "required": [
287
+ "dealer",
288
+ "commitments",
289
+ "pok",
290
+ "shares"
291
+ ],
292
+ "properties": {
293
+ "dealer": {
294
+ "$ref": "#/$defs/TrusteeIndex"
295
+ },
296
+ "commitments": {
297
+ "type": "array",
298
+ "minItems": 2,
299
+ "maxItems": 64,
300
+ "items": {
301
+ "$ref": "#/$defs/GroupElement"
302
+ }
303
+ },
304
+ "pok": {
305
+ "$ref": "#/$defs/SigmaProof"
306
+ },
307
+ "shares": {
308
+ "type": "array",
309
+ "minItems": 2,
310
+ "maxItems": 64,
311
+ "items": {
312
+ "$ref": "#/$defs/SealedShare"
313
+ }
314
+ }
315
+ }
316
+ },
317
+ "SealedShare": {
318
+ "title": "SealedShare",
319
+ "type": "object",
320
+ "additionalProperties": false,
321
+ "required": [
322
+ "recipient",
323
+ "share"
324
+ ],
325
+ "properties": {
326
+ "recipient": {
327
+ "$ref": "#/$defs/TrusteeIndex"
328
+ },
329
+ "share": {
330
+ "$ref": "#/$defs/SealedPayload"
331
+ }
332
+ }
333
+ },
334
+ "SealedPayload": {
335
+ "title": "SealedPayload",
336
+ "description": "Bytes sealed to a key: a random group element encrypted as `kem`, and the bytes under ChaCha20-Poly1305 with a key derived from it, multibase base58btc (CONVENTIONS §9.4).",
337
+ "type": "object",
338
+ "additionalProperties": false,
339
+ "required": [
340
+ "kem",
341
+ "body"
342
+ ],
343
+ "properties": {
344
+ "kem": {
345
+ "$ref": "#/$defs/ElGamalCiphertext"
346
+ },
347
+ "body": {
348
+ "type": "string",
349
+ "minLength": 2,
350
+ "maxLength": 131072,
351
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
352
+ }
353
+ }
354
+ },
355
+ "SigmaProof": {
356
+ "title": "SigmaProof",
357
+ "description": "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).",
358
+ "type": "object",
359
+ "additionalProperties": false,
360
+ "required": [
361
+ "c",
362
+ "z"
363
+ ],
364
+ "properties": {
365
+ "c": {
366
+ "$ref": "#/$defs/GroupScalar"
367
+ },
368
+ "z": {
369
+ "$ref": "#/$defs/GroupScalar"
370
+ }
371
+ }
372
+ },
373
+ "TransportKey": {
374
+ "title": "TransportKey",
375
+ "description": "The group element a trustee's shares are sealed to, with a Schnorr proof of knowledge of its discrete log (CONVENTIONS §9.6).",
376
+ "type": "object",
377
+ "additionalProperties": false,
378
+ "required": [
379
+ "trustee",
380
+ "key",
381
+ "pok"
382
+ ],
383
+ "properties": {
384
+ "trustee": {
385
+ "$ref": "#/$defs/TrusteeIndex"
386
+ },
387
+ "key": {
388
+ "$ref": "#/$defs/GroupElement"
389
+ },
390
+ "pok": {
391
+ "$ref": "#/$defs/SigmaProof"
392
+ }
393
+ }
394
+ },
395
+ "TrusteePhase": {
396
+ "title": "TrusteePhase",
397
+ "description": "`enrolling`: transport keys are being published. `dealing`: dealings are. `confirming`: each trustee confirms or complains. `keyed`: the election key is formed. `decrypting`: voting has closed and partial decryptions are being published. `done`: every target is decrypted. `failed`: the key could not be formed in time.",
398
+ "type": "string",
399
+ "enum": [
400
+ "enrolling",
401
+ "dealing",
402
+ "confirming",
403
+ "keyed",
404
+ "decrypting",
405
+ "done",
406
+ "failed"
407
+ ]
408
+ },
409
+ "ElectionId": {
410
+ "title": "ElectionId",
411
+ "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.",
412
+ "type": "string",
413
+ "pattern": "^[A-Za-z0-9._-]{1,128}$"
414
+ }
415
+ }
416
+ };
417
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
418
+ export const RESPONSE_PAYLOAD_SCHEMA = {
419
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
420
+ "$ref": "#/$defs/Response",
421
+ "$defs": {
422
+ "Response": {
423
+ "$anchor": "response",
424
+ "title": "Voting — Trustees — Status — response payload",
425
+ "type": "object",
426
+ "additionalProperties": false,
427
+ "required": [
428
+ "phase",
429
+ "threshold",
430
+ "transportKeys",
431
+ "dealings",
432
+ "complaints",
433
+ "confirmed",
434
+ "targets",
435
+ "decrypted"
436
+ ],
437
+ "properties": {
438
+ "phase": {
439
+ "$ref": "#/$defs/TrusteePhase"
440
+ },
441
+ "threshold": {
442
+ "type": "integer",
443
+ "minimum": 2,
444
+ "maximum": 64
445
+ },
446
+ "transportKeys": {
447
+ "type": "array",
448
+ "maxItems": 64,
449
+ "items": {
450
+ "$ref": "#/$defs/TransportKey"
451
+ }
452
+ },
453
+ "dealings": {
454
+ "type": "array",
455
+ "maxItems": 64,
456
+ "items": {
457
+ "$ref": "#/$defs/Dealing"
458
+ }
459
+ },
460
+ "complaints": {
461
+ "type": "array",
462
+ "maxItems": 4096,
463
+ "items": {
464
+ "type": "object",
465
+ "additionalProperties": false,
466
+ "required": [
467
+ "dealer",
468
+ "recipient",
469
+ "justified"
470
+ ],
471
+ "properties": {
472
+ "dealer": {
473
+ "$ref": "#/$defs/TrusteeIndex"
474
+ },
475
+ "recipient": {
476
+ "$ref": "#/$defs/TrusteeIndex"
477
+ },
478
+ "justified": {
479
+ "type": "boolean"
480
+ },
481
+ "share": {
482
+ "$ref": "#/$defs/GroupScalar"
483
+ }
484
+ }
485
+ }
486
+ },
487
+ "confirmed": {
488
+ "type": "array",
489
+ "maxItems": 64,
490
+ "items": {
491
+ "$ref": "#/$defs/TrusteeIndex"
492
+ }
493
+ },
494
+ "electionKey": {
495
+ "$ref": "#/$defs/ElectionKey"
496
+ },
497
+ "targets": {
498
+ "type": "array",
499
+ "maxItems": 100000,
500
+ "items": {
501
+ "$ref": "#/$defs/DecryptionTarget"
502
+ },
503
+ "description": "What remains to be decrypted, once voting has closed."
504
+ },
505
+ "decrypted": {
506
+ "type": "array",
507
+ "maxItems": 64,
508
+ "items": {
509
+ "$ref": "#/$defs/TrusteeIndex"
510
+ },
511
+ "description": "The trustees whose partials have been accepted."
512
+ },
513
+ "ext": {
514
+ "$ref": "#/$defs/Ext"
515
+ }
516
+ }
517
+ },
518
+ "Ext": {
519
+ "title": "Ext",
520
+ "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.",
521
+ "type": "object",
522
+ "minProperties": 1,
523
+ "additionalProperties": true,
524
+ "propertyNames": {
525
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
526
+ }
527
+ },
528
+ "TrusteeIndex": {
529
+ "title": "TrusteeIndex",
530
+ "description": "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.",
531
+ "type": "integer",
532
+ "minimum": 1,
533
+ "maximum": 64
534
+ },
535
+ "DecryptionTarget": {
536
+ "title": "DecryptionTarget",
537
+ "description": "What a partial decryption decrypts: the sealed cast at a board leaf, or the total of one option of one question.",
538
+ "type": "object",
539
+ "additionalProperties": false,
540
+ "required": [
541
+ "ciphertext"
542
+ ],
543
+ "properties": {
544
+ "leafIndex": {
545
+ "type": "integer",
546
+ "minimum": 0,
547
+ "description": "A sealed cast's board leaf."
548
+ },
549
+ "question": {
550
+ "$ref": "#/$defs/Key"
551
+ },
552
+ "option": {
553
+ "$ref": "#/$defs/Key"
554
+ },
555
+ "ciphertext": {
556
+ "$ref": "#/$defs/ElGamalCiphertext"
557
+ }
558
+ },
559
+ "oneOf": [
560
+ {
561
+ "required": [
562
+ "leafIndex"
563
+ ]
564
+ },
565
+ {
566
+ "required": [
567
+ "question",
568
+ "option"
569
+ ]
570
+ }
571
+ ]
572
+ },
573
+ "ElGamalCiphertext": {
574
+ "title": "ElGamalCiphertext",
575
+ "description": "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).",
576
+ "type": "object",
577
+ "additionalProperties": false,
578
+ "required": [
579
+ "a",
580
+ "b"
581
+ ],
582
+ "properties": {
583
+ "a": {
584
+ "$ref": "#/$defs/GroupElement"
585
+ },
586
+ "b": {
587
+ "$ref": "#/$defs/GroupElement"
588
+ }
589
+ }
590
+ },
591
+ "GroupElement": {
592
+ "title": "GroupElement",
593
+ "description": "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).",
594
+ "type": "string",
595
+ "minLength": 2,
596
+ "maxLength": 64,
597
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
598
+ },
599
+ "Key": {
600
+ "title": "Key",
601
+ "description": "A question or option key, unique within its manifest or question.",
602
+ "type": "string",
603
+ "pattern": "^[A-Za-z0-9._-]{1,64}$"
604
+ },
605
+ "ElectionKey": {
606
+ "title": "ElectionKey",
607
+ "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.",
608
+ "type": "object",
609
+ "additionalProperties": false,
610
+ "required": [
611
+ "key",
612
+ "qualified",
613
+ "verification"
614
+ ],
615
+ "properties": {
616
+ "key": {
617
+ "$ref": "#/$defs/GroupElement"
618
+ },
619
+ "qualified": {
620
+ "type": "array",
621
+ "minItems": 1,
622
+ "maxItems": 64,
623
+ "items": {
624
+ "$ref": "#/$defs/TrusteeIndex"
625
+ },
626
+ "description": "The dealers whose dealings the key is formed from."
627
+ },
628
+ "verification": {
629
+ "type": "array",
630
+ "minItems": 2,
631
+ "maxItems": 64,
632
+ "items": {
633
+ "type": "object",
634
+ "additionalProperties": false,
635
+ "required": [
636
+ "trustee",
637
+ "key"
638
+ ],
639
+ "properties": {
640
+ "trustee": {
641
+ "$ref": "#/$defs/TrusteeIndex"
642
+ },
643
+ "key": {
644
+ "$ref": "#/$defs/GroupElement"
645
+ }
646
+ }
647
+ }
648
+ }
649
+ }
650
+ },
651
+ "GroupScalar": {
652
+ "title": "GroupScalar",
653
+ "description": "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).",
654
+ "type": "string",
655
+ "minLength": 2,
656
+ "maxLength": 64,
657
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
658
+ },
659
+ "Dealing": {
660
+ "title": "Dealing",
661
+ "description": "A trustee's contribution to the election key: Feldman commitments to its polynomial, a proof of knowledge of the constant term, and one share per trustee sealed to that trustee's transport key (CONVENTIONS §9.6).",
662
+ "type": "object",
663
+ "additionalProperties": false,
664
+ "required": [
665
+ "dealer",
666
+ "commitments",
667
+ "pok",
668
+ "shares"
669
+ ],
670
+ "properties": {
671
+ "dealer": {
672
+ "$ref": "#/$defs/TrusteeIndex"
673
+ },
674
+ "commitments": {
675
+ "type": "array",
676
+ "minItems": 2,
677
+ "maxItems": 64,
678
+ "items": {
679
+ "$ref": "#/$defs/GroupElement"
680
+ }
681
+ },
682
+ "pok": {
683
+ "$ref": "#/$defs/SigmaProof"
684
+ },
685
+ "shares": {
686
+ "type": "array",
687
+ "minItems": 2,
688
+ "maxItems": 64,
689
+ "items": {
690
+ "$ref": "#/$defs/SealedShare"
691
+ }
692
+ }
693
+ }
694
+ },
695
+ "SealedShare": {
696
+ "title": "SealedShare",
697
+ "type": "object",
698
+ "additionalProperties": false,
699
+ "required": [
700
+ "recipient",
701
+ "share"
702
+ ],
703
+ "properties": {
704
+ "recipient": {
705
+ "$ref": "#/$defs/TrusteeIndex"
706
+ },
707
+ "share": {
708
+ "$ref": "#/$defs/SealedPayload"
709
+ }
710
+ }
711
+ },
712
+ "SealedPayload": {
713
+ "title": "SealedPayload",
714
+ "description": "Bytes sealed to a key: a random group element encrypted as `kem`, and the bytes under ChaCha20-Poly1305 with a key derived from it, multibase base58btc (CONVENTIONS §9.4).",
715
+ "type": "object",
716
+ "additionalProperties": false,
717
+ "required": [
718
+ "kem",
719
+ "body"
720
+ ],
721
+ "properties": {
722
+ "kem": {
723
+ "$ref": "#/$defs/ElGamalCiphertext"
724
+ },
725
+ "body": {
726
+ "type": "string",
727
+ "minLength": 2,
728
+ "maxLength": 131072,
729
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
730
+ }
731
+ }
732
+ },
733
+ "SigmaProof": {
734
+ "title": "SigmaProof",
735
+ "description": "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).",
736
+ "type": "object",
737
+ "additionalProperties": false,
738
+ "required": [
739
+ "c",
740
+ "z"
741
+ ],
742
+ "properties": {
743
+ "c": {
744
+ "$ref": "#/$defs/GroupScalar"
745
+ },
746
+ "z": {
747
+ "$ref": "#/$defs/GroupScalar"
748
+ }
749
+ }
750
+ },
751
+ "TransportKey": {
752
+ "title": "TransportKey",
753
+ "description": "The group element a trustee's shares are sealed to, with a Schnorr proof of knowledge of its discrete log (CONVENTIONS §9.6).",
754
+ "type": "object",
755
+ "additionalProperties": false,
756
+ "required": [
757
+ "trustee",
758
+ "key",
759
+ "pok"
760
+ ],
761
+ "properties": {
762
+ "trustee": {
763
+ "$ref": "#/$defs/TrusteeIndex"
764
+ },
765
+ "key": {
766
+ "$ref": "#/$defs/GroupElement"
767
+ },
768
+ "pok": {
769
+ "$ref": "#/$defs/SigmaProof"
770
+ }
771
+ }
772
+ },
773
+ "TrusteePhase": {
774
+ "title": "TrusteePhase",
775
+ "description": "`enrolling`: transport keys are being published. `dealing`: dealings are. `confirming`: each trustee confirms or complains. `keyed`: the election key is formed. `decrypting`: voting has closed and partial decryptions are being published. `done`: every target is decrypted. `failed`: the key could not be formed in time.",
776
+ "type": "string",
777
+ "enum": [
778
+ "enrolling",
779
+ "dealing",
780
+ "confirming",
781
+ "keyed",
782
+ "decrypting",
783
+ "done",
784
+ "failed"
785
+ ]
786
+ },
787
+ "ElectionId": {
788
+ "title": "ElectionId",
789
+ "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.",
790
+ "type": "string",
791
+ "pattern": "^[A-Za-z0-9._-]{1,128}$"
792
+ }
793
+ }
794
+ };
795
+ /**
796
+ * SPEC.md §7.2 policy for the request variant, from this specification's
797
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
798
+ * per-specification and cannot be derived from the document alone, and
799
+ * item 2 needs the schema this carries.
800
+ */
801
+ export const SPEC = {
802
+ typeUri: TYPE_URI,
803
+ isBearer: false,
804
+ isProofRequired: false,
805
+ isRecipientRequired: true,
806
+ isIssuedAtRequired: true,
807
+ payloadSchema: PAYLOAD_SCHEMA,
808
+ };
809
+ /**
810
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
811
+ * tracks the *issuer* party's requirement because a response swaps the
812
+ * parties (§7.3 item 5).
813
+ */
814
+ export const RESPONSE_SPEC = {
815
+ typeUri: RESPONSE_TYPE_URI,
816
+ isBearer: false,
817
+ isProofRequired: true,
818
+ isRecipientRequired: true,
819
+ isIssuedAtRequired: true,
820
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
821
+ };
822
+ //# sourceMappingURL=payload.js.map