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