@openvtc/trust-tasks 0.28.5 → 0.28.7
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 +32 -0
- package/dist/_shared/components.d.ts +45 -0
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -1
- package/dist/voting/_shared/0.3/voting.d.ts +16 -0
- package/dist/voting/_shared/0.3/voting.d.ts.map +1 -0
- package/dist/voting/_shared/0.3/voting.js +6 -0
- package/dist/voting/_shared/0.3/voting.js.map +1 -0
- package/dist/voting/election/register/0.1/payload.d.ts +4 -4
- package/dist/voting/election/register/0.1/payload.js +1 -1
- package/dist/voting/election/register/0.2/payload.d.ts +13 -2
- package/dist/voting/election/register/0.2/payload.d.ts.map +1 -1
- package/dist/voting/election/register/0.2/payload.js +1 -1
- package/dist/voting/election/register/0.2/payload.js.map +1 -1
- package/dist/voting/election/register/0.3/payload.d.ts +1934 -0
- package/dist/voting/election/register/0.3/payload.d.ts.map +1 -0
- package/dist/voting/election/register/0.3/payload.js +1180 -0
- package/dist/voting/election/register/0.3/payload.js.map +1 -0
- package/dist/voting/election/show/0.1/payload.d.ts +4 -4
- package/dist/voting/election/show/0.1/payload.js +1 -1
- package/dist/voting/election/show/0.2/payload.d.ts +13 -2
- package/dist/voting/election/show/0.2/payload.d.ts.map +1 -1
- package/dist/voting/election/show/0.2/payload.js +1 -1
- package/dist/voting/election/show/0.2/payload.js.map +1 -1
- package/dist/voting/election/show/0.3/payload.d.ts +1838 -0
- package/dist/voting/election/show/0.3/payload.d.ts.map +1 -0
- package/dist/voting/election/show/0.3/payload.js +1126 -0
- package/dist/voting/election/show/0.3/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/deal/0.2/payload.d.ts +4 -4
- package/dist/vta/pcs/trustee/deal/0.2/payload.js +1 -1
- package/dist/vta/pcs/trustee/deal/0.3/payload.d.ts +13 -2
- package/dist/vta/pcs/trustee/deal/0.3/payload.d.ts.map +1 -1
- package/dist/vta/pcs/trustee/deal/0.3/payload.js +1 -1
- package/dist/vta/pcs/trustee/deal/0.3/payload.js.map +1 -1
- package/dist/vta/pcs/trustee/deal/0.4/payload.d.ts +1846 -0
- package/dist/vta/pcs/trustee/deal/0.4/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/deal/0.4/payload.js +1091 -0
- package/dist/vta/pcs/trustee/deal/0.4/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/enrol/0.1/payload.d.ts +4 -4
- package/dist/vta/pcs/trustee/enrol/0.1/payload.js +1 -1
- package/dist/vta/pcs/trustee/enrol/0.2/payload.d.ts +13 -2
- package/dist/vta/pcs/trustee/enrol/0.2/payload.d.ts.map +1 -1
- package/dist/vta/pcs/trustee/enrol/0.2/payload.js +1 -1
- package/dist/vta/pcs/trustee/enrol/0.2/payload.js.map +1 -1
- package/dist/vta/pcs/trustee/enrol/0.3/payload.d.ts +1770 -0
- package/dist/vta/pcs/trustee/enrol/0.3/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/enrol/0.3/payload.js +1054 -0
- package/dist/vta/pcs/trustee/enrol/0.3/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/justify/0.2/payload.d.ts +4 -4
- package/dist/vta/pcs/trustee/justify/0.2/payload.js +1 -1
- package/dist/vta/pcs/trustee/justify/0.3/payload.d.ts +13 -2
- package/dist/vta/pcs/trustee/justify/0.3/payload.d.ts.map +1 -1
- package/dist/vta/pcs/trustee/justify/0.3/payload.js +1 -1
- package/dist/vta/pcs/trustee/justify/0.3/payload.js.map +1 -1
- package/dist/vta/pcs/trustee/justify/0.4/payload.d.ts +1881 -0
- package/dist/vta/pcs/trustee/justify/0.4/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/justify/0.4/payload.js +1109 -0
- package/dist/vta/pcs/trustee/justify/0.4/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/keys/0.2/payload.d.ts +4 -4
- package/dist/vta/pcs/trustee/keys/0.2/payload.js +1 -1
- package/dist/vta/pcs/trustee/keys/0.3/payload.d.ts +13 -2
- package/dist/vta/pcs/trustee/keys/0.3/payload.d.ts.map +1 -1
- package/dist/vta/pcs/trustee/keys/0.3/payload.js +1 -1
- package/dist/vta/pcs/trustee/keys/0.3/payload.js.map +1 -1
- package/dist/vta/pcs/trustee/keys/0.4/payload.d.ts +1926 -0
- package/dist/vta/pcs/trustee/keys/0.4/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/keys/0.4/payload.js +1129 -0
- package/dist/vta/pcs/trustee/keys/0.4/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/read/0.1/payload.d.ts +4 -4
- package/dist/vta/pcs/trustee/read/0.1/payload.js +1 -1
- package/dist/vta/pcs/trustee/read/0.2/payload.d.ts +14 -2
- package/dist/vta/pcs/trustee/read/0.2/payload.d.ts.map +1 -1
- package/dist/vta/pcs/trustee/read/0.2/payload.js +1 -1
- package/dist/vta/pcs/trustee/read/0.2/payload.js.map +1 -1
- package/dist/vta/pcs/trustee/read/0.3/payload.d.ts +540 -0
- package/dist/vta/pcs/trustee/read/0.3/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/read/0.3/payload.js +304 -0
- package/dist/vta/pcs/trustee/read/0.3/payload.js.map +1 -0
- package/dist/vta/pcs/vote/0.1/payload.d.ts +4 -4
- package/dist/vta/pcs/vote/0.1/payload.js +1 -1
- package/dist/vta/pcs/vote/0.2/payload.d.ts +13 -2
- package/dist/vta/pcs/vote/0.2/payload.d.ts.map +1 -1
- package/dist/vta/pcs/vote/0.2/payload.js +1 -1
- package/dist/vta/pcs/vote/0.2/payload.js.map +1 -1
- package/dist/vta/pcs/vote/0.3/payload.d.ts +2222 -0
- package/dist/vta/pcs/vote/0.3/payload.d.ts.map +1 -0
- package/dist/vta/pcs/vote/0.3/payload.js +1296 -0
- package/dist/vta/pcs/vote/0.3/payload.js.map +1 -0
- package/dist/vta/pcs/vote-encrypted/0.2/payload.d.ts +4 -4
- package/dist/vta/pcs/vote-encrypted/0.2/payload.js +1 -1
- package/dist/vta/pcs/vote-encrypted/0.3/payload.d.ts +13 -2
- package/dist/vta/pcs/vote-encrypted/0.3/payload.d.ts.map +1 -1
- package/dist/vta/pcs/vote-encrypted/0.3/payload.js +1 -1
- package/dist/vta/pcs/vote-encrypted/0.3/payload.js.map +1 -1
- package/dist/vta/pcs/vote-encrypted/0.4/payload.d.ts +2242 -0
- package/dist/vta/pcs/vote-encrypted/0.4/payload.d.ts.map +1 -0
- package/dist/vta/pcs/vote-encrypted/0.4/payload.js +1314 -0
- package/dist/vta/pcs/vote-encrypted/0.4/payload.js.map +1 -0
- package/dist/vta/pcs/voter/read/0.1/payload.d.ts +4 -4
- package/dist/vta/pcs/voter/read/0.1/payload.js +1 -1
- package/dist/vta/pcs/voter/read/0.2/payload.d.ts +14 -2
- package/dist/vta/pcs/voter/read/0.2/payload.d.ts.map +1 -1
- package/dist/vta/pcs/voter/read/0.2/payload.js +1 -1
- package/dist/vta/pcs/voter/read/0.2/payload.js.map +1 -1
- package/dist/vta/pcs/voter/read/0.3/payload.d.ts +503 -0
- package/dist/vta/pcs/voter/read/0.3/payload.d.ts.map +1 -0
- package/dist/vta/pcs/voter/read/0.3/payload.js +285 -0
- package/dist/vta/pcs/voter/read/0.3/payload.js.map +1 -0
- package/dist/vta/pcs/voter/register/0.1/payload.d.ts +4 -4
- package/dist/vta/pcs/voter/register/0.1/payload.js +1 -1
- package/dist/vta/pcs/voter/register/0.2/payload.d.ts +14 -2
- package/dist/vta/pcs/voter/register/0.2/payload.d.ts.map +1 -1
- package/dist/vta/pcs/voter/register/0.2/payload.js +1 -1
- package/dist/vta/pcs/voter/register/0.2/payload.js.map +1 -1
- package/dist/vta/pcs/voter/register/0.3/payload.d.ts +2176 -0
- package/dist/vta/pcs/voter/register/0.3/payload.d.ts.map +1 -0
- package/dist/vta/pcs/voter/register/0.3/payload.js +1262 -0
- package/dist/vta/pcs/voter/register/0.3/payload.js.map +1 -0
- package/dist/vtc/elections/create/0.1/payload.d.ts +4 -4
- package/dist/vtc/elections/create/0.1/payload.js +1 -1
- package/dist/vtc/elections/create/0.2/payload.d.ts +4 -4
- package/dist/vtc/elections/create/0.2/payload.js +1 -1
- package/dist/vtc/elections/create/0.3/payload.d.ts +14 -2
- package/dist/vtc/elections/create/0.3/payload.d.ts.map +1 -1
- package/dist/vtc/elections/create/0.3/payload.js +1 -1
- package/dist/vtc/elections/create/0.3/payload.js.map +1 -1
- package/dist/vtc/elections/create/0.4/payload.d.ts +1670 -0
- package/dist/vtc/elections/create/0.4/payload.d.ts.map +1 -0
- package/dist/vtc/elections/create/0.4/payload.js +1008 -0
- package/dist/vtc/elections/create/0.4/payload.js.map +1 -0
- package/dist/vtc/elections/show/0.1/payload.d.ts +4 -4
- package/dist/vtc/elections/show/0.1/payload.js +1 -1
- package/dist/vtc/elections/show/0.2/payload.d.ts +14 -2
- package/dist/vtc/elections/show/0.2/payload.d.ts.map +1 -1
- package/dist/vtc/elections/show/0.2/payload.js +1 -1
- package/dist/vtc/elections/show/0.2/payload.js.map +1 -1
- package/dist/vtc/elections/show/0.3/payload.d.ts +3022 -0
- package/dist/vtc/elections/show/0.3/payload.d.ts.map +1 -0
- package/dist/vtc/elections/show/0.3/payload.js +1765 -0
- package/dist/vtc/elections/show/0.3/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_shared/components.ts +45 -0
- package/src/index.ts +42 -0
- package/src/voting/_shared/0.3/voting.ts +17 -0
- package/src/voting/election/register/0.1/payload.ts +5 -5
- package/src/voting/election/register/0.2/payload.ts +14 -3
- package/src/voting/election/register/0.3/payload.ts +1223 -0
- package/src/voting/election/show/0.1/payload.ts +5 -5
- package/src/voting/election/show/0.2/payload.ts +14 -3
- package/src/voting/election/show/0.3/payload.ts +1165 -0
- package/src/vta/pcs/trustee/deal/0.2/payload.ts +5 -5
- package/src/vta/pcs/trustee/deal/0.3/payload.ts +14 -3
- package/src/vta/pcs/trustee/deal/0.4/payload.ts +1164 -0
- package/src/vta/pcs/trustee/enrol/0.1/payload.ts +5 -5
- package/src/vta/pcs/trustee/enrol/0.2/payload.ts +14 -3
- package/src/vta/pcs/trustee/enrol/0.3/payload.ts +1123 -0
- package/src/vta/pcs/trustee/justify/0.2/payload.ts +5 -5
- package/src/vta/pcs/trustee/justify/0.3/payload.ts +14 -3
- package/src/vta/pcs/trustee/justify/0.4/payload.ts +1183 -0
- package/src/vta/pcs/trustee/keys/0.2/payload.ts +5 -5
- package/src/vta/pcs/trustee/keys/0.3/payload.ts +14 -3
- package/src/vta/pcs/trustee/keys/0.4/payload.ts +1210 -0
- package/src/vta/pcs/trustee/read/0.1/payload.ts +5 -5
- package/src/vta/pcs/trustee/read/0.2/payload.ts +15 -3
- package/src/vta/pcs/trustee/read/0.3/payload.ts +385 -0
- package/src/vta/pcs/vote/0.1/payload.ts +5 -5
- package/src/vta/pcs/vote/0.2/payload.ts +14 -3
- package/src/vta/pcs/vote/0.3/payload.ts +1381 -0
- package/src/vta/pcs/vote-encrypted/0.2/payload.ts +5 -5
- package/src/vta/pcs/vote-encrypted/0.3/payload.ts +14 -3
- package/src/vta/pcs/vote-encrypted/0.4/payload.ts +1385 -0
- package/src/vta/pcs/voter/read/0.1/payload.ts +5 -5
- package/src/vta/pcs/voter/read/0.2/payload.ts +15 -3
- package/src/vta/pcs/voter/read/0.3/payload.ts +363 -0
- package/src/vta/pcs/voter/register/0.1/payload.ts +5 -5
- package/src/vta/pcs/voter/register/0.2/payload.ts +15 -3
- package/src/vta/pcs/voter/register/0.3/payload.ts +1372 -0
- package/src/vtc/elections/create/0.1/payload.ts +5 -5
- package/src/vtc/elections/create/0.2/payload.ts +5 -5
- package/src/vtc/elections/create/0.3/payload.ts +15 -3
- package/src/vtc/elections/create/0.4/payload.ts +1057 -0
- package/src/vtc/elections/show/0.1/payload.ts +5 -5
- package/src/vtc/elections/show/0.2/payload.ts +15 -3
- package/src/vtc/elections/show/0.3/payload.ts +1865 -0
|
@@ -0,0 +1,1865 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/elections/show/0.3/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { BoardHead, BoardVisibility, ChoiceQuestion, DigestMultibase, Disclosure, ElectionId, ElectionKey, ElectionResult, Ext, GroupElement, Key_VotingV0_1 as Key, Manifest_VotingV0_3 as Manifest, Multibase_VotingV0_1 as Multibase, Question, QuestionOption, QuestionResult, RankingQuestion, Revote, RollRule, ScoreQuestion, SecrecyLevel, SignedRequest, TextQuestion, TrusteeCeremony, TrusteeIndex, Trustees, VotingParameters } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 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).
|
|
11
|
+
*/
|
|
12
|
+
export type RegistrarState =
|
|
13
|
+
| "registered"
|
|
14
|
+
| "registration"
|
|
15
|
+
| "voting"
|
|
16
|
+
| "closed"
|
|
17
|
+
| "tallied"
|
|
18
|
+
| "cancelled"
|
|
19
|
+
| "pendingRegistration"
|
|
20
|
+
| "registrationRefused";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 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.
|
|
24
|
+
*/
|
|
25
|
+
export interface VTCElectionsShowPayload {
|
|
26
|
+
electionId: ElectionId;
|
|
27
|
+
ext?: Ext;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Success response to vtc/elections/show/0.1: one election, whole.
|
|
31
|
+
*/
|
|
32
|
+
export interface VTCElectionsShowResponsePayload {
|
|
33
|
+
manifest: Manifest;
|
|
34
|
+
/**
|
|
35
|
+
* The SHA-256 multihash of the RFC 8785 (JCS) canonicalization of `manifest`. A ticket request names it, and every cast is bound to it.
|
|
36
|
+
*/
|
|
37
|
+
manifestDigest: DigestMultibase;
|
|
38
|
+
state: RegistrarState;
|
|
39
|
+
/**
|
|
40
|
+
* The community's voting parameters the election's tickets are issued under (VTI-VOT-020).
|
|
41
|
+
*/
|
|
42
|
+
parameters: VotingParameters;
|
|
43
|
+
/**
|
|
44
|
+
* 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.
|
|
45
|
+
*/
|
|
46
|
+
disclosure: Disclosure;
|
|
47
|
+
/**
|
|
48
|
+
* The board heads the community has kept, oldest first. Empty until the community has read a head.
|
|
49
|
+
*
|
|
50
|
+
* @maxItems 256
|
|
51
|
+
*/
|
|
52
|
+
checkpoints: Checkpoint[];
|
|
53
|
+
/**
|
|
54
|
+
* How many tickets the community has issued for the election. Present only to a caller holding vtc.elections.manage.
|
|
55
|
+
*/
|
|
56
|
+
ticketsIssued?: number;
|
|
57
|
+
/**
|
|
58
|
+
* The key a sealed or tallied-encrypted election's ballots are encrypted under, once its trustees have formed it (CONVENTIONS §9.6).
|
|
59
|
+
*/
|
|
60
|
+
electionKey?: ElectionKey;
|
|
61
|
+
certified?: Certification;
|
|
62
|
+
ext?: Ext;
|
|
63
|
+
/**
|
|
64
|
+
* With electionKey: the trustees' signed steps it forms from, through the board's electionKey entry, each exactly as received. A voter's VTA forms the key itself from these (vta/pcs/vote-encrypted/0.4).
|
|
65
|
+
*/
|
|
66
|
+
ceremony?: TrusteeCeremony;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* 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.
|
|
70
|
+
*/
|
|
71
|
+
export interface Checkpoint {
|
|
72
|
+
head: BoardHead;
|
|
73
|
+
/**
|
|
74
|
+
* 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.
|
|
75
|
+
*/
|
|
76
|
+
document: {};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Present once the community has certified the result.
|
|
80
|
+
*/
|
|
81
|
+
export interface Certification {
|
|
82
|
+
result: ElectionResult;
|
|
83
|
+
certifiedAt: string;
|
|
84
|
+
/**
|
|
85
|
+
* @maxItems 32
|
|
86
|
+
*/
|
|
87
|
+
auditAttestations: {}[];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
91
|
+
export type { BoardHead, BoardVisibility, ChoiceQuestion, DigestMultibase, Disclosure, ElectionId, ElectionKey, ElectionResult, Ext, GroupElement, Key, Manifest, Multibase, Question, QuestionOption, QuestionResult, RankingQuestion, Revote, RollRule, ScoreQuestion, SecrecyLevel, SignedRequest, TextQuestion, TrusteeCeremony, TrusteeIndex, Trustees, VotingParameters };
|
|
92
|
+
|
|
93
|
+
/** Trust Task type URI. */
|
|
94
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vtc/elections/show/0.3" as const;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The earlier version of this specification that this one declares it
|
|
98
|
+
* extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
|
|
99
|
+
* `null`. Only the direct declaration — follow the chain with
|
|
100
|
+
* `extendsChain` / `readForSpec`.
|
|
101
|
+
*/
|
|
102
|
+
export const EXTENDS: string | null = null;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Why this version is deprecated, or `null` while it is current. A
|
|
106
|
+
* superseded or retired version is still supported, and is withdrawn from
|
|
107
|
+
* this package in a later scheduled batch (SPEC "Superseded and Withdrawn
|
|
108
|
+
* Versions").
|
|
109
|
+
*/
|
|
110
|
+
export const DEPRECATION: string | null = null;
|
|
111
|
+
|
|
112
|
+
/** Stable alias for this specification's request payload shape. */
|
|
113
|
+
export type Payload = VTCElectionsShowPayload;
|
|
114
|
+
|
|
115
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
116
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/elections/show/0.3#response" as const;
|
|
117
|
+
|
|
118
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
119
|
+
export type Response = VTCElectionsShowResponsePayload;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* This specification's payload schema, as a value.
|
|
123
|
+
*
|
|
124
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
125
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
126
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
127
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
128
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
129
|
+
*/
|
|
130
|
+
export const PAYLOAD_SCHEMA = {
|
|
131
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
132
|
+
"$id": "https://trusttasks.org/spec/vtc/elections/show/0.3",
|
|
133
|
+
"title": "VTC Elections — Show — payload",
|
|
134
|
+
"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.",
|
|
135
|
+
"type": "object",
|
|
136
|
+
"additionalProperties": false,
|
|
137
|
+
"required": [
|
|
138
|
+
"electionId"
|
|
139
|
+
],
|
|
140
|
+
"properties": {
|
|
141
|
+
"electionId": {
|
|
142
|
+
"$ref": "#/$defs/ElectionId"
|
|
143
|
+
},
|
|
144
|
+
"ext": {
|
|
145
|
+
"$ref": "#/$defs/Ext"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"$defs": {
|
|
149
|
+
"RegistrarState": {
|
|
150
|
+
"title": "RegistrarState",
|
|
151
|
+
"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).",
|
|
152
|
+
"type": "string",
|
|
153
|
+
"enum": [
|
|
154
|
+
"registered",
|
|
155
|
+
"registration",
|
|
156
|
+
"voting",
|
|
157
|
+
"closed",
|
|
158
|
+
"tallied",
|
|
159
|
+
"cancelled",
|
|
160
|
+
"pendingRegistration",
|
|
161
|
+
"registrationRefused"
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"Checkpoint": {
|
|
165
|
+
"title": "Checkpoint",
|
|
166
|
+
"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.",
|
|
167
|
+
"type": "object",
|
|
168
|
+
"additionalProperties": false,
|
|
169
|
+
"required": [
|
|
170
|
+
"head",
|
|
171
|
+
"document"
|
|
172
|
+
],
|
|
173
|
+
"properties": {
|
|
174
|
+
"head": {
|
|
175
|
+
"$ref": "#/$defs/BoardHead"
|
|
176
|
+
},
|
|
177
|
+
"document": {
|
|
178
|
+
"type": "object",
|
|
179
|
+
"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."
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"Certification": {
|
|
184
|
+
"title": "Certification",
|
|
185
|
+
"description": "The community's certification of the election's result, as vtc/elections/certify recorded it.",
|
|
186
|
+
"type": "object",
|
|
187
|
+
"additionalProperties": false,
|
|
188
|
+
"required": [
|
|
189
|
+
"result",
|
|
190
|
+
"certifiedAt",
|
|
191
|
+
"auditAttestations"
|
|
192
|
+
],
|
|
193
|
+
"properties": {
|
|
194
|
+
"result": {
|
|
195
|
+
"$ref": "#/$defs/ElectionResult"
|
|
196
|
+
},
|
|
197
|
+
"certifiedAt": {
|
|
198
|
+
"type": "string",
|
|
199
|
+
"format": "date-time",
|
|
200
|
+
"maxLength": 64
|
|
201
|
+
},
|
|
202
|
+
"auditAttestations": {
|
|
203
|
+
"type": "array",
|
|
204
|
+
"maxItems": 32,
|
|
205
|
+
"items": {
|
|
206
|
+
"type": "object",
|
|
207
|
+
"description": "A verifiable credential from an auditor the manifest names, as received."
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"Response": {
|
|
213
|
+
"$anchor": "response",
|
|
214
|
+
"title": "VTC Elections — Show — response payload",
|
|
215
|
+
"description": "Success response to vtc/elections/show/0.1: one election, whole.",
|
|
216
|
+
"type": "object",
|
|
217
|
+
"additionalProperties": false,
|
|
218
|
+
"required": [
|
|
219
|
+
"manifest",
|
|
220
|
+
"manifestDigest",
|
|
221
|
+
"state",
|
|
222
|
+
"parameters",
|
|
223
|
+
"disclosure",
|
|
224
|
+
"checkpoints"
|
|
225
|
+
],
|
|
226
|
+
"properties": {
|
|
227
|
+
"manifest": {
|
|
228
|
+
"$ref": "#/$defs/Manifest"
|
|
229
|
+
},
|
|
230
|
+
"manifestDigest": {
|
|
231
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
232
|
+
"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."
|
|
233
|
+
},
|
|
234
|
+
"state": {
|
|
235
|
+
"$ref": "#/$defs/RegistrarState"
|
|
236
|
+
},
|
|
237
|
+
"parameters": {
|
|
238
|
+
"$ref": "#/$defs/VotingParameters",
|
|
239
|
+
"description": "The community's voting parameters the election's tickets are issued under (VTI-VOT-020)."
|
|
240
|
+
},
|
|
241
|
+
"disclosure": {
|
|
242
|
+
"$ref": "#/$defs/Disclosure",
|
|
243
|
+
"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."
|
|
244
|
+
},
|
|
245
|
+
"checkpoints": {
|
|
246
|
+
"type": "array",
|
|
247
|
+
"maxItems": 256,
|
|
248
|
+
"items": {
|
|
249
|
+
"$ref": "#/$defs/Checkpoint"
|
|
250
|
+
},
|
|
251
|
+
"description": "The board heads the community has kept, oldest first. Empty until the community has read a head."
|
|
252
|
+
},
|
|
253
|
+
"ticketsIssued": {
|
|
254
|
+
"type": "integer",
|
|
255
|
+
"minimum": 0,
|
|
256
|
+
"description": "How many tickets the community has issued for the election. Present only to a caller holding vtc.elections.manage."
|
|
257
|
+
},
|
|
258
|
+
"electionKey": {
|
|
259
|
+
"$ref": "#/$defs/ElectionKey",
|
|
260
|
+
"description": "The key a sealed or tallied-encrypted election's ballots are encrypted under, once its trustees have formed it (CONVENTIONS §9.6)."
|
|
261
|
+
},
|
|
262
|
+
"certified": {
|
|
263
|
+
"$ref": "#/$defs/Certification",
|
|
264
|
+
"description": "Present once the community has certified the result."
|
|
265
|
+
},
|
|
266
|
+
"ext": {
|
|
267
|
+
"$ref": "#/$defs/Ext"
|
|
268
|
+
},
|
|
269
|
+
"ceremony": {
|
|
270
|
+
"$ref": "#/$defs/TrusteeCeremony",
|
|
271
|
+
"description": "With electionKey: the trustees' signed steps it forms from, through the board's electionKey entry, each exactly as received. A voter's VTA forms the key itself from these (vta/pcs/vote-encrypted/0.4)."
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
"TrusteeCeremony": {
|
|
276
|
+
"title": "TrusteeCeremony",
|
|
277
|
+
"description": "The trustees' ceremony as the board holds it: the `request` of every `trusteeStep` entry, in board order, each exactly as the ballot box received it (CONVENTIONS §9.6). Whoever acts on it verifies each step as its trustee's before taking it; nothing in it is believed for having been passed along.",
|
|
278
|
+
"type": "array",
|
|
279
|
+
"minItems": 1,
|
|
280
|
+
"maxItems": 4224,
|
|
281
|
+
"items": {
|
|
282
|
+
"$ref": "#/$defs/SignedRequest"
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
"SignedRequest": {
|
|
286
|
+
"title": "SignedRequest",
|
|
287
|
+
"description": "A whole Trust Task request document — `id`, `type`, `issuer`, `payload` and every other member, `proof` included — exactly as the ballot box received it, never re-serialised: its proof is taken over its members, and a re-serialised copy does not reliably reproduce them. Typed as an open object so every member survives; CONVENTIONS §9.6 gives the checks that make it a trustee's step.",
|
|
288
|
+
"type": "object",
|
|
289
|
+
"minProperties": 1
|
|
290
|
+
},
|
|
291
|
+
"Ext": {
|
|
292
|
+
"title": "Ext",
|
|
293
|
+
"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.",
|
|
294
|
+
"type": "object",
|
|
295
|
+
"minProperties": 1,
|
|
296
|
+
"additionalProperties": true,
|
|
297
|
+
"propertyNames": {
|
|
298
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
"ElectionKey": {
|
|
302
|
+
"title": "ElectionKey",
|
|
303
|
+
"description": "The election key and each trustee's public verification key, computed from the qualified dealings (CONVENTIONS §9.6). Anyone can recompute it from the board.",
|
|
304
|
+
"type": "object",
|
|
305
|
+
"additionalProperties": false,
|
|
306
|
+
"required": [
|
|
307
|
+
"key",
|
|
308
|
+
"qualified",
|
|
309
|
+
"verification"
|
|
310
|
+
],
|
|
311
|
+
"properties": {
|
|
312
|
+
"key": {
|
|
313
|
+
"$ref": "#/$defs/GroupElement"
|
|
314
|
+
},
|
|
315
|
+
"qualified": {
|
|
316
|
+
"type": "array",
|
|
317
|
+
"minItems": 1,
|
|
318
|
+
"maxItems": 64,
|
|
319
|
+
"items": {
|
|
320
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
321
|
+
},
|
|
322
|
+
"description": "The dealers whose dealings the key is formed from."
|
|
323
|
+
},
|
|
324
|
+
"verification": {
|
|
325
|
+
"type": "array",
|
|
326
|
+
"minItems": 2,
|
|
327
|
+
"maxItems": 64,
|
|
328
|
+
"items": {
|
|
329
|
+
"type": "object",
|
|
330
|
+
"additionalProperties": false,
|
|
331
|
+
"required": [
|
|
332
|
+
"trustee",
|
|
333
|
+
"key"
|
|
334
|
+
],
|
|
335
|
+
"properties": {
|
|
336
|
+
"trustee": {
|
|
337
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
338
|
+
},
|
|
339
|
+
"key": {
|
|
340
|
+
"$ref": "#/$defs/GroupElement"
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
"GroupElement": {
|
|
348
|
+
"title": "GroupElement",
|
|
349
|
+
"description": "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).",
|
|
350
|
+
"type": "string",
|
|
351
|
+
"minLength": 2,
|
|
352
|
+
"maxLength": 64,
|
|
353
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
354
|
+
},
|
|
355
|
+
"TrusteeIndex": {
|
|
356
|
+
"title": "TrusteeIndex",
|
|
357
|
+
"description": "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.",
|
|
358
|
+
"type": "integer",
|
|
359
|
+
"minimum": 1,
|
|
360
|
+
"maximum": 64
|
|
361
|
+
},
|
|
362
|
+
"Disclosure": {
|
|
363
|
+
"title": "Disclosure",
|
|
364
|
+
"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.",
|
|
365
|
+
"type": "object",
|
|
366
|
+
"additionalProperties": false,
|
|
367
|
+
"required": [
|
|
368
|
+
"ballotBox",
|
|
369
|
+
"ballotBoxOperator",
|
|
370
|
+
"sameOperator",
|
|
371
|
+
"boardVisibility",
|
|
372
|
+
"auditors",
|
|
373
|
+
"revote",
|
|
374
|
+
"coercionResistance"
|
|
375
|
+
],
|
|
376
|
+
"properties": {
|
|
377
|
+
"ballotBox": {
|
|
378
|
+
"type": "string",
|
|
379
|
+
"minLength": 1,
|
|
380
|
+
"maxLength": 2048,
|
|
381
|
+
"description": "The ballot box's DID."
|
|
382
|
+
},
|
|
383
|
+
"ballotBoxOperator": {
|
|
384
|
+
"type": "string",
|
|
385
|
+
"minLength": 1,
|
|
386
|
+
"maxLength": 512,
|
|
387
|
+
"description": "Who operates the ballot box, as the community names them."
|
|
388
|
+
},
|
|
389
|
+
"sameOperator": {
|
|
390
|
+
"type": "boolean",
|
|
391
|
+
"description": "Whether the party operating the community's VTC also operates the ballot box."
|
|
392
|
+
},
|
|
393
|
+
"trustees": {
|
|
394
|
+
"$ref": "#/$defs/Trustees"
|
|
395
|
+
},
|
|
396
|
+
"boardVisibility": {
|
|
397
|
+
"$ref": "#/$defs/BoardVisibility"
|
|
398
|
+
},
|
|
399
|
+
"auditors": {
|
|
400
|
+
"type": "array",
|
|
401
|
+
"items": {
|
|
402
|
+
"type": "string",
|
|
403
|
+
"minLength": 1,
|
|
404
|
+
"maxLength": 2048
|
|
405
|
+
},
|
|
406
|
+
"uniqueItems": true
|
|
407
|
+
},
|
|
408
|
+
"revote": {
|
|
409
|
+
"$ref": "#/$defs/Revote"
|
|
410
|
+
},
|
|
411
|
+
"coercionResistance": {
|
|
412
|
+
"const": false,
|
|
413
|
+
"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."
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
"Revote": {
|
|
418
|
+
"title": "Revote",
|
|
419
|
+
"description": "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).",
|
|
420
|
+
"type": "string",
|
|
421
|
+
"enum": [
|
|
422
|
+
"replace",
|
|
423
|
+
"refuse"
|
|
424
|
+
]
|
|
425
|
+
},
|
|
426
|
+
"BoardVisibility": {
|
|
427
|
+
"title": "BoardVisibility",
|
|
428
|
+
"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).",
|
|
429
|
+
"type": "string",
|
|
430
|
+
"enum": [
|
|
431
|
+
"public",
|
|
432
|
+
"private"
|
|
433
|
+
]
|
|
434
|
+
},
|
|
435
|
+
"Trustees": {
|
|
436
|
+
"title": "Trustees",
|
|
437
|
+
"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.",
|
|
438
|
+
"type": "object",
|
|
439
|
+
"additionalProperties": false,
|
|
440
|
+
"required": [
|
|
441
|
+
"dids",
|
|
442
|
+
"threshold"
|
|
443
|
+
],
|
|
444
|
+
"properties": {
|
|
445
|
+
"dids": {
|
|
446
|
+
"type": "array",
|
|
447
|
+
"minItems": 2,
|
|
448
|
+
"items": {
|
|
449
|
+
"type": "string",
|
|
450
|
+
"minLength": 1,
|
|
451
|
+
"maxLength": 2048
|
|
452
|
+
},
|
|
453
|
+
"uniqueItems": true
|
|
454
|
+
},
|
|
455
|
+
"threshold": {
|
|
456
|
+
"type": "integer",
|
|
457
|
+
"minimum": 2
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
"VotingParameters": {
|
|
462
|
+
"title": "VotingParameters",
|
|
463
|
+
"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.",
|
|
464
|
+
"type": "object",
|
|
465
|
+
"additionalProperties": false,
|
|
466
|
+
"required": [
|
|
467
|
+
"suite",
|
|
468
|
+
"votingKey"
|
|
469
|
+
],
|
|
470
|
+
"properties": {
|
|
471
|
+
"suite": {
|
|
472
|
+
"type": "string",
|
|
473
|
+
"const": "ps-ddh-bls12381"
|
|
474
|
+
},
|
|
475
|
+
"votingKey": {
|
|
476
|
+
"$ref": "#/$defs/Multibase"
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
"Multibase": {
|
|
481
|
+
"title": "Multibase",
|
|
482
|
+
"description": "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.",
|
|
483
|
+
"type": "string",
|
|
484
|
+
"maxLength": 16384,
|
|
485
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
486
|
+
},
|
|
487
|
+
"DigestMultibase": {
|
|
488
|
+
"title": "DigestMultibase",
|
|
489
|
+
"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`.",
|
|
490
|
+
"type": "string",
|
|
491
|
+
"minLength": 16,
|
|
492
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
493
|
+
"examples": [
|
|
494
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
495
|
+
]
|
|
496
|
+
},
|
|
497
|
+
"Manifest": {
|
|
498
|
+
"title": "Manifest",
|
|
499
|
+
"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).",
|
|
500
|
+
"type": "object",
|
|
501
|
+
"additionalProperties": false,
|
|
502
|
+
"required": [
|
|
503
|
+
"electionId",
|
|
504
|
+
"community",
|
|
505
|
+
"questions",
|
|
506
|
+
"secrecy",
|
|
507
|
+
"roll",
|
|
508
|
+
"registrationOpensAt",
|
|
509
|
+
"votingOpensAt",
|
|
510
|
+
"votingClosesAt",
|
|
511
|
+
"revote",
|
|
512
|
+
"board",
|
|
513
|
+
"ballotBox",
|
|
514
|
+
"binding",
|
|
515
|
+
"allowEarlyClose",
|
|
516
|
+
"resultsBeforeClose",
|
|
517
|
+
"textReleaseThreshold"
|
|
518
|
+
],
|
|
519
|
+
"properties": {
|
|
520
|
+
"electionId": {
|
|
521
|
+
"$ref": "#/$defs/ElectionId"
|
|
522
|
+
},
|
|
523
|
+
"community": {
|
|
524
|
+
"type": "string",
|
|
525
|
+
"minLength": 1,
|
|
526
|
+
"maxLength": 2048,
|
|
527
|
+
"description": "The community's DID."
|
|
528
|
+
},
|
|
529
|
+
"title": {
|
|
530
|
+
"type": "string",
|
|
531
|
+
"maxLength": 512
|
|
532
|
+
},
|
|
533
|
+
"description": {
|
|
534
|
+
"type": "string",
|
|
535
|
+
"maxLength": 8192
|
|
536
|
+
},
|
|
537
|
+
"questions": {
|
|
538
|
+
"type": "array",
|
|
539
|
+
"minItems": 1,
|
|
540
|
+
"maxItems": 128,
|
|
541
|
+
"items": {
|
|
542
|
+
"$ref": "#/$defs/Question"
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
"secrecy": {
|
|
546
|
+
"$ref": "#/$defs/SecrecyLevel"
|
|
547
|
+
},
|
|
548
|
+
"roll": {
|
|
549
|
+
"$ref": "#/$defs/RollRule"
|
|
550
|
+
},
|
|
551
|
+
"registrationOpensAt": {
|
|
552
|
+
"type": "string",
|
|
553
|
+
"format": "date-time"
|
|
554
|
+
},
|
|
555
|
+
"votingOpensAt": {
|
|
556
|
+
"type": "string",
|
|
557
|
+
"format": "date-time"
|
|
558
|
+
},
|
|
559
|
+
"votingClosesAt": {
|
|
560
|
+
"type": "string",
|
|
561
|
+
"format": "date-time"
|
|
562
|
+
},
|
|
563
|
+
"revote": {
|
|
564
|
+
"$ref": "#/$defs/Revote"
|
|
565
|
+
},
|
|
566
|
+
"board": {
|
|
567
|
+
"type": "object",
|
|
568
|
+
"additionalProperties": false,
|
|
569
|
+
"required": [
|
|
570
|
+
"visibility",
|
|
571
|
+
"auditors"
|
|
572
|
+
],
|
|
573
|
+
"properties": {
|
|
574
|
+
"visibility": {
|
|
575
|
+
"$ref": "#/$defs/BoardVisibility"
|
|
576
|
+
},
|
|
577
|
+
"auditors": {
|
|
578
|
+
"type": "array",
|
|
579
|
+
"items": {
|
|
580
|
+
"type": "string",
|
|
581
|
+
"minLength": 1,
|
|
582
|
+
"maxLength": 2048
|
|
583
|
+
},
|
|
584
|
+
"uniqueItems": true
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
"ballotBox": {
|
|
589
|
+
"type": "string",
|
|
590
|
+
"minLength": 1,
|
|
591
|
+
"maxLength": 2048,
|
|
592
|
+
"description": "The DID of the voting service that holds the board."
|
|
593
|
+
},
|
|
594
|
+
"trustees": {
|
|
595
|
+
"$ref": "#/$defs/Trustees"
|
|
596
|
+
},
|
|
597
|
+
"binding": {
|
|
598
|
+
"type": "boolean",
|
|
599
|
+
"description": "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081)."
|
|
600
|
+
},
|
|
601
|
+
"allowEarlyClose": {
|
|
602
|
+
"type": "boolean"
|
|
603
|
+
},
|
|
604
|
+
"resultsBeforeClose": {
|
|
605
|
+
"type": "boolean",
|
|
606
|
+
"description": "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061)."
|
|
607
|
+
},
|
|
608
|
+
"textReleaseThreshold": {
|
|
609
|
+
"type": "integer",
|
|
610
|
+
"minimum": 1,
|
|
611
|
+
"description": "Counted ballots required before any text answer is disclosed (VTI-VOT-065). At least 1, and SHOULD be at least 10: a written answer can identify its author by what it says or how it is phrased, and the fewer the ballots released together, the easier that is. Where it is below 10, the disclosure a member is shown before they request a ticket MUST say so, and MUST say that a written answer may identify its author (VTI-VOT-090)."
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
},
|
|
615
|
+
"RollRule": {
|
|
616
|
+
"title": "RollRule",
|
|
617
|
+
"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.",
|
|
618
|
+
"type": "object",
|
|
619
|
+
"additionalProperties": false,
|
|
620
|
+
"required": [
|
|
621
|
+
"rule"
|
|
622
|
+
],
|
|
623
|
+
"properties": {
|
|
624
|
+
"rule": {
|
|
625
|
+
"type": "string",
|
|
626
|
+
"enum": [
|
|
627
|
+
"members",
|
|
628
|
+
"membersAndListed",
|
|
629
|
+
"listed"
|
|
630
|
+
]
|
|
631
|
+
},
|
|
632
|
+
"listed": {
|
|
633
|
+
"type": "array",
|
|
634
|
+
"items": {
|
|
635
|
+
"type": "string",
|
|
636
|
+
"minLength": 1,
|
|
637
|
+
"maxLength": 2048,
|
|
638
|
+
"description": "A DID enfranchised by name."
|
|
639
|
+
},
|
|
640
|
+
"uniqueItems": true
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
"SecrecyLevel": {
|
|
645
|
+
"title": "SecrecyLevel",
|
|
646
|
+
"description": "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060). The encrypted levels are cast with `voting/ballot/cast-encrypted/0.1`, under an election key the trustees generate with `voting/trustees/*` (CONVENTIONS §9).",
|
|
647
|
+
"type": "string",
|
|
648
|
+
"enum": [
|
|
649
|
+
"open",
|
|
650
|
+
"sealed",
|
|
651
|
+
"talliedEncrypted"
|
|
652
|
+
]
|
|
653
|
+
},
|
|
654
|
+
"Question": {
|
|
655
|
+
"title": "Question",
|
|
656
|
+
"description": "One question. Tagged union over `type`.",
|
|
657
|
+
"oneOf": [
|
|
658
|
+
{
|
|
659
|
+
"title": "ChoiceQuestion",
|
|
660
|
+
"description": "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.",
|
|
661
|
+
"type": "object",
|
|
662
|
+
"additionalProperties": false,
|
|
663
|
+
"required": [
|
|
664
|
+
"key",
|
|
665
|
+
"type",
|
|
666
|
+
"options",
|
|
667
|
+
"minSelections",
|
|
668
|
+
"maxSelections",
|
|
669
|
+
"optional"
|
|
670
|
+
],
|
|
671
|
+
"properties": {
|
|
672
|
+
"key": {
|
|
673
|
+
"$ref": "#/$defs/Key"
|
|
674
|
+
},
|
|
675
|
+
"type": {
|
|
676
|
+
"const": "choice"
|
|
677
|
+
},
|
|
678
|
+
"text": {
|
|
679
|
+
"type": "string",
|
|
680
|
+
"maxLength": 2048
|
|
681
|
+
},
|
|
682
|
+
"options": {
|
|
683
|
+
"type": "array",
|
|
684
|
+
"minItems": 2,
|
|
685
|
+
"maxItems": 256,
|
|
686
|
+
"items": {
|
|
687
|
+
"$ref": "#/$defs/QuestionOption"
|
|
688
|
+
}
|
|
689
|
+
},
|
|
690
|
+
"minSelections": {
|
|
691
|
+
"type": "integer",
|
|
692
|
+
"minimum": 0
|
|
693
|
+
},
|
|
694
|
+
"maxSelections": {
|
|
695
|
+
"type": "integer",
|
|
696
|
+
"minimum": 1
|
|
697
|
+
},
|
|
698
|
+
"optional": {
|
|
699
|
+
"type": "boolean"
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
"title": "RankingQuestion",
|
|
705
|
+
"description": "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.",
|
|
706
|
+
"type": "object",
|
|
707
|
+
"additionalProperties": false,
|
|
708
|
+
"required": [
|
|
709
|
+
"key",
|
|
710
|
+
"type",
|
|
711
|
+
"options",
|
|
712
|
+
"partial",
|
|
713
|
+
"optional"
|
|
714
|
+
],
|
|
715
|
+
"properties": {
|
|
716
|
+
"key": {
|
|
717
|
+
"$ref": "#/$defs/Key"
|
|
718
|
+
},
|
|
719
|
+
"type": {
|
|
720
|
+
"const": "ranking"
|
|
721
|
+
},
|
|
722
|
+
"text": {
|
|
723
|
+
"type": "string",
|
|
724
|
+
"maxLength": 2048
|
|
725
|
+
},
|
|
726
|
+
"options": {
|
|
727
|
+
"type": "array",
|
|
728
|
+
"minItems": 2,
|
|
729
|
+
"maxItems": 64,
|
|
730
|
+
"items": {
|
|
731
|
+
"$ref": "#/$defs/QuestionOption"
|
|
732
|
+
}
|
|
733
|
+
},
|
|
734
|
+
"partial": {
|
|
735
|
+
"type": "boolean"
|
|
736
|
+
},
|
|
737
|
+
"optional": {
|
|
738
|
+
"type": "boolean"
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"title": "ScoreQuestion",
|
|
744
|
+
"description": "Give each option an integer score within [min, max].",
|
|
745
|
+
"type": "object",
|
|
746
|
+
"additionalProperties": false,
|
|
747
|
+
"required": [
|
|
748
|
+
"key",
|
|
749
|
+
"type",
|
|
750
|
+
"options",
|
|
751
|
+
"min",
|
|
752
|
+
"max",
|
|
753
|
+
"optional"
|
|
754
|
+
],
|
|
755
|
+
"properties": {
|
|
756
|
+
"key": {
|
|
757
|
+
"$ref": "#/$defs/Key"
|
|
758
|
+
},
|
|
759
|
+
"type": {
|
|
760
|
+
"const": "score"
|
|
761
|
+
},
|
|
762
|
+
"text": {
|
|
763
|
+
"type": "string",
|
|
764
|
+
"maxLength": 2048
|
|
765
|
+
},
|
|
766
|
+
"options": {
|
|
767
|
+
"type": "array",
|
|
768
|
+
"minItems": 1,
|
|
769
|
+
"maxItems": 256,
|
|
770
|
+
"items": {
|
|
771
|
+
"$ref": "#/$defs/QuestionOption"
|
|
772
|
+
}
|
|
773
|
+
},
|
|
774
|
+
"min": {
|
|
775
|
+
"type": "integer"
|
|
776
|
+
},
|
|
777
|
+
"max": {
|
|
778
|
+
"type": "integer"
|
|
779
|
+
},
|
|
780
|
+
"optional": {
|
|
781
|
+
"type": "boolean"
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
"title": "TextQuestion",
|
|
787
|
+
"description": "Free text of at most `maxLength` characters.",
|
|
788
|
+
"type": "object",
|
|
789
|
+
"additionalProperties": false,
|
|
790
|
+
"required": [
|
|
791
|
+
"key",
|
|
792
|
+
"type",
|
|
793
|
+
"maxLength",
|
|
794
|
+
"optional"
|
|
795
|
+
],
|
|
796
|
+
"properties": {
|
|
797
|
+
"key": {
|
|
798
|
+
"$ref": "#/$defs/Key"
|
|
799
|
+
},
|
|
800
|
+
"type": {
|
|
801
|
+
"const": "text"
|
|
802
|
+
},
|
|
803
|
+
"text": {
|
|
804
|
+
"type": "string",
|
|
805
|
+
"maxLength": 2048
|
|
806
|
+
},
|
|
807
|
+
"maxLength": {
|
|
808
|
+
"type": "integer",
|
|
809
|
+
"minimum": 1,
|
|
810
|
+
"maximum": 4096
|
|
811
|
+
},
|
|
812
|
+
"optional": {
|
|
813
|
+
"type": "boolean"
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
]
|
|
818
|
+
},
|
|
819
|
+
"Key": {
|
|
820
|
+
"title": "Key",
|
|
821
|
+
"description": "A question or option key, unique within its manifest or question.",
|
|
822
|
+
"type": "string",
|
|
823
|
+
"pattern": "^[A-Za-z0-9._-]{1,64}$"
|
|
824
|
+
},
|
|
825
|
+
"QuestionOption": {
|
|
826
|
+
"title": "QuestionOption",
|
|
827
|
+
"type": "object",
|
|
828
|
+
"additionalProperties": false,
|
|
829
|
+
"required": [
|
|
830
|
+
"key"
|
|
831
|
+
],
|
|
832
|
+
"properties": {
|
|
833
|
+
"key": {
|
|
834
|
+
"$ref": "#/$defs/Key"
|
|
835
|
+
},
|
|
836
|
+
"label": {
|
|
837
|
+
"type": "string",
|
|
838
|
+
"maxLength": 512,
|
|
839
|
+
"description": "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014)."
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
},
|
|
843
|
+
"ElectionId": {
|
|
844
|
+
"title": "ElectionId",
|
|
845
|
+
"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.",
|
|
846
|
+
"type": "string",
|
|
847
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
848
|
+
},
|
|
849
|
+
"ElectionResult": {
|
|
850
|
+
"title": "ElectionResult",
|
|
851
|
+
"description": "An election's result, computable by anyone who can read its board from the board and the registration alone (VTI-VOT-070).",
|
|
852
|
+
"type": "object",
|
|
853
|
+
"additionalProperties": false,
|
|
854
|
+
"required": [
|
|
855
|
+
"electionId",
|
|
856
|
+
"manifestDigest",
|
|
857
|
+
"ballotsCounted",
|
|
858
|
+
"questions",
|
|
859
|
+
"head"
|
|
860
|
+
],
|
|
861
|
+
"properties": {
|
|
862
|
+
"electionId": {
|
|
863
|
+
"$ref": "#/$defs/ElectionId"
|
|
864
|
+
},
|
|
865
|
+
"manifestDigest": {
|
|
866
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
867
|
+
},
|
|
868
|
+
"ballotsCounted": {
|
|
869
|
+
"type": "integer",
|
|
870
|
+
"minimum": 0
|
|
871
|
+
},
|
|
872
|
+
"questions": {
|
|
873
|
+
"type": "array",
|
|
874
|
+
"items": {
|
|
875
|
+
"$ref": "#/$defs/QuestionResult"
|
|
876
|
+
}
|
|
877
|
+
},
|
|
878
|
+
"head": {
|
|
879
|
+
"$ref": "#/$defs/BoardHead",
|
|
880
|
+
"description": "The head of the board as it stood at close: the result counts exactly its entries."
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
},
|
|
884
|
+
"BoardHead": {
|
|
885
|
+
"title": "BoardHead",
|
|
886
|
+
"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.",
|
|
887
|
+
"type": "object",
|
|
888
|
+
"additionalProperties": false,
|
|
889
|
+
"required": [
|
|
890
|
+
"electionId",
|
|
891
|
+
"treeSize",
|
|
892
|
+
"rootHash",
|
|
893
|
+
"issuedAt"
|
|
894
|
+
],
|
|
895
|
+
"properties": {
|
|
896
|
+
"electionId": {
|
|
897
|
+
"$ref": "#/$defs/ElectionId"
|
|
898
|
+
},
|
|
899
|
+
"treeSize": {
|
|
900
|
+
"type": "integer",
|
|
901
|
+
"minimum": 0
|
|
902
|
+
},
|
|
903
|
+
"rootHash": {
|
|
904
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
905
|
+
"description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
|
|
906
|
+
},
|
|
907
|
+
"issuedAt": {
|
|
908
|
+
"type": "string",
|
|
909
|
+
"format": "date-time"
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
},
|
|
913
|
+
"QuestionResult": {
|
|
914
|
+
"title": "QuestionResult",
|
|
915
|
+
"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.",
|
|
916
|
+
"type": "object",
|
|
917
|
+
"additionalProperties": false,
|
|
918
|
+
"required": [
|
|
919
|
+
"question",
|
|
920
|
+
"abstained"
|
|
921
|
+
],
|
|
922
|
+
"properties": {
|
|
923
|
+
"question": {
|
|
924
|
+
"$ref": "#/$defs/Key"
|
|
925
|
+
},
|
|
926
|
+
"abstained": {
|
|
927
|
+
"type": "integer",
|
|
928
|
+
"minimum": 0
|
|
929
|
+
},
|
|
930
|
+
"choice": {
|
|
931
|
+
"type": "object",
|
|
932
|
+
"propertyNames": {
|
|
933
|
+
"$ref": "#/$defs/Key"
|
|
934
|
+
},
|
|
935
|
+
"additionalProperties": {
|
|
936
|
+
"type": "integer",
|
|
937
|
+
"minimum": 0
|
|
938
|
+
}
|
|
939
|
+
},
|
|
940
|
+
"ranking": {
|
|
941
|
+
"type": "object",
|
|
942
|
+
"propertyNames": {
|
|
943
|
+
"$ref": "#/$defs/Key"
|
|
944
|
+
},
|
|
945
|
+
"additionalProperties": {
|
|
946
|
+
"type": "array",
|
|
947
|
+
"items": {
|
|
948
|
+
"type": "integer",
|
|
949
|
+
"minimum": 0
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
},
|
|
953
|
+
"score": {
|
|
954
|
+
"type": "object",
|
|
955
|
+
"propertyNames": {
|
|
956
|
+
"$ref": "#/$defs/Key"
|
|
957
|
+
},
|
|
958
|
+
"additionalProperties": {
|
|
959
|
+
"type": "object",
|
|
960
|
+
"additionalProperties": false,
|
|
961
|
+
"required": [
|
|
962
|
+
"sum",
|
|
963
|
+
"count"
|
|
964
|
+
],
|
|
965
|
+
"properties": {
|
|
966
|
+
"sum": {
|
|
967
|
+
"type": "integer"
|
|
968
|
+
},
|
|
969
|
+
"count": {
|
|
970
|
+
"type": "integer",
|
|
971
|
+
"minimum": 0
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
},
|
|
976
|
+
"text": {
|
|
977
|
+
"type": "array",
|
|
978
|
+
"items": {
|
|
979
|
+
"type": "string",
|
|
980
|
+
"maxLength": 4096
|
|
981
|
+
}
|
|
982
|
+
},
|
|
983
|
+
"withheld": {
|
|
984
|
+
"type": "boolean"
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
} as const;
|
|
990
|
+
|
|
991
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
992
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
993
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
994
|
+
"$ref": "#/$defs/Response",
|
|
995
|
+
"$defs": {
|
|
996
|
+
"RegistrarState": {
|
|
997
|
+
"title": "RegistrarState",
|
|
998
|
+
"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).",
|
|
999
|
+
"type": "string",
|
|
1000
|
+
"enum": [
|
|
1001
|
+
"registered",
|
|
1002
|
+
"registration",
|
|
1003
|
+
"voting",
|
|
1004
|
+
"closed",
|
|
1005
|
+
"tallied",
|
|
1006
|
+
"cancelled",
|
|
1007
|
+
"pendingRegistration",
|
|
1008
|
+
"registrationRefused"
|
|
1009
|
+
]
|
|
1010
|
+
},
|
|
1011
|
+
"Checkpoint": {
|
|
1012
|
+
"title": "Checkpoint",
|
|
1013
|
+
"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.",
|
|
1014
|
+
"type": "object",
|
|
1015
|
+
"additionalProperties": false,
|
|
1016
|
+
"required": [
|
|
1017
|
+
"head",
|
|
1018
|
+
"document"
|
|
1019
|
+
],
|
|
1020
|
+
"properties": {
|
|
1021
|
+
"head": {
|
|
1022
|
+
"$ref": "#/$defs/BoardHead"
|
|
1023
|
+
},
|
|
1024
|
+
"document": {
|
|
1025
|
+
"type": "object",
|
|
1026
|
+
"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."
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
},
|
|
1030
|
+
"Certification": {
|
|
1031
|
+
"title": "Certification",
|
|
1032
|
+
"description": "The community's certification of the election's result, as vtc/elections/certify recorded it.",
|
|
1033
|
+
"type": "object",
|
|
1034
|
+
"additionalProperties": false,
|
|
1035
|
+
"required": [
|
|
1036
|
+
"result",
|
|
1037
|
+
"certifiedAt",
|
|
1038
|
+
"auditAttestations"
|
|
1039
|
+
],
|
|
1040
|
+
"properties": {
|
|
1041
|
+
"result": {
|
|
1042
|
+
"$ref": "#/$defs/ElectionResult"
|
|
1043
|
+
},
|
|
1044
|
+
"certifiedAt": {
|
|
1045
|
+
"type": "string",
|
|
1046
|
+
"format": "date-time",
|
|
1047
|
+
"maxLength": 64
|
|
1048
|
+
},
|
|
1049
|
+
"auditAttestations": {
|
|
1050
|
+
"type": "array",
|
|
1051
|
+
"maxItems": 32,
|
|
1052
|
+
"items": {
|
|
1053
|
+
"type": "object",
|
|
1054
|
+
"description": "A verifiable credential from an auditor the manifest names, as received."
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
},
|
|
1059
|
+
"Response": {
|
|
1060
|
+
"$anchor": "response",
|
|
1061
|
+
"title": "VTC Elections — Show — response payload",
|
|
1062
|
+
"description": "Success response to vtc/elections/show/0.1: one election, whole.",
|
|
1063
|
+
"type": "object",
|
|
1064
|
+
"additionalProperties": false,
|
|
1065
|
+
"required": [
|
|
1066
|
+
"manifest",
|
|
1067
|
+
"manifestDigest",
|
|
1068
|
+
"state",
|
|
1069
|
+
"parameters",
|
|
1070
|
+
"disclosure",
|
|
1071
|
+
"checkpoints"
|
|
1072
|
+
],
|
|
1073
|
+
"properties": {
|
|
1074
|
+
"manifest": {
|
|
1075
|
+
"$ref": "#/$defs/Manifest"
|
|
1076
|
+
},
|
|
1077
|
+
"manifestDigest": {
|
|
1078
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
1079
|
+
"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."
|
|
1080
|
+
},
|
|
1081
|
+
"state": {
|
|
1082
|
+
"$ref": "#/$defs/RegistrarState"
|
|
1083
|
+
},
|
|
1084
|
+
"parameters": {
|
|
1085
|
+
"$ref": "#/$defs/VotingParameters",
|
|
1086
|
+
"description": "The community's voting parameters the election's tickets are issued under (VTI-VOT-020)."
|
|
1087
|
+
},
|
|
1088
|
+
"disclosure": {
|
|
1089
|
+
"$ref": "#/$defs/Disclosure",
|
|
1090
|
+
"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."
|
|
1091
|
+
},
|
|
1092
|
+
"checkpoints": {
|
|
1093
|
+
"type": "array",
|
|
1094
|
+
"maxItems": 256,
|
|
1095
|
+
"items": {
|
|
1096
|
+
"$ref": "#/$defs/Checkpoint"
|
|
1097
|
+
},
|
|
1098
|
+
"description": "The board heads the community has kept, oldest first. Empty until the community has read a head."
|
|
1099
|
+
},
|
|
1100
|
+
"ticketsIssued": {
|
|
1101
|
+
"type": "integer",
|
|
1102
|
+
"minimum": 0,
|
|
1103
|
+
"description": "How many tickets the community has issued for the election. Present only to a caller holding vtc.elections.manage."
|
|
1104
|
+
},
|
|
1105
|
+
"electionKey": {
|
|
1106
|
+
"$ref": "#/$defs/ElectionKey",
|
|
1107
|
+
"description": "The key a sealed or tallied-encrypted election's ballots are encrypted under, once its trustees have formed it (CONVENTIONS §9.6)."
|
|
1108
|
+
},
|
|
1109
|
+
"certified": {
|
|
1110
|
+
"$ref": "#/$defs/Certification",
|
|
1111
|
+
"description": "Present once the community has certified the result."
|
|
1112
|
+
},
|
|
1113
|
+
"ext": {
|
|
1114
|
+
"$ref": "#/$defs/Ext"
|
|
1115
|
+
},
|
|
1116
|
+
"ceremony": {
|
|
1117
|
+
"$ref": "#/$defs/TrusteeCeremony",
|
|
1118
|
+
"description": "With electionKey: the trustees' signed steps it forms from, through the board's electionKey entry, each exactly as received. A voter's VTA forms the key itself from these (vta/pcs/vote-encrypted/0.4)."
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
},
|
|
1122
|
+
"TrusteeCeremony": {
|
|
1123
|
+
"title": "TrusteeCeremony",
|
|
1124
|
+
"description": "The trustees' ceremony as the board holds it: the `request` of every `trusteeStep` entry, in board order, each exactly as the ballot box received it (CONVENTIONS §9.6). Whoever acts on it verifies each step as its trustee's before taking it; nothing in it is believed for having been passed along.",
|
|
1125
|
+
"type": "array",
|
|
1126
|
+
"minItems": 1,
|
|
1127
|
+
"maxItems": 4224,
|
|
1128
|
+
"items": {
|
|
1129
|
+
"$ref": "#/$defs/SignedRequest"
|
|
1130
|
+
}
|
|
1131
|
+
},
|
|
1132
|
+
"SignedRequest": {
|
|
1133
|
+
"title": "SignedRequest",
|
|
1134
|
+
"description": "A whole Trust Task request document — `id`, `type`, `issuer`, `payload` and every other member, `proof` included — exactly as the ballot box received it, never re-serialised: its proof is taken over its members, and a re-serialised copy does not reliably reproduce them. Typed as an open object so every member survives; CONVENTIONS §9.6 gives the checks that make it a trustee's step.",
|
|
1135
|
+
"type": "object",
|
|
1136
|
+
"minProperties": 1
|
|
1137
|
+
},
|
|
1138
|
+
"Ext": {
|
|
1139
|
+
"title": "Ext",
|
|
1140
|
+
"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.",
|
|
1141
|
+
"type": "object",
|
|
1142
|
+
"minProperties": 1,
|
|
1143
|
+
"additionalProperties": true,
|
|
1144
|
+
"propertyNames": {
|
|
1145
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
1146
|
+
}
|
|
1147
|
+
},
|
|
1148
|
+
"ElectionKey": {
|
|
1149
|
+
"title": "ElectionKey",
|
|
1150
|
+
"description": "The election key and each trustee's public verification key, computed from the qualified dealings (CONVENTIONS §9.6). Anyone can recompute it from the board.",
|
|
1151
|
+
"type": "object",
|
|
1152
|
+
"additionalProperties": false,
|
|
1153
|
+
"required": [
|
|
1154
|
+
"key",
|
|
1155
|
+
"qualified",
|
|
1156
|
+
"verification"
|
|
1157
|
+
],
|
|
1158
|
+
"properties": {
|
|
1159
|
+
"key": {
|
|
1160
|
+
"$ref": "#/$defs/GroupElement"
|
|
1161
|
+
},
|
|
1162
|
+
"qualified": {
|
|
1163
|
+
"type": "array",
|
|
1164
|
+
"minItems": 1,
|
|
1165
|
+
"maxItems": 64,
|
|
1166
|
+
"items": {
|
|
1167
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
1168
|
+
},
|
|
1169
|
+
"description": "The dealers whose dealings the key is formed from."
|
|
1170
|
+
},
|
|
1171
|
+
"verification": {
|
|
1172
|
+
"type": "array",
|
|
1173
|
+
"minItems": 2,
|
|
1174
|
+
"maxItems": 64,
|
|
1175
|
+
"items": {
|
|
1176
|
+
"type": "object",
|
|
1177
|
+
"additionalProperties": false,
|
|
1178
|
+
"required": [
|
|
1179
|
+
"trustee",
|
|
1180
|
+
"key"
|
|
1181
|
+
],
|
|
1182
|
+
"properties": {
|
|
1183
|
+
"trustee": {
|
|
1184
|
+
"$ref": "#/$defs/TrusteeIndex"
|
|
1185
|
+
},
|
|
1186
|
+
"key": {
|
|
1187
|
+
"$ref": "#/$defs/GroupElement"
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
},
|
|
1194
|
+
"GroupElement": {
|
|
1195
|
+
"title": "GroupElement",
|
|
1196
|
+
"description": "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).",
|
|
1197
|
+
"type": "string",
|
|
1198
|
+
"minLength": 2,
|
|
1199
|
+
"maxLength": 64,
|
|
1200
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
1201
|
+
},
|
|
1202
|
+
"TrusteeIndex": {
|
|
1203
|
+
"title": "TrusteeIndex",
|
|
1204
|
+
"description": "A trustee's index: its position in the manifest's `trustees.dids`, counting from 1.",
|
|
1205
|
+
"type": "integer",
|
|
1206
|
+
"minimum": 1,
|
|
1207
|
+
"maximum": 64
|
|
1208
|
+
},
|
|
1209
|
+
"Disclosure": {
|
|
1210
|
+
"title": "Disclosure",
|
|
1211
|
+
"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.",
|
|
1212
|
+
"type": "object",
|
|
1213
|
+
"additionalProperties": false,
|
|
1214
|
+
"required": [
|
|
1215
|
+
"ballotBox",
|
|
1216
|
+
"ballotBoxOperator",
|
|
1217
|
+
"sameOperator",
|
|
1218
|
+
"boardVisibility",
|
|
1219
|
+
"auditors",
|
|
1220
|
+
"revote",
|
|
1221
|
+
"coercionResistance"
|
|
1222
|
+
],
|
|
1223
|
+
"properties": {
|
|
1224
|
+
"ballotBox": {
|
|
1225
|
+
"type": "string",
|
|
1226
|
+
"minLength": 1,
|
|
1227
|
+
"maxLength": 2048,
|
|
1228
|
+
"description": "The ballot box's DID."
|
|
1229
|
+
},
|
|
1230
|
+
"ballotBoxOperator": {
|
|
1231
|
+
"type": "string",
|
|
1232
|
+
"minLength": 1,
|
|
1233
|
+
"maxLength": 512,
|
|
1234
|
+
"description": "Who operates the ballot box, as the community names them."
|
|
1235
|
+
},
|
|
1236
|
+
"sameOperator": {
|
|
1237
|
+
"type": "boolean",
|
|
1238
|
+
"description": "Whether the party operating the community's VTC also operates the ballot box."
|
|
1239
|
+
},
|
|
1240
|
+
"trustees": {
|
|
1241
|
+
"$ref": "#/$defs/Trustees"
|
|
1242
|
+
},
|
|
1243
|
+
"boardVisibility": {
|
|
1244
|
+
"$ref": "#/$defs/BoardVisibility"
|
|
1245
|
+
},
|
|
1246
|
+
"auditors": {
|
|
1247
|
+
"type": "array",
|
|
1248
|
+
"items": {
|
|
1249
|
+
"type": "string",
|
|
1250
|
+
"minLength": 1,
|
|
1251
|
+
"maxLength": 2048
|
|
1252
|
+
},
|
|
1253
|
+
"uniqueItems": true
|
|
1254
|
+
},
|
|
1255
|
+
"revote": {
|
|
1256
|
+
"$ref": "#/$defs/Revote"
|
|
1257
|
+
},
|
|
1258
|
+
"coercionResistance": {
|
|
1259
|
+
"const": false,
|
|
1260
|
+
"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."
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
},
|
|
1264
|
+
"Revote": {
|
|
1265
|
+
"title": "Revote",
|
|
1266
|
+
"description": "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).",
|
|
1267
|
+
"type": "string",
|
|
1268
|
+
"enum": [
|
|
1269
|
+
"replace",
|
|
1270
|
+
"refuse"
|
|
1271
|
+
]
|
|
1272
|
+
},
|
|
1273
|
+
"BoardVisibility": {
|
|
1274
|
+
"title": "BoardVisibility",
|
|
1275
|
+
"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).",
|
|
1276
|
+
"type": "string",
|
|
1277
|
+
"enum": [
|
|
1278
|
+
"public",
|
|
1279
|
+
"private"
|
|
1280
|
+
]
|
|
1281
|
+
},
|
|
1282
|
+
"Trustees": {
|
|
1283
|
+
"title": "Trustees",
|
|
1284
|
+
"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.",
|
|
1285
|
+
"type": "object",
|
|
1286
|
+
"additionalProperties": false,
|
|
1287
|
+
"required": [
|
|
1288
|
+
"dids",
|
|
1289
|
+
"threshold"
|
|
1290
|
+
],
|
|
1291
|
+
"properties": {
|
|
1292
|
+
"dids": {
|
|
1293
|
+
"type": "array",
|
|
1294
|
+
"minItems": 2,
|
|
1295
|
+
"items": {
|
|
1296
|
+
"type": "string",
|
|
1297
|
+
"minLength": 1,
|
|
1298
|
+
"maxLength": 2048
|
|
1299
|
+
},
|
|
1300
|
+
"uniqueItems": true
|
|
1301
|
+
},
|
|
1302
|
+
"threshold": {
|
|
1303
|
+
"type": "integer",
|
|
1304
|
+
"minimum": 2
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
},
|
|
1308
|
+
"VotingParameters": {
|
|
1309
|
+
"title": "VotingParameters",
|
|
1310
|
+
"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.",
|
|
1311
|
+
"type": "object",
|
|
1312
|
+
"additionalProperties": false,
|
|
1313
|
+
"required": [
|
|
1314
|
+
"suite",
|
|
1315
|
+
"votingKey"
|
|
1316
|
+
],
|
|
1317
|
+
"properties": {
|
|
1318
|
+
"suite": {
|
|
1319
|
+
"type": "string",
|
|
1320
|
+
"const": "ps-ddh-bls12381"
|
|
1321
|
+
},
|
|
1322
|
+
"votingKey": {
|
|
1323
|
+
"$ref": "#/$defs/Multibase"
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
},
|
|
1327
|
+
"Multibase": {
|
|
1328
|
+
"title": "Multibase",
|
|
1329
|
+
"description": "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.",
|
|
1330
|
+
"type": "string",
|
|
1331
|
+
"maxLength": 16384,
|
|
1332
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
1333
|
+
},
|
|
1334
|
+
"DigestMultibase": {
|
|
1335
|
+
"title": "DigestMultibase",
|
|
1336
|
+
"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`.",
|
|
1337
|
+
"type": "string",
|
|
1338
|
+
"minLength": 16,
|
|
1339
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
1340
|
+
"examples": [
|
|
1341
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
1342
|
+
]
|
|
1343
|
+
},
|
|
1344
|
+
"Manifest": {
|
|
1345
|
+
"title": "Manifest",
|
|
1346
|
+
"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).",
|
|
1347
|
+
"type": "object",
|
|
1348
|
+
"additionalProperties": false,
|
|
1349
|
+
"required": [
|
|
1350
|
+
"electionId",
|
|
1351
|
+
"community",
|
|
1352
|
+
"questions",
|
|
1353
|
+
"secrecy",
|
|
1354
|
+
"roll",
|
|
1355
|
+
"registrationOpensAt",
|
|
1356
|
+
"votingOpensAt",
|
|
1357
|
+
"votingClosesAt",
|
|
1358
|
+
"revote",
|
|
1359
|
+
"board",
|
|
1360
|
+
"ballotBox",
|
|
1361
|
+
"binding",
|
|
1362
|
+
"allowEarlyClose",
|
|
1363
|
+
"resultsBeforeClose",
|
|
1364
|
+
"textReleaseThreshold"
|
|
1365
|
+
],
|
|
1366
|
+
"properties": {
|
|
1367
|
+
"electionId": {
|
|
1368
|
+
"$ref": "#/$defs/ElectionId"
|
|
1369
|
+
},
|
|
1370
|
+
"community": {
|
|
1371
|
+
"type": "string",
|
|
1372
|
+
"minLength": 1,
|
|
1373
|
+
"maxLength": 2048,
|
|
1374
|
+
"description": "The community's DID."
|
|
1375
|
+
},
|
|
1376
|
+
"title": {
|
|
1377
|
+
"type": "string",
|
|
1378
|
+
"maxLength": 512
|
|
1379
|
+
},
|
|
1380
|
+
"description": {
|
|
1381
|
+
"type": "string",
|
|
1382
|
+
"maxLength": 8192
|
|
1383
|
+
},
|
|
1384
|
+
"questions": {
|
|
1385
|
+
"type": "array",
|
|
1386
|
+
"minItems": 1,
|
|
1387
|
+
"maxItems": 128,
|
|
1388
|
+
"items": {
|
|
1389
|
+
"$ref": "#/$defs/Question"
|
|
1390
|
+
}
|
|
1391
|
+
},
|
|
1392
|
+
"secrecy": {
|
|
1393
|
+
"$ref": "#/$defs/SecrecyLevel"
|
|
1394
|
+
},
|
|
1395
|
+
"roll": {
|
|
1396
|
+
"$ref": "#/$defs/RollRule"
|
|
1397
|
+
},
|
|
1398
|
+
"registrationOpensAt": {
|
|
1399
|
+
"type": "string",
|
|
1400
|
+
"format": "date-time"
|
|
1401
|
+
},
|
|
1402
|
+
"votingOpensAt": {
|
|
1403
|
+
"type": "string",
|
|
1404
|
+
"format": "date-time"
|
|
1405
|
+
},
|
|
1406
|
+
"votingClosesAt": {
|
|
1407
|
+
"type": "string",
|
|
1408
|
+
"format": "date-time"
|
|
1409
|
+
},
|
|
1410
|
+
"revote": {
|
|
1411
|
+
"$ref": "#/$defs/Revote"
|
|
1412
|
+
},
|
|
1413
|
+
"board": {
|
|
1414
|
+
"type": "object",
|
|
1415
|
+
"additionalProperties": false,
|
|
1416
|
+
"required": [
|
|
1417
|
+
"visibility",
|
|
1418
|
+
"auditors"
|
|
1419
|
+
],
|
|
1420
|
+
"properties": {
|
|
1421
|
+
"visibility": {
|
|
1422
|
+
"$ref": "#/$defs/BoardVisibility"
|
|
1423
|
+
},
|
|
1424
|
+
"auditors": {
|
|
1425
|
+
"type": "array",
|
|
1426
|
+
"items": {
|
|
1427
|
+
"type": "string",
|
|
1428
|
+
"minLength": 1,
|
|
1429
|
+
"maxLength": 2048
|
|
1430
|
+
},
|
|
1431
|
+
"uniqueItems": true
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
},
|
|
1435
|
+
"ballotBox": {
|
|
1436
|
+
"type": "string",
|
|
1437
|
+
"minLength": 1,
|
|
1438
|
+
"maxLength": 2048,
|
|
1439
|
+
"description": "The DID of the voting service that holds the board."
|
|
1440
|
+
},
|
|
1441
|
+
"trustees": {
|
|
1442
|
+
"$ref": "#/$defs/Trustees"
|
|
1443
|
+
},
|
|
1444
|
+
"binding": {
|
|
1445
|
+
"type": "boolean",
|
|
1446
|
+
"description": "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081)."
|
|
1447
|
+
},
|
|
1448
|
+
"allowEarlyClose": {
|
|
1449
|
+
"type": "boolean"
|
|
1450
|
+
},
|
|
1451
|
+
"resultsBeforeClose": {
|
|
1452
|
+
"type": "boolean",
|
|
1453
|
+
"description": "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061)."
|
|
1454
|
+
},
|
|
1455
|
+
"textReleaseThreshold": {
|
|
1456
|
+
"type": "integer",
|
|
1457
|
+
"minimum": 1,
|
|
1458
|
+
"description": "Counted ballots required before any text answer is disclosed (VTI-VOT-065). At least 1, and SHOULD be at least 10: a written answer can identify its author by what it says or how it is phrased, and the fewer the ballots released together, the easier that is. Where it is below 10, the disclosure a member is shown before they request a ticket MUST say so, and MUST say that a written answer may identify its author (VTI-VOT-090)."
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
},
|
|
1462
|
+
"RollRule": {
|
|
1463
|
+
"title": "RollRule",
|
|
1464
|
+
"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.",
|
|
1465
|
+
"type": "object",
|
|
1466
|
+
"additionalProperties": false,
|
|
1467
|
+
"required": [
|
|
1468
|
+
"rule"
|
|
1469
|
+
],
|
|
1470
|
+
"properties": {
|
|
1471
|
+
"rule": {
|
|
1472
|
+
"type": "string",
|
|
1473
|
+
"enum": [
|
|
1474
|
+
"members",
|
|
1475
|
+
"membersAndListed",
|
|
1476
|
+
"listed"
|
|
1477
|
+
]
|
|
1478
|
+
},
|
|
1479
|
+
"listed": {
|
|
1480
|
+
"type": "array",
|
|
1481
|
+
"items": {
|
|
1482
|
+
"type": "string",
|
|
1483
|
+
"minLength": 1,
|
|
1484
|
+
"maxLength": 2048,
|
|
1485
|
+
"description": "A DID enfranchised by name."
|
|
1486
|
+
},
|
|
1487
|
+
"uniqueItems": true
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
},
|
|
1491
|
+
"SecrecyLevel": {
|
|
1492
|
+
"title": "SecrecyLevel",
|
|
1493
|
+
"description": "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060). The encrypted levels are cast with `voting/ballot/cast-encrypted/0.1`, under an election key the trustees generate with `voting/trustees/*` (CONVENTIONS §9).",
|
|
1494
|
+
"type": "string",
|
|
1495
|
+
"enum": [
|
|
1496
|
+
"open",
|
|
1497
|
+
"sealed",
|
|
1498
|
+
"talliedEncrypted"
|
|
1499
|
+
]
|
|
1500
|
+
},
|
|
1501
|
+
"Question": {
|
|
1502
|
+
"title": "Question",
|
|
1503
|
+
"description": "One question. Tagged union over `type`.",
|
|
1504
|
+
"oneOf": [
|
|
1505
|
+
{
|
|
1506
|
+
"title": "ChoiceQuestion",
|
|
1507
|
+
"description": "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.",
|
|
1508
|
+
"type": "object",
|
|
1509
|
+
"additionalProperties": false,
|
|
1510
|
+
"required": [
|
|
1511
|
+
"key",
|
|
1512
|
+
"type",
|
|
1513
|
+
"options",
|
|
1514
|
+
"minSelections",
|
|
1515
|
+
"maxSelections",
|
|
1516
|
+
"optional"
|
|
1517
|
+
],
|
|
1518
|
+
"properties": {
|
|
1519
|
+
"key": {
|
|
1520
|
+
"$ref": "#/$defs/Key"
|
|
1521
|
+
},
|
|
1522
|
+
"type": {
|
|
1523
|
+
"const": "choice"
|
|
1524
|
+
},
|
|
1525
|
+
"text": {
|
|
1526
|
+
"type": "string",
|
|
1527
|
+
"maxLength": 2048
|
|
1528
|
+
},
|
|
1529
|
+
"options": {
|
|
1530
|
+
"type": "array",
|
|
1531
|
+
"minItems": 2,
|
|
1532
|
+
"maxItems": 256,
|
|
1533
|
+
"items": {
|
|
1534
|
+
"$ref": "#/$defs/QuestionOption"
|
|
1535
|
+
}
|
|
1536
|
+
},
|
|
1537
|
+
"minSelections": {
|
|
1538
|
+
"type": "integer",
|
|
1539
|
+
"minimum": 0
|
|
1540
|
+
},
|
|
1541
|
+
"maxSelections": {
|
|
1542
|
+
"type": "integer",
|
|
1543
|
+
"minimum": 1
|
|
1544
|
+
},
|
|
1545
|
+
"optional": {
|
|
1546
|
+
"type": "boolean"
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
},
|
|
1550
|
+
{
|
|
1551
|
+
"title": "RankingQuestion",
|
|
1552
|
+
"description": "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.",
|
|
1553
|
+
"type": "object",
|
|
1554
|
+
"additionalProperties": false,
|
|
1555
|
+
"required": [
|
|
1556
|
+
"key",
|
|
1557
|
+
"type",
|
|
1558
|
+
"options",
|
|
1559
|
+
"partial",
|
|
1560
|
+
"optional"
|
|
1561
|
+
],
|
|
1562
|
+
"properties": {
|
|
1563
|
+
"key": {
|
|
1564
|
+
"$ref": "#/$defs/Key"
|
|
1565
|
+
},
|
|
1566
|
+
"type": {
|
|
1567
|
+
"const": "ranking"
|
|
1568
|
+
},
|
|
1569
|
+
"text": {
|
|
1570
|
+
"type": "string",
|
|
1571
|
+
"maxLength": 2048
|
|
1572
|
+
},
|
|
1573
|
+
"options": {
|
|
1574
|
+
"type": "array",
|
|
1575
|
+
"minItems": 2,
|
|
1576
|
+
"maxItems": 64,
|
|
1577
|
+
"items": {
|
|
1578
|
+
"$ref": "#/$defs/QuestionOption"
|
|
1579
|
+
}
|
|
1580
|
+
},
|
|
1581
|
+
"partial": {
|
|
1582
|
+
"type": "boolean"
|
|
1583
|
+
},
|
|
1584
|
+
"optional": {
|
|
1585
|
+
"type": "boolean"
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
},
|
|
1589
|
+
{
|
|
1590
|
+
"title": "ScoreQuestion",
|
|
1591
|
+
"description": "Give each option an integer score within [min, max].",
|
|
1592
|
+
"type": "object",
|
|
1593
|
+
"additionalProperties": false,
|
|
1594
|
+
"required": [
|
|
1595
|
+
"key",
|
|
1596
|
+
"type",
|
|
1597
|
+
"options",
|
|
1598
|
+
"min",
|
|
1599
|
+
"max",
|
|
1600
|
+
"optional"
|
|
1601
|
+
],
|
|
1602
|
+
"properties": {
|
|
1603
|
+
"key": {
|
|
1604
|
+
"$ref": "#/$defs/Key"
|
|
1605
|
+
},
|
|
1606
|
+
"type": {
|
|
1607
|
+
"const": "score"
|
|
1608
|
+
},
|
|
1609
|
+
"text": {
|
|
1610
|
+
"type": "string",
|
|
1611
|
+
"maxLength": 2048
|
|
1612
|
+
},
|
|
1613
|
+
"options": {
|
|
1614
|
+
"type": "array",
|
|
1615
|
+
"minItems": 1,
|
|
1616
|
+
"maxItems": 256,
|
|
1617
|
+
"items": {
|
|
1618
|
+
"$ref": "#/$defs/QuestionOption"
|
|
1619
|
+
}
|
|
1620
|
+
},
|
|
1621
|
+
"min": {
|
|
1622
|
+
"type": "integer"
|
|
1623
|
+
},
|
|
1624
|
+
"max": {
|
|
1625
|
+
"type": "integer"
|
|
1626
|
+
},
|
|
1627
|
+
"optional": {
|
|
1628
|
+
"type": "boolean"
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
},
|
|
1632
|
+
{
|
|
1633
|
+
"title": "TextQuestion",
|
|
1634
|
+
"description": "Free text of at most `maxLength` characters.",
|
|
1635
|
+
"type": "object",
|
|
1636
|
+
"additionalProperties": false,
|
|
1637
|
+
"required": [
|
|
1638
|
+
"key",
|
|
1639
|
+
"type",
|
|
1640
|
+
"maxLength",
|
|
1641
|
+
"optional"
|
|
1642
|
+
],
|
|
1643
|
+
"properties": {
|
|
1644
|
+
"key": {
|
|
1645
|
+
"$ref": "#/$defs/Key"
|
|
1646
|
+
},
|
|
1647
|
+
"type": {
|
|
1648
|
+
"const": "text"
|
|
1649
|
+
},
|
|
1650
|
+
"text": {
|
|
1651
|
+
"type": "string",
|
|
1652
|
+
"maxLength": 2048
|
|
1653
|
+
},
|
|
1654
|
+
"maxLength": {
|
|
1655
|
+
"type": "integer",
|
|
1656
|
+
"minimum": 1,
|
|
1657
|
+
"maximum": 4096
|
|
1658
|
+
},
|
|
1659
|
+
"optional": {
|
|
1660
|
+
"type": "boolean"
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
]
|
|
1665
|
+
},
|
|
1666
|
+
"Key": {
|
|
1667
|
+
"title": "Key",
|
|
1668
|
+
"description": "A question or option key, unique within its manifest or question.",
|
|
1669
|
+
"type": "string",
|
|
1670
|
+
"pattern": "^[A-Za-z0-9._-]{1,64}$"
|
|
1671
|
+
},
|
|
1672
|
+
"QuestionOption": {
|
|
1673
|
+
"title": "QuestionOption",
|
|
1674
|
+
"type": "object",
|
|
1675
|
+
"additionalProperties": false,
|
|
1676
|
+
"required": [
|
|
1677
|
+
"key"
|
|
1678
|
+
],
|
|
1679
|
+
"properties": {
|
|
1680
|
+
"key": {
|
|
1681
|
+
"$ref": "#/$defs/Key"
|
|
1682
|
+
},
|
|
1683
|
+
"label": {
|
|
1684
|
+
"type": "string",
|
|
1685
|
+
"maxLength": 512,
|
|
1686
|
+
"description": "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014)."
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
},
|
|
1690
|
+
"ElectionId": {
|
|
1691
|
+
"title": "ElectionId",
|
|
1692
|
+
"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.",
|
|
1693
|
+
"type": "string",
|
|
1694
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
1695
|
+
},
|
|
1696
|
+
"ElectionResult": {
|
|
1697
|
+
"title": "ElectionResult",
|
|
1698
|
+
"description": "An election's result, computable by anyone who can read its board from the board and the registration alone (VTI-VOT-070).",
|
|
1699
|
+
"type": "object",
|
|
1700
|
+
"additionalProperties": false,
|
|
1701
|
+
"required": [
|
|
1702
|
+
"electionId",
|
|
1703
|
+
"manifestDigest",
|
|
1704
|
+
"ballotsCounted",
|
|
1705
|
+
"questions",
|
|
1706
|
+
"head"
|
|
1707
|
+
],
|
|
1708
|
+
"properties": {
|
|
1709
|
+
"electionId": {
|
|
1710
|
+
"$ref": "#/$defs/ElectionId"
|
|
1711
|
+
},
|
|
1712
|
+
"manifestDigest": {
|
|
1713
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
1714
|
+
},
|
|
1715
|
+
"ballotsCounted": {
|
|
1716
|
+
"type": "integer",
|
|
1717
|
+
"minimum": 0
|
|
1718
|
+
},
|
|
1719
|
+
"questions": {
|
|
1720
|
+
"type": "array",
|
|
1721
|
+
"items": {
|
|
1722
|
+
"$ref": "#/$defs/QuestionResult"
|
|
1723
|
+
}
|
|
1724
|
+
},
|
|
1725
|
+
"head": {
|
|
1726
|
+
"$ref": "#/$defs/BoardHead",
|
|
1727
|
+
"description": "The head of the board as it stood at close: the result counts exactly its entries."
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
},
|
|
1731
|
+
"BoardHead": {
|
|
1732
|
+
"title": "BoardHead",
|
|
1733
|
+
"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.",
|
|
1734
|
+
"type": "object",
|
|
1735
|
+
"additionalProperties": false,
|
|
1736
|
+
"required": [
|
|
1737
|
+
"electionId",
|
|
1738
|
+
"treeSize",
|
|
1739
|
+
"rootHash",
|
|
1740
|
+
"issuedAt"
|
|
1741
|
+
],
|
|
1742
|
+
"properties": {
|
|
1743
|
+
"electionId": {
|
|
1744
|
+
"$ref": "#/$defs/ElectionId"
|
|
1745
|
+
},
|
|
1746
|
+
"treeSize": {
|
|
1747
|
+
"type": "integer",
|
|
1748
|
+
"minimum": 0
|
|
1749
|
+
},
|
|
1750
|
+
"rootHash": {
|
|
1751
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
1752
|
+
"description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
|
|
1753
|
+
},
|
|
1754
|
+
"issuedAt": {
|
|
1755
|
+
"type": "string",
|
|
1756
|
+
"format": "date-time"
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
},
|
|
1760
|
+
"QuestionResult": {
|
|
1761
|
+
"title": "QuestionResult",
|
|
1762
|
+
"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.",
|
|
1763
|
+
"type": "object",
|
|
1764
|
+
"additionalProperties": false,
|
|
1765
|
+
"required": [
|
|
1766
|
+
"question",
|
|
1767
|
+
"abstained"
|
|
1768
|
+
],
|
|
1769
|
+
"properties": {
|
|
1770
|
+
"question": {
|
|
1771
|
+
"$ref": "#/$defs/Key"
|
|
1772
|
+
},
|
|
1773
|
+
"abstained": {
|
|
1774
|
+
"type": "integer",
|
|
1775
|
+
"minimum": 0
|
|
1776
|
+
},
|
|
1777
|
+
"choice": {
|
|
1778
|
+
"type": "object",
|
|
1779
|
+
"propertyNames": {
|
|
1780
|
+
"$ref": "#/$defs/Key"
|
|
1781
|
+
},
|
|
1782
|
+
"additionalProperties": {
|
|
1783
|
+
"type": "integer",
|
|
1784
|
+
"minimum": 0
|
|
1785
|
+
}
|
|
1786
|
+
},
|
|
1787
|
+
"ranking": {
|
|
1788
|
+
"type": "object",
|
|
1789
|
+
"propertyNames": {
|
|
1790
|
+
"$ref": "#/$defs/Key"
|
|
1791
|
+
},
|
|
1792
|
+
"additionalProperties": {
|
|
1793
|
+
"type": "array",
|
|
1794
|
+
"items": {
|
|
1795
|
+
"type": "integer",
|
|
1796
|
+
"minimum": 0
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
},
|
|
1800
|
+
"score": {
|
|
1801
|
+
"type": "object",
|
|
1802
|
+
"propertyNames": {
|
|
1803
|
+
"$ref": "#/$defs/Key"
|
|
1804
|
+
},
|
|
1805
|
+
"additionalProperties": {
|
|
1806
|
+
"type": "object",
|
|
1807
|
+
"additionalProperties": false,
|
|
1808
|
+
"required": [
|
|
1809
|
+
"sum",
|
|
1810
|
+
"count"
|
|
1811
|
+
],
|
|
1812
|
+
"properties": {
|
|
1813
|
+
"sum": {
|
|
1814
|
+
"type": "integer"
|
|
1815
|
+
},
|
|
1816
|
+
"count": {
|
|
1817
|
+
"type": "integer",
|
|
1818
|
+
"minimum": 0
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
},
|
|
1823
|
+
"text": {
|
|
1824
|
+
"type": "array",
|
|
1825
|
+
"items": {
|
|
1826
|
+
"type": "string",
|
|
1827
|
+
"maxLength": 4096
|
|
1828
|
+
}
|
|
1829
|
+
},
|
|
1830
|
+
"withheld": {
|
|
1831
|
+
"type": "boolean"
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
} as const;
|
|
1837
|
+
|
|
1838
|
+
/**
|
|
1839
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
1840
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
1841
|
+
* per-specification and cannot be derived from the document alone, and
|
|
1842
|
+
* item 2 needs the schema this carries.
|
|
1843
|
+
*/
|
|
1844
|
+
export const SPEC = {
|
|
1845
|
+
typeUri: TYPE_URI,
|
|
1846
|
+
isBearer: false,
|
|
1847
|
+
isProofRequired: false,
|
|
1848
|
+
isRecipientRequired: true,
|
|
1849
|
+
isIssuedAtRequired: false,
|
|
1850
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
1851
|
+
} as const;
|
|
1852
|
+
|
|
1853
|
+
/**
|
|
1854
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
1855
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
1856
|
+
* parties (§7.3 item 5).
|
|
1857
|
+
*/
|
|
1858
|
+
export const RESPONSE_SPEC = {
|
|
1859
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
1860
|
+
isBearer: false,
|
|
1861
|
+
isProofRequired: false,
|
|
1862
|
+
isRecipientRequired: true,
|
|
1863
|
+
isIssuedAtRequired: false,
|
|
1864
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
1865
|
+
} as const;
|