@openvtc/trust-tasks 0.26.20 → 0.26.22
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 +84 -0
- package/dist/_shared/components.d.ts +328 -17
- 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 +24 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -1
- package/dist/voting/_shared/0.1/voting.d.ts +16 -0
- package/dist/voting/_shared/0.1/voting.d.ts.map +1 -0
- package/dist/voting/_shared/0.1/voting.js +6 -0
- package/dist/voting/_shared/0.1/voting.js.map +1 -0
- package/dist/voting/ballot/cast/0.1/payload.d.ts +887 -0
- package/dist/voting/ballot/cast/0.1/payload.d.ts.map +1 -0
- package/dist/voting/ballot/cast/0.1/payload.js +506 -0
- package/dist/voting/ballot/cast/0.1/payload.js.map +1 -0
- package/dist/voting/board/consistency/0.1/payload.d.ts +389 -0
- package/dist/voting/board/consistency/0.1/payload.d.ts.map +1 -0
- package/dist/voting/board/consistency/0.1/payload.js +218 -0
- package/dist/voting/board/consistency/0.1/payload.js.map +1 -0
- package/dist/voting/board/head/0.1/payload.d.ts +380 -0
- package/dist/voting/board/head/0.1/payload.d.ts.map +1 -0
- package/dist/voting/board/head/0.1/payload.js +224 -0
- package/dist/voting/board/head/0.1/payload.js.map +1 -0
- package/dist/voting/board/inclusion/0.1/payload.d.ts +449 -0
- package/dist/voting/board/inclusion/0.1/payload.d.ts.map +1 -0
- package/dist/voting/board/inclusion/0.1/payload.js +246 -0
- package/dist/voting/board/inclusion/0.1/payload.js.map +1 -0
- package/dist/voting/board/read/0.1/payload.d.ts +1596 -0
- package/dist/voting/board/read/0.1/payload.d.ts.map +1 -0
- package/dist/voting/board/read/0.1/payload.js +920 -0
- package/dist/voting/board/read/0.1/payload.js.map +1 -0
- package/dist/voting/election/cancel/0.1/payload.d.ts +540 -0
- package/dist/voting/election/cancel/0.1/payload.d.ts.map +1 -0
- package/dist/voting/election/cancel/0.1/payload.js +331 -0
- package/dist/voting/election/cancel/0.1/payload.js.map +1 -0
- package/dist/voting/election/close/0.1/payload.d.ts +540 -0
- package/dist/voting/election/close/0.1/payload.d.ts.map +1 -0
- package/dist/voting/election/close/0.1/payload.js +330 -0
- package/dist/voting/election/close/0.1/payload.js.map +1 -0
- package/dist/voting/election/register/0.1/payload.d.ts +1920 -0
- package/dist/voting/election/register/0.1/payload.d.ts.map +1 -0
- package/dist/voting/election/register/0.1/payload.js +1166 -0
- package/dist/voting/election/register/0.1/payload.js.map +1 -0
- package/dist/voting/election/show/0.1/payload.d.ts +1824 -0
- package/dist/voting/election/show/0.1/payload.d.ts.map +1 -0
- package/dist/voting/election/show/0.1/payload.js +1112 -0
- package/dist/voting/election/show/0.1/payload.js.map +1 -0
- package/dist/voting/result/show/0.1/payload.d.ts +849 -0
- package/dist/voting/result/show/0.1/payload.d.ts.map +1 -0
- package/dist/voting/result/show/0.1/payload.js +498 -0
- package/dist/voting/result/show/0.1/payload.js.map +1 -0
- package/dist/vta/_shared/0.1/app-state-record.d.ts +1 -1
- package/dist/vta/_shared/0.1/app-state-record.d.ts.map +1 -1
- package/dist/vta/_shared/0.4/pcs-engine.d.ts +1 -1
- package/dist/vta/_shared/0.4/pcs-engine.d.ts.map +1 -1
- package/dist/vta/app-state/delete/1.0/payload.d.ts +1 -1
- package/dist/vta/app-state/delete/1.0/payload.d.ts.map +1 -1
- package/dist/vta/app-state/get/1.0/payload.d.ts +1 -1
- package/dist/vta/app-state/get/1.0/payload.d.ts.map +1 -1
- package/dist/vta/app-state/get-many/1.0/payload.d.ts +1 -1
- package/dist/vta/app-state/get-many/1.0/payload.d.ts.map +1 -1
- package/dist/vta/app-state/list/1.0/payload.d.ts +1 -1
- package/dist/vta/app-state/list/1.0/payload.d.ts.map +1 -1
- package/dist/vta/app-state/put/1.0/payload.d.ts +1 -1
- package/dist/vta/app-state/put/1.0/payload.d.ts.map +1 -1
- package/dist/vta/app-state/put-many/1.0/payload.d.ts +1 -1
- package/dist/vta/app-state/put-many/1.0/payload.d.ts.map +1 -1
- package/dist/vta/pcs/applications/create/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/applications/create/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/applications/show/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/applications/show/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/attest/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/attest/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/prove/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/prove/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/root-accept/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/root-accept/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/tokens/abandon/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/tokens/abandon/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/tokens/accept/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/tokens/accept/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/verify-attestation/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/verify-attestation/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/vetter/show/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/vetter/show/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/vote/0.1/payload.d.ts +2208 -0
- package/dist/vta/pcs/vote/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/vote/0.1/payload.js +1282 -0
- package/dist/vta/pcs/vote/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/voter/accept/0.1/payload.d.ts +450 -0
- package/dist/vta/pcs/voter/accept/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/voter/accept/0.1/payload.js +247 -0
- package/dist/vta/pcs/voter/accept/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/voter/receipt/0.1/payload.d.ts +531 -0
- package/dist/vta/pcs/voter/receipt/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/voter/receipt/0.1/payload.js +301 -0
- package/dist/vta/pcs/voter/receipt/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/voter/register/0.1/payload.d.ts +1934 -0
- package/dist/vta/pcs/voter/register/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/voter/register/0.1/payload.js +1133 -0
- package/dist/vta/pcs/voter/register/0.1/payload.js.map +1 -0
- package/dist/vtc/directory/card/present/0.1/payload.d.ts +2 -2
- package/dist/vtc/directory/card/present/0.1/payload.js +1 -1
- package/dist/vtc/directory/card/present/0.1/payload.js.map +1 -1
- package/dist/vtc/elections/cancel/0.1/payload.d.ts +301 -0
- package/dist/vtc/elections/cancel/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/cancel/0.1/payload.js +183 -0
- package/dist/vtc/elections/cancel/0.1/payload.js.map +1 -0
- package/dist/vtc/elections/certify/0.1/payload.d.ts +914 -0
- package/dist/vtc/elections/certify/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/certify/0.1/payload.js +512 -0
- package/dist/vtc/elections/certify/0.1/payload.js.map +1 -0
- package/dist/vtc/elections/close/0.1/payload.d.ts +301 -0
- package/dist/vtc/elections/close/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/close/0.1/payload.js +182 -0
- package/dist/vtc/elections/close/0.1/payload.js.map +1 -0
- package/dist/vtc/elections/create/0.1/payload.d.ts +1656 -0
- package/dist/vtc/elections/create/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/create/0.1/payload.js +994 -0
- package/dist/vtc/elections/create/0.1/payload.js.map +1 -0
- package/dist/vtc/elections/list/0.1/payload.d.ts +521 -0
- package/dist/vtc/elections/list/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/list/0.1/payload.js +290 -0
- package/dist/vtc/elections/list/0.1/payload.js.map +1 -0
- package/dist/vtc/elections/show/0.1/payload.d.ts +2688 -0
- package/dist/vtc/elections/show/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/show/0.1/payload.js +1581 -0
- package/dist/vtc/elections/show/0.1/payload.js.map +1 -0
- package/dist/vtc/elections/tickets/issue/0.1/payload.d.ts +597 -0
- package/dist/vtc/elections/tickets/issue/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/tickets/issue/0.1/payload.js +318 -0
- package/dist/vtc/elections/tickets/issue/0.1/payload.js.map +1 -0
- package/dist/vtc/groups/create/0.1/payload.d.ts +4 -4
- package/dist/vtc/groups/create/0.1/payload.js +2 -2
- package/dist/vtc/groups/create/0.1/payload.js.map +1 -1
- package/dist/vtc/groups/list/0.1/payload.d.ts +4 -4
- package/dist/vtc/groups/list/0.1/payload.js +2 -2
- package/dist/vtc/groups/list/0.1/payload.js.map +1 -1
- package/dist/vtc/groups/managers/add/0.1/payload.d.ts +337 -0
- package/dist/vtc/groups/managers/add/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/groups/managers/add/0.1/payload.js +184 -0
- package/dist/vtc/groups/managers/add/0.1/payload.js.map +1 -0
- package/dist/vtc/groups/managers/remove/0.1/payload.d.ts +337 -0
- package/dist/vtc/groups/managers/remove/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/groups/managers/remove/0.1/payload.js +184 -0
- package/dist/vtc/groups/managers/remove/0.1/payload.js.map +1 -0
- package/dist/vtc/groups/show/0.1/payload.d.ts +4 -4
- package/dist/vtc/groups/show/0.1/payload.js +2 -2
- package/dist/vtc/groups/show/0.1/payload.js.map +1 -1
- package/dist/vtc/groups/update/0.1/payload.d.ts +4 -4
- package/dist/vtc/groups/update/0.1/payload.js +2 -2
- package/dist/vtc/groups/update/0.1/payload.js.map +1 -1
- package/package.json +1 -1
- package/src/_shared/components.ts +332 -17
- 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 +24 -0
- package/src/voting/_shared/0.1/voting.ts +17 -0
- package/src/voting/ballot/cast/0.1/payload.ts +560 -0
- package/src/voting/board/consistency/0.1/payload.ts +264 -0
- package/src/voting/board/head/0.1/payload.ts +257 -0
- package/src/voting/board/inclusion/0.1/payload.ts +300 -0
- package/src/voting/board/read/0.1/payload.ts +981 -0
- package/src/voting/election/cancel/0.1/payload.ts +368 -0
- package/src/voting/election/close/0.1/payload.ts +367 -0
- package/src/voting/election/register/0.1/payload.ts +1207 -0
- package/src/voting/election/show/0.1/payload.ts +1149 -0
- package/src/voting/result/show/0.1/payload.ts +536 -0
- package/src/vta/_shared/0.1/app-state-record.ts +1 -1
- package/src/vta/_shared/0.4/pcs-engine.ts +1 -1
- package/src/vta/app-state/delete/1.0/payload.ts +1 -1
- package/src/vta/app-state/get/1.0/payload.ts +1 -1
- package/src/vta/app-state/get-many/1.0/payload.ts +1 -1
- package/src/vta/app-state/list/1.0/payload.ts +1 -1
- package/src/vta/app-state/put/1.0/payload.ts +1 -1
- package/src/vta/app-state/put-many/1.0/payload.ts +1 -1
- package/src/vta/pcs/applications/create/0.1/payload.ts +1 -1
- package/src/vta/pcs/applications/show/0.1/payload.ts +1 -1
- package/src/vta/pcs/attest/0.1/payload.ts +1 -1
- package/src/vta/pcs/prove/0.1/payload.ts +1 -1
- package/src/vta/pcs/root-accept/0.1/payload.ts +1 -1
- package/src/vta/pcs/tokens/abandon/0.1/payload.ts +1 -1
- package/src/vta/pcs/tokens/accept/0.1/payload.ts +1 -1
- package/src/vta/pcs/verify-attestation/0.1/payload.ts +1 -1
- package/src/vta/pcs/vetter/show/0.1/payload.ts +1 -1
- package/src/vta/pcs/vote/0.1/payload.ts +1365 -0
- package/src/vta/pcs/voter/accept/0.1/payload.ts +306 -0
- package/src/vta/pcs/voter/receipt/0.1/payload.ts +367 -0
- package/src/vta/pcs/voter/register/0.1/payload.ts +1211 -0
- package/src/vtc/directory/card/present/0.1/payload.ts +1 -1
- package/src/vtc/elections/cancel/0.1/payload.ts +223 -0
- package/src/vtc/elections/certify/0.1/payload.ts +565 -0
- package/src/vtc/elections/close/0.1/payload.ts +222 -0
- package/src/vtc/elections/create/0.1/payload.ts +1041 -0
- package/src/vtc/elections/list/0.1/payload.ts +371 -0
- package/src/vtc/elections/show/0.1/payload.ts +1671 -0
- package/src/vtc/elections/tickets/issue/0.1/payload.ts +394 -0
- package/src/vtc/groups/create/0.1/payload.ts +2 -2
- package/src/vtc/groups/list/0.1/payload.ts +2 -2
- package/src/vtc/groups/managers/add/0.1/payload.ts +230 -0
- package/src/vtc/groups/managers/remove/0.1/payload.ts +230 -0
- package/src/vtc/groups/show/0.1/payload.ts +2 -2
- package/src/vtc/groups/update/0.1/payload.ts +2 -2
|
@@ -0,0 +1,2688 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/elections/show/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
import type { BoardHead, BoardVisibility, ChoiceQuestion, DigestMultibase, Disclosure, ElectionId, ElectionResult, Ext, Key_VotingV0_1 as Key, Manifest, Multibase_VotingV0_1 as Multibase, Question, QuestionOption, QuestionResult, RankingQuestion, Revote, RollRule, ScoreQuestion, SecrecyLevel, TextQuestion, Trustees, VotingParameters } from "../../../../_shared/components.js";
|
|
6
|
+
/**
|
|
7
|
+
* An election's state as its registrar holds it: the ballot box's `ElectionState` once the ballot box has registered the election, or, before that, `pendingRegistration` (the community is still delivering the registration) or `registrationRefused` (the ballot box refused it on a later delivery, and only a cancellation clears it). The first six values are the ballot box's `ElectionState` (voting/_shared/0.1).
|
|
8
|
+
*/
|
|
9
|
+
export type RegistrarState = "registered" | "registration" | "voting" | "closed" | "tallied" | "cancelled" | "pendingRegistration" | "registrationRefused";
|
|
10
|
+
/**
|
|
11
|
+
* A member or an administrator reads one election of the community whole: its manifest, state, voting parameters, disclosure, the board checkpoints the community kept and, once certified, the certified result. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
|
|
12
|
+
*/
|
|
13
|
+
export interface VTCElectionsShowPayload {
|
|
14
|
+
electionId: ElectionId;
|
|
15
|
+
ext?: Ext;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Success response to vtc/elections/show/0.1: one election, whole.
|
|
19
|
+
*/
|
|
20
|
+
export interface VTCElectionsShowResponsePayload {
|
|
21
|
+
manifest: Manifest;
|
|
22
|
+
/**
|
|
23
|
+
* The SHA-256 multihash of the RFC 8785 (JCS) canonicalization of `manifest`. A ticket request names it, and every cast is bound to it.
|
|
24
|
+
*/
|
|
25
|
+
manifestDigest: DigestMultibase;
|
|
26
|
+
state: RegistrarState;
|
|
27
|
+
/**
|
|
28
|
+
* The community's voting parameters the election's tickets are issued under (VTI-VOT-020).
|
|
29
|
+
*/
|
|
30
|
+
parameters: VotingParameters;
|
|
31
|
+
/**
|
|
32
|
+
* How the election is run, generated from the manifest and the community's configuration (VTI-VOT-090). Always present: a member reads it before requesting a ticket.
|
|
33
|
+
*/
|
|
34
|
+
disclosure: Disclosure;
|
|
35
|
+
/**
|
|
36
|
+
* The board heads the community has kept, oldest first. Empty until the community has read a head.
|
|
37
|
+
*
|
|
38
|
+
* @maxItems 256
|
|
39
|
+
*/
|
|
40
|
+
checkpoints: Checkpoint[];
|
|
41
|
+
/**
|
|
42
|
+
* How many tickets the community has issued for the election. Present only to a caller holding vtc.elections.manage.
|
|
43
|
+
*/
|
|
44
|
+
ticketsIssued?: number;
|
|
45
|
+
certified?: Certification;
|
|
46
|
+
ext?: Ext;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A board head the community read from the ballot box and kept, with the ballot box's signed document that carried it. Certification proves the board's final head consistent with every checkpoint, so a ballot box that rewrote its board after a checkpoint is caught.
|
|
50
|
+
*/
|
|
51
|
+
export interface Checkpoint {
|
|
52
|
+
head: BoardHead;
|
|
53
|
+
/**
|
|
54
|
+
* The ballot box's signed voting/board/head `#response` document whose payload carries `head`, kept whole and exactly as received — proof included — so anyone can verify it against the ballot box's DID without trusting the community.
|
|
55
|
+
*/
|
|
56
|
+
document: {};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Present once the community has certified the result.
|
|
60
|
+
*/
|
|
61
|
+
export interface Certification {
|
|
62
|
+
result: ElectionResult;
|
|
63
|
+
certifiedAt: string;
|
|
64
|
+
/**
|
|
65
|
+
* @maxItems 32
|
|
66
|
+
*/
|
|
67
|
+
auditAttestations: {}[];
|
|
68
|
+
}
|
|
69
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
70
|
+
export type { BoardHead, BoardVisibility, ChoiceQuestion, DigestMultibase, Disclosure, ElectionId, ElectionResult, Ext, Key, Manifest, Multibase, Question, QuestionOption, QuestionResult, RankingQuestion, Revote, RollRule, ScoreQuestion, SecrecyLevel, TextQuestion, Trustees, VotingParameters };
|
|
71
|
+
/** Trust Task type URI. */
|
|
72
|
+
export declare const TYPE_URI: "https://trusttasks.org/spec/vtc/elections/show/0.1";
|
|
73
|
+
/** Stable alias for this specification's request payload shape. */
|
|
74
|
+
export type Payload = VTCElectionsShowPayload;
|
|
75
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
76
|
+
export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/vtc/elections/show/0.1#response";
|
|
77
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
78
|
+
export type Response = VTCElectionsShowResponsePayload;
|
|
79
|
+
/**
|
|
80
|
+
* This specification's payload schema, as a value.
|
|
81
|
+
*
|
|
82
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
83
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
84
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
85
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
86
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
87
|
+
*/
|
|
88
|
+
export declare const PAYLOAD_SCHEMA: {
|
|
89
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
90
|
+
readonly $id: "https://trusttasks.org/spec/vtc/elections/show/0.1";
|
|
91
|
+
readonly title: "VTC Elections — Show — payload";
|
|
92
|
+
readonly description: "A member or an administrator reads one election of the community whole: its manifest, state, voting parameters, disclosure, the board checkpoints the community kept and, once certified, the certified result. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.";
|
|
93
|
+
readonly type: "object";
|
|
94
|
+
readonly additionalProperties: false;
|
|
95
|
+
readonly required: readonly ["electionId"];
|
|
96
|
+
readonly properties: {
|
|
97
|
+
readonly electionId: {
|
|
98
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
99
|
+
};
|
|
100
|
+
readonly ext: {
|
|
101
|
+
readonly $ref: "#/$defs/Ext";
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
readonly $defs: {
|
|
105
|
+
readonly RegistrarState: {
|
|
106
|
+
readonly title: "RegistrarState";
|
|
107
|
+
readonly description: "An election's state as its registrar holds it: the ballot box's `ElectionState` once the ballot box has registered the election, or, before that, `pendingRegistration` (the community is still delivering the registration) or `registrationRefused` (the ballot box refused it on a later delivery, and only a cancellation clears it). The first six values are the ballot box's `ElectionState` (voting/_shared/0.1).";
|
|
108
|
+
readonly type: "string";
|
|
109
|
+
readonly enum: readonly ["registered", "registration", "voting", "closed", "tallied", "cancelled", "pendingRegistration", "registrationRefused"];
|
|
110
|
+
};
|
|
111
|
+
readonly Checkpoint: {
|
|
112
|
+
readonly title: "Checkpoint";
|
|
113
|
+
readonly description: "A board head the community read from the ballot box and kept, with the ballot box's signed document that carried it. Certification proves the board's final head consistent with every checkpoint, so a ballot box that rewrote its board after a checkpoint is caught.";
|
|
114
|
+
readonly type: "object";
|
|
115
|
+
readonly additionalProperties: false;
|
|
116
|
+
readonly required: readonly ["head", "document"];
|
|
117
|
+
readonly properties: {
|
|
118
|
+
readonly head: {
|
|
119
|
+
readonly $ref: "#/$defs/BoardHead";
|
|
120
|
+
};
|
|
121
|
+
readonly document: {
|
|
122
|
+
readonly type: "object";
|
|
123
|
+
readonly description: "The ballot box's signed voting/board/head `#response` document whose payload carries `head`, kept whole and exactly as received — proof included — so anyone can verify it against the ballot box's DID without trusting the community.";
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
readonly Certification: {
|
|
128
|
+
readonly title: "Certification";
|
|
129
|
+
readonly description: "The community's certification of the election's result, as vtc/elections/certify recorded it.";
|
|
130
|
+
readonly type: "object";
|
|
131
|
+
readonly additionalProperties: false;
|
|
132
|
+
readonly required: readonly ["result", "certifiedAt", "auditAttestations"];
|
|
133
|
+
readonly properties: {
|
|
134
|
+
readonly result: {
|
|
135
|
+
readonly $ref: "#/$defs/ElectionResult";
|
|
136
|
+
};
|
|
137
|
+
readonly certifiedAt: {
|
|
138
|
+
readonly type: "string";
|
|
139
|
+
readonly format: "date-time";
|
|
140
|
+
readonly maxLength: 64;
|
|
141
|
+
};
|
|
142
|
+
readonly auditAttestations: {
|
|
143
|
+
readonly type: "array";
|
|
144
|
+
readonly maxItems: 32;
|
|
145
|
+
readonly items: {
|
|
146
|
+
readonly type: "object";
|
|
147
|
+
readonly description: "A verifiable credential from an auditor the manifest names, as received.";
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
readonly Response: {
|
|
153
|
+
readonly $anchor: "response";
|
|
154
|
+
readonly title: "VTC Elections — Show — response payload";
|
|
155
|
+
readonly description: "Success response to vtc/elections/show/0.1: one election, whole.";
|
|
156
|
+
readonly type: "object";
|
|
157
|
+
readonly additionalProperties: false;
|
|
158
|
+
readonly required: readonly ["manifest", "manifestDigest", "state", "parameters", "disclosure", "checkpoints"];
|
|
159
|
+
readonly properties: {
|
|
160
|
+
readonly manifest: {
|
|
161
|
+
readonly $ref: "#/$defs/Manifest";
|
|
162
|
+
};
|
|
163
|
+
readonly manifestDigest: {
|
|
164
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
165
|
+
readonly description: "The SHA-256 multihash of the RFC 8785 (JCS) canonicalization of `manifest`. A ticket request names it, and every cast is bound to it.";
|
|
166
|
+
};
|
|
167
|
+
readonly state: {
|
|
168
|
+
readonly $ref: "#/$defs/RegistrarState";
|
|
169
|
+
};
|
|
170
|
+
readonly parameters: {
|
|
171
|
+
readonly $ref: "#/$defs/VotingParameters";
|
|
172
|
+
readonly description: "The community's voting parameters the election's tickets are issued under (VTI-VOT-020).";
|
|
173
|
+
};
|
|
174
|
+
readonly disclosure: {
|
|
175
|
+
readonly $ref: "#/$defs/Disclosure";
|
|
176
|
+
readonly description: "How the election is run, generated from the manifest and the community's configuration (VTI-VOT-090). Always present: a member reads it before requesting a ticket.";
|
|
177
|
+
};
|
|
178
|
+
readonly checkpoints: {
|
|
179
|
+
readonly type: "array";
|
|
180
|
+
readonly maxItems: 256;
|
|
181
|
+
readonly items: {
|
|
182
|
+
readonly $ref: "#/$defs/Checkpoint";
|
|
183
|
+
};
|
|
184
|
+
readonly description: "The board heads the community has kept, oldest first. Empty until the community has read a head.";
|
|
185
|
+
};
|
|
186
|
+
readonly ticketsIssued: {
|
|
187
|
+
readonly type: "integer";
|
|
188
|
+
readonly minimum: 0;
|
|
189
|
+
readonly description: "How many tickets the community has issued for the election. Present only to a caller holding vtc.elections.manage.";
|
|
190
|
+
};
|
|
191
|
+
readonly certified: {
|
|
192
|
+
readonly $ref: "#/$defs/Certification";
|
|
193
|
+
readonly description: "Present once the community has certified the result.";
|
|
194
|
+
};
|
|
195
|
+
readonly ext: {
|
|
196
|
+
readonly $ref: "#/$defs/Ext";
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
readonly Ext: {
|
|
201
|
+
readonly title: "Ext";
|
|
202
|
+
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.";
|
|
203
|
+
readonly type: "object";
|
|
204
|
+
readonly minProperties: 1;
|
|
205
|
+
readonly additionalProperties: true;
|
|
206
|
+
readonly propertyNames: {
|
|
207
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
readonly Disclosure: {
|
|
211
|
+
readonly title: "Disclosure";
|
|
212
|
+
readonly description: "The statement a community publishes, and shows a member before they request a ticket, about how one election is run (VTI-VOT-090). Generated from the election's manifest and the community's configuration, never written by hand.";
|
|
213
|
+
readonly type: "object";
|
|
214
|
+
readonly additionalProperties: false;
|
|
215
|
+
readonly required: readonly ["ballotBox", "ballotBoxOperator", "sameOperator", "boardVisibility", "auditors", "revote", "coercionResistance"];
|
|
216
|
+
readonly properties: {
|
|
217
|
+
readonly ballotBox: {
|
|
218
|
+
readonly type: "string";
|
|
219
|
+
readonly minLength: 1;
|
|
220
|
+
readonly maxLength: 2048;
|
|
221
|
+
readonly description: "The ballot box's DID.";
|
|
222
|
+
};
|
|
223
|
+
readonly ballotBoxOperator: {
|
|
224
|
+
readonly type: "string";
|
|
225
|
+
readonly minLength: 1;
|
|
226
|
+
readonly maxLength: 512;
|
|
227
|
+
readonly description: "Who operates the ballot box, as the community names them.";
|
|
228
|
+
};
|
|
229
|
+
readonly sameOperator: {
|
|
230
|
+
readonly type: "boolean";
|
|
231
|
+
readonly description: "Whether the party operating the community's VTC also operates the ballot box.";
|
|
232
|
+
};
|
|
233
|
+
readonly trustees: {
|
|
234
|
+
readonly $ref: "#/$defs/Trustees";
|
|
235
|
+
};
|
|
236
|
+
readonly boardVisibility: {
|
|
237
|
+
readonly $ref: "#/$defs/BoardVisibility";
|
|
238
|
+
};
|
|
239
|
+
readonly auditors: {
|
|
240
|
+
readonly type: "array";
|
|
241
|
+
readonly items: {
|
|
242
|
+
readonly type: "string";
|
|
243
|
+
readonly minLength: 1;
|
|
244
|
+
readonly maxLength: 2048;
|
|
245
|
+
};
|
|
246
|
+
readonly uniqueItems: true;
|
|
247
|
+
};
|
|
248
|
+
readonly revote: {
|
|
249
|
+
readonly $ref: "#/$defs/Revote";
|
|
250
|
+
};
|
|
251
|
+
readonly coercionResistance: {
|
|
252
|
+
readonly const: false;
|
|
253
|
+
readonly description: "Always false: a voter can prove how they voted, so the community cannot protect a member against being made to vote a certain way.";
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
readonly Revote: {
|
|
258
|
+
readonly title: "Revote";
|
|
259
|
+
readonly description: "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).";
|
|
260
|
+
readonly type: "string";
|
|
261
|
+
readonly enum: readonly ["replace", "refuse"];
|
|
262
|
+
};
|
|
263
|
+
readonly BoardVisibility: {
|
|
264
|
+
readonly title: "BoardVisibility";
|
|
265
|
+
readonly description: "`public`: anyone reads the board. `private`: the community, the auditors the manifest names and, for one cast's inclusion, the holder of its receipt (VTI-VOT-052).";
|
|
266
|
+
readonly type: "string";
|
|
267
|
+
readonly enum: readonly ["public", "private"];
|
|
268
|
+
};
|
|
269
|
+
readonly Trustees: {
|
|
270
|
+
readonly title: "Trustees";
|
|
271
|
+
readonly description: "The trustees of a sealed or tallied-encrypted election and the number of them decryption needs (VTI-VOT-062). Neither the community nor the ballot box may be one.";
|
|
272
|
+
readonly type: "object";
|
|
273
|
+
readonly additionalProperties: false;
|
|
274
|
+
readonly required: readonly ["dids", "threshold"];
|
|
275
|
+
readonly properties: {
|
|
276
|
+
readonly dids: {
|
|
277
|
+
readonly type: "array";
|
|
278
|
+
readonly minItems: 2;
|
|
279
|
+
readonly items: {
|
|
280
|
+
readonly type: "string";
|
|
281
|
+
readonly minLength: 1;
|
|
282
|
+
readonly maxLength: 2048;
|
|
283
|
+
};
|
|
284
|
+
readonly uniqueItems: true;
|
|
285
|
+
};
|
|
286
|
+
readonly threshold: {
|
|
287
|
+
readonly type: "integer";
|
|
288
|
+
readonly minimum: 2;
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
readonly VotingParameters: {
|
|
293
|
+
readonly title: "VotingParameters";
|
|
294
|
+
readonly description: "The community's published voting parameters: the PCS suite and the voting verification key tickets are issued under (VTI-VOT-020). Distinct from its hidden-vetting helper key.";
|
|
295
|
+
readonly type: "object";
|
|
296
|
+
readonly additionalProperties: false;
|
|
297
|
+
readonly required: readonly ["suite", "votingKey"];
|
|
298
|
+
readonly properties: {
|
|
299
|
+
readonly suite: {
|
|
300
|
+
readonly type: "string";
|
|
301
|
+
readonly const: "ps-ddh-bls12381";
|
|
302
|
+
};
|
|
303
|
+
readonly votingKey: {
|
|
304
|
+
readonly $ref: "#/$defs/Multibase";
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
};
|
|
308
|
+
readonly Multibase: {
|
|
309
|
+
readonly title: "Multibase";
|
|
310
|
+
readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
|
|
311
|
+
readonly type: "string";
|
|
312
|
+
readonly maxLength: 16384;
|
|
313
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
314
|
+
};
|
|
315
|
+
readonly DigestMultibase: {
|
|
316
|
+
readonly title: "DigestMultibase";
|
|
317
|
+
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`.";
|
|
318
|
+
readonly type: "string";
|
|
319
|
+
readonly minLength: 16;
|
|
320
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
321
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
322
|
+
};
|
|
323
|
+
readonly Manifest: {
|
|
324
|
+
readonly title: "Manifest";
|
|
325
|
+
readonly description: "What an election asks and how it is decided (VTI-VOT-010). Its digest (`manifestDigest`) is the SHA-256 multihash of its RFC 8785 (JCS) canonicalization, and every cast is bound to it (VTI-VOT-011).";
|
|
326
|
+
readonly type: "object";
|
|
327
|
+
readonly additionalProperties: false;
|
|
328
|
+
readonly required: readonly ["electionId", "community", "questions", "secrecy", "roll", "registrationOpens", "votingOpens", "votingCloses", "revote", "board", "ballotBox", "binding", "allowEarlyClose", "resultsBeforeClose", "textReleaseThreshold"];
|
|
329
|
+
readonly properties: {
|
|
330
|
+
readonly electionId: {
|
|
331
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
332
|
+
};
|
|
333
|
+
readonly community: {
|
|
334
|
+
readonly type: "string";
|
|
335
|
+
readonly minLength: 1;
|
|
336
|
+
readonly maxLength: 2048;
|
|
337
|
+
readonly description: "The community's DID.";
|
|
338
|
+
};
|
|
339
|
+
readonly title: {
|
|
340
|
+
readonly type: "string";
|
|
341
|
+
readonly maxLength: 512;
|
|
342
|
+
};
|
|
343
|
+
readonly description: {
|
|
344
|
+
readonly type: "string";
|
|
345
|
+
readonly maxLength: 8192;
|
|
346
|
+
};
|
|
347
|
+
readonly questions: {
|
|
348
|
+
readonly type: "array";
|
|
349
|
+
readonly minItems: 1;
|
|
350
|
+
readonly maxItems: 128;
|
|
351
|
+
readonly items: {
|
|
352
|
+
readonly $ref: "#/$defs/Question";
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
readonly secrecy: {
|
|
356
|
+
readonly $ref: "#/$defs/SecrecyLevel";
|
|
357
|
+
};
|
|
358
|
+
readonly roll: {
|
|
359
|
+
readonly $ref: "#/$defs/RollRule";
|
|
360
|
+
};
|
|
361
|
+
readonly registrationOpens: {
|
|
362
|
+
readonly type: "string";
|
|
363
|
+
readonly format: "date-time";
|
|
364
|
+
};
|
|
365
|
+
readonly votingOpens: {
|
|
366
|
+
readonly type: "string";
|
|
367
|
+
readonly format: "date-time";
|
|
368
|
+
};
|
|
369
|
+
readonly votingCloses: {
|
|
370
|
+
readonly type: "string";
|
|
371
|
+
readonly format: "date-time";
|
|
372
|
+
};
|
|
373
|
+
readonly revote: {
|
|
374
|
+
readonly $ref: "#/$defs/Revote";
|
|
375
|
+
};
|
|
376
|
+
readonly board: {
|
|
377
|
+
readonly type: "object";
|
|
378
|
+
readonly additionalProperties: false;
|
|
379
|
+
readonly required: readonly ["visibility", "auditors"];
|
|
380
|
+
readonly properties: {
|
|
381
|
+
readonly visibility: {
|
|
382
|
+
readonly $ref: "#/$defs/BoardVisibility";
|
|
383
|
+
};
|
|
384
|
+
readonly auditors: {
|
|
385
|
+
readonly type: "array";
|
|
386
|
+
readonly items: {
|
|
387
|
+
readonly type: "string";
|
|
388
|
+
readonly minLength: 1;
|
|
389
|
+
readonly maxLength: 2048;
|
|
390
|
+
};
|
|
391
|
+
readonly uniqueItems: true;
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
readonly ballotBox: {
|
|
396
|
+
readonly type: "string";
|
|
397
|
+
readonly minLength: 1;
|
|
398
|
+
readonly maxLength: 2048;
|
|
399
|
+
readonly description: "The DID of the voting service that holds the board.";
|
|
400
|
+
};
|
|
401
|
+
readonly trustees: {
|
|
402
|
+
readonly $ref: "#/$defs/Trustees";
|
|
403
|
+
};
|
|
404
|
+
readonly binding: {
|
|
405
|
+
readonly type: "boolean";
|
|
406
|
+
readonly description: "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081).";
|
|
407
|
+
};
|
|
408
|
+
readonly allowEarlyClose: {
|
|
409
|
+
readonly type: "boolean";
|
|
410
|
+
};
|
|
411
|
+
readonly resultsBeforeClose: {
|
|
412
|
+
readonly type: "boolean";
|
|
413
|
+
readonly description: "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061).";
|
|
414
|
+
};
|
|
415
|
+
readonly textReleaseThreshold: {
|
|
416
|
+
readonly type: "integer";
|
|
417
|
+
readonly minimum: 10;
|
|
418
|
+
readonly description: "Counted ballots required before any text answer is disclosed (VTI-VOT-065).";
|
|
419
|
+
};
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
readonly RollRule: {
|
|
423
|
+
readonly title: "RollRule";
|
|
424
|
+
readonly description: "Who may be issued a ticket (VTI-VOT-021): the community's active members, its active members and the parties `listed` names, or only the parties `listed` names.";
|
|
425
|
+
readonly type: "object";
|
|
426
|
+
readonly additionalProperties: false;
|
|
427
|
+
readonly required: readonly ["rule"];
|
|
428
|
+
readonly properties: {
|
|
429
|
+
readonly rule: {
|
|
430
|
+
readonly type: "string";
|
|
431
|
+
readonly enum: readonly ["members", "membersAndListed", "listed"];
|
|
432
|
+
};
|
|
433
|
+
readonly listed: {
|
|
434
|
+
readonly type: "array";
|
|
435
|
+
readonly items: {
|
|
436
|
+
readonly type: "string";
|
|
437
|
+
readonly minLength: 1;
|
|
438
|
+
readonly maxLength: 2048;
|
|
439
|
+
readonly description: "A DID enfranchised by name.";
|
|
440
|
+
};
|
|
441
|
+
readonly uniqueItems: true;
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
};
|
|
445
|
+
readonly SecrecyLevel: {
|
|
446
|
+
readonly title: "SecrecyLevel";
|
|
447
|
+
readonly 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). Version 0.1 of the voting tasks carries open ballots only; a ballot box refuses to register any other level with `voting/election/register:unsupportedSecrecy` until the trustee tasks are specified.";
|
|
448
|
+
readonly type: "string";
|
|
449
|
+
readonly enum: readonly ["open", "sealed", "talliedEncrypted"];
|
|
450
|
+
};
|
|
451
|
+
readonly Question: {
|
|
452
|
+
readonly title: "Question";
|
|
453
|
+
readonly description: "One question. Tagged union over `type`.";
|
|
454
|
+
readonly oneOf: readonly [{
|
|
455
|
+
readonly title: "ChoiceQuestion";
|
|
456
|
+
readonly description: "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.";
|
|
457
|
+
readonly type: "object";
|
|
458
|
+
readonly additionalProperties: false;
|
|
459
|
+
readonly required: readonly ["key", "type", "options", "minSelections", "maxSelections", "optional"];
|
|
460
|
+
readonly properties: {
|
|
461
|
+
readonly key: {
|
|
462
|
+
readonly $ref: "#/$defs/Key";
|
|
463
|
+
};
|
|
464
|
+
readonly type: {
|
|
465
|
+
readonly const: "choice";
|
|
466
|
+
};
|
|
467
|
+
readonly text: {
|
|
468
|
+
readonly type: "string";
|
|
469
|
+
readonly maxLength: 2048;
|
|
470
|
+
};
|
|
471
|
+
readonly options: {
|
|
472
|
+
readonly type: "array";
|
|
473
|
+
readonly minItems: 2;
|
|
474
|
+
readonly maxItems: 256;
|
|
475
|
+
readonly items: {
|
|
476
|
+
readonly $ref: "#/$defs/QuestionOption";
|
|
477
|
+
};
|
|
478
|
+
};
|
|
479
|
+
readonly minSelections: {
|
|
480
|
+
readonly type: "integer";
|
|
481
|
+
readonly minimum: 0;
|
|
482
|
+
};
|
|
483
|
+
readonly maxSelections: {
|
|
484
|
+
readonly type: "integer";
|
|
485
|
+
readonly minimum: 1;
|
|
486
|
+
};
|
|
487
|
+
readonly optional: {
|
|
488
|
+
readonly type: "boolean";
|
|
489
|
+
};
|
|
490
|
+
};
|
|
491
|
+
}, {
|
|
492
|
+
readonly title: "RankingQuestion";
|
|
493
|
+
readonly description: "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.";
|
|
494
|
+
readonly type: "object";
|
|
495
|
+
readonly additionalProperties: false;
|
|
496
|
+
readonly required: readonly ["key", "type", "options", "partial", "optional"];
|
|
497
|
+
readonly properties: {
|
|
498
|
+
readonly key: {
|
|
499
|
+
readonly $ref: "#/$defs/Key";
|
|
500
|
+
};
|
|
501
|
+
readonly type: {
|
|
502
|
+
readonly const: "ranking";
|
|
503
|
+
};
|
|
504
|
+
readonly text: {
|
|
505
|
+
readonly type: "string";
|
|
506
|
+
readonly maxLength: 2048;
|
|
507
|
+
};
|
|
508
|
+
readonly options: {
|
|
509
|
+
readonly type: "array";
|
|
510
|
+
readonly minItems: 2;
|
|
511
|
+
readonly maxItems: 64;
|
|
512
|
+
readonly items: {
|
|
513
|
+
readonly $ref: "#/$defs/QuestionOption";
|
|
514
|
+
};
|
|
515
|
+
};
|
|
516
|
+
readonly partial: {
|
|
517
|
+
readonly type: "boolean";
|
|
518
|
+
};
|
|
519
|
+
readonly optional: {
|
|
520
|
+
readonly type: "boolean";
|
|
521
|
+
};
|
|
522
|
+
};
|
|
523
|
+
}, {
|
|
524
|
+
readonly title: "ScoreQuestion";
|
|
525
|
+
readonly description: "Give each option an integer score within [min, max].";
|
|
526
|
+
readonly type: "object";
|
|
527
|
+
readonly additionalProperties: false;
|
|
528
|
+
readonly required: readonly ["key", "type", "options", "min", "max", "optional"];
|
|
529
|
+
readonly properties: {
|
|
530
|
+
readonly key: {
|
|
531
|
+
readonly $ref: "#/$defs/Key";
|
|
532
|
+
};
|
|
533
|
+
readonly type: {
|
|
534
|
+
readonly const: "score";
|
|
535
|
+
};
|
|
536
|
+
readonly text: {
|
|
537
|
+
readonly type: "string";
|
|
538
|
+
readonly maxLength: 2048;
|
|
539
|
+
};
|
|
540
|
+
readonly options: {
|
|
541
|
+
readonly type: "array";
|
|
542
|
+
readonly minItems: 1;
|
|
543
|
+
readonly maxItems: 256;
|
|
544
|
+
readonly items: {
|
|
545
|
+
readonly $ref: "#/$defs/QuestionOption";
|
|
546
|
+
};
|
|
547
|
+
};
|
|
548
|
+
readonly min: {
|
|
549
|
+
readonly type: "integer";
|
|
550
|
+
};
|
|
551
|
+
readonly max: {
|
|
552
|
+
readonly type: "integer";
|
|
553
|
+
};
|
|
554
|
+
readonly optional: {
|
|
555
|
+
readonly type: "boolean";
|
|
556
|
+
};
|
|
557
|
+
};
|
|
558
|
+
}, {
|
|
559
|
+
readonly title: "TextQuestion";
|
|
560
|
+
readonly description: "Free text of at most `maxLength` characters.";
|
|
561
|
+
readonly type: "object";
|
|
562
|
+
readonly additionalProperties: false;
|
|
563
|
+
readonly required: readonly ["key", "type", "maxLength", "optional"];
|
|
564
|
+
readonly properties: {
|
|
565
|
+
readonly key: {
|
|
566
|
+
readonly $ref: "#/$defs/Key";
|
|
567
|
+
};
|
|
568
|
+
readonly type: {
|
|
569
|
+
readonly const: "text";
|
|
570
|
+
};
|
|
571
|
+
readonly text: {
|
|
572
|
+
readonly type: "string";
|
|
573
|
+
readonly maxLength: 2048;
|
|
574
|
+
};
|
|
575
|
+
readonly maxLength: {
|
|
576
|
+
readonly type: "integer";
|
|
577
|
+
readonly minimum: 1;
|
|
578
|
+
readonly maximum: 4096;
|
|
579
|
+
};
|
|
580
|
+
readonly optional: {
|
|
581
|
+
readonly type: "boolean";
|
|
582
|
+
};
|
|
583
|
+
};
|
|
584
|
+
}];
|
|
585
|
+
};
|
|
586
|
+
readonly Key: {
|
|
587
|
+
readonly title: "Key";
|
|
588
|
+
readonly description: "A question or option key, unique within its manifest or question.";
|
|
589
|
+
readonly type: "string";
|
|
590
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
|
|
591
|
+
};
|
|
592
|
+
readonly QuestionOption: {
|
|
593
|
+
readonly title: "QuestionOption";
|
|
594
|
+
readonly type: "object";
|
|
595
|
+
readonly additionalProperties: false;
|
|
596
|
+
readonly required: readonly ["key"];
|
|
597
|
+
readonly properties: {
|
|
598
|
+
readonly key: {
|
|
599
|
+
readonly $ref: "#/$defs/Key";
|
|
600
|
+
};
|
|
601
|
+
readonly label: {
|
|
602
|
+
readonly type: "string";
|
|
603
|
+
readonly maxLength: 512;
|
|
604
|
+
readonly description: "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014).";
|
|
605
|
+
};
|
|
606
|
+
};
|
|
607
|
+
};
|
|
608
|
+
readonly ElectionId: {
|
|
609
|
+
readonly title: "ElectionId";
|
|
610
|
+
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.";
|
|
611
|
+
readonly type: "string";
|
|
612
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
|
|
613
|
+
};
|
|
614
|
+
readonly ElectionResult: {
|
|
615
|
+
readonly title: "ElectionResult";
|
|
616
|
+
readonly description: "An election's result, computable by anyone who can read its board from the board and the registration alone (VTI-VOT-070).";
|
|
617
|
+
readonly type: "object";
|
|
618
|
+
readonly additionalProperties: false;
|
|
619
|
+
readonly required: readonly ["electionId", "manifestDigest", "ballotsCounted", "questions", "head"];
|
|
620
|
+
readonly properties: {
|
|
621
|
+
readonly electionId: {
|
|
622
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
623
|
+
};
|
|
624
|
+
readonly manifestDigest: {
|
|
625
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
626
|
+
};
|
|
627
|
+
readonly ballotsCounted: {
|
|
628
|
+
readonly type: "integer";
|
|
629
|
+
readonly minimum: 0;
|
|
630
|
+
};
|
|
631
|
+
readonly questions: {
|
|
632
|
+
readonly type: "array";
|
|
633
|
+
readonly items: {
|
|
634
|
+
readonly $ref: "#/$defs/QuestionResult";
|
|
635
|
+
};
|
|
636
|
+
};
|
|
637
|
+
readonly head: {
|
|
638
|
+
readonly $ref: "#/$defs/BoardHead";
|
|
639
|
+
readonly description: "The head of the board as it stood at close: the result counts exactly its entries.";
|
|
640
|
+
};
|
|
641
|
+
};
|
|
642
|
+
};
|
|
643
|
+
readonly BoardHead: {
|
|
644
|
+
readonly title: "BoardHead";
|
|
645
|
+
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.";
|
|
646
|
+
readonly type: "object";
|
|
647
|
+
readonly additionalProperties: false;
|
|
648
|
+
readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
|
|
649
|
+
readonly properties: {
|
|
650
|
+
readonly electionId: {
|
|
651
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
652
|
+
};
|
|
653
|
+
readonly treeSize: {
|
|
654
|
+
readonly type: "integer";
|
|
655
|
+
readonly minimum: 0;
|
|
656
|
+
};
|
|
657
|
+
readonly rootHash: {
|
|
658
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
659
|
+
readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
|
|
660
|
+
};
|
|
661
|
+
readonly issuedAt: {
|
|
662
|
+
readonly type: "string";
|
|
663
|
+
readonly format: "date-time";
|
|
664
|
+
};
|
|
665
|
+
};
|
|
666
|
+
};
|
|
667
|
+
readonly QuestionResult: {
|
|
668
|
+
readonly title: "QuestionResult";
|
|
669
|
+
readonly description: "One question's totals. `choice`: selections per option. `ranking`: per option, how many ballots placed it at each position (index 0 = first). `score`: per option, the sum and the number of ballots that scored it. `text`: the answers, in board order, withheld (`withheld: true`) below the manifest's `textReleaseThreshold`. `abstained` counts ballots that left the question unanswered.";
|
|
670
|
+
readonly type: "object";
|
|
671
|
+
readonly additionalProperties: false;
|
|
672
|
+
readonly required: readonly ["question", "abstained"];
|
|
673
|
+
readonly properties: {
|
|
674
|
+
readonly question: {
|
|
675
|
+
readonly $ref: "#/$defs/Key";
|
|
676
|
+
};
|
|
677
|
+
readonly abstained: {
|
|
678
|
+
readonly type: "integer";
|
|
679
|
+
readonly minimum: 0;
|
|
680
|
+
};
|
|
681
|
+
readonly choice: {
|
|
682
|
+
readonly type: "object";
|
|
683
|
+
readonly propertyNames: {
|
|
684
|
+
readonly $ref: "#/$defs/Key";
|
|
685
|
+
};
|
|
686
|
+
readonly additionalProperties: {
|
|
687
|
+
readonly type: "integer";
|
|
688
|
+
readonly minimum: 0;
|
|
689
|
+
};
|
|
690
|
+
};
|
|
691
|
+
readonly ranking: {
|
|
692
|
+
readonly type: "object";
|
|
693
|
+
readonly propertyNames: {
|
|
694
|
+
readonly $ref: "#/$defs/Key";
|
|
695
|
+
};
|
|
696
|
+
readonly additionalProperties: {
|
|
697
|
+
readonly type: "array";
|
|
698
|
+
readonly items: {
|
|
699
|
+
readonly type: "integer";
|
|
700
|
+
readonly minimum: 0;
|
|
701
|
+
};
|
|
702
|
+
};
|
|
703
|
+
};
|
|
704
|
+
readonly score: {
|
|
705
|
+
readonly type: "object";
|
|
706
|
+
readonly propertyNames: {
|
|
707
|
+
readonly $ref: "#/$defs/Key";
|
|
708
|
+
};
|
|
709
|
+
readonly additionalProperties: {
|
|
710
|
+
readonly type: "object";
|
|
711
|
+
readonly additionalProperties: false;
|
|
712
|
+
readonly required: readonly ["sum", "count"];
|
|
713
|
+
readonly properties: {
|
|
714
|
+
readonly sum: {
|
|
715
|
+
readonly type: "integer";
|
|
716
|
+
};
|
|
717
|
+
readonly count: {
|
|
718
|
+
readonly type: "integer";
|
|
719
|
+
readonly minimum: 0;
|
|
720
|
+
};
|
|
721
|
+
};
|
|
722
|
+
};
|
|
723
|
+
};
|
|
724
|
+
readonly text: {
|
|
725
|
+
readonly type: "array";
|
|
726
|
+
readonly items: {
|
|
727
|
+
readonly type: "string";
|
|
728
|
+
readonly maxLength: 4096;
|
|
729
|
+
};
|
|
730
|
+
};
|
|
731
|
+
readonly withheld: {
|
|
732
|
+
readonly type: "boolean";
|
|
733
|
+
};
|
|
734
|
+
};
|
|
735
|
+
};
|
|
736
|
+
};
|
|
737
|
+
};
|
|
738
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
739
|
+
export declare const RESPONSE_PAYLOAD_SCHEMA: {
|
|
740
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
741
|
+
readonly $ref: "#/$defs/Response";
|
|
742
|
+
readonly $defs: {
|
|
743
|
+
readonly RegistrarState: {
|
|
744
|
+
readonly title: "RegistrarState";
|
|
745
|
+
readonly description: "An election's state as its registrar holds it: the ballot box's `ElectionState` once the ballot box has registered the election, or, before that, `pendingRegistration` (the community is still delivering the registration) or `registrationRefused` (the ballot box refused it on a later delivery, and only a cancellation clears it). The first six values are the ballot box's `ElectionState` (voting/_shared/0.1).";
|
|
746
|
+
readonly type: "string";
|
|
747
|
+
readonly enum: readonly ["registered", "registration", "voting", "closed", "tallied", "cancelled", "pendingRegistration", "registrationRefused"];
|
|
748
|
+
};
|
|
749
|
+
readonly Checkpoint: {
|
|
750
|
+
readonly title: "Checkpoint";
|
|
751
|
+
readonly description: "A board head the community read from the ballot box and kept, with the ballot box's signed document that carried it. Certification proves the board's final head consistent with every checkpoint, so a ballot box that rewrote its board after a checkpoint is caught.";
|
|
752
|
+
readonly type: "object";
|
|
753
|
+
readonly additionalProperties: false;
|
|
754
|
+
readonly required: readonly ["head", "document"];
|
|
755
|
+
readonly properties: {
|
|
756
|
+
readonly head: {
|
|
757
|
+
readonly $ref: "#/$defs/BoardHead";
|
|
758
|
+
};
|
|
759
|
+
readonly document: {
|
|
760
|
+
readonly type: "object";
|
|
761
|
+
readonly description: "The ballot box's signed voting/board/head `#response` document whose payload carries `head`, kept whole and exactly as received — proof included — so anyone can verify it against the ballot box's DID without trusting the community.";
|
|
762
|
+
};
|
|
763
|
+
};
|
|
764
|
+
};
|
|
765
|
+
readonly Certification: {
|
|
766
|
+
readonly title: "Certification";
|
|
767
|
+
readonly description: "The community's certification of the election's result, as vtc/elections/certify recorded it.";
|
|
768
|
+
readonly type: "object";
|
|
769
|
+
readonly additionalProperties: false;
|
|
770
|
+
readonly required: readonly ["result", "certifiedAt", "auditAttestations"];
|
|
771
|
+
readonly properties: {
|
|
772
|
+
readonly result: {
|
|
773
|
+
readonly $ref: "#/$defs/ElectionResult";
|
|
774
|
+
};
|
|
775
|
+
readonly certifiedAt: {
|
|
776
|
+
readonly type: "string";
|
|
777
|
+
readonly format: "date-time";
|
|
778
|
+
readonly maxLength: 64;
|
|
779
|
+
};
|
|
780
|
+
readonly auditAttestations: {
|
|
781
|
+
readonly type: "array";
|
|
782
|
+
readonly maxItems: 32;
|
|
783
|
+
readonly items: {
|
|
784
|
+
readonly type: "object";
|
|
785
|
+
readonly description: "A verifiable credential from an auditor the manifest names, as received.";
|
|
786
|
+
};
|
|
787
|
+
};
|
|
788
|
+
};
|
|
789
|
+
};
|
|
790
|
+
readonly Response: {
|
|
791
|
+
readonly $anchor: "response";
|
|
792
|
+
readonly title: "VTC Elections — Show — response payload";
|
|
793
|
+
readonly description: "Success response to vtc/elections/show/0.1: one election, whole.";
|
|
794
|
+
readonly type: "object";
|
|
795
|
+
readonly additionalProperties: false;
|
|
796
|
+
readonly required: readonly ["manifest", "manifestDigest", "state", "parameters", "disclosure", "checkpoints"];
|
|
797
|
+
readonly properties: {
|
|
798
|
+
readonly manifest: {
|
|
799
|
+
readonly $ref: "#/$defs/Manifest";
|
|
800
|
+
};
|
|
801
|
+
readonly manifestDigest: {
|
|
802
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
803
|
+
readonly description: "The SHA-256 multihash of the RFC 8785 (JCS) canonicalization of `manifest`. A ticket request names it, and every cast is bound to it.";
|
|
804
|
+
};
|
|
805
|
+
readonly state: {
|
|
806
|
+
readonly $ref: "#/$defs/RegistrarState";
|
|
807
|
+
};
|
|
808
|
+
readonly parameters: {
|
|
809
|
+
readonly $ref: "#/$defs/VotingParameters";
|
|
810
|
+
readonly description: "The community's voting parameters the election's tickets are issued under (VTI-VOT-020).";
|
|
811
|
+
};
|
|
812
|
+
readonly disclosure: {
|
|
813
|
+
readonly $ref: "#/$defs/Disclosure";
|
|
814
|
+
readonly description: "How the election is run, generated from the manifest and the community's configuration (VTI-VOT-090). Always present: a member reads it before requesting a ticket.";
|
|
815
|
+
};
|
|
816
|
+
readonly checkpoints: {
|
|
817
|
+
readonly type: "array";
|
|
818
|
+
readonly maxItems: 256;
|
|
819
|
+
readonly items: {
|
|
820
|
+
readonly $ref: "#/$defs/Checkpoint";
|
|
821
|
+
};
|
|
822
|
+
readonly description: "The board heads the community has kept, oldest first. Empty until the community has read a head.";
|
|
823
|
+
};
|
|
824
|
+
readonly ticketsIssued: {
|
|
825
|
+
readonly type: "integer";
|
|
826
|
+
readonly minimum: 0;
|
|
827
|
+
readonly description: "How many tickets the community has issued for the election. Present only to a caller holding vtc.elections.manage.";
|
|
828
|
+
};
|
|
829
|
+
readonly certified: {
|
|
830
|
+
readonly $ref: "#/$defs/Certification";
|
|
831
|
+
readonly description: "Present once the community has certified the result.";
|
|
832
|
+
};
|
|
833
|
+
readonly ext: {
|
|
834
|
+
readonly $ref: "#/$defs/Ext";
|
|
835
|
+
};
|
|
836
|
+
};
|
|
837
|
+
};
|
|
838
|
+
readonly Ext: {
|
|
839
|
+
readonly title: "Ext";
|
|
840
|
+
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.";
|
|
841
|
+
readonly type: "object";
|
|
842
|
+
readonly minProperties: 1;
|
|
843
|
+
readonly additionalProperties: true;
|
|
844
|
+
readonly propertyNames: {
|
|
845
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
846
|
+
};
|
|
847
|
+
};
|
|
848
|
+
readonly Disclosure: {
|
|
849
|
+
readonly title: "Disclosure";
|
|
850
|
+
readonly description: "The statement a community publishes, and shows a member before they request a ticket, about how one election is run (VTI-VOT-090). Generated from the election's manifest and the community's configuration, never written by hand.";
|
|
851
|
+
readonly type: "object";
|
|
852
|
+
readonly additionalProperties: false;
|
|
853
|
+
readonly required: readonly ["ballotBox", "ballotBoxOperator", "sameOperator", "boardVisibility", "auditors", "revote", "coercionResistance"];
|
|
854
|
+
readonly properties: {
|
|
855
|
+
readonly ballotBox: {
|
|
856
|
+
readonly type: "string";
|
|
857
|
+
readonly minLength: 1;
|
|
858
|
+
readonly maxLength: 2048;
|
|
859
|
+
readonly description: "The ballot box's DID.";
|
|
860
|
+
};
|
|
861
|
+
readonly ballotBoxOperator: {
|
|
862
|
+
readonly type: "string";
|
|
863
|
+
readonly minLength: 1;
|
|
864
|
+
readonly maxLength: 512;
|
|
865
|
+
readonly description: "Who operates the ballot box, as the community names them.";
|
|
866
|
+
};
|
|
867
|
+
readonly sameOperator: {
|
|
868
|
+
readonly type: "boolean";
|
|
869
|
+
readonly description: "Whether the party operating the community's VTC also operates the ballot box.";
|
|
870
|
+
};
|
|
871
|
+
readonly trustees: {
|
|
872
|
+
readonly $ref: "#/$defs/Trustees";
|
|
873
|
+
};
|
|
874
|
+
readonly boardVisibility: {
|
|
875
|
+
readonly $ref: "#/$defs/BoardVisibility";
|
|
876
|
+
};
|
|
877
|
+
readonly auditors: {
|
|
878
|
+
readonly type: "array";
|
|
879
|
+
readonly items: {
|
|
880
|
+
readonly type: "string";
|
|
881
|
+
readonly minLength: 1;
|
|
882
|
+
readonly maxLength: 2048;
|
|
883
|
+
};
|
|
884
|
+
readonly uniqueItems: true;
|
|
885
|
+
};
|
|
886
|
+
readonly revote: {
|
|
887
|
+
readonly $ref: "#/$defs/Revote";
|
|
888
|
+
};
|
|
889
|
+
readonly coercionResistance: {
|
|
890
|
+
readonly const: false;
|
|
891
|
+
readonly description: "Always false: a voter can prove how they voted, so the community cannot protect a member against being made to vote a certain way.";
|
|
892
|
+
};
|
|
893
|
+
};
|
|
894
|
+
};
|
|
895
|
+
readonly Revote: {
|
|
896
|
+
readonly title: "Revote";
|
|
897
|
+
readonly description: "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).";
|
|
898
|
+
readonly type: "string";
|
|
899
|
+
readonly enum: readonly ["replace", "refuse"];
|
|
900
|
+
};
|
|
901
|
+
readonly BoardVisibility: {
|
|
902
|
+
readonly title: "BoardVisibility";
|
|
903
|
+
readonly description: "`public`: anyone reads the board. `private`: the community, the auditors the manifest names and, for one cast's inclusion, the holder of its receipt (VTI-VOT-052).";
|
|
904
|
+
readonly type: "string";
|
|
905
|
+
readonly enum: readonly ["public", "private"];
|
|
906
|
+
};
|
|
907
|
+
readonly Trustees: {
|
|
908
|
+
readonly title: "Trustees";
|
|
909
|
+
readonly description: "The trustees of a sealed or tallied-encrypted election and the number of them decryption needs (VTI-VOT-062). Neither the community nor the ballot box may be one.";
|
|
910
|
+
readonly type: "object";
|
|
911
|
+
readonly additionalProperties: false;
|
|
912
|
+
readonly required: readonly ["dids", "threshold"];
|
|
913
|
+
readonly properties: {
|
|
914
|
+
readonly dids: {
|
|
915
|
+
readonly type: "array";
|
|
916
|
+
readonly minItems: 2;
|
|
917
|
+
readonly items: {
|
|
918
|
+
readonly type: "string";
|
|
919
|
+
readonly minLength: 1;
|
|
920
|
+
readonly maxLength: 2048;
|
|
921
|
+
};
|
|
922
|
+
readonly uniqueItems: true;
|
|
923
|
+
};
|
|
924
|
+
readonly threshold: {
|
|
925
|
+
readonly type: "integer";
|
|
926
|
+
readonly minimum: 2;
|
|
927
|
+
};
|
|
928
|
+
};
|
|
929
|
+
};
|
|
930
|
+
readonly VotingParameters: {
|
|
931
|
+
readonly title: "VotingParameters";
|
|
932
|
+
readonly description: "The community's published voting parameters: the PCS suite and the voting verification key tickets are issued under (VTI-VOT-020). Distinct from its hidden-vetting helper key.";
|
|
933
|
+
readonly type: "object";
|
|
934
|
+
readonly additionalProperties: false;
|
|
935
|
+
readonly required: readonly ["suite", "votingKey"];
|
|
936
|
+
readonly properties: {
|
|
937
|
+
readonly suite: {
|
|
938
|
+
readonly type: "string";
|
|
939
|
+
readonly const: "ps-ddh-bls12381";
|
|
940
|
+
};
|
|
941
|
+
readonly votingKey: {
|
|
942
|
+
readonly $ref: "#/$defs/Multibase";
|
|
943
|
+
};
|
|
944
|
+
};
|
|
945
|
+
};
|
|
946
|
+
readonly Multibase: {
|
|
947
|
+
readonly title: "Multibase";
|
|
948
|
+
readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
|
|
949
|
+
readonly type: "string";
|
|
950
|
+
readonly maxLength: 16384;
|
|
951
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
952
|
+
};
|
|
953
|
+
readonly DigestMultibase: {
|
|
954
|
+
readonly title: "DigestMultibase";
|
|
955
|
+
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`.";
|
|
956
|
+
readonly type: "string";
|
|
957
|
+
readonly minLength: 16;
|
|
958
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
959
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
960
|
+
};
|
|
961
|
+
readonly Manifest: {
|
|
962
|
+
readonly title: "Manifest";
|
|
963
|
+
readonly description: "What an election asks and how it is decided (VTI-VOT-010). Its digest (`manifestDigest`) is the SHA-256 multihash of its RFC 8785 (JCS) canonicalization, and every cast is bound to it (VTI-VOT-011).";
|
|
964
|
+
readonly type: "object";
|
|
965
|
+
readonly additionalProperties: false;
|
|
966
|
+
readonly required: readonly ["electionId", "community", "questions", "secrecy", "roll", "registrationOpens", "votingOpens", "votingCloses", "revote", "board", "ballotBox", "binding", "allowEarlyClose", "resultsBeforeClose", "textReleaseThreshold"];
|
|
967
|
+
readonly properties: {
|
|
968
|
+
readonly electionId: {
|
|
969
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
970
|
+
};
|
|
971
|
+
readonly community: {
|
|
972
|
+
readonly type: "string";
|
|
973
|
+
readonly minLength: 1;
|
|
974
|
+
readonly maxLength: 2048;
|
|
975
|
+
readonly description: "The community's DID.";
|
|
976
|
+
};
|
|
977
|
+
readonly title: {
|
|
978
|
+
readonly type: "string";
|
|
979
|
+
readonly maxLength: 512;
|
|
980
|
+
};
|
|
981
|
+
readonly description: {
|
|
982
|
+
readonly type: "string";
|
|
983
|
+
readonly maxLength: 8192;
|
|
984
|
+
};
|
|
985
|
+
readonly questions: {
|
|
986
|
+
readonly type: "array";
|
|
987
|
+
readonly minItems: 1;
|
|
988
|
+
readonly maxItems: 128;
|
|
989
|
+
readonly items: {
|
|
990
|
+
readonly $ref: "#/$defs/Question";
|
|
991
|
+
};
|
|
992
|
+
};
|
|
993
|
+
readonly secrecy: {
|
|
994
|
+
readonly $ref: "#/$defs/SecrecyLevel";
|
|
995
|
+
};
|
|
996
|
+
readonly roll: {
|
|
997
|
+
readonly $ref: "#/$defs/RollRule";
|
|
998
|
+
};
|
|
999
|
+
readonly registrationOpens: {
|
|
1000
|
+
readonly type: "string";
|
|
1001
|
+
readonly format: "date-time";
|
|
1002
|
+
};
|
|
1003
|
+
readonly votingOpens: {
|
|
1004
|
+
readonly type: "string";
|
|
1005
|
+
readonly format: "date-time";
|
|
1006
|
+
};
|
|
1007
|
+
readonly votingCloses: {
|
|
1008
|
+
readonly type: "string";
|
|
1009
|
+
readonly format: "date-time";
|
|
1010
|
+
};
|
|
1011
|
+
readonly revote: {
|
|
1012
|
+
readonly $ref: "#/$defs/Revote";
|
|
1013
|
+
};
|
|
1014
|
+
readonly board: {
|
|
1015
|
+
readonly type: "object";
|
|
1016
|
+
readonly additionalProperties: false;
|
|
1017
|
+
readonly required: readonly ["visibility", "auditors"];
|
|
1018
|
+
readonly properties: {
|
|
1019
|
+
readonly visibility: {
|
|
1020
|
+
readonly $ref: "#/$defs/BoardVisibility";
|
|
1021
|
+
};
|
|
1022
|
+
readonly auditors: {
|
|
1023
|
+
readonly type: "array";
|
|
1024
|
+
readonly items: {
|
|
1025
|
+
readonly type: "string";
|
|
1026
|
+
readonly minLength: 1;
|
|
1027
|
+
readonly maxLength: 2048;
|
|
1028
|
+
};
|
|
1029
|
+
readonly uniqueItems: true;
|
|
1030
|
+
};
|
|
1031
|
+
};
|
|
1032
|
+
};
|
|
1033
|
+
readonly ballotBox: {
|
|
1034
|
+
readonly type: "string";
|
|
1035
|
+
readonly minLength: 1;
|
|
1036
|
+
readonly maxLength: 2048;
|
|
1037
|
+
readonly description: "The DID of the voting service that holds the board.";
|
|
1038
|
+
};
|
|
1039
|
+
readonly trustees: {
|
|
1040
|
+
readonly $ref: "#/$defs/Trustees";
|
|
1041
|
+
};
|
|
1042
|
+
readonly binding: {
|
|
1043
|
+
readonly type: "boolean";
|
|
1044
|
+
readonly description: "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081).";
|
|
1045
|
+
};
|
|
1046
|
+
readonly allowEarlyClose: {
|
|
1047
|
+
readonly type: "boolean";
|
|
1048
|
+
};
|
|
1049
|
+
readonly resultsBeforeClose: {
|
|
1050
|
+
readonly type: "boolean";
|
|
1051
|
+
readonly description: "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061).";
|
|
1052
|
+
};
|
|
1053
|
+
readonly textReleaseThreshold: {
|
|
1054
|
+
readonly type: "integer";
|
|
1055
|
+
readonly minimum: 10;
|
|
1056
|
+
readonly description: "Counted ballots required before any text answer is disclosed (VTI-VOT-065).";
|
|
1057
|
+
};
|
|
1058
|
+
};
|
|
1059
|
+
};
|
|
1060
|
+
readonly RollRule: {
|
|
1061
|
+
readonly title: "RollRule";
|
|
1062
|
+
readonly description: "Who may be issued a ticket (VTI-VOT-021): the community's active members, its active members and the parties `listed` names, or only the parties `listed` names.";
|
|
1063
|
+
readonly type: "object";
|
|
1064
|
+
readonly additionalProperties: false;
|
|
1065
|
+
readonly required: readonly ["rule"];
|
|
1066
|
+
readonly properties: {
|
|
1067
|
+
readonly rule: {
|
|
1068
|
+
readonly type: "string";
|
|
1069
|
+
readonly enum: readonly ["members", "membersAndListed", "listed"];
|
|
1070
|
+
};
|
|
1071
|
+
readonly listed: {
|
|
1072
|
+
readonly type: "array";
|
|
1073
|
+
readonly items: {
|
|
1074
|
+
readonly type: "string";
|
|
1075
|
+
readonly minLength: 1;
|
|
1076
|
+
readonly maxLength: 2048;
|
|
1077
|
+
readonly description: "A DID enfranchised by name.";
|
|
1078
|
+
};
|
|
1079
|
+
readonly uniqueItems: true;
|
|
1080
|
+
};
|
|
1081
|
+
};
|
|
1082
|
+
};
|
|
1083
|
+
readonly SecrecyLevel: {
|
|
1084
|
+
readonly title: "SecrecyLevel";
|
|
1085
|
+
readonly 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). Version 0.1 of the voting tasks carries open ballots only; a ballot box refuses to register any other level with `voting/election/register:unsupportedSecrecy` until the trustee tasks are specified.";
|
|
1086
|
+
readonly type: "string";
|
|
1087
|
+
readonly enum: readonly ["open", "sealed", "talliedEncrypted"];
|
|
1088
|
+
};
|
|
1089
|
+
readonly Question: {
|
|
1090
|
+
readonly title: "Question";
|
|
1091
|
+
readonly description: "One question. Tagged union over `type`.";
|
|
1092
|
+
readonly oneOf: readonly [{
|
|
1093
|
+
readonly title: "ChoiceQuestion";
|
|
1094
|
+
readonly description: "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.";
|
|
1095
|
+
readonly type: "object";
|
|
1096
|
+
readonly additionalProperties: false;
|
|
1097
|
+
readonly required: readonly ["key", "type", "options", "minSelections", "maxSelections", "optional"];
|
|
1098
|
+
readonly properties: {
|
|
1099
|
+
readonly key: {
|
|
1100
|
+
readonly $ref: "#/$defs/Key";
|
|
1101
|
+
};
|
|
1102
|
+
readonly type: {
|
|
1103
|
+
readonly const: "choice";
|
|
1104
|
+
};
|
|
1105
|
+
readonly text: {
|
|
1106
|
+
readonly type: "string";
|
|
1107
|
+
readonly maxLength: 2048;
|
|
1108
|
+
};
|
|
1109
|
+
readonly options: {
|
|
1110
|
+
readonly type: "array";
|
|
1111
|
+
readonly minItems: 2;
|
|
1112
|
+
readonly maxItems: 256;
|
|
1113
|
+
readonly items: {
|
|
1114
|
+
readonly $ref: "#/$defs/QuestionOption";
|
|
1115
|
+
};
|
|
1116
|
+
};
|
|
1117
|
+
readonly minSelections: {
|
|
1118
|
+
readonly type: "integer";
|
|
1119
|
+
readonly minimum: 0;
|
|
1120
|
+
};
|
|
1121
|
+
readonly maxSelections: {
|
|
1122
|
+
readonly type: "integer";
|
|
1123
|
+
readonly minimum: 1;
|
|
1124
|
+
};
|
|
1125
|
+
readonly optional: {
|
|
1126
|
+
readonly type: "boolean";
|
|
1127
|
+
};
|
|
1128
|
+
};
|
|
1129
|
+
}, {
|
|
1130
|
+
readonly title: "RankingQuestion";
|
|
1131
|
+
readonly description: "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.";
|
|
1132
|
+
readonly type: "object";
|
|
1133
|
+
readonly additionalProperties: false;
|
|
1134
|
+
readonly required: readonly ["key", "type", "options", "partial", "optional"];
|
|
1135
|
+
readonly properties: {
|
|
1136
|
+
readonly key: {
|
|
1137
|
+
readonly $ref: "#/$defs/Key";
|
|
1138
|
+
};
|
|
1139
|
+
readonly type: {
|
|
1140
|
+
readonly const: "ranking";
|
|
1141
|
+
};
|
|
1142
|
+
readonly text: {
|
|
1143
|
+
readonly type: "string";
|
|
1144
|
+
readonly maxLength: 2048;
|
|
1145
|
+
};
|
|
1146
|
+
readonly options: {
|
|
1147
|
+
readonly type: "array";
|
|
1148
|
+
readonly minItems: 2;
|
|
1149
|
+
readonly maxItems: 64;
|
|
1150
|
+
readonly items: {
|
|
1151
|
+
readonly $ref: "#/$defs/QuestionOption";
|
|
1152
|
+
};
|
|
1153
|
+
};
|
|
1154
|
+
readonly partial: {
|
|
1155
|
+
readonly type: "boolean";
|
|
1156
|
+
};
|
|
1157
|
+
readonly optional: {
|
|
1158
|
+
readonly type: "boolean";
|
|
1159
|
+
};
|
|
1160
|
+
};
|
|
1161
|
+
}, {
|
|
1162
|
+
readonly title: "ScoreQuestion";
|
|
1163
|
+
readonly description: "Give each option an integer score within [min, max].";
|
|
1164
|
+
readonly type: "object";
|
|
1165
|
+
readonly additionalProperties: false;
|
|
1166
|
+
readonly required: readonly ["key", "type", "options", "min", "max", "optional"];
|
|
1167
|
+
readonly properties: {
|
|
1168
|
+
readonly key: {
|
|
1169
|
+
readonly $ref: "#/$defs/Key";
|
|
1170
|
+
};
|
|
1171
|
+
readonly type: {
|
|
1172
|
+
readonly const: "score";
|
|
1173
|
+
};
|
|
1174
|
+
readonly text: {
|
|
1175
|
+
readonly type: "string";
|
|
1176
|
+
readonly maxLength: 2048;
|
|
1177
|
+
};
|
|
1178
|
+
readonly options: {
|
|
1179
|
+
readonly type: "array";
|
|
1180
|
+
readonly minItems: 1;
|
|
1181
|
+
readonly maxItems: 256;
|
|
1182
|
+
readonly items: {
|
|
1183
|
+
readonly $ref: "#/$defs/QuestionOption";
|
|
1184
|
+
};
|
|
1185
|
+
};
|
|
1186
|
+
readonly min: {
|
|
1187
|
+
readonly type: "integer";
|
|
1188
|
+
};
|
|
1189
|
+
readonly max: {
|
|
1190
|
+
readonly type: "integer";
|
|
1191
|
+
};
|
|
1192
|
+
readonly optional: {
|
|
1193
|
+
readonly type: "boolean";
|
|
1194
|
+
};
|
|
1195
|
+
};
|
|
1196
|
+
}, {
|
|
1197
|
+
readonly title: "TextQuestion";
|
|
1198
|
+
readonly description: "Free text of at most `maxLength` characters.";
|
|
1199
|
+
readonly type: "object";
|
|
1200
|
+
readonly additionalProperties: false;
|
|
1201
|
+
readonly required: readonly ["key", "type", "maxLength", "optional"];
|
|
1202
|
+
readonly properties: {
|
|
1203
|
+
readonly key: {
|
|
1204
|
+
readonly $ref: "#/$defs/Key";
|
|
1205
|
+
};
|
|
1206
|
+
readonly type: {
|
|
1207
|
+
readonly const: "text";
|
|
1208
|
+
};
|
|
1209
|
+
readonly text: {
|
|
1210
|
+
readonly type: "string";
|
|
1211
|
+
readonly maxLength: 2048;
|
|
1212
|
+
};
|
|
1213
|
+
readonly maxLength: {
|
|
1214
|
+
readonly type: "integer";
|
|
1215
|
+
readonly minimum: 1;
|
|
1216
|
+
readonly maximum: 4096;
|
|
1217
|
+
};
|
|
1218
|
+
readonly optional: {
|
|
1219
|
+
readonly type: "boolean";
|
|
1220
|
+
};
|
|
1221
|
+
};
|
|
1222
|
+
}];
|
|
1223
|
+
};
|
|
1224
|
+
readonly Key: {
|
|
1225
|
+
readonly title: "Key";
|
|
1226
|
+
readonly description: "A question or option key, unique within its manifest or question.";
|
|
1227
|
+
readonly type: "string";
|
|
1228
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
|
|
1229
|
+
};
|
|
1230
|
+
readonly QuestionOption: {
|
|
1231
|
+
readonly title: "QuestionOption";
|
|
1232
|
+
readonly type: "object";
|
|
1233
|
+
readonly additionalProperties: false;
|
|
1234
|
+
readonly required: readonly ["key"];
|
|
1235
|
+
readonly properties: {
|
|
1236
|
+
readonly key: {
|
|
1237
|
+
readonly $ref: "#/$defs/Key";
|
|
1238
|
+
};
|
|
1239
|
+
readonly label: {
|
|
1240
|
+
readonly type: "string";
|
|
1241
|
+
readonly maxLength: 512;
|
|
1242
|
+
readonly description: "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014).";
|
|
1243
|
+
};
|
|
1244
|
+
};
|
|
1245
|
+
};
|
|
1246
|
+
readonly ElectionId: {
|
|
1247
|
+
readonly title: "ElectionId";
|
|
1248
|
+
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.";
|
|
1249
|
+
readonly type: "string";
|
|
1250
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
|
|
1251
|
+
};
|
|
1252
|
+
readonly ElectionResult: {
|
|
1253
|
+
readonly title: "ElectionResult";
|
|
1254
|
+
readonly description: "An election's result, computable by anyone who can read its board from the board and the registration alone (VTI-VOT-070).";
|
|
1255
|
+
readonly type: "object";
|
|
1256
|
+
readonly additionalProperties: false;
|
|
1257
|
+
readonly required: readonly ["electionId", "manifestDigest", "ballotsCounted", "questions", "head"];
|
|
1258
|
+
readonly properties: {
|
|
1259
|
+
readonly electionId: {
|
|
1260
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
1261
|
+
};
|
|
1262
|
+
readonly manifestDigest: {
|
|
1263
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
1264
|
+
};
|
|
1265
|
+
readonly ballotsCounted: {
|
|
1266
|
+
readonly type: "integer";
|
|
1267
|
+
readonly minimum: 0;
|
|
1268
|
+
};
|
|
1269
|
+
readonly questions: {
|
|
1270
|
+
readonly type: "array";
|
|
1271
|
+
readonly items: {
|
|
1272
|
+
readonly $ref: "#/$defs/QuestionResult";
|
|
1273
|
+
};
|
|
1274
|
+
};
|
|
1275
|
+
readonly head: {
|
|
1276
|
+
readonly $ref: "#/$defs/BoardHead";
|
|
1277
|
+
readonly description: "The head of the board as it stood at close: the result counts exactly its entries.";
|
|
1278
|
+
};
|
|
1279
|
+
};
|
|
1280
|
+
};
|
|
1281
|
+
readonly BoardHead: {
|
|
1282
|
+
readonly title: "BoardHead";
|
|
1283
|
+
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.";
|
|
1284
|
+
readonly type: "object";
|
|
1285
|
+
readonly additionalProperties: false;
|
|
1286
|
+
readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
|
|
1287
|
+
readonly properties: {
|
|
1288
|
+
readonly electionId: {
|
|
1289
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
1290
|
+
};
|
|
1291
|
+
readonly treeSize: {
|
|
1292
|
+
readonly type: "integer";
|
|
1293
|
+
readonly minimum: 0;
|
|
1294
|
+
};
|
|
1295
|
+
readonly rootHash: {
|
|
1296
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
1297
|
+
readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
|
|
1298
|
+
};
|
|
1299
|
+
readonly issuedAt: {
|
|
1300
|
+
readonly type: "string";
|
|
1301
|
+
readonly format: "date-time";
|
|
1302
|
+
};
|
|
1303
|
+
};
|
|
1304
|
+
};
|
|
1305
|
+
readonly QuestionResult: {
|
|
1306
|
+
readonly title: "QuestionResult";
|
|
1307
|
+
readonly description: "One question's totals. `choice`: selections per option. `ranking`: per option, how many ballots placed it at each position (index 0 = first). `score`: per option, the sum and the number of ballots that scored it. `text`: the answers, in board order, withheld (`withheld: true`) below the manifest's `textReleaseThreshold`. `abstained` counts ballots that left the question unanswered.";
|
|
1308
|
+
readonly type: "object";
|
|
1309
|
+
readonly additionalProperties: false;
|
|
1310
|
+
readonly required: readonly ["question", "abstained"];
|
|
1311
|
+
readonly properties: {
|
|
1312
|
+
readonly question: {
|
|
1313
|
+
readonly $ref: "#/$defs/Key";
|
|
1314
|
+
};
|
|
1315
|
+
readonly abstained: {
|
|
1316
|
+
readonly type: "integer";
|
|
1317
|
+
readonly minimum: 0;
|
|
1318
|
+
};
|
|
1319
|
+
readonly choice: {
|
|
1320
|
+
readonly type: "object";
|
|
1321
|
+
readonly propertyNames: {
|
|
1322
|
+
readonly $ref: "#/$defs/Key";
|
|
1323
|
+
};
|
|
1324
|
+
readonly additionalProperties: {
|
|
1325
|
+
readonly type: "integer";
|
|
1326
|
+
readonly minimum: 0;
|
|
1327
|
+
};
|
|
1328
|
+
};
|
|
1329
|
+
readonly ranking: {
|
|
1330
|
+
readonly type: "object";
|
|
1331
|
+
readonly propertyNames: {
|
|
1332
|
+
readonly $ref: "#/$defs/Key";
|
|
1333
|
+
};
|
|
1334
|
+
readonly additionalProperties: {
|
|
1335
|
+
readonly type: "array";
|
|
1336
|
+
readonly items: {
|
|
1337
|
+
readonly type: "integer";
|
|
1338
|
+
readonly minimum: 0;
|
|
1339
|
+
};
|
|
1340
|
+
};
|
|
1341
|
+
};
|
|
1342
|
+
readonly score: {
|
|
1343
|
+
readonly type: "object";
|
|
1344
|
+
readonly propertyNames: {
|
|
1345
|
+
readonly $ref: "#/$defs/Key";
|
|
1346
|
+
};
|
|
1347
|
+
readonly additionalProperties: {
|
|
1348
|
+
readonly type: "object";
|
|
1349
|
+
readonly additionalProperties: false;
|
|
1350
|
+
readonly required: readonly ["sum", "count"];
|
|
1351
|
+
readonly properties: {
|
|
1352
|
+
readonly sum: {
|
|
1353
|
+
readonly type: "integer";
|
|
1354
|
+
};
|
|
1355
|
+
readonly count: {
|
|
1356
|
+
readonly type: "integer";
|
|
1357
|
+
readonly minimum: 0;
|
|
1358
|
+
};
|
|
1359
|
+
};
|
|
1360
|
+
};
|
|
1361
|
+
};
|
|
1362
|
+
readonly text: {
|
|
1363
|
+
readonly type: "array";
|
|
1364
|
+
readonly items: {
|
|
1365
|
+
readonly type: "string";
|
|
1366
|
+
readonly maxLength: 4096;
|
|
1367
|
+
};
|
|
1368
|
+
};
|
|
1369
|
+
readonly withheld: {
|
|
1370
|
+
readonly type: "boolean";
|
|
1371
|
+
};
|
|
1372
|
+
};
|
|
1373
|
+
};
|
|
1374
|
+
};
|
|
1375
|
+
};
|
|
1376
|
+
/**
|
|
1377
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
1378
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
1379
|
+
* per-specification and cannot be derived from the document alone, and
|
|
1380
|
+
* item 2 needs the schema this carries.
|
|
1381
|
+
*/
|
|
1382
|
+
export declare const SPEC: {
|
|
1383
|
+
readonly typeUri: "https://trusttasks.org/spec/vtc/elections/show/0.1";
|
|
1384
|
+
readonly isBearer: false;
|
|
1385
|
+
readonly isProofRequired: false;
|
|
1386
|
+
readonly isRecipientRequired: true;
|
|
1387
|
+
readonly isIssuedAtRequired: false;
|
|
1388
|
+
readonly payloadSchema: {
|
|
1389
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
1390
|
+
readonly $id: "https://trusttasks.org/spec/vtc/elections/show/0.1";
|
|
1391
|
+
readonly title: "VTC Elections — Show — payload";
|
|
1392
|
+
readonly description: "A member or an administrator reads one election of the community whole: its manifest, state, voting parameters, disclosure, the board checkpoints the community kept and, once certified, the certified result. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.";
|
|
1393
|
+
readonly type: "object";
|
|
1394
|
+
readonly additionalProperties: false;
|
|
1395
|
+
readonly required: readonly ["electionId"];
|
|
1396
|
+
readonly properties: {
|
|
1397
|
+
readonly electionId: {
|
|
1398
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
1399
|
+
};
|
|
1400
|
+
readonly ext: {
|
|
1401
|
+
readonly $ref: "#/$defs/Ext";
|
|
1402
|
+
};
|
|
1403
|
+
};
|
|
1404
|
+
readonly $defs: {
|
|
1405
|
+
readonly RegistrarState: {
|
|
1406
|
+
readonly title: "RegistrarState";
|
|
1407
|
+
readonly description: "An election's state as its registrar holds it: the ballot box's `ElectionState` once the ballot box has registered the election, or, before that, `pendingRegistration` (the community is still delivering the registration) or `registrationRefused` (the ballot box refused it on a later delivery, and only a cancellation clears it). The first six values are the ballot box's `ElectionState` (voting/_shared/0.1).";
|
|
1408
|
+
readonly type: "string";
|
|
1409
|
+
readonly enum: readonly ["registered", "registration", "voting", "closed", "tallied", "cancelled", "pendingRegistration", "registrationRefused"];
|
|
1410
|
+
};
|
|
1411
|
+
readonly Checkpoint: {
|
|
1412
|
+
readonly title: "Checkpoint";
|
|
1413
|
+
readonly description: "A board head the community read from the ballot box and kept, with the ballot box's signed document that carried it. Certification proves the board's final head consistent with every checkpoint, so a ballot box that rewrote its board after a checkpoint is caught.";
|
|
1414
|
+
readonly type: "object";
|
|
1415
|
+
readonly additionalProperties: false;
|
|
1416
|
+
readonly required: readonly ["head", "document"];
|
|
1417
|
+
readonly properties: {
|
|
1418
|
+
readonly head: {
|
|
1419
|
+
readonly $ref: "#/$defs/BoardHead";
|
|
1420
|
+
};
|
|
1421
|
+
readonly document: {
|
|
1422
|
+
readonly type: "object";
|
|
1423
|
+
readonly description: "The ballot box's signed voting/board/head `#response` document whose payload carries `head`, kept whole and exactly as received — proof included — so anyone can verify it against the ballot box's DID without trusting the community.";
|
|
1424
|
+
};
|
|
1425
|
+
};
|
|
1426
|
+
};
|
|
1427
|
+
readonly Certification: {
|
|
1428
|
+
readonly title: "Certification";
|
|
1429
|
+
readonly description: "The community's certification of the election's result, as vtc/elections/certify recorded it.";
|
|
1430
|
+
readonly type: "object";
|
|
1431
|
+
readonly additionalProperties: false;
|
|
1432
|
+
readonly required: readonly ["result", "certifiedAt", "auditAttestations"];
|
|
1433
|
+
readonly properties: {
|
|
1434
|
+
readonly result: {
|
|
1435
|
+
readonly $ref: "#/$defs/ElectionResult";
|
|
1436
|
+
};
|
|
1437
|
+
readonly certifiedAt: {
|
|
1438
|
+
readonly type: "string";
|
|
1439
|
+
readonly format: "date-time";
|
|
1440
|
+
readonly maxLength: 64;
|
|
1441
|
+
};
|
|
1442
|
+
readonly auditAttestations: {
|
|
1443
|
+
readonly type: "array";
|
|
1444
|
+
readonly maxItems: 32;
|
|
1445
|
+
readonly items: {
|
|
1446
|
+
readonly type: "object";
|
|
1447
|
+
readonly description: "A verifiable credential from an auditor the manifest names, as received.";
|
|
1448
|
+
};
|
|
1449
|
+
};
|
|
1450
|
+
};
|
|
1451
|
+
};
|
|
1452
|
+
readonly Response: {
|
|
1453
|
+
readonly $anchor: "response";
|
|
1454
|
+
readonly title: "VTC Elections — Show — response payload";
|
|
1455
|
+
readonly description: "Success response to vtc/elections/show/0.1: one election, whole.";
|
|
1456
|
+
readonly type: "object";
|
|
1457
|
+
readonly additionalProperties: false;
|
|
1458
|
+
readonly required: readonly ["manifest", "manifestDigest", "state", "parameters", "disclosure", "checkpoints"];
|
|
1459
|
+
readonly properties: {
|
|
1460
|
+
readonly manifest: {
|
|
1461
|
+
readonly $ref: "#/$defs/Manifest";
|
|
1462
|
+
};
|
|
1463
|
+
readonly manifestDigest: {
|
|
1464
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
1465
|
+
readonly description: "The SHA-256 multihash of the RFC 8785 (JCS) canonicalization of `manifest`. A ticket request names it, and every cast is bound to it.";
|
|
1466
|
+
};
|
|
1467
|
+
readonly state: {
|
|
1468
|
+
readonly $ref: "#/$defs/RegistrarState";
|
|
1469
|
+
};
|
|
1470
|
+
readonly parameters: {
|
|
1471
|
+
readonly $ref: "#/$defs/VotingParameters";
|
|
1472
|
+
readonly description: "The community's voting parameters the election's tickets are issued under (VTI-VOT-020).";
|
|
1473
|
+
};
|
|
1474
|
+
readonly disclosure: {
|
|
1475
|
+
readonly $ref: "#/$defs/Disclosure";
|
|
1476
|
+
readonly description: "How the election is run, generated from the manifest and the community's configuration (VTI-VOT-090). Always present: a member reads it before requesting a ticket.";
|
|
1477
|
+
};
|
|
1478
|
+
readonly checkpoints: {
|
|
1479
|
+
readonly type: "array";
|
|
1480
|
+
readonly maxItems: 256;
|
|
1481
|
+
readonly items: {
|
|
1482
|
+
readonly $ref: "#/$defs/Checkpoint";
|
|
1483
|
+
};
|
|
1484
|
+
readonly description: "The board heads the community has kept, oldest first. Empty until the community has read a head.";
|
|
1485
|
+
};
|
|
1486
|
+
readonly ticketsIssued: {
|
|
1487
|
+
readonly type: "integer";
|
|
1488
|
+
readonly minimum: 0;
|
|
1489
|
+
readonly description: "How many tickets the community has issued for the election. Present only to a caller holding vtc.elections.manage.";
|
|
1490
|
+
};
|
|
1491
|
+
readonly certified: {
|
|
1492
|
+
readonly $ref: "#/$defs/Certification";
|
|
1493
|
+
readonly description: "Present once the community has certified the result.";
|
|
1494
|
+
};
|
|
1495
|
+
readonly ext: {
|
|
1496
|
+
readonly $ref: "#/$defs/Ext";
|
|
1497
|
+
};
|
|
1498
|
+
};
|
|
1499
|
+
};
|
|
1500
|
+
readonly Ext: {
|
|
1501
|
+
readonly title: "Ext";
|
|
1502
|
+
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.";
|
|
1503
|
+
readonly type: "object";
|
|
1504
|
+
readonly minProperties: 1;
|
|
1505
|
+
readonly additionalProperties: true;
|
|
1506
|
+
readonly propertyNames: {
|
|
1507
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
1508
|
+
};
|
|
1509
|
+
};
|
|
1510
|
+
readonly Disclosure: {
|
|
1511
|
+
readonly title: "Disclosure";
|
|
1512
|
+
readonly description: "The statement a community publishes, and shows a member before they request a ticket, about how one election is run (VTI-VOT-090). Generated from the election's manifest and the community's configuration, never written by hand.";
|
|
1513
|
+
readonly type: "object";
|
|
1514
|
+
readonly additionalProperties: false;
|
|
1515
|
+
readonly required: readonly ["ballotBox", "ballotBoxOperator", "sameOperator", "boardVisibility", "auditors", "revote", "coercionResistance"];
|
|
1516
|
+
readonly properties: {
|
|
1517
|
+
readonly ballotBox: {
|
|
1518
|
+
readonly type: "string";
|
|
1519
|
+
readonly minLength: 1;
|
|
1520
|
+
readonly maxLength: 2048;
|
|
1521
|
+
readonly description: "The ballot box's DID.";
|
|
1522
|
+
};
|
|
1523
|
+
readonly ballotBoxOperator: {
|
|
1524
|
+
readonly type: "string";
|
|
1525
|
+
readonly minLength: 1;
|
|
1526
|
+
readonly maxLength: 512;
|
|
1527
|
+
readonly description: "Who operates the ballot box, as the community names them.";
|
|
1528
|
+
};
|
|
1529
|
+
readonly sameOperator: {
|
|
1530
|
+
readonly type: "boolean";
|
|
1531
|
+
readonly description: "Whether the party operating the community's VTC also operates the ballot box.";
|
|
1532
|
+
};
|
|
1533
|
+
readonly trustees: {
|
|
1534
|
+
readonly $ref: "#/$defs/Trustees";
|
|
1535
|
+
};
|
|
1536
|
+
readonly boardVisibility: {
|
|
1537
|
+
readonly $ref: "#/$defs/BoardVisibility";
|
|
1538
|
+
};
|
|
1539
|
+
readonly auditors: {
|
|
1540
|
+
readonly type: "array";
|
|
1541
|
+
readonly items: {
|
|
1542
|
+
readonly type: "string";
|
|
1543
|
+
readonly minLength: 1;
|
|
1544
|
+
readonly maxLength: 2048;
|
|
1545
|
+
};
|
|
1546
|
+
readonly uniqueItems: true;
|
|
1547
|
+
};
|
|
1548
|
+
readonly revote: {
|
|
1549
|
+
readonly $ref: "#/$defs/Revote";
|
|
1550
|
+
};
|
|
1551
|
+
readonly coercionResistance: {
|
|
1552
|
+
readonly const: false;
|
|
1553
|
+
readonly description: "Always false: a voter can prove how they voted, so the community cannot protect a member against being made to vote a certain way.";
|
|
1554
|
+
};
|
|
1555
|
+
};
|
|
1556
|
+
};
|
|
1557
|
+
readonly Revote: {
|
|
1558
|
+
readonly title: "Revote";
|
|
1559
|
+
readonly description: "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).";
|
|
1560
|
+
readonly type: "string";
|
|
1561
|
+
readonly enum: readonly ["replace", "refuse"];
|
|
1562
|
+
};
|
|
1563
|
+
readonly BoardVisibility: {
|
|
1564
|
+
readonly title: "BoardVisibility";
|
|
1565
|
+
readonly description: "`public`: anyone reads the board. `private`: the community, the auditors the manifest names and, for one cast's inclusion, the holder of its receipt (VTI-VOT-052).";
|
|
1566
|
+
readonly type: "string";
|
|
1567
|
+
readonly enum: readonly ["public", "private"];
|
|
1568
|
+
};
|
|
1569
|
+
readonly Trustees: {
|
|
1570
|
+
readonly title: "Trustees";
|
|
1571
|
+
readonly description: "The trustees of a sealed or tallied-encrypted election and the number of them decryption needs (VTI-VOT-062). Neither the community nor the ballot box may be one.";
|
|
1572
|
+
readonly type: "object";
|
|
1573
|
+
readonly additionalProperties: false;
|
|
1574
|
+
readonly required: readonly ["dids", "threshold"];
|
|
1575
|
+
readonly properties: {
|
|
1576
|
+
readonly dids: {
|
|
1577
|
+
readonly type: "array";
|
|
1578
|
+
readonly minItems: 2;
|
|
1579
|
+
readonly items: {
|
|
1580
|
+
readonly type: "string";
|
|
1581
|
+
readonly minLength: 1;
|
|
1582
|
+
readonly maxLength: 2048;
|
|
1583
|
+
};
|
|
1584
|
+
readonly uniqueItems: true;
|
|
1585
|
+
};
|
|
1586
|
+
readonly threshold: {
|
|
1587
|
+
readonly type: "integer";
|
|
1588
|
+
readonly minimum: 2;
|
|
1589
|
+
};
|
|
1590
|
+
};
|
|
1591
|
+
};
|
|
1592
|
+
readonly VotingParameters: {
|
|
1593
|
+
readonly title: "VotingParameters";
|
|
1594
|
+
readonly description: "The community's published voting parameters: the PCS suite and the voting verification key tickets are issued under (VTI-VOT-020). Distinct from its hidden-vetting helper key.";
|
|
1595
|
+
readonly type: "object";
|
|
1596
|
+
readonly additionalProperties: false;
|
|
1597
|
+
readonly required: readonly ["suite", "votingKey"];
|
|
1598
|
+
readonly properties: {
|
|
1599
|
+
readonly suite: {
|
|
1600
|
+
readonly type: "string";
|
|
1601
|
+
readonly const: "ps-ddh-bls12381";
|
|
1602
|
+
};
|
|
1603
|
+
readonly votingKey: {
|
|
1604
|
+
readonly $ref: "#/$defs/Multibase";
|
|
1605
|
+
};
|
|
1606
|
+
};
|
|
1607
|
+
};
|
|
1608
|
+
readonly Multibase: {
|
|
1609
|
+
readonly title: "Multibase";
|
|
1610
|
+
readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
|
|
1611
|
+
readonly type: "string";
|
|
1612
|
+
readonly maxLength: 16384;
|
|
1613
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
1614
|
+
};
|
|
1615
|
+
readonly DigestMultibase: {
|
|
1616
|
+
readonly title: "DigestMultibase";
|
|
1617
|
+
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`.";
|
|
1618
|
+
readonly type: "string";
|
|
1619
|
+
readonly minLength: 16;
|
|
1620
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
1621
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
1622
|
+
};
|
|
1623
|
+
readonly Manifest: {
|
|
1624
|
+
readonly title: "Manifest";
|
|
1625
|
+
readonly description: "What an election asks and how it is decided (VTI-VOT-010). Its digest (`manifestDigest`) is the SHA-256 multihash of its RFC 8785 (JCS) canonicalization, and every cast is bound to it (VTI-VOT-011).";
|
|
1626
|
+
readonly type: "object";
|
|
1627
|
+
readonly additionalProperties: false;
|
|
1628
|
+
readonly required: readonly ["electionId", "community", "questions", "secrecy", "roll", "registrationOpens", "votingOpens", "votingCloses", "revote", "board", "ballotBox", "binding", "allowEarlyClose", "resultsBeforeClose", "textReleaseThreshold"];
|
|
1629
|
+
readonly properties: {
|
|
1630
|
+
readonly electionId: {
|
|
1631
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
1632
|
+
};
|
|
1633
|
+
readonly community: {
|
|
1634
|
+
readonly type: "string";
|
|
1635
|
+
readonly minLength: 1;
|
|
1636
|
+
readonly maxLength: 2048;
|
|
1637
|
+
readonly description: "The community's DID.";
|
|
1638
|
+
};
|
|
1639
|
+
readonly title: {
|
|
1640
|
+
readonly type: "string";
|
|
1641
|
+
readonly maxLength: 512;
|
|
1642
|
+
};
|
|
1643
|
+
readonly description: {
|
|
1644
|
+
readonly type: "string";
|
|
1645
|
+
readonly maxLength: 8192;
|
|
1646
|
+
};
|
|
1647
|
+
readonly questions: {
|
|
1648
|
+
readonly type: "array";
|
|
1649
|
+
readonly minItems: 1;
|
|
1650
|
+
readonly maxItems: 128;
|
|
1651
|
+
readonly items: {
|
|
1652
|
+
readonly $ref: "#/$defs/Question";
|
|
1653
|
+
};
|
|
1654
|
+
};
|
|
1655
|
+
readonly secrecy: {
|
|
1656
|
+
readonly $ref: "#/$defs/SecrecyLevel";
|
|
1657
|
+
};
|
|
1658
|
+
readonly roll: {
|
|
1659
|
+
readonly $ref: "#/$defs/RollRule";
|
|
1660
|
+
};
|
|
1661
|
+
readonly registrationOpens: {
|
|
1662
|
+
readonly type: "string";
|
|
1663
|
+
readonly format: "date-time";
|
|
1664
|
+
};
|
|
1665
|
+
readonly votingOpens: {
|
|
1666
|
+
readonly type: "string";
|
|
1667
|
+
readonly format: "date-time";
|
|
1668
|
+
};
|
|
1669
|
+
readonly votingCloses: {
|
|
1670
|
+
readonly type: "string";
|
|
1671
|
+
readonly format: "date-time";
|
|
1672
|
+
};
|
|
1673
|
+
readonly revote: {
|
|
1674
|
+
readonly $ref: "#/$defs/Revote";
|
|
1675
|
+
};
|
|
1676
|
+
readonly board: {
|
|
1677
|
+
readonly type: "object";
|
|
1678
|
+
readonly additionalProperties: false;
|
|
1679
|
+
readonly required: readonly ["visibility", "auditors"];
|
|
1680
|
+
readonly properties: {
|
|
1681
|
+
readonly visibility: {
|
|
1682
|
+
readonly $ref: "#/$defs/BoardVisibility";
|
|
1683
|
+
};
|
|
1684
|
+
readonly auditors: {
|
|
1685
|
+
readonly type: "array";
|
|
1686
|
+
readonly items: {
|
|
1687
|
+
readonly type: "string";
|
|
1688
|
+
readonly minLength: 1;
|
|
1689
|
+
readonly maxLength: 2048;
|
|
1690
|
+
};
|
|
1691
|
+
readonly uniqueItems: true;
|
|
1692
|
+
};
|
|
1693
|
+
};
|
|
1694
|
+
};
|
|
1695
|
+
readonly ballotBox: {
|
|
1696
|
+
readonly type: "string";
|
|
1697
|
+
readonly minLength: 1;
|
|
1698
|
+
readonly maxLength: 2048;
|
|
1699
|
+
readonly description: "The DID of the voting service that holds the board.";
|
|
1700
|
+
};
|
|
1701
|
+
readonly trustees: {
|
|
1702
|
+
readonly $ref: "#/$defs/Trustees";
|
|
1703
|
+
};
|
|
1704
|
+
readonly binding: {
|
|
1705
|
+
readonly type: "boolean";
|
|
1706
|
+
readonly description: "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081).";
|
|
1707
|
+
};
|
|
1708
|
+
readonly allowEarlyClose: {
|
|
1709
|
+
readonly type: "boolean";
|
|
1710
|
+
};
|
|
1711
|
+
readonly resultsBeforeClose: {
|
|
1712
|
+
readonly type: "boolean";
|
|
1713
|
+
readonly description: "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061).";
|
|
1714
|
+
};
|
|
1715
|
+
readonly textReleaseThreshold: {
|
|
1716
|
+
readonly type: "integer";
|
|
1717
|
+
readonly minimum: 10;
|
|
1718
|
+
readonly description: "Counted ballots required before any text answer is disclosed (VTI-VOT-065).";
|
|
1719
|
+
};
|
|
1720
|
+
};
|
|
1721
|
+
};
|
|
1722
|
+
readonly RollRule: {
|
|
1723
|
+
readonly title: "RollRule";
|
|
1724
|
+
readonly description: "Who may be issued a ticket (VTI-VOT-021): the community's active members, its active members and the parties `listed` names, or only the parties `listed` names.";
|
|
1725
|
+
readonly type: "object";
|
|
1726
|
+
readonly additionalProperties: false;
|
|
1727
|
+
readonly required: readonly ["rule"];
|
|
1728
|
+
readonly properties: {
|
|
1729
|
+
readonly rule: {
|
|
1730
|
+
readonly type: "string";
|
|
1731
|
+
readonly enum: readonly ["members", "membersAndListed", "listed"];
|
|
1732
|
+
};
|
|
1733
|
+
readonly listed: {
|
|
1734
|
+
readonly type: "array";
|
|
1735
|
+
readonly items: {
|
|
1736
|
+
readonly type: "string";
|
|
1737
|
+
readonly minLength: 1;
|
|
1738
|
+
readonly maxLength: 2048;
|
|
1739
|
+
readonly description: "A DID enfranchised by name.";
|
|
1740
|
+
};
|
|
1741
|
+
readonly uniqueItems: true;
|
|
1742
|
+
};
|
|
1743
|
+
};
|
|
1744
|
+
};
|
|
1745
|
+
readonly SecrecyLevel: {
|
|
1746
|
+
readonly title: "SecrecyLevel";
|
|
1747
|
+
readonly 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). Version 0.1 of the voting tasks carries open ballots only; a ballot box refuses to register any other level with `voting/election/register:unsupportedSecrecy` until the trustee tasks are specified.";
|
|
1748
|
+
readonly type: "string";
|
|
1749
|
+
readonly enum: readonly ["open", "sealed", "talliedEncrypted"];
|
|
1750
|
+
};
|
|
1751
|
+
readonly Question: {
|
|
1752
|
+
readonly title: "Question";
|
|
1753
|
+
readonly description: "One question. Tagged union over `type`.";
|
|
1754
|
+
readonly oneOf: readonly [{
|
|
1755
|
+
readonly title: "ChoiceQuestion";
|
|
1756
|
+
readonly description: "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.";
|
|
1757
|
+
readonly type: "object";
|
|
1758
|
+
readonly additionalProperties: false;
|
|
1759
|
+
readonly required: readonly ["key", "type", "options", "minSelections", "maxSelections", "optional"];
|
|
1760
|
+
readonly properties: {
|
|
1761
|
+
readonly key: {
|
|
1762
|
+
readonly $ref: "#/$defs/Key";
|
|
1763
|
+
};
|
|
1764
|
+
readonly type: {
|
|
1765
|
+
readonly const: "choice";
|
|
1766
|
+
};
|
|
1767
|
+
readonly text: {
|
|
1768
|
+
readonly type: "string";
|
|
1769
|
+
readonly maxLength: 2048;
|
|
1770
|
+
};
|
|
1771
|
+
readonly options: {
|
|
1772
|
+
readonly type: "array";
|
|
1773
|
+
readonly minItems: 2;
|
|
1774
|
+
readonly maxItems: 256;
|
|
1775
|
+
readonly items: {
|
|
1776
|
+
readonly $ref: "#/$defs/QuestionOption";
|
|
1777
|
+
};
|
|
1778
|
+
};
|
|
1779
|
+
readonly minSelections: {
|
|
1780
|
+
readonly type: "integer";
|
|
1781
|
+
readonly minimum: 0;
|
|
1782
|
+
};
|
|
1783
|
+
readonly maxSelections: {
|
|
1784
|
+
readonly type: "integer";
|
|
1785
|
+
readonly minimum: 1;
|
|
1786
|
+
};
|
|
1787
|
+
readonly optional: {
|
|
1788
|
+
readonly type: "boolean";
|
|
1789
|
+
};
|
|
1790
|
+
};
|
|
1791
|
+
}, {
|
|
1792
|
+
readonly title: "RankingQuestion";
|
|
1793
|
+
readonly description: "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.";
|
|
1794
|
+
readonly type: "object";
|
|
1795
|
+
readonly additionalProperties: false;
|
|
1796
|
+
readonly required: readonly ["key", "type", "options", "partial", "optional"];
|
|
1797
|
+
readonly properties: {
|
|
1798
|
+
readonly key: {
|
|
1799
|
+
readonly $ref: "#/$defs/Key";
|
|
1800
|
+
};
|
|
1801
|
+
readonly type: {
|
|
1802
|
+
readonly const: "ranking";
|
|
1803
|
+
};
|
|
1804
|
+
readonly text: {
|
|
1805
|
+
readonly type: "string";
|
|
1806
|
+
readonly maxLength: 2048;
|
|
1807
|
+
};
|
|
1808
|
+
readonly options: {
|
|
1809
|
+
readonly type: "array";
|
|
1810
|
+
readonly minItems: 2;
|
|
1811
|
+
readonly maxItems: 64;
|
|
1812
|
+
readonly items: {
|
|
1813
|
+
readonly $ref: "#/$defs/QuestionOption";
|
|
1814
|
+
};
|
|
1815
|
+
};
|
|
1816
|
+
readonly partial: {
|
|
1817
|
+
readonly type: "boolean";
|
|
1818
|
+
};
|
|
1819
|
+
readonly optional: {
|
|
1820
|
+
readonly type: "boolean";
|
|
1821
|
+
};
|
|
1822
|
+
};
|
|
1823
|
+
}, {
|
|
1824
|
+
readonly title: "ScoreQuestion";
|
|
1825
|
+
readonly description: "Give each option an integer score within [min, max].";
|
|
1826
|
+
readonly type: "object";
|
|
1827
|
+
readonly additionalProperties: false;
|
|
1828
|
+
readonly required: readonly ["key", "type", "options", "min", "max", "optional"];
|
|
1829
|
+
readonly properties: {
|
|
1830
|
+
readonly key: {
|
|
1831
|
+
readonly $ref: "#/$defs/Key";
|
|
1832
|
+
};
|
|
1833
|
+
readonly type: {
|
|
1834
|
+
readonly const: "score";
|
|
1835
|
+
};
|
|
1836
|
+
readonly text: {
|
|
1837
|
+
readonly type: "string";
|
|
1838
|
+
readonly maxLength: 2048;
|
|
1839
|
+
};
|
|
1840
|
+
readonly options: {
|
|
1841
|
+
readonly type: "array";
|
|
1842
|
+
readonly minItems: 1;
|
|
1843
|
+
readonly maxItems: 256;
|
|
1844
|
+
readonly items: {
|
|
1845
|
+
readonly $ref: "#/$defs/QuestionOption";
|
|
1846
|
+
};
|
|
1847
|
+
};
|
|
1848
|
+
readonly min: {
|
|
1849
|
+
readonly type: "integer";
|
|
1850
|
+
};
|
|
1851
|
+
readonly max: {
|
|
1852
|
+
readonly type: "integer";
|
|
1853
|
+
};
|
|
1854
|
+
readonly optional: {
|
|
1855
|
+
readonly type: "boolean";
|
|
1856
|
+
};
|
|
1857
|
+
};
|
|
1858
|
+
}, {
|
|
1859
|
+
readonly title: "TextQuestion";
|
|
1860
|
+
readonly description: "Free text of at most `maxLength` characters.";
|
|
1861
|
+
readonly type: "object";
|
|
1862
|
+
readonly additionalProperties: false;
|
|
1863
|
+
readonly required: readonly ["key", "type", "maxLength", "optional"];
|
|
1864
|
+
readonly properties: {
|
|
1865
|
+
readonly key: {
|
|
1866
|
+
readonly $ref: "#/$defs/Key";
|
|
1867
|
+
};
|
|
1868
|
+
readonly type: {
|
|
1869
|
+
readonly const: "text";
|
|
1870
|
+
};
|
|
1871
|
+
readonly text: {
|
|
1872
|
+
readonly type: "string";
|
|
1873
|
+
readonly maxLength: 2048;
|
|
1874
|
+
};
|
|
1875
|
+
readonly maxLength: {
|
|
1876
|
+
readonly type: "integer";
|
|
1877
|
+
readonly minimum: 1;
|
|
1878
|
+
readonly maximum: 4096;
|
|
1879
|
+
};
|
|
1880
|
+
readonly optional: {
|
|
1881
|
+
readonly type: "boolean";
|
|
1882
|
+
};
|
|
1883
|
+
};
|
|
1884
|
+
}];
|
|
1885
|
+
};
|
|
1886
|
+
readonly Key: {
|
|
1887
|
+
readonly title: "Key";
|
|
1888
|
+
readonly description: "A question or option key, unique within its manifest or question.";
|
|
1889
|
+
readonly type: "string";
|
|
1890
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
|
|
1891
|
+
};
|
|
1892
|
+
readonly QuestionOption: {
|
|
1893
|
+
readonly title: "QuestionOption";
|
|
1894
|
+
readonly type: "object";
|
|
1895
|
+
readonly additionalProperties: false;
|
|
1896
|
+
readonly required: readonly ["key"];
|
|
1897
|
+
readonly properties: {
|
|
1898
|
+
readonly key: {
|
|
1899
|
+
readonly $ref: "#/$defs/Key";
|
|
1900
|
+
};
|
|
1901
|
+
readonly label: {
|
|
1902
|
+
readonly type: "string";
|
|
1903
|
+
readonly maxLength: 512;
|
|
1904
|
+
readonly description: "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014).";
|
|
1905
|
+
};
|
|
1906
|
+
};
|
|
1907
|
+
};
|
|
1908
|
+
readonly ElectionId: {
|
|
1909
|
+
readonly title: "ElectionId";
|
|
1910
|
+
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.";
|
|
1911
|
+
readonly type: "string";
|
|
1912
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
|
|
1913
|
+
};
|
|
1914
|
+
readonly ElectionResult: {
|
|
1915
|
+
readonly title: "ElectionResult";
|
|
1916
|
+
readonly description: "An election's result, computable by anyone who can read its board from the board and the registration alone (VTI-VOT-070).";
|
|
1917
|
+
readonly type: "object";
|
|
1918
|
+
readonly additionalProperties: false;
|
|
1919
|
+
readonly required: readonly ["electionId", "manifestDigest", "ballotsCounted", "questions", "head"];
|
|
1920
|
+
readonly properties: {
|
|
1921
|
+
readonly electionId: {
|
|
1922
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
1923
|
+
};
|
|
1924
|
+
readonly manifestDigest: {
|
|
1925
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
1926
|
+
};
|
|
1927
|
+
readonly ballotsCounted: {
|
|
1928
|
+
readonly type: "integer";
|
|
1929
|
+
readonly minimum: 0;
|
|
1930
|
+
};
|
|
1931
|
+
readonly questions: {
|
|
1932
|
+
readonly type: "array";
|
|
1933
|
+
readonly items: {
|
|
1934
|
+
readonly $ref: "#/$defs/QuestionResult";
|
|
1935
|
+
};
|
|
1936
|
+
};
|
|
1937
|
+
readonly head: {
|
|
1938
|
+
readonly $ref: "#/$defs/BoardHead";
|
|
1939
|
+
readonly description: "The head of the board as it stood at close: the result counts exactly its entries.";
|
|
1940
|
+
};
|
|
1941
|
+
};
|
|
1942
|
+
};
|
|
1943
|
+
readonly BoardHead: {
|
|
1944
|
+
readonly title: "BoardHead";
|
|
1945
|
+
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.";
|
|
1946
|
+
readonly type: "object";
|
|
1947
|
+
readonly additionalProperties: false;
|
|
1948
|
+
readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
|
|
1949
|
+
readonly properties: {
|
|
1950
|
+
readonly electionId: {
|
|
1951
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
1952
|
+
};
|
|
1953
|
+
readonly treeSize: {
|
|
1954
|
+
readonly type: "integer";
|
|
1955
|
+
readonly minimum: 0;
|
|
1956
|
+
};
|
|
1957
|
+
readonly rootHash: {
|
|
1958
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
1959
|
+
readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
|
|
1960
|
+
};
|
|
1961
|
+
readonly issuedAt: {
|
|
1962
|
+
readonly type: "string";
|
|
1963
|
+
readonly format: "date-time";
|
|
1964
|
+
};
|
|
1965
|
+
};
|
|
1966
|
+
};
|
|
1967
|
+
readonly QuestionResult: {
|
|
1968
|
+
readonly title: "QuestionResult";
|
|
1969
|
+
readonly description: "One question's totals. `choice`: selections per option. `ranking`: per option, how many ballots placed it at each position (index 0 = first). `score`: per option, the sum and the number of ballots that scored it. `text`: the answers, in board order, withheld (`withheld: true`) below the manifest's `textReleaseThreshold`. `abstained` counts ballots that left the question unanswered.";
|
|
1970
|
+
readonly type: "object";
|
|
1971
|
+
readonly additionalProperties: false;
|
|
1972
|
+
readonly required: readonly ["question", "abstained"];
|
|
1973
|
+
readonly properties: {
|
|
1974
|
+
readonly question: {
|
|
1975
|
+
readonly $ref: "#/$defs/Key";
|
|
1976
|
+
};
|
|
1977
|
+
readonly abstained: {
|
|
1978
|
+
readonly type: "integer";
|
|
1979
|
+
readonly minimum: 0;
|
|
1980
|
+
};
|
|
1981
|
+
readonly choice: {
|
|
1982
|
+
readonly type: "object";
|
|
1983
|
+
readonly propertyNames: {
|
|
1984
|
+
readonly $ref: "#/$defs/Key";
|
|
1985
|
+
};
|
|
1986
|
+
readonly additionalProperties: {
|
|
1987
|
+
readonly type: "integer";
|
|
1988
|
+
readonly minimum: 0;
|
|
1989
|
+
};
|
|
1990
|
+
};
|
|
1991
|
+
readonly ranking: {
|
|
1992
|
+
readonly type: "object";
|
|
1993
|
+
readonly propertyNames: {
|
|
1994
|
+
readonly $ref: "#/$defs/Key";
|
|
1995
|
+
};
|
|
1996
|
+
readonly additionalProperties: {
|
|
1997
|
+
readonly type: "array";
|
|
1998
|
+
readonly items: {
|
|
1999
|
+
readonly type: "integer";
|
|
2000
|
+
readonly minimum: 0;
|
|
2001
|
+
};
|
|
2002
|
+
};
|
|
2003
|
+
};
|
|
2004
|
+
readonly score: {
|
|
2005
|
+
readonly type: "object";
|
|
2006
|
+
readonly propertyNames: {
|
|
2007
|
+
readonly $ref: "#/$defs/Key";
|
|
2008
|
+
};
|
|
2009
|
+
readonly additionalProperties: {
|
|
2010
|
+
readonly type: "object";
|
|
2011
|
+
readonly additionalProperties: false;
|
|
2012
|
+
readonly required: readonly ["sum", "count"];
|
|
2013
|
+
readonly properties: {
|
|
2014
|
+
readonly sum: {
|
|
2015
|
+
readonly type: "integer";
|
|
2016
|
+
};
|
|
2017
|
+
readonly count: {
|
|
2018
|
+
readonly type: "integer";
|
|
2019
|
+
readonly minimum: 0;
|
|
2020
|
+
};
|
|
2021
|
+
};
|
|
2022
|
+
};
|
|
2023
|
+
};
|
|
2024
|
+
readonly text: {
|
|
2025
|
+
readonly type: "array";
|
|
2026
|
+
readonly items: {
|
|
2027
|
+
readonly type: "string";
|
|
2028
|
+
readonly maxLength: 4096;
|
|
2029
|
+
};
|
|
2030
|
+
};
|
|
2031
|
+
readonly withheld: {
|
|
2032
|
+
readonly type: "boolean";
|
|
2033
|
+
};
|
|
2034
|
+
};
|
|
2035
|
+
};
|
|
2036
|
+
};
|
|
2037
|
+
};
|
|
2038
|
+
};
|
|
2039
|
+
/**
|
|
2040
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
2041
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
2042
|
+
* parties (§7.3 item 5).
|
|
2043
|
+
*/
|
|
2044
|
+
export declare const RESPONSE_SPEC: {
|
|
2045
|
+
readonly typeUri: "https://trusttasks.org/spec/vtc/elections/show/0.1#response";
|
|
2046
|
+
readonly isBearer: false;
|
|
2047
|
+
readonly isProofRequired: false;
|
|
2048
|
+
readonly isRecipientRequired: true;
|
|
2049
|
+
readonly isIssuedAtRequired: false;
|
|
2050
|
+
readonly payloadSchema: {
|
|
2051
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
2052
|
+
readonly $ref: "#/$defs/Response";
|
|
2053
|
+
readonly $defs: {
|
|
2054
|
+
readonly RegistrarState: {
|
|
2055
|
+
readonly title: "RegistrarState";
|
|
2056
|
+
readonly description: "An election's state as its registrar holds it: the ballot box's `ElectionState` once the ballot box has registered the election, or, before that, `pendingRegistration` (the community is still delivering the registration) or `registrationRefused` (the ballot box refused it on a later delivery, and only a cancellation clears it). The first six values are the ballot box's `ElectionState` (voting/_shared/0.1).";
|
|
2057
|
+
readonly type: "string";
|
|
2058
|
+
readonly enum: readonly ["registered", "registration", "voting", "closed", "tallied", "cancelled", "pendingRegistration", "registrationRefused"];
|
|
2059
|
+
};
|
|
2060
|
+
readonly Checkpoint: {
|
|
2061
|
+
readonly title: "Checkpoint";
|
|
2062
|
+
readonly description: "A board head the community read from the ballot box and kept, with the ballot box's signed document that carried it. Certification proves the board's final head consistent with every checkpoint, so a ballot box that rewrote its board after a checkpoint is caught.";
|
|
2063
|
+
readonly type: "object";
|
|
2064
|
+
readonly additionalProperties: false;
|
|
2065
|
+
readonly required: readonly ["head", "document"];
|
|
2066
|
+
readonly properties: {
|
|
2067
|
+
readonly head: {
|
|
2068
|
+
readonly $ref: "#/$defs/BoardHead";
|
|
2069
|
+
};
|
|
2070
|
+
readonly document: {
|
|
2071
|
+
readonly type: "object";
|
|
2072
|
+
readonly description: "The ballot box's signed voting/board/head `#response` document whose payload carries `head`, kept whole and exactly as received — proof included — so anyone can verify it against the ballot box's DID without trusting the community.";
|
|
2073
|
+
};
|
|
2074
|
+
};
|
|
2075
|
+
};
|
|
2076
|
+
readonly Certification: {
|
|
2077
|
+
readonly title: "Certification";
|
|
2078
|
+
readonly description: "The community's certification of the election's result, as vtc/elections/certify recorded it.";
|
|
2079
|
+
readonly type: "object";
|
|
2080
|
+
readonly additionalProperties: false;
|
|
2081
|
+
readonly required: readonly ["result", "certifiedAt", "auditAttestations"];
|
|
2082
|
+
readonly properties: {
|
|
2083
|
+
readonly result: {
|
|
2084
|
+
readonly $ref: "#/$defs/ElectionResult";
|
|
2085
|
+
};
|
|
2086
|
+
readonly certifiedAt: {
|
|
2087
|
+
readonly type: "string";
|
|
2088
|
+
readonly format: "date-time";
|
|
2089
|
+
readonly maxLength: 64;
|
|
2090
|
+
};
|
|
2091
|
+
readonly auditAttestations: {
|
|
2092
|
+
readonly type: "array";
|
|
2093
|
+
readonly maxItems: 32;
|
|
2094
|
+
readonly items: {
|
|
2095
|
+
readonly type: "object";
|
|
2096
|
+
readonly description: "A verifiable credential from an auditor the manifest names, as received.";
|
|
2097
|
+
};
|
|
2098
|
+
};
|
|
2099
|
+
};
|
|
2100
|
+
};
|
|
2101
|
+
readonly Response: {
|
|
2102
|
+
readonly $anchor: "response";
|
|
2103
|
+
readonly title: "VTC Elections — Show — response payload";
|
|
2104
|
+
readonly description: "Success response to vtc/elections/show/0.1: one election, whole.";
|
|
2105
|
+
readonly type: "object";
|
|
2106
|
+
readonly additionalProperties: false;
|
|
2107
|
+
readonly required: readonly ["manifest", "manifestDigest", "state", "parameters", "disclosure", "checkpoints"];
|
|
2108
|
+
readonly properties: {
|
|
2109
|
+
readonly manifest: {
|
|
2110
|
+
readonly $ref: "#/$defs/Manifest";
|
|
2111
|
+
};
|
|
2112
|
+
readonly manifestDigest: {
|
|
2113
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
2114
|
+
readonly description: "The SHA-256 multihash of the RFC 8785 (JCS) canonicalization of `manifest`. A ticket request names it, and every cast is bound to it.";
|
|
2115
|
+
};
|
|
2116
|
+
readonly state: {
|
|
2117
|
+
readonly $ref: "#/$defs/RegistrarState";
|
|
2118
|
+
};
|
|
2119
|
+
readonly parameters: {
|
|
2120
|
+
readonly $ref: "#/$defs/VotingParameters";
|
|
2121
|
+
readonly description: "The community's voting parameters the election's tickets are issued under (VTI-VOT-020).";
|
|
2122
|
+
};
|
|
2123
|
+
readonly disclosure: {
|
|
2124
|
+
readonly $ref: "#/$defs/Disclosure";
|
|
2125
|
+
readonly description: "How the election is run, generated from the manifest and the community's configuration (VTI-VOT-090). Always present: a member reads it before requesting a ticket.";
|
|
2126
|
+
};
|
|
2127
|
+
readonly checkpoints: {
|
|
2128
|
+
readonly type: "array";
|
|
2129
|
+
readonly maxItems: 256;
|
|
2130
|
+
readonly items: {
|
|
2131
|
+
readonly $ref: "#/$defs/Checkpoint";
|
|
2132
|
+
};
|
|
2133
|
+
readonly description: "The board heads the community has kept, oldest first. Empty until the community has read a head.";
|
|
2134
|
+
};
|
|
2135
|
+
readonly ticketsIssued: {
|
|
2136
|
+
readonly type: "integer";
|
|
2137
|
+
readonly minimum: 0;
|
|
2138
|
+
readonly description: "How many tickets the community has issued for the election. Present only to a caller holding vtc.elections.manage.";
|
|
2139
|
+
};
|
|
2140
|
+
readonly certified: {
|
|
2141
|
+
readonly $ref: "#/$defs/Certification";
|
|
2142
|
+
readonly description: "Present once the community has certified the result.";
|
|
2143
|
+
};
|
|
2144
|
+
readonly ext: {
|
|
2145
|
+
readonly $ref: "#/$defs/Ext";
|
|
2146
|
+
};
|
|
2147
|
+
};
|
|
2148
|
+
};
|
|
2149
|
+
readonly Ext: {
|
|
2150
|
+
readonly title: "Ext";
|
|
2151
|
+
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.";
|
|
2152
|
+
readonly type: "object";
|
|
2153
|
+
readonly minProperties: 1;
|
|
2154
|
+
readonly additionalProperties: true;
|
|
2155
|
+
readonly propertyNames: {
|
|
2156
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
2157
|
+
};
|
|
2158
|
+
};
|
|
2159
|
+
readonly Disclosure: {
|
|
2160
|
+
readonly title: "Disclosure";
|
|
2161
|
+
readonly description: "The statement a community publishes, and shows a member before they request a ticket, about how one election is run (VTI-VOT-090). Generated from the election's manifest and the community's configuration, never written by hand.";
|
|
2162
|
+
readonly type: "object";
|
|
2163
|
+
readonly additionalProperties: false;
|
|
2164
|
+
readonly required: readonly ["ballotBox", "ballotBoxOperator", "sameOperator", "boardVisibility", "auditors", "revote", "coercionResistance"];
|
|
2165
|
+
readonly properties: {
|
|
2166
|
+
readonly ballotBox: {
|
|
2167
|
+
readonly type: "string";
|
|
2168
|
+
readonly minLength: 1;
|
|
2169
|
+
readonly maxLength: 2048;
|
|
2170
|
+
readonly description: "The ballot box's DID.";
|
|
2171
|
+
};
|
|
2172
|
+
readonly ballotBoxOperator: {
|
|
2173
|
+
readonly type: "string";
|
|
2174
|
+
readonly minLength: 1;
|
|
2175
|
+
readonly maxLength: 512;
|
|
2176
|
+
readonly description: "Who operates the ballot box, as the community names them.";
|
|
2177
|
+
};
|
|
2178
|
+
readonly sameOperator: {
|
|
2179
|
+
readonly type: "boolean";
|
|
2180
|
+
readonly description: "Whether the party operating the community's VTC also operates the ballot box.";
|
|
2181
|
+
};
|
|
2182
|
+
readonly trustees: {
|
|
2183
|
+
readonly $ref: "#/$defs/Trustees";
|
|
2184
|
+
};
|
|
2185
|
+
readonly boardVisibility: {
|
|
2186
|
+
readonly $ref: "#/$defs/BoardVisibility";
|
|
2187
|
+
};
|
|
2188
|
+
readonly auditors: {
|
|
2189
|
+
readonly type: "array";
|
|
2190
|
+
readonly items: {
|
|
2191
|
+
readonly type: "string";
|
|
2192
|
+
readonly minLength: 1;
|
|
2193
|
+
readonly maxLength: 2048;
|
|
2194
|
+
};
|
|
2195
|
+
readonly uniqueItems: true;
|
|
2196
|
+
};
|
|
2197
|
+
readonly revote: {
|
|
2198
|
+
readonly $ref: "#/$defs/Revote";
|
|
2199
|
+
};
|
|
2200
|
+
readonly coercionResistance: {
|
|
2201
|
+
readonly const: false;
|
|
2202
|
+
readonly description: "Always false: a voter can prove how they voted, so the community cannot protect a member against being made to vote a certain way.";
|
|
2203
|
+
};
|
|
2204
|
+
};
|
|
2205
|
+
};
|
|
2206
|
+
readonly Revote: {
|
|
2207
|
+
readonly title: "Revote";
|
|
2208
|
+
readonly description: "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).";
|
|
2209
|
+
readonly type: "string";
|
|
2210
|
+
readonly enum: readonly ["replace", "refuse"];
|
|
2211
|
+
};
|
|
2212
|
+
readonly BoardVisibility: {
|
|
2213
|
+
readonly title: "BoardVisibility";
|
|
2214
|
+
readonly description: "`public`: anyone reads the board. `private`: the community, the auditors the manifest names and, for one cast's inclusion, the holder of its receipt (VTI-VOT-052).";
|
|
2215
|
+
readonly type: "string";
|
|
2216
|
+
readonly enum: readonly ["public", "private"];
|
|
2217
|
+
};
|
|
2218
|
+
readonly Trustees: {
|
|
2219
|
+
readonly title: "Trustees";
|
|
2220
|
+
readonly description: "The trustees of a sealed or tallied-encrypted election and the number of them decryption needs (VTI-VOT-062). Neither the community nor the ballot box may be one.";
|
|
2221
|
+
readonly type: "object";
|
|
2222
|
+
readonly additionalProperties: false;
|
|
2223
|
+
readonly required: readonly ["dids", "threshold"];
|
|
2224
|
+
readonly properties: {
|
|
2225
|
+
readonly dids: {
|
|
2226
|
+
readonly type: "array";
|
|
2227
|
+
readonly minItems: 2;
|
|
2228
|
+
readonly items: {
|
|
2229
|
+
readonly type: "string";
|
|
2230
|
+
readonly minLength: 1;
|
|
2231
|
+
readonly maxLength: 2048;
|
|
2232
|
+
};
|
|
2233
|
+
readonly uniqueItems: true;
|
|
2234
|
+
};
|
|
2235
|
+
readonly threshold: {
|
|
2236
|
+
readonly type: "integer";
|
|
2237
|
+
readonly minimum: 2;
|
|
2238
|
+
};
|
|
2239
|
+
};
|
|
2240
|
+
};
|
|
2241
|
+
readonly VotingParameters: {
|
|
2242
|
+
readonly title: "VotingParameters";
|
|
2243
|
+
readonly description: "The community's published voting parameters: the PCS suite and the voting verification key tickets are issued under (VTI-VOT-020). Distinct from its hidden-vetting helper key.";
|
|
2244
|
+
readonly type: "object";
|
|
2245
|
+
readonly additionalProperties: false;
|
|
2246
|
+
readonly required: readonly ["suite", "votingKey"];
|
|
2247
|
+
readonly properties: {
|
|
2248
|
+
readonly suite: {
|
|
2249
|
+
readonly type: "string";
|
|
2250
|
+
readonly const: "ps-ddh-bls12381";
|
|
2251
|
+
};
|
|
2252
|
+
readonly votingKey: {
|
|
2253
|
+
readonly $ref: "#/$defs/Multibase";
|
|
2254
|
+
};
|
|
2255
|
+
};
|
|
2256
|
+
};
|
|
2257
|
+
readonly Multibase: {
|
|
2258
|
+
readonly title: "Multibase";
|
|
2259
|
+
readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
|
|
2260
|
+
readonly type: "string";
|
|
2261
|
+
readonly maxLength: 16384;
|
|
2262
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
2263
|
+
};
|
|
2264
|
+
readonly DigestMultibase: {
|
|
2265
|
+
readonly title: "DigestMultibase";
|
|
2266
|
+
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`.";
|
|
2267
|
+
readonly type: "string";
|
|
2268
|
+
readonly minLength: 16;
|
|
2269
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
2270
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
2271
|
+
};
|
|
2272
|
+
readonly Manifest: {
|
|
2273
|
+
readonly title: "Manifest";
|
|
2274
|
+
readonly description: "What an election asks and how it is decided (VTI-VOT-010). Its digest (`manifestDigest`) is the SHA-256 multihash of its RFC 8785 (JCS) canonicalization, and every cast is bound to it (VTI-VOT-011).";
|
|
2275
|
+
readonly type: "object";
|
|
2276
|
+
readonly additionalProperties: false;
|
|
2277
|
+
readonly required: readonly ["electionId", "community", "questions", "secrecy", "roll", "registrationOpens", "votingOpens", "votingCloses", "revote", "board", "ballotBox", "binding", "allowEarlyClose", "resultsBeforeClose", "textReleaseThreshold"];
|
|
2278
|
+
readonly properties: {
|
|
2279
|
+
readonly electionId: {
|
|
2280
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
2281
|
+
};
|
|
2282
|
+
readonly community: {
|
|
2283
|
+
readonly type: "string";
|
|
2284
|
+
readonly minLength: 1;
|
|
2285
|
+
readonly maxLength: 2048;
|
|
2286
|
+
readonly description: "The community's DID.";
|
|
2287
|
+
};
|
|
2288
|
+
readonly title: {
|
|
2289
|
+
readonly type: "string";
|
|
2290
|
+
readonly maxLength: 512;
|
|
2291
|
+
};
|
|
2292
|
+
readonly description: {
|
|
2293
|
+
readonly type: "string";
|
|
2294
|
+
readonly maxLength: 8192;
|
|
2295
|
+
};
|
|
2296
|
+
readonly questions: {
|
|
2297
|
+
readonly type: "array";
|
|
2298
|
+
readonly minItems: 1;
|
|
2299
|
+
readonly maxItems: 128;
|
|
2300
|
+
readonly items: {
|
|
2301
|
+
readonly $ref: "#/$defs/Question";
|
|
2302
|
+
};
|
|
2303
|
+
};
|
|
2304
|
+
readonly secrecy: {
|
|
2305
|
+
readonly $ref: "#/$defs/SecrecyLevel";
|
|
2306
|
+
};
|
|
2307
|
+
readonly roll: {
|
|
2308
|
+
readonly $ref: "#/$defs/RollRule";
|
|
2309
|
+
};
|
|
2310
|
+
readonly registrationOpens: {
|
|
2311
|
+
readonly type: "string";
|
|
2312
|
+
readonly format: "date-time";
|
|
2313
|
+
};
|
|
2314
|
+
readonly votingOpens: {
|
|
2315
|
+
readonly type: "string";
|
|
2316
|
+
readonly format: "date-time";
|
|
2317
|
+
};
|
|
2318
|
+
readonly votingCloses: {
|
|
2319
|
+
readonly type: "string";
|
|
2320
|
+
readonly format: "date-time";
|
|
2321
|
+
};
|
|
2322
|
+
readonly revote: {
|
|
2323
|
+
readonly $ref: "#/$defs/Revote";
|
|
2324
|
+
};
|
|
2325
|
+
readonly board: {
|
|
2326
|
+
readonly type: "object";
|
|
2327
|
+
readonly additionalProperties: false;
|
|
2328
|
+
readonly required: readonly ["visibility", "auditors"];
|
|
2329
|
+
readonly properties: {
|
|
2330
|
+
readonly visibility: {
|
|
2331
|
+
readonly $ref: "#/$defs/BoardVisibility";
|
|
2332
|
+
};
|
|
2333
|
+
readonly auditors: {
|
|
2334
|
+
readonly type: "array";
|
|
2335
|
+
readonly items: {
|
|
2336
|
+
readonly type: "string";
|
|
2337
|
+
readonly minLength: 1;
|
|
2338
|
+
readonly maxLength: 2048;
|
|
2339
|
+
};
|
|
2340
|
+
readonly uniqueItems: true;
|
|
2341
|
+
};
|
|
2342
|
+
};
|
|
2343
|
+
};
|
|
2344
|
+
readonly ballotBox: {
|
|
2345
|
+
readonly type: "string";
|
|
2346
|
+
readonly minLength: 1;
|
|
2347
|
+
readonly maxLength: 2048;
|
|
2348
|
+
readonly description: "The DID of the voting service that holds the board.";
|
|
2349
|
+
};
|
|
2350
|
+
readonly trustees: {
|
|
2351
|
+
readonly $ref: "#/$defs/Trustees";
|
|
2352
|
+
};
|
|
2353
|
+
readonly binding: {
|
|
2354
|
+
readonly type: "boolean";
|
|
2355
|
+
readonly description: "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081).";
|
|
2356
|
+
};
|
|
2357
|
+
readonly allowEarlyClose: {
|
|
2358
|
+
readonly type: "boolean";
|
|
2359
|
+
};
|
|
2360
|
+
readonly resultsBeforeClose: {
|
|
2361
|
+
readonly type: "boolean";
|
|
2362
|
+
readonly description: "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061).";
|
|
2363
|
+
};
|
|
2364
|
+
readonly textReleaseThreshold: {
|
|
2365
|
+
readonly type: "integer";
|
|
2366
|
+
readonly minimum: 10;
|
|
2367
|
+
readonly description: "Counted ballots required before any text answer is disclosed (VTI-VOT-065).";
|
|
2368
|
+
};
|
|
2369
|
+
};
|
|
2370
|
+
};
|
|
2371
|
+
readonly RollRule: {
|
|
2372
|
+
readonly title: "RollRule";
|
|
2373
|
+
readonly description: "Who may be issued a ticket (VTI-VOT-021): the community's active members, its active members and the parties `listed` names, or only the parties `listed` names.";
|
|
2374
|
+
readonly type: "object";
|
|
2375
|
+
readonly additionalProperties: false;
|
|
2376
|
+
readonly required: readonly ["rule"];
|
|
2377
|
+
readonly properties: {
|
|
2378
|
+
readonly rule: {
|
|
2379
|
+
readonly type: "string";
|
|
2380
|
+
readonly enum: readonly ["members", "membersAndListed", "listed"];
|
|
2381
|
+
};
|
|
2382
|
+
readonly listed: {
|
|
2383
|
+
readonly type: "array";
|
|
2384
|
+
readonly items: {
|
|
2385
|
+
readonly type: "string";
|
|
2386
|
+
readonly minLength: 1;
|
|
2387
|
+
readonly maxLength: 2048;
|
|
2388
|
+
readonly description: "A DID enfranchised by name.";
|
|
2389
|
+
};
|
|
2390
|
+
readonly uniqueItems: true;
|
|
2391
|
+
};
|
|
2392
|
+
};
|
|
2393
|
+
};
|
|
2394
|
+
readonly SecrecyLevel: {
|
|
2395
|
+
readonly title: "SecrecyLevel";
|
|
2396
|
+
readonly 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). Version 0.1 of the voting tasks carries open ballots only; a ballot box refuses to register any other level with `voting/election/register:unsupportedSecrecy` until the trustee tasks are specified.";
|
|
2397
|
+
readonly type: "string";
|
|
2398
|
+
readonly enum: readonly ["open", "sealed", "talliedEncrypted"];
|
|
2399
|
+
};
|
|
2400
|
+
readonly Question: {
|
|
2401
|
+
readonly title: "Question";
|
|
2402
|
+
readonly description: "One question. Tagged union over `type`.";
|
|
2403
|
+
readonly oneOf: readonly [{
|
|
2404
|
+
readonly title: "ChoiceQuestion";
|
|
2405
|
+
readonly description: "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.";
|
|
2406
|
+
readonly type: "object";
|
|
2407
|
+
readonly additionalProperties: false;
|
|
2408
|
+
readonly required: readonly ["key", "type", "options", "minSelections", "maxSelections", "optional"];
|
|
2409
|
+
readonly properties: {
|
|
2410
|
+
readonly key: {
|
|
2411
|
+
readonly $ref: "#/$defs/Key";
|
|
2412
|
+
};
|
|
2413
|
+
readonly type: {
|
|
2414
|
+
readonly const: "choice";
|
|
2415
|
+
};
|
|
2416
|
+
readonly text: {
|
|
2417
|
+
readonly type: "string";
|
|
2418
|
+
readonly maxLength: 2048;
|
|
2419
|
+
};
|
|
2420
|
+
readonly options: {
|
|
2421
|
+
readonly type: "array";
|
|
2422
|
+
readonly minItems: 2;
|
|
2423
|
+
readonly maxItems: 256;
|
|
2424
|
+
readonly items: {
|
|
2425
|
+
readonly $ref: "#/$defs/QuestionOption";
|
|
2426
|
+
};
|
|
2427
|
+
};
|
|
2428
|
+
readonly minSelections: {
|
|
2429
|
+
readonly type: "integer";
|
|
2430
|
+
readonly minimum: 0;
|
|
2431
|
+
};
|
|
2432
|
+
readonly maxSelections: {
|
|
2433
|
+
readonly type: "integer";
|
|
2434
|
+
readonly minimum: 1;
|
|
2435
|
+
};
|
|
2436
|
+
readonly optional: {
|
|
2437
|
+
readonly type: "boolean";
|
|
2438
|
+
};
|
|
2439
|
+
};
|
|
2440
|
+
}, {
|
|
2441
|
+
readonly title: "RankingQuestion";
|
|
2442
|
+
readonly description: "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.";
|
|
2443
|
+
readonly type: "object";
|
|
2444
|
+
readonly additionalProperties: false;
|
|
2445
|
+
readonly required: readonly ["key", "type", "options", "partial", "optional"];
|
|
2446
|
+
readonly properties: {
|
|
2447
|
+
readonly key: {
|
|
2448
|
+
readonly $ref: "#/$defs/Key";
|
|
2449
|
+
};
|
|
2450
|
+
readonly type: {
|
|
2451
|
+
readonly const: "ranking";
|
|
2452
|
+
};
|
|
2453
|
+
readonly text: {
|
|
2454
|
+
readonly type: "string";
|
|
2455
|
+
readonly maxLength: 2048;
|
|
2456
|
+
};
|
|
2457
|
+
readonly options: {
|
|
2458
|
+
readonly type: "array";
|
|
2459
|
+
readonly minItems: 2;
|
|
2460
|
+
readonly maxItems: 64;
|
|
2461
|
+
readonly items: {
|
|
2462
|
+
readonly $ref: "#/$defs/QuestionOption";
|
|
2463
|
+
};
|
|
2464
|
+
};
|
|
2465
|
+
readonly partial: {
|
|
2466
|
+
readonly type: "boolean";
|
|
2467
|
+
};
|
|
2468
|
+
readonly optional: {
|
|
2469
|
+
readonly type: "boolean";
|
|
2470
|
+
};
|
|
2471
|
+
};
|
|
2472
|
+
}, {
|
|
2473
|
+
readonly title: "ScoreQuestion";
|
|
2474
|
+
readonly description: "Give each option an integer score within [min, max].";
|
|
2475
|
+
readonly type: "object";
|
|
2476
|
+
readonly additionalProperties: false;
|
|
2477
|
+
readonly required: readonly ["key", "type", "options", "min", "max", "optional"];
|
|
2478
|
+
readonly properties: {
|
|
2479
|
+
readonly key: {
|
|
2480
|
+
readonly $ref: "#/$defs/Key";
|
|
2481
|
+
};
|
|
2482
|
+
readonly type: {
|
|
2483
|
+
readonly const: "score";
|
|
2484
|
+
};
|
|
2485
|
+
readonly text: {
|
|
2486
|
+
readonly type: "string";
|
|
2487
|
+
readonly maxLength: 2048;
|
|
2488
|
+
};
|
|
2489
|
+
readonly options: {
|
|
2490
|
+
readonly type: "array";
|
|
2491
|
+
readonly minItems: 1;
|
|
2492
|
+
readonly maxItems: 256;
|
|
2493
|
+
readonly items: {
|
|
2494
|
+
readonly $ref: "#/$defs/QuestionOption";
|
|
2495
|
+
};
|
|
2496
|
+
};
|
|
2497
|
+
readonly min: {
|
|
2498
|
+
readonly type: "integer";
|
|
2499
|
+
};
|
|
2500
|
+
readonly max: {
|
|
2501
|
+
readonly type: "integer";
|
|
2502
|
+
};
|
|
2503
|
+
readonly optional: {
|
|
2504
|
+
readonly type: "boolean";
|
|
2505
|
+
};
|
|
2506
|
+
};
|
|
2507
|
+
}, {
|
|
2508
|
+
readonly title: "TextQuestion";
|
|
2509
|
+
readonly description: "Free text of at most `maxLength` characters.";
|
|
2510
|
+
readonly type: "object";
|
|
2511
|
+
readonly additionalProperties: false;
|
|
2512
|
+
readonly required: readonly ["key", "type", "maxLength", "optional"];
|
|
2513
|
+
readonly properties: {
|
|
2514
|
+
readonly key: {
|
|
2515
|
+
readonly $ref: "#/$defs/Key";
|
|
2516
|
+
};
|
|
2517
|
+
readonly type: {
|
|
2518
|
+
readonly const: "text";
|
|
2519
|
+
};
|
|
2520
|
+
readonly text: {
|
|
2521
|
+
readonly type: "string";
|
|
2522
|
+
readonly maxLength: 2048;
|
|
2523
|
+
};
|
|
2524
|
+
readonly maxLength: {
|
|
2525
|
+
readonly type: "integer";
|
|
2526
|
+
readonly minimum: 1;
|
|
2527
|
+
readonly maximum: 4096;
|
|
2528
|
+
};
|
|
2529
|
+
readonly optional: {
|
|
2530
|
+
readonly type: "boolean";
|
|
2531
|
+
};
|
|
2532
|
+
};
|
|
2533
|
+
}];
|
|
2534
|
+
};
|
|
2535
|
+
readonly Key: {
|
|
2536
|
+
readonly title: "Key";
|
|
2537
|
+
readonly description: "A question or option key, unique within its manifest or question.";
|
|
2538
|
+
readonly type: "string";
|
|
2539
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
|
|
2540
|
+
};
|
|
2541
|
+
readonly QuestionOption: {
|
|
2542
|
+
readonly title: "QuestionOption";
|
|
2543
|
+
readonly type: "object";
|
|
2544
|
+
readonly additionalProperties: false;
|
|
2545
|
+
readonly required: readonly ["key"];
|
|
2546
|
+
readonly properties: {
|
|
2547
|
+
readonly key: {
|
|
2548
|
+
readonly $ref: "#/$defs/Key";
|
|
2549
|
+
};
|
|
2550
|
+
readonly label: {
|
|
2551
|
+
readonly type: "string";
|
|
2552
|
+
readonly maxLength: 512;
|
|
2553
|
+
readonly description: "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014).";
|
|
2554
|
+
};
|
|
2555
|
+
};
|
|
2556
|
+
};
|
|
2557
|
+
readonly ElectionId: {
|
|
2558
|
+
readonly title: "ElectionId";
|
|
2559
|
+
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.";
|
|
2560
|
+
readonly type: "string";
|
|
2561
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
|
|
2562
|
+
};
|
|
2563
|
+
readonly ElectionResult: {
|
|
2564
|
+
readonly title: "ElectionResult";
|
|
2565
|
+
readonly description: "An election's result, computable by anyone who can read its board from the board and the registration alone (VTI-VOT-070).";
|
|
2566
|
+
readonly type: "object";
|
|
2567
|
+
readonly additionalProperties: false;
|
|
2568
|
+
readonly required: readonly ["electionId", "manifestDigest", "ballotsCounted", "questions", "head"];
|
|
2569
|
+
readonly properties: {
|
|
2570
|
+
readonly electionId: {
|
|
2571
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
2572
|
+
};
|
|
2573
|
+
readonly manifestDigest: {
|
|
2574
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
2575
|
+
};
|
|
2576
|
+
readonly ballotsCounted: {
|
|
2577
|
+
readonly type: "integer";
|
|
2578
|
+
readonly minimum: 0;
|
|
2579
|
+
};
|
|
2580
|
+
readonly questions: {
|
|
2581
|
+
readonly type: "array";
|
|
2582
|
+
readonly items: {
|
|
2583
|
+
readonly $ref: "#/$defs/QuestionResult";
|
|
2584
|
+
};
|
|
2585
|
+
};
|
|
2586
|
+
readonly head: {
|
|
2587
|
+
readonly $ref: "#/$defs/BoardHead";
|
|
2588
|
+
readonly description: "The head of the board as it stood at close: the result counts exactly its entries.";
|
|
2589
|
+
};
|
|
2590
|
+
};
|
|
2591
|
+
};
|
|
2592
|
+
readonly BoardHead: {
|
|
2593
|
+
readonly title: "BoardHead";
|
|
2594
|
+
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.";
|
|
2595
|
+
readonly type: "object";
|
|
2596
|
+
readonly additionalProperties: false;
|
|
2597
|
+
readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
|
|
2598
|
+
readonly properties: {
|
|
2599
|
+
readonly electionId: {
|
|
2600
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
2601
|
+
};
|
|
2602
|
+
readonly treeSize: {
|
|
2603
|
+
readonly type: "integer";
|
|
2604
|
+
readonly minimum: 0;
|
|
2605
|
+
};
|
|
2606
|
+
readonly rootHash: {
|
|
2607
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
2608
|
+
readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
|
|
2609
|
+
};
|
|
2610
|
+
readonly issuedAt: {
|
|
2611
|
+
readonly type: "string";
|
|
2612
|
+
readonly format: "date-time";
|
|
2613
|
+
};
|
|
2614
|
+
};
|
|
2615
|
+
};
|
|
2616
|
+
readonly QuestionResult: {
|
|
2617
|
+
readonly title: "QuestionResult";
|
|
2618
|
+
readonly description: "One question's totals. `choice`: selections per option. `ranking`: per option, how many ballots placed it at each position (index 0 = first). `score`: per option, the sum and the number of ballots that scored it. `text`: the answers, in board order, withheld (`withheld: true`) below the manifest's `textReleaseThreshold`. `abstained` counts ballots that left the question unanswered.";
|
|
2619
|
+
readonly type: "object";
|
|
2620
|
+
readonly additionalProperties: false;
|
|
2621
|
+
readonly required: readonly ["question", "abstained"];
|
|
2622
|
+
readonly properties: {
|
|
2623
|
+
readonly question: {
|
|
2624
|
+
readonly $ref: "#/$defs/Key";
|
|
2625
|
+
};
|
|
2626
|
+
readonly abstained: {
|
|
2627
|
+
readonly type: "integer";
|
|
2628
|
+
readonly minimum: 0;
|
|
2629
|
+
};
|
|
2630
|
+
readonly choice: {
|
|
2631
|
+
readonly type: "object";
|
|
2632
|
+
readonly propertyNames: {
|
|
2633
|
+
readonly $ref: "#/$defs/Key";
|
|
2634
|
+
};
|
|
2635
|
+
readonly additionalProperties: {
|
|
2636
|
+
readonly type: "integer";
|
|
2637
|
+
readonly minimum: 0;
|
|
2638
|
+
};
|
|
2639
|
+
};
|
|
2640
|
+
readonly ranking: {
|
|
2641
|
+
readonly type: "object";
|
|
2642
|
+
readonly propertyNames: {
|
|
2643
|
+
readonly $ref: "#/$defs/Key";
|
|
2644
|
+
};
|
|
2645
|
+
readonly additionalProperties: {
|
|
2646
|
+
readonly type: "array";
|
|
2647
|
+
readonly items: {
|
|
2648
|
+
readonly type: "integer";
|
|
2649
|
+
readonly minimum: 0;
|
|
2650
|
+
};
|
|
2651
|
+
};
|
|
2652
|
+
};
|
|
2653
|
+
readonly score: {
|
|
2654
|
+
readonly type: "object";
|
|
2655
|
+
readonly propertyNames: {
|
|
2656
|
+
readonly $ref: "#/$defs/Key";
|
|
2657
|
+
};
|
|
2658
|
+
readonly additionalProperties: {
|
|
2659
|
+
readonly type: "object";
|
|
2660
|
+
readonly additionalProperties: false;
|
|
2661
|
+
readonly required: readonly ["sum", "count"];
|
|
2662
|
+
readonly properties: {
|
|
2663
|
+
readonly sum: {
|
|
2664
|
+
readonly type: "integer";
|
|
2665
|
+
};
|
|
2666
|
+
readonly count: {
|
|
2667
|
+
readonly type: "integer";
|
|
2668
|
+
readonly minimum: 0;
|
|
2669
|
+
};
|
|
2670
|
+
};
|
|
2671
|
+
};
|
|
2672
|
+
};
|
|
2673
|
+
readonly text: {
|
|
2674
|
+
readonly type: "array";
|
|
2675
|
+
readonly items: {
|
|
2676
|
+
readonly type: "string";
|
|
2677
|
+
readonly maxLength: 4096;
|
|
2678
|
+
};
|
|
2679
|
+
};
|
|
2680
|
+
readonly withheld: {
|
|
2681
|
+
readonly type: "boolean";
|
|
2682
|
+
};
|
|
2683
|
+
};
|
|
2684
|
+
};
|
|
2685
|
+
};
|
|
2686
|
+
};
|
|
2687
|
+
};
|
|
2688
|
+
//# sourceMappingURL=payload.d.ts.map
|