@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
@@ -0,0 +1,665 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/voting/trustees/deal/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { BoardHead, Dealing, DigestMultibase, ElectionId, ElectionState, ElectionSummary, ElGamalCiphertext, Ext, GroupElement, GroupScalar, SealedPayload, SealedShare, SigmaProof, TrusteeIndex, TrusteePhase } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A trustee publishes its contribution to the election key: commitments to its polynomial and every trustee's share sealed to that trustee.
11
+ */
12
+ export interface VotingTrusteesDealPayload {
13
+ /**
14
+ * The community's DID: the registrar that registered the election.
15
+ */
16
+ community: string;
17
+ electionId: ElectionId;
18
+ dealing: Dealing;
19
+ ext?: Ext;
20
+ }
21
+ export interface VotingTrusteesDealResponsePayload {
22
+ election: ElectionSummary;
23
+ phase: TrusteePhase;
24
+ ext?: Ext;
25
+ }
26
+
27
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
28
+ export type { BoardHead, Dealing, DigestMultibase, ElectionId, ElectionState, ElectionSummary, ElGamalCiphertext, Ext, GroupElement, GroupScalar, SealedPayload, SealedShare, SigmaProof, TrusteeIndex, TrusteePhase };
29
+
30
+ /** Trust Task type URI. */
31
+ export const TYPE_URI = "https://trusttasks.org/spec/voting/trustees/deal/0.1" as const;
32
+
33
+ /** Stable alias for this specification's request payload shape. */
34
+ export type Payload = VotingTrusteesDealPayload;
35
+
36
+ /** Trust Task response type URI (request type URI + "#response"). */
37
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/voting/trustees/deal/0.1#response" as const;
38
+
39
+ /** Stable alias for this specification's success-response payload shape. */
40
+ export type Response = VotingTrusteesDealResponsePayload;
41
+
42
+ /**
43
+ * This specification's payload schema, as a value.
44
+ *
45
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
46
+ * rather than only as a `.json` file because TypeScript types are erased
47
+ * at runtime: without a schema a consumer has nothing to validate, and
48
+ * every REQUIRED payload member is optional in practice. Cross-file
49
+ * `$ref`s are already inlined, so it needs no resolver.
50
+ */
51
+ export const PAYLOAD_SCHEMA = {
52
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
53
+ "$id": "https://trusttasks.org/spec/voting/trustees/deal/0.1",
54
+ "title": "Voting — Trustees — Deal — payload",
55
+ "description": "A trustee publishes its contribution to the election key: commitments to its polynomial and every trustee's share sealed to that trustee.",
56
+ "type": "object",
57
+ "additionalProperties": false,
58
+ "required": [
59
+ "community",
60
+ "electionId",
61
+ "dealing"
62
+ ],
63
+ "properties": {
64
+ "community": {
65
+ "type": "string",
66
+ "minLength": 1,
67
+ "maxLength": 2048,
68
+ "description": "The community's DID: the registrar that registered the election."
69
+ },
70
+ "electionId": {
71
+ "$ref": "#/$defs/ElectionId"
72
+ },
73
+ "dealing": {
74
+ "$ref": "#/$defs/Dealing"
75
+ },
76
+ "ext": {
77
+ "$ref": "#/$defs/Ext"
78
+ }
79
+ },
80
+ "$defs": {
81
+ "Response": {
82
+ "$anchor": "response",
83
+ "title": "Voting — Trustees — Deal — response payload",
84
+ "type": "object",
85
+ "additionalProperties": false,
86
+ "required": [
87
+ "election",
88
+ "phase"
89
+ ],
90
+ "properties": {
91
+ "election": {
92
+ "$ref": "#/$defs/ElectionSummary"
93
+ },
94
+ "phase": {
95
+ "$ref": "#/$defs/TrusteePhase"
96
+ },
97
+ "ext": {
98
+ "$ref": "#/$defs/Ext"
99
+ }
100
+ }
101
+ },
102
+ "Ext": {
103
+ "title": "Ext",
104
+ "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.",
105
+ "type": "object",
106
+ "minProperties": 1,
107
+ "additionalProperties": true,
108
+ "propertyNames": {
109
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
110
+ }
111
+ },
112
+ "TrusteePhase": {
113
+ "title": "TrusteePhase",
114
+ "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.",
115
+ "type": "string",
116
+ "enum": [
117
+ "enrolling",
118
+ "dealing",
119
+ "confirming",
120
+ "keyed",
121
+ "decrypting",
122
+ "done",
123
+ "failed"
124
+ ]
125
+ },
126
+ "ElectionSummary": {
127
+ "title": "ElectionSummary",
128
+ "description": "A ballot box's view of one election.",
129
+ "type": "object",
130
+ "additionalProperties": false,
131
+ "required": [
132
+ "electionId",
133
+ "community",
134
+ "manifestDigest",
135
+ "state",
136
+ "ballotsAdmitted",
137
+ "head"
138
+ ],
139
+ "properties": {
140
+ "electionId": {
141
+ "$ref": "#/$defs/ElectionId"
142
+ },
143
+ "community": {
144
+ "type": "string",
145
+ "minLength": 1,
146
+ "maxLength": 2048
147
+ },
148
+ "manifestDigest": {
149
+ "$ref": "#/$defs/DigestMultibase"
150
+ },
151
+ "state": {
152
+ "$ref": "#/$defs/ElectionState"
153
+ },
154
+ "ballotsAdmitted": {
155
+ "type": "integer",
156
+ "minimum": 0,
157
+ "description": "Distinct tags with a counted ballot."
158
+ },
159
+ "head": {
160
+ "$ref": "#/$defs/BoardHead"
161
+ }
162
+ }
163
+ },
164
+ "BoardHead": {
165
+ "title": "BoardHead",
166
+ "description": "A board's tree head (RFC 9162 §2.1). A head is signed by being carried in a document the ballot box signs; whoever keeps a head keeps that whole document.",
167
+ "type": "object",
168
+ "additionalProperties": false,
169
+ "required": [
170
+ "electionId",
171
+ "treeSize",
172
+ "rootHash",
173
+ "issuedAt"
174
+ ],
175
+ "properties": {
176
+ "electionId": {
177
+ "$ref": "#/$defs/ElectionId"
178
+ },
179
+ "treeSize": {
180
+ "type": "integer",
181
+ "minimum": 0
182
+ },
183
+ "rootHash": {
184
+ "$ref": "#/$defs/DigestMultibase",
185
+ "description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
186
+ },
187
+ "issuedAt": {
188
+ "type": "string",
189
+ "format": "date-time"
190
+ }
191
+ }
192
+ },
193
+ "ElectionId": {
194
+ "title": "ElectionId",
195
+ "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.",
196
+ "type": "string",
197
+ "pattern": "^[A-Za-z0-9._-]{1,128}$"
198
+ },
199
+ "DigestMultibase": {
200
+ "title": "DigestMultibase",
201
+ "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`.",
202
+ "type": "string",
203
+ "minLength": 16,
204
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
205
+ "examples": [
206
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
207
+ ]
208
+ },
209
+ "ElectionState": {
210
+ "title": "ElectionState",
211
+ "type": "string",
212
+ "enum": [
213
+ "registered",
214
+ "registration",
215
+ "voting",
216
+ "closed",
217
+ "tallied",
218
+ "cancelled"
219
+ ]
220
+ },
221
+ "Dealing": {
222
+ "title": "Dealing",
223
+ "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).",
224
+ "type": "object",
225
+ "additionalProperties": false,
226
+ "required": [
227
+ "dealer",
228
+ "commitments",
229
+ "pok",
230
+ "shares"
231
+ ],
232
+ "properties": {
233
+ "dealer": {
234
+ "$ref": "#/$defs/TrusteeIndex"
235
+ },
236
+ "commitments": {
237
+ "type": "array",
238
+ "minItems": 2,
239
+ "maxItems": 64,
240
+ "items": {
241
+ "$ref": "#/$defs/GroupElement"
242
+ }
243
+ },
244
+ "pok": {
245
+ "$ref": "#/$defs/SigmaProof"
246
+ },
247
+ "shares": {
248
+ "type": "array",
249
+ "minItems": 2,
250
+ "maxItems": 64,
251
+ "items": {
252
+ "$ref": "#/$defs/SealedShare"
253
+ }
254
+ }
255
+ }
256
+ },
257
+ "SealedShare": {
258
+ "title": "SealedShare",
259
+ "type": "object",
260
+ "additionalProperties": false,
261
+ "required": [
262
+ "recipient",
263
+ "share"
264
+ ],
265
+ "properties": {
266
+ "recipient": {
267
+ "$ref": "#/$defs/TrusteeIndex"
268
+ },
269
+ "share": {
270
+ "$ref": "#/$defs/SealedPayload"
271
+ }
272
+ }
273
+ },
274
+ "SealedPayload": {
275
+ "title": "SealedPayload",
276
+ "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).",
277
+ "type": "object",
278
+ "additionalProperties": false,
279
+ "required": [
280
+ "kem",
281
+ "body"
282
+ ],
283
+ "properties": {
284
+ "kem": {
285
+ "$ref": "#/$defs/ElGamalCiphertext"
286
+ },
287
+ "body": {
288
+ "type": "string",
289
+ "minLength": 2,
290
+ "maxLength": 131072,
291
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
292
+ }
293
+ }
294
+ },
295
+ "ElGamalCiphertext": {
296
+ "title": "ElGamalCiphertext",
297
+ "description": "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).",
298
+ "type": "object",
299
+ "additionalProperties": false,
300
+ "required": [
301
+ "a",
302
+ "b"
303
+ ],
304
+ "properties": {
305
+ "a": {
306
+ "$ref": "#/$defs/GroupElement"
307
+ },
308
+ "b": {
309
+ "$ref": "#/$defs/GroupElement"
310
+ }
311
+ }
312
+ },
313
+ "GroupElement": {
314
+ "title": "GroupElement",
315
+ "description": "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).",
316
+ "type": "string",
317
+ "minLength": 2,
318
+ "maxLength": 64,
319
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
320
+ },
321
+ "TrusteeIndex": {
322
+ "title": "TrusteeIndex",
323
+ "description": "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.",
324
+ "type": "integer",
325
+ "minimum": 1,
326
+ "maximum": 64
327
+ },
328
+ "SigmaProof": {
329
+ "title": "SigmaProof",
330
+ "description": "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).",
331
+ "type": "object",
332
+ "additionalProperties": false,
333
+ "required": [
334
+ "c",
335
+ "z"
336
+ ],
337
+ "properties": {
338
+ "c": {
339
+ "$ref": "#/$defs/GroupScalar"
340
+ },
341
+ "z": {
342
+ "$ref": "#/$defs/GroupScalar"
343
+ }
344
+ }
345
+ },
346
+ "GroupScalar": {
347
+ "title": "GroupScalar",
348
+ "description": "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).",
349
+ "type": "string",
350
+ "minLength": 2,
351
+ "maxLength": 64,
352
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
353
+ }
354
+ }
355
+ } as const;
356
+
357
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
358
+ export const RESPONSE_PAYLOAD_SCHEMA = {
359
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
360
+ "$ref": "#/$defs/Response",
361
+ "$defs": {
362
+ "Response": {
363
+ "$anchor": "response",
364
+ "title": "Voting — Trustees — Deal — response payload",
365
+ "type": "object",
366
+ "additionalProperties": false,
367
+ "required": [
368
+ "election",
369
+ "phase"
370
+ ],
371
+ "properties": {
372
+ "election": {
373
+ "$ref": "#/$defs/ElectionSummary"
374
+ },
375
+ "phase": {
376
+ "$ref": "#/$defs/TrusteePhase"
377
+ },
378
+ "ext": {
379
+ "$ref": "#/$defs/Ext"
380
+ }
381
+ }
382
+ },
383
+ "Ext": {
384
+ "title": "Ext",
385
+ "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.",
386
+ "type": "object",
387
+ "minProperties": 1,
388
+ "additionalProperties": true,
389
+ "propertyNames": {
390
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
391
+ }
392
+ },
393
+ "TrusteePhase": {
394
+ "title": "TrusteePhase",
395
+ "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.",
396
+ "type": "string",
397
+ "enum": [
398
+ "enrolling",
399
+ "dealing",
400
+ "confirming",
401
+ "keyed",
402
+ "decrypting",
403
+ "done",
404
+ "failed"
405
+ ]
406
+ },
407
+ "ElectionSummary": {
408
+ "title": "ElectionSummary",
409
+ "description": "A ballot box's view of one election.",
410
+ "type": "object",
411
+ "additionalProperties": false,
412
+ "required": [
413
+ "electionId",
414
+ "community",
415
+ "manifestDigest",
416
+ "state",
417
+ "ballotsAdmitted",
418
+ "head"
419
+ ],
420
+ "properties": {
421
+ "electionId": {
422
+ "$ref": "#/$defs/ElectionId"
423
+ },
424
+ "community": {
425
+ "type": "string",
426
+ "minLength": 1,
427
+ "maxLength": 2048
428
+ },
429
+ "manifestDigest": {
430
+ "$ref": "#/$defs/DigestMultibase"
431
+ },
432
+ "state": {
433
+ "$ref": "#/$defs/ElectionState"
434
+ },
435
+ "ballotsAdmitted": {
436
+ "type": "integer",
437
+ "minimum": 0,
438
+ "description": "Distinct tags with a counted ballot."
439
+ },
440
+ "head": {
441
+ "$ref": "#/$defs/BoardHead"
442
+ }
443
+ }
444
+ },
445
+ "BoardHead": {
446
+ "title": "BoardHead",
447
+ "description": "A board's tree head (RFC 9162 §2.1). A head is signed by being carried in a document the ballot box signs; whoever keeps a head keeps that whole document.",
448
+ "type": "object",
449
+ "additionalProperties": false,
450
+ "required": [
451
+ "electionId",
452
+ "treeSize",
453
+ "rootHash",
454
+ "issuedAt"
455
+ ],
456
+ "properties": {
457
+ "electionId": {
458
+ "$ref": "#/$defs/ElectionId"
459
+ },
460
+ "treeSize": {
461
+ "type": "integer",
462
+ "minimum": 0
463
+ },
464
+ "rootHash": {
465
+ "$ref": "#/$defs/DigestMultibase",
466
+ "description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
467
+ },
468
+ "issuedAt": {
469
+ "type": "string",
470
+ "format": "date-time"
471
+ }
472
+ }
473
+ },
474
+ "ElectionId": {
475
+ "title": "ElectionId",
476
+ "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.",
477
+ "type": "string",
478
+ "pattern": "^[A-Za-z0-9._-]{1,128}$"
479
+ },
480
+ "DigestMultibase": {
481
+ "title": "DigestMultibase",
482
+ "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`.",
483
+ "type": "string",
484
+ "minLength": 16,
485
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
486
+ "examples": [
487
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
488
+ ]
489
+ },
490
+ "ElectionState": {
491
+ "title": "ElectionState",
492
+ "type": "string",
493
+ "enum": [
494
+ "registered",
495
+ "registration",
496
+ "voting",
497
+ "closed",
498
+ "tallied",
499
+ "cancelled"
500
+ ]
501
+ },
502
+ "Dealing": {
503
+ "title": "Dealing",
504
+ "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).",
505
+ "type": "object",
506
+ "additionalProperties": false,
507
+ "required": [
508
+ "dealer",
509
+ "commitments",
510
+ "pok",
511
+ "shares"
512
+ ],
513
+ "properties": {
514
+ "dealer": {
515
+ "$ref": "#/$defs/TrusteeIndex"
516
+ },
517
+ "commitments": {
518
+ "type": "array",
519
+ "minItems": 2,
520
+ "maxItems": 64,
521
+ "items": {
522
+ "$ref": "#/$defs/GroupElement"
523
+ }
524
+ },
525
+ "pok": {
526
+ "$ref": "#/$defs/SigmaProof"
527
+ },
528
+ "shares": {
529
+ "type": "array",
530
+ "minItems": 2,
531
+ "maxItems": 64,
532
+ "items": {
533
+ "$ref": "#/$defs/SealedShare"
534
+ }
535
+ }
536
+ }
537
+ },
538
+ "SealedShare": {
539
+ "title": "SealedShare",
540
+ "type": "object",
541
+ "additionalProperties": false,
542
+ "required": [
543
+ "recipient",
544
+ "share"
545
+ ],
546
+ "properties": {
547
+ "recipient": {
548
+ "$ref": "#/$defs/TrusteeIndex"
549
+ },
550
+ "share": {
551
+ "$ref": "#/$defs/SealedPayload"
552
+ }
553
+ }
554
+ },
555
+ "SealedPayload": {
556
+ "title": "SealedPayload",
557
+ "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).",
558
+ "type": "object",
559
+ "additionalProperties": false,
560
+ "required": [
561
+ "kem",
562
+ "body"
563
+ ],
564
+ "properties": {
565
+ "kem": {
566
+ "$ref": "#/$defs/ElGamalCiphertext"
567
+ },
568
+ "body": {
569
+ "type": "string",
570
+ "minLength": 2,
571
+ "maxLength": 131072,
572
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
573
+ }
574
+ }
575
+ },
576
+ "ElGamalCiphertext": {
577
+ "title": "ElGamalCiphertext",
578
+ "description": "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).",
579
+ "type": "object",
580
+ "additionalProperties": false,
581
+ "required": [
582
+ "a",
583
+ "b"
584
+ ],
585
+ "properties": {
586
+ "a": {
587
+ "$ref": "#/$defs/GroupElement"
588
+ },
589
+ "b": {
590
+ "$ref": "#/$defs/GroupElement"
591
+ }
592
+ }
593
+ },
594
+ "GroupElement": {
595
+ "title": "GroupElement",
596
+ "description": "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).",
597
+ "type": "string",
598
+ "minLength": 2,
599
+ "maxLength": 64,
600
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
601
+ },
602
+ "TrusteeIndex": {
603
+ "title": "TrusteeIndex",
604
+ "description": "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.",
605
+ "type": "integer",
606
+ "minimum": 1,
607
+ "maximum": 64
608
+ },
609
+ "SigmaProof": {
610
+ "title": "SigmaProof",
611
+ "description": "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).",
612
+ "type": "object",
613
+ "additionalProperties": false,
614
+ "required": [
615
+ "c",
616
+ "z"
617
+ ],
618
+ "properties": {
619
+ "c": {
620
+ "$ref": "#/$defs/GroupScalar"
621
+ },
622
+ "z": {
623
+ "$ref": "#/$defs/GroupScalar"
624
+ }
625
+ }
626
+ },
627
+ "GroupScalar": {
628
+ "title": "GroupScalar",
629
+ "description": "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).",
630
+ "type": "string",
631
+ "minLength": 2,
632
+ "maxLength": 64,
633
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
634
+ }
635
+ }
636
+ } as const;
637
+
638
+ /**
639
+ * SPEC.md §7.2 policy for the request variant, from this specification's
640
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
641
+ * per-specification and cannot be derived from the document alone, and
642
+ * item 2 needs the schema this carries.
643
+ */
644
+ export const SPEC = {
645
+ typeUri: TYPE_URI,
646
+ isBearer: false,
647
+ isProofRequired: true,
648
+ isRecipientRequired: true,
649
+ isIssuedAtRequired: true,
650
+ payloadSchema: PAYLOAD_SCHEMA,
651
+ } as const;
652
+
653
+ /**
654
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
655
+ * tracks the *issuer* party's requirement because a response swaps the
656
+ * parties (§7.3 item 5).
657
+ */
658
+ export const RESPONSE_SPEC = {
659
+ typeUri: RESPONSE_TYPE_URI,
660
+ isBearer: false,
661
+ isProofRequired: true,
662
+ isRecipientRequired: true,
663
+ isIssuedAtRequired: true,
664
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
665
+ } as const;