@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,1009 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/voting/trustees/decrypt/0.1/payload.schema.json
4
+ */
5
+ import type { BoardHead, DecryptionTarget, DigestMultibase, ElectionId, ElectionState, ElectionSummary, Ext, GroupElement, GroupScalar, PartialDecryption, SigmaProof, TrusteeIndex, TrusteePhase } from "../../../../_shared/components.js";
6
+ /**
7
+ * After voting closes, a trustee publishes its partial decryption of every target, each with a proof it used its share of the election key.
8
+ */
9
+ export interface VotingTrusteesDecryptPayload {
10
+ /**
11
+ * The community's DID: the registrar that registered the election.
12
+ */
13
+ community: string;
14
+ electionId: ElectionId;
15
+ trustee: TrusteeIndex;
16
+ /**
17
+ * @minItems 1
18
+ * @maxItems 100000
19
+ */
20
+ partials: [PartialDecryption, ...PartialDecryption[]];
21
+ ext?: Ext;
22
+ }
23
+ export interface VotingTrusteesDecryptResponsePayload {
24
+ election: ElectionSummary;
25
+ phase: TrusteePhase;
26
+ ext?: Ext;
27
+ }
28
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
29
+ export type { BoardHead, DecryptionTarget, DigestMultibase, ElectionId, ElectionState, ElectionSummary, Ext, GroupElement, GroupScalar, PartialDecryption, SigmaProof, TrusteeIndex, TrusteePhase };
30
+ /** Trust Task type URI. */
31
+ export declare const TYPE_URI: "https://trusttasks.org/spec/voting/trustees/decrypt/0.1";
32
+ /** Stable alias for this specification's request payload shape. */
33
+ export type Payload = VotingTrusteesDecryptPayload;
34
+ /** Trust Task response type URI (request type URI + "#response"). */
35
+ export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/voting/trustees/decrypt/0.1#response";
36
+ /** Stable alias for this specification's success-response payload shape. */
37
+ export type Response = VotingTrusteesDecryptResponsePayload;
38
+ /**
39
+ * This specification's payload schema, as a value.
40
+ *
41
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
42
+ * rather than only as a `.json` file because TypeScript types are erased
43
+ * at runtime: without a schema a consumer has nothing to validate, and
44
+ * every REQUIRED payload member is optional in practice. Cross-file
45
+ * `$ref`s are already inlined, so it needs no resolver.
46
+ */
47
+ export declare const PAYLOAD_SCHEMA: {
48
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
49
+ readonly $id: "https://trusttasks.org/spec/voting/trustees/decrypt/0.1";
50
+ readonly title: "Voting — Trustees — Decrypt — payload";
51
+ readonly description: "After voting closes, a trustee publishes its partial decryption of every target, each with a proof it used its share of the election key.";
52
+ readonly type: "object";
53
+ readonly additionalProperties: false;
54
+ readonly required: readonly ["community", "electionId", "trustee", "partials"];
55
+ readonly properties: {
56
+ readonly community: {
57
+ readonly type: "string";
58
+ readonly minLength: 1;
59
+ readonly maxLength: 2048;
60
+ readonly description: "The community's DID: the registrar that registered the election.";
61
+ };
62
+ readonly electionId: {
63
+ readonly $ref: "#/$defs/ElectionId";
64
+ };
65
+ readonly trustee: {
66
+ readonly $ref: "#/$defs/TrusteeIndex";
67
+ };
68
+ readonly partials: {
69
+ readonly type: "array";
70
+ readonly minItems: 1;
71
+ readonly maxItems: 100000;
72
+ readonly items: {
73
+ readonly $ref: "#/$defs/PartialDecryption";
74
+ };
75
+ };
76
+ readonly ext: {
77
+ readonly $ref: "#/$defs/Ext";
78
+ };
79
+ };
80
+ readonly $defs: {
81
+ readonly Response: {
82
+ readonly $anchor: "response";
83
+ readonly title: "Voting — Trustees — Decrypt — response payload";
84
+ readonly type: "object";
85
+ readonly additionalProperties: false;
86
+ readonly required: readonly ["election", "phase"];
87
+ readonly properties: {
88
+ readonly election: {
89
+ readonly $ref: "#/$defs/ElectionSummary";
90
+ };
91
+ readonly phase: {
92
+ readonly $ref: "#/$defs/TrusteePhase";
93
+ };
94
+ readonly ext: {
95
+ readonly $ref: "#/$defs/Ext";
96
+ };
97
+ };
98
+ };
99
+ readonly Ext: {
100
+ readonly title: "Ext";
101
+ readonly 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.";
102
+ readonly type: "object";
103
+ readonly minProperties: 1;
104
+ readonly additionalProperties: true;
105
+ readonly propertyNames: {
106
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
107
+ };
108
+ };
109
+ readonly TrusteePhase: {
110
+ readonly title: "TrusteePhase";
111
+ readonly 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.";
112
+ readonly type: "string";
113
+ readonly enum: readonly ["enrolling", "dealing", "confirming", "keyed", "decrypting", "done", "failed"];
114
+ };
115
+ readonly ElectionSummary: {
116
+ readonly title: "ElectionSummary";
117
+ readonly description: "A ballot box's view of one election.";
118
+ readonly type: "object";
119
+ readonly additionalProperties: false;
120
+ readonly required: readonly ["electionId", "community", "manifestDigest", "state", "ballotsAdmitted", "head"];
121
+ readonly properties: {
122
+ readonly electionId: {
123
+ readonly $ref: "#/$defs/ElectionId";
124
+ };
125
+ readonly community: {
126
+ readonly type: "string";
127
+ readonly minLength: 1;
128
+ readonly maxLength: 2048;
129
+ };
130
+ readonly manifestDigest: {
131
+ readonly $ref: "#/$defs/DigestMultibase";
132
+ };
133
+ readonly state: {
134
+ readonly $ref: "#/$defs/ElectionState";
135
+ };
136
+ readonly ballotsAdmitted: {
137
+ readonly type: "integer";
138
+ readonly minimum: 0;
139
+ readonly description: "Distinct tags with a counted ballot.";
140
+ };
141
+ readonly head: {
142
+ readonly $ref: "#/$defs/BoardHead";
143
+ };
144
+ };
145
+ };
146
+ readonly BoardHead: {
147
+ readonly title: "BoardHead";
148
+ readonly 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.";
149
+ readonly type: "object";
150
+ readonly additionalProperties: false;
151
+ readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
152
+ readonly properties: {
153
+ readonly electionId: {
154
+ readonly $ref: "#/$defs/ElectionId";
155
+ };
156
+ readonly treeSize: {
157
+ readonly type: "integer";
158
+ readonly minimum: 0;
159
+ };
160
+ readonly rootHash: {
161
+ readonly $ref: "#/$defs/DigestMultibase";
162
+ readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
163
+ };
164
+ readonly issuedAt: {
165
+ readonly type: "string";
166
+ readonly format: "date-time";
167
+ };
168
+ };
169
+ };
170
+ readonly ElectionId: {
171
+ readonly title: "ElectionId";
172
+ readonly 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.";
173
+ readonly type: "string";
174
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
175
+ };
176
+ readonly DigestMultibase: {
177
+ readonly title: "DigestMultibase";
178
+ readonly 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`.";
179
+ readonly type: "string";
180
+ readonly minLength: 16;
181
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
182
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
183
+ };
184
+ readonly ElectionState: {
185
+ readonly title: "ElectionState";
186
+ readonly type: "string";
187
+ readonly enum: readonly ["registered", "registration", "voting", "closed", "tallied", "cancelled"];
188
+ };
189
+ readonly PartialDecryption: {
190
+ readonly title: "PartialDecryption";
191
+ readonly description: "Trustee `trustee`'s share of one decryption, `d = x_j·a`, with a Chaum–Pedersen proof against its verification key (CONVENTIONS §9.7).";
192
+ readonly type: "object";
193
+ readonly additionalProperties: false;
194
+ readonly required: readonly ["target", "d", "proof"];
195
+ readonly properties: {
196
+ readonly target: {
197
+ readonly $ref: "#/$defs/DecryptionTarget";
198
+ };
199
+ readonly d: {
200
+ readonly $ref: "#/$defs/GroupElement";
201
+ };
202
+ readonly proof: {
203
+ readonly $ref: "#/$defs/SigmaProof";
204
+ };
205
+ };
206
+ };
207
+ readonly SigmaProof: {
208
+ readonly title: "SigmaProof";
209
+ readonly description: "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).";
210
+ readonly type: "object";
211
+ readonly additionalProperties: false;
212
+ readonly required: readonly ["c", "z"];
213
+ readonly properties: {
214
+ readonly c: {
215
+ readonly $ref: "#/$defs/GroupScalar";
216
+ };
217
+ readonly z: {
218
+ readonly $ref: "#/$defs/GroupScalar";
219
+ };
220
+ };
221
+ };
222
+ readonly GroupScalar: {
223
+ readonly title: "GroupScalar";
224
+ readonly description: "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).";
225
+ readonly type: "string";
226
+ readonly minLength: 2;
227
+ readonly maxLength: 64;
228
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
229
+ };
230
+ readonly GroupElement: {
231
+ readonly title: "GroupElement";
232
+ readonly description: "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).";
233
+ readonly type: "string";
234
+ readonly minLength: 2;
235
+ readonly maxLength: 64;
236
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
237
+ };
238
+ readonly DecryptionTarget: {
239
+ readonly title: "DecryptionTarget";
240
+ readonly description: "What a partial decryption decrypts: the sealed cast at a board leaf, or the total of one option of one question.";
241
+ readonly type: "object";
242
+ readonly additionalProperties: false;
243
+ readonly required: readonly ["ciphertext"];
244
+ readonly properties: {
245
+ readonly leafIndex: {
246
+ readonly type: "integer";
247
+ readonly minimum: 0;
248
+ readonly description: "A sealed cast's board leaf.";
249
+ };
250
+ readonly question: {
251
+ readonly $ref: "#/$defs/Key";
252
+ };
253
+ readonly option: {
254
+ readonly $ref: "#/$defs/Key";
255
+ };
256
+ readonly ciphertext: {
257
+ readonly $ref: "#/$defs/ElGamalCiphertext";
258
+ };
259
+ };
260
+ readonly oneOf: readonly [{
261
+ readonly required: readonly ["leafIndex"];
262
+ }, {
263
+ readonly required: readonly ["question", "option"];
264
+ }];
265
+ };
266
+ readonly ElGamalCiphertext: {
267
+ readonly title: "ElGamalCiphertext";
268
+ readonly description: "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).";
269
+ readonly type: "object";
270
+ readonly additionalProperties: false;
271
+ readonly required: readonly ["a", "b"];
272
+ readonly properties: {
273
+ readonly a: {
274
+ readonly $ref: "#/$defs/GroupElement";
275
+ };
276
+ readonly b: {
277
+ readonly $ref: "#/$defs/GroupElement";
278
+ };
279
+ };
280
+ };
281
+ readonly Key: {
282
+ readonly title: "Key";
283
+ readonly description: "A question or option key, unique within its manifest or question.";
284
+ readonly type: "string";
285
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
286
+ };
287
+ readonly TrusteeIndex: {
288
+ readonly title: "TrusteeIndex";
289
+ readonly description: "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.";
290
+ readonly type: "integer";
291
+ readonly minimum: 1;
292
+ readonly maximum: 64;
293
+ };
294
+ };
295
+ };
296
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
297
+ export declare const RESPONSE_PAYLOAD_SCHEMA: {
298
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
299
+ readonly $ref: "#/$defs/Response";
300
+ readonly $defs: {
301
+ readonly Response: {
302
+ readonly $anchor: "response";
303
+ readonly title: "Voting — Trustees — Decrypt — response payload";
304
+ readonly type: "object";
305
+ readonly additionalProperties: false;
306
+ readonly required: readonly ["election", "phase"];
307
+ readonly properties: {
308
+ readonly election: {
309
+ readonly $ref: "#/$defs/ElectionSummary";
310
+ };
311
+ readonly phase: {
312
+ readonly $ref: "#/$defs/TrusteePhase";
313
+ };
314
+ readonly ext: {
315
+ readonly $ref: "#/$defs/Ext";
316
+ };
317
+ };
318
+ };
319
+ readonly Ext: {
320
+ readonly title: "Ext";
321
+ readonly 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.";
322
+ readonly type: "object";
323
+ readonly minProperties: 1;
324
+ readonly additionalProperties: true;
325
+ readonly propertyNames: {
326
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
327
+ };
328
+ };
329
+ readonly TrusteePhase: {
330
+ readonly title: "TrusteePhase";
331
+ readonly 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.";
332
+ readonly type: "string";
333
+ readonly enum: readonly ["enrolling", "dealing", "confirming", "keyed", "decrypting", "done", "failed"];
334
+ };
335
+ readonly ElectionSummary: {
336
+ readonly title: "ElectionSummary";
337
+ readonly description: "A ballot box's view of one election.";
338
+ readonly type: "object";
339
+ readonly additionalProperties: false;
340
+ readonly required: readonly ["electionId", "community", "manifestDigest", "state", "ballotsAdmitted", "head"];
341
+ readonly properties: {
342
+ readonly electionId: {
343
+ readonly $ref: "#/$defs/ElectionId";
344
+ };
345
+ readonly community: {
346
+ readonly type: "string";
347
+ readonly minLength: 1;
348
+ readonly maxLength: 2048;
349
+ };
350
+ readonly manifestDigest: {
351
+ readonly $ref: "#/$defs/DigestMultibase";
352
+ };
353
+ readonly state: {
354
+ readonly $ref: "#/$defs/ElectionState";
355
+ };
356
+ readonly ballotsAdmitted: {
357
+ readonly type: "integer";
358
+ readonly minimum: 0;
359
+ readonly description: "Distinct tags with a counted ballot.";
360
+ };
361
+ readonly head: {
362
+ readonly $ref: "#/$defs/BoardHead";
363
+ };
364
+ };
365
+ };
366
+ readonly BoardHead: {
367
+ readonly title: "BoardHead";
368
+ readonly 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.";
369
+ readonly type: "object";
370
+ readonly additionalProperties: false;
371
+ readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
372
+ readonly properties: {
373
+ readonly electionId: {
374
+ readonly $ref: "#/$defs/ElectionId";
375
+ };
376
+ readonly treeSize: {
377
+ readonly type: "integer";
378
+ readonly minimum: 0;
379
+ };
380
+ readonly rootHash: {
381
+ readonly $ref: "#/$defs/DigestMultibase";
382
+ readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
383
+ };
384
+ readonly issuedAt: {
385
+ readonly type: "string";
386
+ readonly format: "date-time";
387
+ };
388
+ };
389
+ };
390
+ readonly ElectionId: {
391
+ readonly title: "ElectionId";
392
+ readonly 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.";
393
+ readonly type: "string";
394
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
395
+ };
396
+ readonly DigestMultibase: {
397
+ readonly title: "DigestMultibase";
398
+ readonly 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`.";
399
+ readonly type: "string";
400
+ readonly minLength: 16;
401
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
402
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
403
+ };
404
+ readonly ElectionState: {
405
+ readonly title: "ElectionState";
406
+ readonly type: "string";
407
+ readonly enum: readonly ["registered", "registration", "voting", "closed", "tallied", "cancelled"];
408
+ };
409
+ readonly PartialDecryption: {
410
+ readonly title: "PartialDecryption";
411
+ readonly description: "Trustee `trustee`'s share of one decryption, `d = x_j·a`, with a Chaum–Pedersen proof against its verification key (CONVENTIONS §9.7).";
412
+ readonly type: "object";
413
+ readonly additionalProperties: false;
414
+ readonly required: readonly ["target", "d", "proof"];
415
+ readonly properties: {
416
+ readonly target: {
417
+ readonly $ref: "#/$defs/DecryptionTarget";
418
+ };
419
+ readonly d: {
420
+ readonly $ref: "#/$defs/GroupElement";
421
+ };
422
+ readonly proof: {
423
+ readonly $ref: "#/$defs/SigmaProof";
424
+ };
425
+ };
426
+ };
427
+ readonly SigmaProof: {
428
+ readonly title: "SigmaProof";
429
+ readonly description: "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).";
430
+ readonly type: "object";
431
+ readonly additionalProperties: false;
432
+ readonly required: readonly ["c", "z"];
433
+ readonly properties: {
434
+ readonly c: {
435
+ readonly $ref: "#/$defs/GroupScalar";
436
+ };
437
+ readonly z: {
438
+ readonly $ref: "#/$defs/GroupScalar";
439
+ };
440
+ };
441
+ };
442
+ readonly GroupScalar: {
443
+ readonly title: "GroupScalar";
444
+ readonly description: "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).";
445
+ readonly type: "string";
446
+ readonly minLength: 2;
447
+ readonly maxLength: 64;
448
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
449
+ };
450
+ readonly GroupElement: {
451
+ readonly title: "GroupElement";
452
+ readonly description: "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).";
453
+ readonly type: "string";
454
+ readonly minLength: 2;
455
+ readonly maxLength: 64;
456
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
457
+ };
458
+ readonly DecryptionTarget: {
459
+ readonly title: "DecryptionTarget";
460
+ readonly description: "What a partial decryption decrypts: the sealed cast at a board leaf, or the total of one option of one question.";
461
+ readonly type: "object";
462
+ readonly additionalProperties: false;
463
+ readonly required: readonly ["ciphertext"];
464
+ readonly properties: {
465
+ readonly leafIndex: {
466
+ readonly type: "integer";
467
+ readonly minimum: 0;
468
+ readonly description: "A sealed cast's board leaf.";
469
+ };
470
+ readonly question: {
471
+ readonly $ref: "#/$defs/Key";
472
+ };
473
+ readonly option: {
474
+ readonly $ref: "#/$defs/Key";
475
+ };
476
+ readonly ciphertext: {
477
+ readonly $ref: "#/$defs/ElGamalCiphertext";
478
+ };
479
+ };
480
+ readonly oneOf: readonly [{
481
+ readonly required: readonly ["leafIndex"];
482
+ }, {
483
+ readonly required: readonly ["question", "option"];
484
+ }];
485
+ };
486
+ readonly ElGamalCiphertext: {
487
+ readonly title: "ElGamalCiphertext";
488
+ readonly description: "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).";
489
+ readonly type: "object";
490
+ readonly additionalProperties: false;
491
+ readonly required: readonly ["a", "b"];
492
+ readonly properties: {
493
+ readonly a: {
494
+ readonly $ref: "#/$defs/GroupElement";
495
+ };
496
+ readonly b: {
497
+ readonly $ref: "#/$defs/GroupElement";
498
+ };
499
+ };
500
+ };
501
+ readonly Key: {
502
+ readonly title: "Key";
503
+ readonly description: "A question or option key, unique within its manifest or question.";
504
+ readonly type: "string";
505
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
506
+ };
507
+ readonly TrusteeIndex: {
508
+ readonly title: "TrusteeIndex";
509
+ readonly description: "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.";
510
+ readonly type: "integer";
511
+ readonly minimum: 1;
512
+ readonly maximum: 64;
513
+ };
514
+ };
515
+ };
516
+ /**
517
+ * SPEC.md §7.2 policy for the request variant, from this specification's
518
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
519
+ * per-specification and cannot be derived from the document alone, and
520
+ * item 2 needs the schema this carries.
521
+ */
522
+ export declare const SPEC: {
523
+ readonly typeUri: "https://trusttasks.org/spec/voting/trustees/decrypt/0.1";
524
+ readonly isBearer: false;
525
+ readonly isProofRequired: true;
526
+ readonly isRecipientRequired: true;
527
+ readonly isIssuedAtRequired: true;
528
+ readonly payloadSchema: {
529
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
530
+ readonly $id: "https://trusttasks.org/spec/voting/trustees/decrypt/0.1";
531
+ readonly title: "Voting — Trustees — Decrypt — payload";
532
+ readonly description: "After voting closes, a trustee publishes its partial decryption of every target, each with a proof it used its share of the election key.";
533
+ readonly type: "object";
534
+ readonly additionalProperties: false;
535
+ readonly required: readonly ["community", "electionId", "trustee", "partials"];
536
+ readonly properties: {
537
+ readonly community: {
538
+ readonly type: "string";
539
+ readonly minLength: 1;
540
+ readonly maxLength: 2048;
541
+ readonly description: "The community's DID: the registrar that registered the election.";
542
+ };
543
+ readonly electionId: {
544
+ readonly $ref: "#/$defs/ElectionId";
545
+ };
546
+ readonly trustee: {
547
+ readonly $ref: "#/$defs/TrusteeIndex";
548
+ };
549
+ readonly partials: {
550
+ readonly type: "array";
551
+ readonly minItems: 1;
552
+ readonly maxItems: 100000;
553
+ readonly items: {
554
+ readonly $ref: "#/$defs/PartialDecryption";
555
+ };
556
+ };
557
+ readonly ext: {
558
+ readonly $ref: "#/$defs/Ext";
559
+ };
560
+ };
561
+ readonly $defs: {
562
+ readonly Response: {
563
+ readonly $anchor: "response";
564
+ readonly title: "Voting — Trustees — Decrypt — response payload";
565
+ readonly type: "object";
566
+ readonly additionalProperties: false;
567
+ readonly required: readonly ["election", "phase"];
568
+ readonly properties: {
569
+ readonly election: {
570
+ readonly $ref: "#/$defs/ElectionSummary";
571
+ };
572
+ readonly phase: {
573
+ readonly $ref: "#/$defs/TrusteePhase";
574
+ };
575
+ readonly ext: {
576
+ readonly $ref: "#/$defs/Ext";
577
+ };
578
+ };
579
+ };
580
+ readonly Ext: {
581
+ readonly title: "Ext";
582
+ readonly 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.";
583
+ readonly type: "object";
584
+ readonly minProperties: 1;
585
+ readonly additionalProperties: true;
586
+ readonly propertyNames: {
587
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
588
+ };
589
+ };
590
+ readonly TrusteePhase: {
591
+ readonly title: "TrusteePhase";
592
+ readonly 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.";
593
+ readonly type: "string";
594
+ readonly enum: readonly ["enrolling", "dealing", "confirming", "keyed", "decrypting", "done", "failed"];
595
+ };
596
+ readonly ElectionSummary: {
597
+ readonly title: "ElectionSummary";
598
+ readonly description: "A ballot box's view of one election.";
599
+ readonly type: "object";
600
+ readonly additionalProperties: false;
601
+ readonly required: readonly ["electionId", "community", "manifestDigest", "state", "ballotsAdmitted", "head"];
602
+ readonly properties: {
603
+ readonly electionId: {
604
+ readonly $ref: "#/$defs/ElectionId";
605
+ };
606
+ readonly community: {
607
+ readonly type: "string";
608
+ readonly minLength: 1;
609
+ readonly maxLength: 2048;
610
+ };
611
+ readonly manifestDigest: {
612
+ readonly $ref: "#/$defs/DigestMultibase";
613
+ };
614
+ readonly state: {
615
+ readonly $ref: "#/$defs/ElectionState";
616
+ };
617
+ readonly ballotsAdmitted: {
618
+ readonly type: "integer";
619
+ readonly minimum: 0;
620
+ readonly description: "Distinct tags with a counted ballot.";
621
+ };
622
+ readonly head: {
623
+ readonly $ref: "#/$defs/BoardHead";
624
+ };
625
+ };
626
+ };
627
+ readonly BoardHead: {
628
+ readonly title: "BoardHead";
629
+ readonly 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.";
630
+ readonly type: "object";
631
+ readonly additionalProperties: false;
632
+ readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
633
+ readonly properties: {
634
+ readonly electionId: {
635
+ readonly $ref: "#/$defs/ElectionId";
636
+ };
637
+ readonly treeSize: {
638
+ readonly type: "integer";
639
+ readonly minimum: 0;
640
+ };
641
+ readonly rootHash: {
642
+ readonly $ref: "#/$defs/DigestMultibase";
643
+ readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
644
+ };
645
+ readonly issuedAt: {
646
+ readonly type: "string";
647
+ readonly format: "date-time";
648
+ };
649
+ };
650
+ };
651
+ readonly ElectionId: {
652
+ readonly title: "ElectionId";
653
+ readonly 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.";
654
+ readonly type: "string";
655
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
656
+ };
657
+ readonly DigestMultibase: {
658
+ readonly title: "DigestMultibase";
659
+ readonly 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`.";
660
+ readonly type: "string";
661
+ readonly minLength: 16;
662
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
663
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
664
+ };
665
+ readonly ElectionState: {
666
+ readonly title: "ElectionState";
667
+ readonly type: "string";
668
+ readonly enum: readonly ["registered", "registration", "voting", "closed", "tallied", "cancelled"];
669
+ };
670
+ readonly PartialDecryption: {
671
+ readonly title: "PartialDecryption";
672
+ readonly description: "Trustee `trustee`'s share of one decryption, `d = x_j·a`, with a Chaum–Pedersen proof against its verification key (CONVENTIONS §9.7).";
673
+ readonly type: "object";
674
+ readonly additionalProperties: false;
675
+ readonly required: readonly ["target", "d", "proof"];
676
+ readonly properties: {
677
+ readonly target: {
678
+ readonly $ref: "#/$defs/DecryptionTarget";
679
+ };
680
+ readonly d: {
681
+ readonly $ref: "#/$defs/GroupElement";
682
+ };
683
+ readonly proof: {
684
+ readonly $ref: "#/$defs/SigmaProof";
685
+ };
686
+ };
687
+ };
688
+ readonly SigmaProof: {
689
+ readonly title: "SigmaProof";
690
+ readonly description: "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).";
691
+ readonly type: "object";
692
+ readonly additionalProperties: false;
693
+ readonly required: readonly ["c", "z"];
694
+ readonly properties: {
695
+ readonly c: {
696
+ readonly $ref: "#/$defs/GroupScalar";
697
+ };
698
+ readonly z: {
699
+ readonly $ref: "#/$defs/GroupScalar";
700
+ };
701
+ };
702
+ };
703
+ readonly GroupScalar: {
704
+ readonly title: "GroupScalar";
705
+ readonly description: "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).";
706
+ readonly type: "string";
707
+ readonly minLength: 2;
708
+ readonly maxLength: 64;
709
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
710
+ };
711
+ readonly GroupElement: {
712
+ readonly title: "GroupElement";
713
+ readonly description: "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).";
714
+ readonly type: "string";
715
+ readonly minLength: 2;
716
+ readonly maxLength: 64;
717
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
718
+ };
719
+ readonly DecryptionTarget: {
720
+ readonly title: "DecryptionTarget";
721
+ readonly description: "What a partial decryption decrypts: the sealed cast at a board leaf, or the total of one option of one question.";
722
+ readonly type: "object";
723
+ readonly additionalProperties: false;
724
+ readonly required: readonly ["ciphertext"];
725
+ readonly properties: {
726
+ readonly leafIndex: {
727
+ readonly type: "integer";
728
+ readonly minimum: 0;
729
+ readonly description: "A sealed cast's board leaf.";
730
+ };
731
+ readonly question: {
732
+ readonly $ref: "#/$defs/Key";
733
+ };
734
+ readonly option: {
735
+ readonly $ref: "#/$defs/Key";
736
+ };
737
+ readonly ciphertext: {
738
+ readonly $ref: "#/$defs/ElGamalCiphertext";
739
+ };
740
+ };
741
+ readonly oneOf: readonly [{
742
+ readonly required: readonly ["leafIndex"];
743
+ }, {
744
+ readonly required: readonly ["question", "option"];
745
+ }];
746
+ };
747
+ readonly ElGamalCiphertext: {
748
+ readonly title: "ElGamalCiphertext";
749
+ readonly description: "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).";
750
+ readonly type: "object";
751
+ readonly additionalProperties: false;
752
+ readonly required: readonly ["a", "b"];
753
+ readonly properties: {
754
+ readonly a: {
755
+ readonly $ref: "#/$defs/GroupElement";
756
+ };
757
+ readonly b: {
758
+ readonly $ref: "#/$defs/GroupElement";
759
+ };
760
+ };
761
+ };
762
+ readonly Key: {
763
+ readonly title: "Key";
764
+ readonly description: "A question or option key, unique within its manifest or question.";
765
+ readonly type: "string";
766
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
767
+ };
768
+ readonly TrusteeIndex: {
769
+ readonly title: "TrusteeIndex";
770
+ readonly description: "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.";
771
+ readonly type: "integer";
772
+ readonly minimum: 1;
773
+ readonly maximum: 64;
774
+ };
775
+ };
776
+ };
777
+ };
778
+ /**
779
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
780
+ * tracks the *issuer* party's requirement because a response swaps the
781
+ * parties (§7.3 item 5).
782
+ */
783
+ export declare const RESPONSE_SPEC: {
784
+ readonly typeUri: "https://trusttasks.org/spec/voting/trustees/decrypt/0.1#response";
785
+ readonly isBearer: false;
786
+ readonly isProofRequired: true;
787
+ readonly isRecipientRequired: true;
788
+ readonly isIssuedAtRequired: true;
789
+ readonly payloadSchema: {
790
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
791
+ readonly $ref: "#/$defs/Response";
792
+ readonly $defs: {
793
+ readonly Response: {
794
+ readonly $anchor: "response";
795
+ readonly title: "Voting — Trustees — Decrypt — response payload";
796
+ readonly type: "object";
797
+ readonly additionalProperties: false;
798
+ readonly required: readonly ["election", "phase"];
799
+ readonly properties: {
800
+ readonly election: {
801
+ readonly $ref: "#/$defs/ElectionSummary";
802
+ };
803
+ readonly phase: {
804
+ readonly $ref: "#/$defs/TrusteePhase";
805
+ };
806
+ readonly ext: {
807
+ readonly $ref: "#/$defs/Ext";
808
+ };
809
+ };
810
+ };
811
+ readonly Ext: {
812
+ readonly title: "Ext";
813
+ readonly 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.";
814
+ readonly type: "object";
815
+ readonly minProperties: 1;
816
+ readonly additionalProperties: true;
817
+ readonly propertyNames: {
818
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
819
+ };
820
+ };
821
+ readonly TrusteePhase: {
822
+ readonly title: "TrusteePhase";
823
+ readonly 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.";
824
+ readonly type: "string";
825
+ readonly enum: readonly ["enrolling", "dealing", "confirming", "keyed", "decrypting", "done", "failed"];
826
+ };
827
+ readonly ElectionSummary: {
828
+ readonly title: "ElectionSummary";
829
+ readonly description: "A ballot box's view of one election.";
830
+ readonly type: "object";
831
+ readonly additionalProperties: false;
832
+ readonly required: readonly ["electionId", "community", "manifestDigest", "state", "ballotsAdmitted", "head"];
833
+ readonly properties: {
834
+ readonly electionId: {
835
+ readonly $ref: "#/$defs/ElectionId";
836
+ };
837
+ readonly community: {
838
+ readonly type: "string";
839
+ readonly minLength: 1;
840
+ readonly maxLength: 2048;
841
+ };
842
+ readonly manifestDigest: {
843
+ readonly $ref: "#/$defs/DigestMultibase";
844
+ };
845
+ readonly state: {
846
+ readonly $ref: "#/$defs/ElectionState";
847
+ };
848
+ readonly ballotsAdmitted: {
849
+ readonly type: "integer";
850
+ readonly minimum: 0;
851
+ readonly description: "Distinct tags with a counted ballot.";
852
+ };
853
+ readonly head: {
854
+ readonly $ref: "#/$defs/BoardHead";
855
+ };
856
+ };
857
+ };
858
+ readonly BoardHead: {
859
+ readonly title: "BoardHead";
860
+ readonly 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.";
861
+ readonly type: "object";
862
+ readonly additionalProperties: false;
863
+ readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
864
+ readonly properties: {
865
+ readonly electionId: {
866
+ readonly $ref: "#/$defs/ElectionId";
867
+ };
868
+ readonly treeSize: {
869
+ readonly type: "integer";
870
+ readonly minimum: 0;
871
+ };
872
+ readonly rootHash: {
873
+ readonly $ref: "#/$defs/DigestMultibase";
874
+ readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
875
+ };
876
+ readonly issuedAt: {
877
+ readonly type: "string";
878
+ readonly format: "date-time";
879
+ };
880
+ };
881
+ };
882
+ readonly ElectionId: {
883
+ readonly title: "ElectionId";
884
+ readonly 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.";
885
+ readonly type: "string";
886
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
887
+ };
888
+ readonly DigestMultibase: {
889
+ readonly title: "DigestMultibase";
890
+ readonly 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`.";
891
+ readonly type: "string";
892
+ readonly minLength: 16;
893
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
894
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
895
+ };
896
+ readonly ElectionState: {
897
+ readonly title: "ElectionState";
898
+ readonly type: "string";
899
+ readonly enum: readonly ["registered", "registration", "voting", "closed", "tallied", "cancelled"];
900
+ };
901
+ readonly PartialDecryption: {
902
+ readonly title: "PartialDecryption";
903
+ readonly description: "Trustee `trustee`'s share of one decryption, `d = x_j·a`, with a Chaum–Pedersen proof against its verification key (CONVENTIONS §9.7).";
904
+ readonly type: "object";
905
+ readonly additionalProperties: false;
906
+ readonly required: readonly ["target", "d", "proof"];
907
+ readonly properties: {
908
+ readonly target: {
909
+ readonly $ref: "#/$defs/DecryptionTarget";
910
+ };
911
+ readonly d: {
912
+ readonly $ref: "#/$defs/GroupElement";
913
+ };
914
+ readonly proof: {
915
+ readonly $ref: "#/$defs/SigmaProof";
916
+ };
917
+ };
918
+ };
919
+ readonly SigmaProof: {
920
+ readonly title: "SigmaProof";
921
+ readonly description: "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).";
922
+ readonly type: "object";
923
+ readonly additionalProperties: false;
924
+ readonly required: readonly ["c", "z"];
925
+ readonly properties: {
926
+ readonly c: {
927
+ readonly $ref: "#/$defs/GroupScalar";
928
+ };
929
+ readonly z: {
930
+ readonly $ref: "#/$defs/GroupScalar";
931
+ };
932
+ };
933
+ };
934
+ readonly GroupScalar: {
935
+ readonly title: "GroupScalar";
936
+ readonly description: "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).";
937
+ readonly type: "string";
938
+ readonly minLength: 2;
939
+ readonly maxLength: 64;
940
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
941
+ };
942
+ readonly GroupElement: {
943
+ readonly title: "GroupElement";
944
+ readonly description: "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).";
945
+ readonly type: "string";
946
+ readonly minLength: 2;
947
+ readonly maxLength: 64;
948
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
949
+ };
950
+ readonly DecryptionTarget: {
951
+ readonly title: "DecryptionTarget";
952
+ readonly description: "What a partial decryption decrypts: the sealed cast at a board leaf, or the total of one option of one question.";
953
+ readonly type: "object";
954
+ readonly additionalProperties: false;
955
+ readonly required: readonly ["ciphertext"];
956
+ readonly properties: {
957
+ readonly leafIndex: {
958
+ readonly type: "integer";
959
+ readonly minimum: 0;
960
+ readonly description: "A sealed cast's board leaf.";
961
+ };
962
+ readonly question: {
963
+ readonly $ref: "#/$defs/Key";
964
+ };
965
+ readonly option: {
966
+ readonly $ref: "#/$defs/Key";
967
+ };
968
+ readonly ciphertext: {
969
+ readonly $ref: "#/$defs/ElGamalCiphertext";
970
+ };
971
+ };
972
+ readonly oneOf: readonly [{
973
+ readonly required: readonly ["leafIndex"];
974
+ }, {
975
+ readonly required: readonly ["question", "option"];
976
+ }];
977
+ };
978
+ readonly ElGamalCiphertext: {
979
+ readonly title: "ElGamalCiphertext";
980
+ readonly description: "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).";
981
+ readonly type: "object";
982
+ readonly additionalProperties: false;
983
+ readonly required: readonly ["a", "b"];
984
+ readonly properties: {
985
+ readonly a: {
986
+ readonly $ref: "#/$defs/GroupElement";
987
+ };
988
+ readonly b: {
989
+ readonly $ref: "#/$defs/GroupElement";
990
+ };
991
+ };
992
+ };
993
+ readonly Key: {
994
+ readonly title: "Key";
995
+ readonly description: "A question or option key, unique within its manifest or question.";
996
+ readonly type: "string";
997
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
998
+ };
999
+ readonly TrusteeIndex: {
1000
+ readonly title: "TrusteeIndex";
1001
+ readonly description: "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.";
1002
+ readonly type: "integer";
1003
+ readonly minimum: 1;
1004
+ readonly maximum: 64;
1005
+ };
1006
+ };
1007
+ };
1008
+ };
1009
+ //# sourceMappingURL=payload.d.ts.map