@openvtc/trust-tasks 0.26.25 → 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 +54 -0
- package/dist/_shared/components.d.ts +207 -4
- 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 +13 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- 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/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/package.json +1 -1
- package/src/_shared/components.ts +222 -4
- 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 +13 -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/elections/create/0.1/payload.ts +2 -2
- package/src/vtc/elections/show/0.1/payload.ts +2 -2
|
@@ -431,7 +431,7 @@ export const PAYLOAD_SCHEMA = {
|
|
|
431
431
|
},
|
|
432
432
|
"SecrecyLevel": {
|
|
433
433
|
"title": "SecrecyLevel",
|
|
434
|
-
"description": "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060).
|
|
434
|
+
"description": "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060). The encrypted levels are cast with `voting/ballot/cast-encrypted/0.1`, under an election key the trustees generate with `voting/trustees/*` (CONVENTIONS §9).",
|
|
435
435
|
"type": "string",
|
|
436
436
|
"enum": [
|
|
437
437
|
"open",
|
|
@@ -977,7 +977,7 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
977
977
|
},
|
|
978
978
|
"SecrecyLevel": {
|
|
979
979
|
"title": "SecrecyLevel",
|
|
980
|
-
"description": "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060).
|
|
980
|
+
"description": "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060). The encrypted levels are cast with `voting/ballot/cast-encrypted/0.1`, under an election key the trustees generate with `voting/trustees/*` (CONVENTIONS §9).",
|
|
981
981
|
"type": "string",
|
|
982
982
|
"enum": [
|
|
983
983
|
"open",
|
|
@@ -300,7 +300,7 @@ export const PAYLOAD_SCHEMA = {
|
|
|
300
300
|
},
|
|
301
301
|
"SecrecyLevel": {
|
|
302
302
|
"title": "SecrecyLevel",
|
|
303
|
-
"description": "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060).
|
|
303
|
+
"description": "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060). The encrypted levels are cast with `voting/ballot/cast-encrypted/0.1`, under an election key the trustees generate with `voting/trustees/*` (CONVENTIONS §9).",
|
|
304
304
|
"type": "string",
|
|
305
305
|
"enum": [
|
|
306
306
|
"open",
|
|
@@ -824,7 +824,7 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
824
824
|
},
|
|
825
825
|
"SecrecyLevel": {
|
|
826
826
|
"title": "SecrecyLevel",
|
|
827
|
-
"description": "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060).
|
|
827
|
+
"description": "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060). The encrypted levels are cast with `voting/ballot/cast-encrypted/0.1`, under an election key the trustees generate with `voting/trustees/*` (CONVENTIONS §9).",
|
|
828
828
|
"type": "string",
|
|
829
829
|
"enum": [
|
|
830
830
|
"open",
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/voting/trustees/confirm/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { BoardHead, DigestMultibase, ElectionId, ElectionState, ElectionSummary, Ext, TrusteeIndex, TrusteePhase } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A trustee confirms the shares it was dealt, or complains of the dealers whose shares failed their check.
|
|
11
|
+
*/
|
|
12
|
+
export interface VotingTrusteesConfirmPayload {
|
|
13
|
+
/**
|
|
14
|
+
* The community's DID: the registrar that registered the election.
|
|
15
|
+
*/
|
|
16
|
+
community: string;
|
|
17
|
+
electionId: ElectionId;
|
|
18
|
+
trustee: TrusteeIndex;
|
|
19
|
+
/**
|
|
20
|
+
* The dealers whose share to this trustee failed its check. Empty when every share checked.
|
|
21
|
+
*
|
|
22
|
+
* @maxItems 64
|
|
23
|
+
*/
|
|
24
|
+
complaints: TrusteeIndex[];
|
|
25
|
+
ext?: Ext;
|
|
26
|
+
}
|
|
27
|
+
export interface VotingTrusteesConfirmResponsePayload {
|
|
28
|
+
election: ElectionSummary;
|
|
29
|
+
phase: TrusteePhase;
|
|
30
|
+
ext?: Ext;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
34
|
+
export type { BoardHead, DigestMultibase, ElectionId, ElectionState, ElectionSummary, Ext, TrusteeIndex, TrusteePhase };
|
|
35
|
+
|
|
36
|
+
/** Trust Task type URI. */
|
|
37
|
+
export const TYPE_URI = "https://trusttasks.org/spec/voting/trustees/confirm/0.1" as const;
|
|
38
|
+
|
|
39
|
+
/** Stable alias for this specification's request payload shape. */
|
|
40
|
+
export type Payload = VotingTrusteesConfirmPayload;
|
|
41
|
+
|
|
42
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
43
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/voting/trustees/confirm/0.1#response" as const;
|
|
44
|
+
|
|
45
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
46
|
+
export type Response = VotingTrusteesConfirmResponsePayload;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* This specification's payload schema, as a value.
|
|
50
|
+
*
|
|
51
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
52
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
53
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
54
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
55
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
56
|
+
*/
|
|
57
|
+
export const PAYLOAD_SCHEMA = {
|
|
58
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
59
|
+
"$id": "https://trusttasks.org/spec/voting/trustees/confirm/0.1",
|
|
60
|
+
"title": "Voting — Trustees — Confirm — payload",
|
|
61
|
+
"description": "A trustee confirms the shares it was dealt, or complains of the dealers whose shares failed their check.",
|
|
62
|
+
"type": "object",
|
|
63
|
+
"additionalProperties": false,
|
|
64
|
+
"required": [
|
|
65
|
+
"community",
|
|
66
|
+
"electionId",
|
|
67
|
+
"trustee",
|
|
68
|
+
"complaints"
|
|
69
|
+
],
|
|
70
|
+
"properties": {
|
|
71
|
+
"community": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"minLength": 1,
|
|
74
|
+
"maxLength": 2048,
|
|
75
|
+
"description": "The community's DID: the registrar that registered the election."
|
|
76
|
+
},
|
|
77
|
+
"electionId": {
|
|
78
|
+
"$ref": "#/$defs/ElectionId"
|
|
79
|
+
},
|
|
80
|
+
"trustee": {
|
|
81
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
82
|
+
},
|
|
83
|
+
"complaints": {
|
|
84
|
+
"type": "array",
|
|
85
|
+
"maxItems": 64,
|
|
86
|
+
"uniqueItems": true,
|
|
87
|
+
"items": {
|
|
88
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
89
|
+
},
|
|
90
|
+
"description": "The dealers whose share to this trustee failed its check. Empty when every share checked."
|
|
91
|
+
},
|
|
92
|
+
"ext": {
|
|
93
|
+
"$ref": "#/$defs/Ext"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"$defs": {
|
|
97
|
+
"Response": {
|
|
98
|
+
"$anchor": "response",
|
|
99
|
+
"title": "Voting — Trustees — Confirm — response payload",
|
|
100
|
+
"type": "object",
|
|
101
|
+
"additionalProperties": false,
|
|
102
|
+
"required": [
|
|
103
|
+
"election",
|
|
104
|
+
"phase"
|
|
105
|
+
],
|
|
106
|
+
"properties": {
|
|
107
|
+
"election": {
|
|
108
|
+
"$ref": "#/$defs/ElectionSummary"
|
|
109
|
+
},
|
|
110
|
+
"phase": {
|
|
111
|
+
"$ref": "#/$defs/TrusteePhase"
|
|
112
|
+
},
|
|
113
|
+
"ext": {
|
|
114
|
+
"$ref": "#/$defs/Ext"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"Ext": {
|
|
119
|
+
"title": "Ext",
|
|
120
|
+
"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.",
|
|
121
|
+
"type": "object",
|
|
122
|
+
"minProperties": 1,
|
|
123
|
+
"additionalProperties": true,
|
|
124
|
+
"propertyNames": {
|
|
125
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"TrusteePhase": {
|
|
129
|
+
"title": "TrusteePhase",
|
|
130
|
+
"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.",
|
|
131
|
+
"type": "string",
|
|
132
|
+
"enum": [
|
|
133
|
+
"enrolling",
|
|
134
|
+
"dealing",
|
|
135
|
+
"confirming",
|
|
136
|
+
"keyed",
|
|
137
|
+
"decrypting",
|
|
138
|
+
"done",
|
|
139
|
+
"failed"
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
"ElectionSummary": {
|
|
143
|
+
"title": "ElectionSummary",
|
|
144
|
+
"description": "A ballot box's view of one election.",
|
|
145
|
+
"type": "object",
|
|
146
|
+
"additionalProperties": false,
|
|
147
|
+
"required": [
|
|
148
|
+
"electionId",
|
|
149
|
+
"community",
|
|
150
|
+
"manifestDigest",
|
|
151
|
+
"state",
|
|
152
|
+
"ballotsAdmitted",
|
|
153
|
+
"head"
|
|
154
|
+
],
|
|
155
|
+
"properties": {
|
|
156
|
+
"electionId": {
|
|
157
|
+
"$ref": "#/$defs/ElectionId"
|
|
158
|
+
},
|
|
159
|
+
"community": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"minLength": 1,
|
|
162
|
+
"maxLength": 2048
|
|
163
|
+
},
|
|
164
|
+
"manifestDigest": {
|
|
165
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
166
|
+
},
|
|
167
|
+
"state": {
|
|
168
|
+
"$ref": "#/$defs/ElectionState"
|
|
169
|
+
},
|
|
170
|
+
"ballotsAdmitted": {
|
|
171
|
+
"type": "integer",
|
|
172
|
+
"minimum": 0,
|
|
173
|
+
"description": "Distinct tags with a counted ballot."
|
|
174
|
+
},
|
|
175
|
+
"head": {
|
|
176
|
+
"$ref": "#/$defs/BoardHead"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"BoardHead": {
|
|
181
|
+
"title": "BoardHead",
|
|
182
|
+
"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.",
|
|
183
|
+
"type": "object",
|
|
184
|
+
"additionalProperties": false,
|
|
185
|
+
"required": [
|
|
186
|
+
"electionId",
|
|
187
|
+
"treeSize",
|
|
188
|
+
"rootHash",
|
|
189
|
+
"issuedAt"
|
|
190
|
+
],
|
|
191
|
+
"properties": {
|
|
192
|
+
"electionId": {
|
|
193
|
+
"$ref": "#/$defs/ElectionId"
|
|
194
|
+
},
|
|
195
|
+
"treeSize": {
|
|
196
|
+
"type": "integer",
|
|
197
|
+
"minimum": 0
|
|
198
|
+
},
|
|
199
|
+
"rootHash": {
|
|
200
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
201
|
+
"description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
|
|
202
|
+
},
|
|
203
|
+
"issuedAt": {
|
|
204
|
+
"type": "string",
|
|
205
|
+
"format": "date-time"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"ElectionId": {
|
|
210
|
+
"title": "ElectionId",
|
|
211
|
+
"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.",
|
|
212
|
+
"type": "string",
|
|
213
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
214
|
+
},
|
|
215
|
+
"DigestMultibase": {
|
|
216
|
+
"title": "DigestMultibase",
|
|
217
|
+
"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`.",
|
|
218
|
+
"type": "string",
|
|
219
|
+
"minLength": 16,
|
|
220
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
221
|
+
"examples": [
|
|
222
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
"ElectionState": {
|
|
226
|
+
"title": "ElectionState",
|
|
227
|
+
"type": "string",
|
|
228
|
+
"enum": [
|
|
229
|
+
"registered",
|
|
230
|
+
"registration",
|
|
231
|
+
"voting",
|
|
232
|
+
"closed",
|
|
233
|
+
"tallied",
|
|
234
|
+
"cancelled"
|
|
235
|
+
]
|
|
236
|
+
},
|
|
237
|
+
"TrusteeIndex": {
|
|
238
|
+
"title": "TrusteeIndex",
|
|
239
|
+
"description": "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.",
|
|
240
|
+
"type": "integer",
|
|
241
|
+
"minimum": 1,
|
|
242
|
+
"maximum": 64
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
} as const;
|
|
246
|
+
|
|
247
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
248
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
249
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
250
|
+
"$ref": "#/$defs/Response",
|
|
251
|
+
"$defs": {
|
|
252
|
+
"Response": {
|
|
253
|
+
"$anchor": "response",
|
|
254
|
+
"title": "Voting — Trustees — Confirm — response payload",
|
|
255
|
+
"type": "object",
|
|
256
|
+
"additionalProperties": false,
|
|
257
|
+
"required": [
|
|
258
|
+
"election",
|
|
259
|
+
"phase"
|
|
260
|
+
],
|
|
261
|
+
"properties": {
|
|
262
|
+
"election": {
|
|
263
|
+
"$ref": "#/$defs/ElectionSummary"
|
|
264
|
+
},
|
|
265
|
+
"phase": {
|
|
266
|
+
"$ref": "#/$defs/TrusteePhase"
|
|
267
|
+
},
|
|
268
|
+
"ext": {
|
|
269
|
+
"$ref": "#/$defs/Ext"
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"Ext": {
|
|
274
|
+
"title": "Ext",
|
|
275
|
+
"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.",
|
|
276
|
+
"type": "object",
|
|
277
|
+
"minProperties": 1,
|
|
278
|
+
"additionalProperties": true,
|
|
279
|
+
"propertyNames": {
|
|
280
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
"TrusteePhase": {
|
|
284
|
+
"title": "TrusteePhase",
|
|
285
|
+
"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.",
|
|
286
|
+
"type": "string",
|
|
287
|
+
"enum": [
|
|
288
|
+
"enrolling",
|
|
289
|
+
"dealing",
|
|
290
|
+
"confirming",
|
|
291
|
+
"keyed",
|
|
292
|
+
"decrypting",
|
|
293
|
+
"done",
|
|
294
|
+
"failed"
|
|
295
|
+
]
|
|
296
|
+
},
|
|
297
|
+
"ElectionSummary": {
|
|
298
|
+
"title": "ElectionSummary",
|
|
299
|
+
"description": "A ballot box's view of one election.",
|
|
300
|
+
"type": "object",
|
|
301
|
+
"additionalProperties": false,
|
|
302
|
+
"required": [
|
|
303
|
+
"electionId",
|
|
304
|
+
"community",
|
|
305
|
+
"manifestDigest",
|
|
306
|
+
"state",
|
|
307
|
+
"ballotsAdmitted",
|
|
308
|
+
"head"
|
|
309
|
+
],
|
|
310
|
+
"properties": {
|
|
311
|
+
"electionId": {
|
|
312
|
+
"$ref": "#/$defs/ElectionId"
|
|
313
|
+
},
|
|
314
|
+
"community": {
|
|
315
|
+
"type": "string",
|
|
316
|
+
"minLength": 1,
|
|
317
|
+
"maxLength": 2048
|
|
318
|
+
},
|
|
319
|
+
"manifestDigest": {
|
|
320
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
321
|
+
},
|
|
322
|
+
"state": {
|
|
323
|
+
"$ref": "#/$defs/ElectionState"
|
|
324
|
+
},
|
|
325
|
+
"ballotsAdmitted": {
|
|
326
|
+
"type": "integer",
|
|
327
|
+
"minimum": 0,
|
|
328
|
+
"description": "Distinct tags with a counted ballot."
|
|
329
|
+
},
|
|
330
|
+
"head": {
|
|
331
|
+
"$ref": "#/$defs/BoardHead"
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
"BoardHead": {
|
|
336
|
+
"title": "BoardHead",
|
|
337
|
+
"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.",
|
|
338
|
+
"type": "object",
|
|
339
|
+
"additionalProperties": false,
|
|
340
|
+
"required": [
|
|
341
|
+
"electionId",
|
|
342
|
+
"treeSize",
|
|
343
|
+
"rootHash",
|
|
344
|
+
"issuedAt"
|
|
345
|
+
],
|
|
346
|
+
"properties": {
|
|
347
|
+
"electionId": {
|
|
348
|
+
"$ref": "#/$defs/ElectionId"
|
|
349
|
+
},
|
|
350
|
+
"treeSize": {
|
|
351
|
+
"type": "integer",
|
|
352
|
+
"minimum": 0
|
|
353
|
+
},
|
|
354
|
+
"rootHash": {
|
|
355
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
356
|
+
"description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
|
|
357
|
+
},
|
|
358
|
+
"issuedAt": {
|
|
359
|
+
"type": "string",
|
|
360
|
+
"format": "date-time"
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
"ElectionId": {
|
|
365
|
+
"title": "ElectionId",
|
|
366
|
+
"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.",
|
|
367
|
+
"type": "string",
|
|
368
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
369
|
+
},
|
|
370
|
+
"DigestMultibase": {
|
|
371
|
+
"title": "DigestMultibase",
|
|
372
|
+
"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`.",
|
|
373
|
+
"type": "string",
|
|
374
|
+
"minLength": 16,
|
|
375
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
376
|
+
"examples": [
|
|
377
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
378
|
+
]
|
|
379
|
+
},
|
|
380
|
+
"ElectionState": {
|
|
381
|
+
"title": "ElectionState",
|
|
382
|
+
"type": "string",
|
|
383
|
+
"enum": [
|
|
384
|
+
"registered",
|
|
385
|
+
"registration",
|
|
386
|
+
"voting",
|
|
387
|
+
"closed",
|
|
388
|
+
"tallied",
|
|
389
|
+
"cancelled"
|
|
390
|
+
]
|
|
391
|
+
},
|
|
392
|
+
"TrusteeIndex": {
|
|
393
|
+
"title": "TrusteeIndex",
|
|
394
|
+
"description": "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.",
|
|
395
|
+
"type": "integer",
|
|
396
|
+
"minimum": 1,
|
|
397
|
+
"maximum": 64
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
} as const;
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
404
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
405
|
+
* per-specification and cannot be derived from the document alone, and
|
|
406
|
+
* item 2 needs the schema this carries.
|
|
407
|
+
*/
|
|
408
|
+
export const SPEC = {
|
|
409
|
+
typeUri: TYPE_URI,
|
|
410
|
+
isBearer: false,
|
|
411
|
+
isProofRequired: true,
|
|
412
|
+
isRecipientRequired: true,
|
|
413
|
+
isIssuedAtRequired: true,
|
|
414
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
415
|
+
} as const;
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
419
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
420
|
+
* parties (§7.3 item 5).
|
|
421
|
+
*/
|
|
422
|
+
export const RESPONSE_SPEC = {
|
|
423
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
424
|
+
isBearer: false,
|
|
425
|
+
isProofRequired: true,
|
|
426
|
+
isRecipientRequired: true,
|
|
427
|
+
isIssuedAtRequired: true,
|
|
428
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
429
|
+
} as const;
|