@openvtc/trust-tasks 0.26.25 → 0.26.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/dist/_shared/components.d.ts +207 -4
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/device/list/0.1/payload.d.ts +4 -4
- package/dist/device/list/0.1/payload.d.ts.map +1 -1
- package/dist/device/list/0.1/payload.js +4 -2
- package/dist/device/list/0.1/payload.js.map +1 -1
- package/dist/device/list/0.2/payload.d.ts +4 -4
- package/dist/device/list/0.2/payload.d.ts.map +1 -1
- package/dist/device/list/0.2/payload.js +4 -2
- package/dist/device/list/0.2/payload.js.map +1 -1
- package/dist/device/register/0.1/payload.d.ts +4 -4
- package/dist/device/register/0.1/payload.d.ts.map +1 -1
- package/dist/device/register/0.1/payload.js +4 -2
- package/dist/device/register/0.1/payload.js.map +1 -1
- package/dist/device/register/0.2/payload.d.ts +4 -4
- package/dist/device/register/0.2/payload.d.ts.map +1 -1
- package/dist/device/register/0.2/payload.js +4 -2
- package/dist/device/register/0.2/payload.js.map +1 -1
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/voting/_shared/0.1/voting.d.ts +1 -1
- package/dist/voting/_shared/0.1/voting.d.ts.map +1 -1
- package/dist/voting/ballot/cast-encrypted/0.1/payload.d.ts +1166 -0
- package/dist/voting/ballot/cast-encrypted/0.1/payload.d.ts.map +1 -0
- package/dist/voting/ballot/cast-encrypted/0.1/payload.js +690 -0
- package/dist/voting/ballot/cast-encrypted/0.1/payload.js.map +1 -0
- package/dist/voting/board/read/0.1/payload.d.ts +2555 -719
- package/dist/voting/board/read/0.1/payload.d.ts.map +1 -1
- package/dist/voting/board/read/0.1/payload.js +1517 -391
- package/dist/voting/board/read/0.1/payload.js.map +1 -1
- package/dist/voting/election/register/0.1/payload.d.ts +4 -4
- package/dist/voting/election/register/0.1/payload.js +2 -2
- package/dist/voting/election/register/0.1/payload.js.map +1 -1
- package/dist/voting/election/show/0.1/payload.d.ts +4 -4
- package/dist/voting/election/show/0.1/payload.js +2 -2
- package/dist/voting/election/show/0.1/payload.js.map +1 -1
- package/dist/voting/trustees/confirm/0.1/payload.d.ts +620 -0
- package/dist/voting/trustees/confirm/0.1/payload.d.ts.map +1 -0
- package/dist/voting/trustees/confirm/0.1/payload.js +388 -0
- package/dist/voting/trustees/confirm/0.1/payload.js.map +1 -0
- package/dist/voting/trustees/deal/0.1/payload.d.ts +1032 -0
- package/dist/voting/trustees/deal/0.1/payload.d.ts.map +1 -0
- package/dist/voting/trustees/deal/0.1/payload.js +630 -0
- package/dist/voting/trustees/deal/0.1/payload.js.map +1 -0
- package/dist/voting/trustees/decrypt/0.1/payload.d.ts +1009 -0
- package/dist/voting/trustees/decrypt/0.1/payload.d.ts.map +1 -0
- package/dist/voting/trustees/decrypt/0.1/payload.js +623 -0
- package/dist/voting/trustees/decrypt/0.1/payload.js.map +1 -0
- package/dist/voting/trustees/enrol/0.1/payload.d.ts +792 -0
- package/dist/voting/trustees/enrol/0.1/payload.d.ts.map +1 -0
- package/dist/voting/trustees/enrol/0.1/payload.js +490 -0
- package/dist/voting/trustees/enrol/0.1/payload.js.map +1 -0
- package/dist/voting/trustees/justify/0.1/payload.d.ts +642 -0
- package/dist/voting/trustees/justify/0.1/payload.d.ts.map +1 -0
- package/dist/voting/trustees/justify/0.1/payload.js +402 -0
- package/dist/voting/trustees/justify/0.1/payload.js.map +1 -0
- package/dist/voting/trustees/status/0.1/payload.d.ts +1411 -0
- package/dist/voting/trustees/status/0.1/payload.d.ts.map +1 -0
- package/dist/voting/trustees/status/0.1/payload.js +822 -0
- package/dist/voting/trustees/status/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/deal/0.1/payload.d.ts +2005 -0
- package/dist/vta/pcs/trustee/deal/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/deal/0.1/payload.js +1176 -0
- package/dist/vta/pcs/trustee/deal/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/decrypt/0.1/payload.d.ts +736 -0
- package/dist/vta/pcs/trustee/decrypt/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/decrypt/0.1/payload.js +412 -0
- package/dist/vta/pcs/trustee/decrypt/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/enrol/0.1/payload.d.ts +1756 -0
- package/dist/vta/pcs/trustee/enrol/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/enrol/0.1/payload.js +1040 -0
- package/dist/vta/pcs/trustee/enrol/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/justify/0.1/payload.d.ts +504 -0
- package/dist/vta/pcs/trustee/justify/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/justify/0.1/payload.js +274 -0
- package/dist/vta/pcs/trustee/justify/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/keys/0.1/payload.d.ts +2501 -0
- package/dist/vta/pcs/trustee/keys/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/keys/0.1/payload.js +1455 -0
- package/dist/vta/pcs/trustee/keys/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/vote/0.1/payload.d.ts +4 -4
- package/dist/vta/pcs/vote/0.1/payload.js +2 -2
- package/dist/vta/pcs/vote/0.1/payload.js.map +1 -1
- package/dist/vta/pcs/vote-encrypted/0.1/payload.d.ts +2375 -0
- package/dist/vta/pcs/vote-encrypted/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/vote-encrypted/0.1/payload.js +1389 -0
- package/dist/vta/pcs/vote-encrypted/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/voter/register/0.1/payload.d.ts +4 -4
- package/dist/vta/pcs/voter/register/0.1/payload.js +2 -2
- package/dist/vta/pcs/voter/register/0.1/payload.js.map +1 -1
- package/dist/vtc/elections/create/0.1/payload.d.ts +4 -4
- package/dist/vtc/elections/create/0.1/payload.js +2 -2
- package/dist/vtc/elections/create/0.1/payload.js.map +1 -1
- package/dist/vtc/elections/show/0.1/payload.d.ts +4 -4
- package/dist/vtc/elections/show/0.1/payload.js +2 -2
- package/dist/vtc/elections/show/0.1/payload.js.map +1 -1
- package/package.json +1 -1
- package/src/_shared/components.ts +222 -4
- package/src/device/list/0.1/payload.ts +4 -2
- package/src/device/list/0.2/payload.ts +4 -2
- package/src/device/register/0.1/payload.ts +4 -2
- package/src/device/register/0.2/payload.ts +4 -2
- package/src/index.ts +13 -0
- package/src/voting/_shared/0.1/voting.ts +1 -1
- package/src/voting/ballot/cast-encrypted/0.1/payload.ts +735 -0
- package/src/voting/board/read/0.1/payload.ts +1519 -393
- package/src/voting/election/register/0.1/payload.ts +2 -2
- package/src/voting/election/show/0.1/payload.ts +2 -2
- package/src/voting/trustees/confirm/0.1/payload.ts +429 -0
- package/src/voting/trustees/deal/0.1/payload.ts +665 -0
- package/src/voting/trustees/decrypt/0.1/payload.ts +663 -0
- package/src/voting/trustees/enrol/0.1/payload.ts +525 -0
- package/src/voting/trustees/justify/0.1/payload.ts +439 -0
- package/src/voting/trustees/status/0.1/payload.ts +890 -0
- package/src/vta/pcs/trustee/deal/0.1/payload.ts +1250 -0
- package/src/vta/pcs/trustee/decrypt/0.1/payload.ts +489 -0
- package/src/vta/pcs/trustee/enrol/0.1/payload.ts +1107 -0
- package/src/vta/pcs/trustee/justify/0.1/payload.ts +341 -0
- package/src/vta/pcs/trustee/keys/0.1/payload.ts +1545 -0
- package/src/vta/pcs/vote/0.1/payload.ts +2 -2
- package/src/vta/pcs/vote-encrypted/0.1/payload.ts +1455 -0
- package/src/vta/pcs/voter/register/0.1/payload.ts +2 -2
- package/src/vtc/elections/create/0.1/payload.ts +2 -2
- package/src/vtc/elections/show/0.1/payload.ts +2 -2
|
@@ -0,0 +1,1166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/voting/ballot/cast-encrypted/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
import type { BoardHead, DigestMultibase, ElectionId, EncryptedCast, Ext, Multibase_VotingV0_1 as Multibase } from "../../../../_shared/components.js";
|
|
6
|
+
/**
|
|
7
|
+
* A voter casts a sealed or tallied-encrypted ballot, admitted by its PCS attestation and, when tallied-encrypted, by its proofs of validity.
|
|
8
|
+
*/
|
|
9
|
+
export interface VotingBallotCastEncryptedPayload {
|
|
10
|
+
/**
|
|
11
|
+
* The community's DID.
|
|
12
|
+
*/
|
|
13
|
+
community: string;
|
|
14
|
+
electionId: ElectionId;
|
|
15
|
+
cast: EncryptedCast;
|
|
16
|
+
ext?: Ext;
|
|
17
|
+
}
|
|
18
|
+
export interface VotingBallotCastEncryptedResponsePayload {
|
|
19
|
+
electionId: ElectionId;
|
|
20
|
+
/**
|
|
21
|
+
* As voting/ballot/cast.
|
|
22
|
+
*/
|
|
23
|
+
outcome: "counted" | "replaced" | "alreadyCounted";
|
|
24
|
+
/**
|
|
25
|
+
* The board index of this cast's `encryptedCast` entry.
|
|
26
|
+
*/
|
|
27
|
+
leafIndex: number;
|
|
28
|
+
entryHash: DigestMultibase;
|
|
29
|
+
head: BoardHead;
|
|
30
|
+
receiptToken: Multibase;
|
|
31
|
+
ext?: Ext;
|
|
32
|
+
}
|
|
33
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
34
|
+
export type { BoardHead, DigestMultibase, ElectionId, EncryptedCast, Ext, Multibase };
|
|
35
|
+
/** Trust Task type URI. */
|
|
36
|
+
export declare const TYPE_URI: "https://trusttasks.org/spec/voting/ballot/cast-encrypted/0.1";
|
|
37
|
+
/** Stable alias for this specification's request payload shape. */
|
|
38
|
+
export type Payload = VotingBallotCastEncryptedPayload;
|
|
39
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
40
|
+
export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/voting/ballot/cast-encrypted/0.1#response";
|
|
41
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
42
|
+
export type Response = VotingBallotCastEncryptedResponsePayload;
|
|
43
|
+
/**
|
|
44
|
+
* This specification's payload schema, as a value.
|
|
45
|
+
*
|
|
46
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
47
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
48
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
49
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
50
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
51
|
+
*/
|
|
52
|
+
export declare const PAYLOAD_SCHEMA: {
|
|
53
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
54
|
+
readonly $id: "https://trusttasks.org/spec/voting/ballot/cast-encrypted/0.1";
|
|
55
|
+
readonly title: "Voting — Ballot — Cast Encrypted — payload";
|
|
56
|
+
readonly description: "A voter casts a sealed or tallied-encrypted ballot, admitted by its PCS attestation and, when tallied-encrypted, by its proofs of validity.";
|
|
57
|
+
readonly type: "object";
|
|
58
|
+
readonly additionalProperties: false;
|
|
59
|
+
readonly required: readonly ["community", "electionId", "cast"];
|
|
60
|
+
readonly properties: {
|
|
61
|
+
readonly community: {
|
|
62
|
+
readonly type: "string";
|
|
63
|
+
readonly minLength: 1;
|
|
64
|
+
readonly maxLength: 2048;
|
|
65
|
+
readonly description: "The community's DID.";
|
|
66
|
+
};
|
|
67
|
+
readonly electionId: {
|
|
68
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
69
|
+
};
|
|
70
|
+
readonly cast: {
|
|
71
|
+
readonly $ref: "#/$defs/EncryptedCast";
|
|
72
|
+
};
|
|
73
|
+
readonly ext: {
|
|
74
|
+
readonly $ref: "#/$defs/Ext";
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
readonly $defs: {
|
|
78
|
+
readonly Response: {
|
|
79
|
+
readonly $anchor: "response";
|
|
80
|
+
readonly title: "Voting — Ballot — Cast Encrypted — response payload";
|
|
81
|
+
readonly type: "object";
|
|
82
|
+
readonly additionalProperties: false;
|
|
83
|
+
readonly required: readonly ["electionId", "outcome", "leafIndex", "entryHash", "head", "receiptToken"];
|
|
84
|
+
readonly properties: {
|
|
85
|
+
readonly electionId: {
|
|
86
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
87
|
+
};
|
|
88
|
+
readonly outcome: {
|
|
89
|
+
readonly type: "string";
|
|
90
|
+
readonly enum: readonly ["counted", "replaced", "alreadyCounted"];
|
|
91
|
+
readonly description: "As voting/ballot/cast.";
|
|
92
|
+
};
|
|
93
|
+
readonly leafIndex: {
|
|
94
|
+
readonly type: "integer";
|
|
95
|
+
readonly minimum: 0;
|
|
96
|
+
readonly description: "The board index of this cast's `encryptedCast` entry.";
|
|
97
|
+
};
|
|
98
|
+
readonly entryHash: {
|
|
99
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
100
|
+
};
|
|
101
|
+
readonly head: {
|
|
102
|
+
readonly $ref: "#/$defs/BoardHead";
|
|
103
|
+
};
|
|
104
|
+
readonly receiptToken: {
|
|
105
|
+
readonly $ref: "#/$defs/Multibase";
|
|
106
|
+
};
|
|
107
|
+
readonly ext: {
|
|
108
|
+
readonly $ref: "#/$defs/Ext";
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
readonly Ext: {
|
|
113
|
+
readonly title: "Ext";
|
|
114
|
+
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.";
|
|
115
|
+
readonly type: "object";
|
|
116
|
+
readonly minProperties: 1;
|
|
117
|
+
readonly additionalProperties: true;
|
|
118
|
+
readonly propertyNames: {
|
|
119
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
readonly Multibase: {
|
|
123
|
+
readonly title: "Multibase";
|
|
124
|
+
readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
|
|
125
|
+
readonly type: "string";
|
|
126
|
+
readonly maxLength: 16384;
|
|
127
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
128
|
+
};
|
|
129
|
+
readonly BoardHead: {
|
|
130
|
+
readonly title: "BoardHead";
|
|
131
|
+
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.";
|
|
132
|
+
readonly type: "object";
|
|
133
|
+
readonly additionalProperties: false;
|
|
134
|
+
readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
|
|
135
|
+
readonly properties: {
|
|
136
|
+
readonly electionId: {
|
|
137
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
138
|
+
};
|
|
139
|
+
readonly treeSize: {
|
|
140
|
+
readonly type: "integer";
|
|
141
|
+
readonly minimum: 0;
|
|
142
|
+
};
|
|
143
|
+
readonly rootHash: {
|
|
144
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
145
|
+
readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
|
|
146
|
+
};
|
|
147
|
+
readonly issuedAt: {
|
|
148
|
+
readonly type: "string";
|
|
149
|
+
readonly format: "date-time";
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
readonly ElectionId: {
|
|
154
|
+
readonly title: "ElectionId";
|
|
155
|
+
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.";
|
|
156
|
+
readonly type: "string";
|
|
157
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
|
|
158
|
+
};
|
|
159
|
+
readonly DigestMultibase: {
|
|
160
|
+
readonly title: "DigestMultibase";
|
|
161
|
+
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`.";
|
|
162
|
+
readonly type: "string";
|
|
163
|
+
readonly minLength: 16;
|
|
164
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
165
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
166
|
+
};
|
|
167
|
+
readonly EncryptedCast: {
|
|
168
|
+
readonly title: "EncryptedCast";
|
|
169
|
+
readonly description: "A cast of a sealed or tallied-encrypted election: exactly one of `sealed` (the Ballot's JCS bytes sealed to the election key) or `encrypted`, with the tag and the attestation over the JCS bytes of whichever is present (CONVENTIONS §3.6, §9.5).";
|
|
170
|
+
readonly type: "object";
|
|
171
|
+
readonly additionalProperties: false;
|
|
172
|
+
readonly required: readonly ["tag", "attestation"];
|
|
173
|
+
readonly properties: {
|
|
174
|
+
readonly sealed: {
|
|
175
|
+
readonly $ref: "#/$defs/SealedPayload";
|
|
176
|
+
};
|
|
177
|
+
readonly encrypted: {
|
|
178
|
+
readonly $ref: "#/$defs/EncryptedBallot";
|
|
179
|
+
};
|
|
180
|
+
readonly tag: {
|
|
181
|
+
readonly $ref: "#/$defs/Multibase";
|
|
182
|
+
};
|
|
183
|
+
readonly attestation: {
|
|
184
|
+
readonly $ref: "#/$defs/Multibase";
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
readonly oneOf: readonly [{
|
|
188
|
+
readonly required: readonly ["sealed"];
|
|
189
|
+
}, {
|
|
190
|
+
readonly required: readonly ["encrypted"];
|
|
191
|
+
}];
|
|
192
|
+
};
|
|
193
|
+
readonly EncryptedBallot: {
|
|
194
|
+
readonly title: "EncryptedBallot";
|
|
195
|
+
readonly description: "A tallied-encrypted ballot: one EncryptedQuestion per manifest question, in the manifest's order. Never decrypted (VTI-VOT-064).";
|
|
196
|
+
readonly type: "object";
|
|
197
|
+
readonly additionalProperties: false;
|
|
198
|
+
readonly required: readonly ["electionId", "manifestDigest", "questions"];
|
|
199
|
+
readonly properties: {
|
|
200
|
+
readonly electionId: {
|
|
201
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
202
|
+
};
|
|
203
|
+
readonly manifestDigest: {
|
|
204
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
205
|
+
};
|
|
206
|
+
readonly questions: {
|
|
207
|
+
readonly type: "array";
|
|
208
|
+
readonly minItems: 1;
|
|
209
|
+
readonly maxItems: 64;
|
|
210
|
+
readonly items: {
|
|
211
|
+
readonly $ref: "#/$defs/EncryptedQuestion";
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
readonly EncryptedQuestion: {
|
|
217
|
+
readonly title: "EncryptedQuestion";
|
|
218
|
+
readonly description: "One choice question of a tallied-encrypted ballot: per option, in the manifest's order, an encryption of 0 or 1 with its proof; and a proof that the selections sum to a count the question admits (CONVENTIONS §9.5).";
|
|
219
|
+
readonly type: "object";
|
|
220
|
+
readonly additionalProperties: false;
|
|
221
|
+
readonly required: readonly ["question", "options", "sumProof"];
|
|
222
|
+
readonly properties: {
|
|
223
|
+
readonly question: {
|
|
224
|
+
readonly $ref: "#/$defs/Key";
|
|
225
|
+
};
|
|
226
|
+
readonly options: {
|
|
227
|
+
readonly type: "array";
|
|
228
|
+
readonly minItems: 1;
|
|
229
|
+
readonly maxItems: 64;
|
|
230
|
+
readonly items: {
|
|
231
|
+
readonly $ref: "#/$defs/EncryptedOption";
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
readonly sumProof: {
|
|
235
|
+
readonly $ref: "#/$defs/DisjunctiveProof";
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
readonly DisjunctiveProof: {
|
|
240
|
+
readonly title: "DisjunctiveProof";
|
|
241
|
+
readonly description: "A disjunctive proof that a ciphertext encrypts one value of a public list: one `(c, z)` per value, in the list's order (CONVENTIONS §9.3).";
|
|
242
|
+
readonly type: "array";
|
|
243
|
+
readonly minItems: 1;
|
|
244
|
+
readonly maxItems: 65;
|
|
245
|
+
readonly items: {
|
|
246
|
+
readonly $ref: "#/$defs/SigmaProof";
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
readonly SigmaProof: {
|
|
250
|
+
readonly title: "SigmaProof";
|
|
251
|
+
readonly description: "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).";
|
|
252
|
+
readonly type: "object";
|
|
253
|
+
readonly additionalProperties: false;
|
|
254
|
+
readonly required: readonly ["c", "z"];
|
|
255
|
+
readonly properties: {
|
|
256
|
+
readonly c: {
|
|
257
|
+
readonly $ref: "#/$defs/GroupScalar";
|
|
258
|
+
};
|
|
259
|
+
readonly z: {
|
|
260
|
+
readonly $ref: "#/$defs/GroupScalar";
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
readonly GroupScalar: {
|
|
265
|
+
readonly title: "GroupScalar";
|
|
266
|
+
readonly description: "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).";
|
|
267
|
+
readonly type: "string";
|
|
268
|
+
readonly minLength: 2;
|
|
269
|
+
readonly maxLength: 64;
|
|
270
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
271
|
+
};
|
|
272
|
+
readonly EncryptedOption: {
|
|
273
|
+
readonly title: "EncryptedOption";
|
|
274
|
+
readonly type: "object";
|
|
275
|
+
readonly additionalProperties: false;
|
|
276
|
+
readonly required: readonly ["ciphertext", "proof"];
|
|
277
|
+
readonly properties: {
|
|
278
|
+
readonly ciphertext: {
|
|
279
|
+
readonly $ref: "#/$defs/ElGamalCiphertext";
|
|
280
|
+
};
|
|
281
|
+
readonly proof: {
|
|
282
|
+
readonly $ref: "#/$defs/DisjunctiveProof";
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
readonly ElGamalCiphertext: {
|
|
287
|
+
readonly title: "ElGamalCiphertext";
|
|
288
|
+
readonly description: "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).";
|
|
289
|
+
readonly type: "object";
|
|
290
|
+
readonly additionalProperties: false;
|
|
291
|
+
readonly required: readonly ["a", "b"];
|
|
292
|
+
readonly properties: {
|
|
293
|
+
readonly a: {
|
|
294
|
+
readonly $ref: "#/$defs/GroupElement";
|
|
295
|
+
};
|
|
296
|
+
readonly b: {
|
|
297
|
+
readonly $ref: "#/$defs/GroupElement";
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
readonly GroupElement: {
|
|
302
|
+
readonly title: "GroupElement";
|
|
303
|
+
readonly description: "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).";
|
|
304
|
+
readonly type: "string";
|
|
305
|
+
readonly minLength: 2;
|
|
306
|
+
readonly maxLength: 64;
|
|
307
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
308
|
+
};
|
|
309
|
+
readonly Key: {
|
|
310
|
+
readonly title: "Key";
|
|
311
|
+
readonly description: "A question or option key, unique within its manifest or question.";
|
|
312
|
+
readonly type: "string";
|
|
313
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
|
|
314
|
+
};
|
|
315
|
+
readonly SealedPayload: {
|
|
316
|
+
readonly title: "SealedPayload";
|
|
317
|
+
readonly description: "Bytes sealed to a key: a random group element encrypted as `kem`, and the bytes under ChaCha20-Poly1305 with a key derived from it, multibase base58btc (CONVENTIONS §9.4).";
|
|
318
|
+
readonly type: "object";
|
|
319
|
+
readonly additionalProperties: false;
|
|
320
|
+
readonly required: readonly ["kem", "body"];
|
|
321
|
+
readonly properties: {
|
|
322
|
+
readonly kem: {
|
|
323
|
+
readonly $ref: "#/$defs/ElGamalCiphertext";
|
|
324
|
+
};
|
|
325
|
+
readonly body: {
|
|
326
|
+
readonly type: "string";
|
|
327
|
+
readonly minLength: 2;
|
|
328
|
+
readonly maxLength: 131072;
|
|
329
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
330
|
+
};
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
};
|
|
335
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
336
|
+
export declare const RESPONSE_PAYLOAD_SCHEMA: {
|
|
337
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
338
|
+
readonly $ref: "#/$defs/Response";
|
|
339
|
+
readonly $defs: {
|
|
340
|
+
readonly Response: {
|
|
341
|
+
readonly $anchor: "response";
|
|
342
|
+
readonly title: "Voting — Ballot — Cast Encrypted — response payload";
|
|
343
|
+
readonly type: "object";
|
|
344
|
+
readonly additionalProperties: false;
|
|
345
|
+
readonly required: readonly ["electionId", "outcome", "leafIndex", "entryHash", "head", "receiptToken"];
|
|
346
|
+
readonly properties: {
|
|
347
|
+
readonly electionId: {
|
|
348
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
349
|
+
};
|
|
350
|
+
readonly outcome: {
|
|
351
|
+
readonly type: "string";
|
|
352
|
+
readonly enum: readonly ["counted", "replaced", "alreadyCounted"];
|
|
353
|
+
readonly description: "As voting/ballot/cast.";
|
|
354
|
+
};
|
|
355
|
+
readonly leafIndex: {
|
|
356
|
+
readonly type: "integer";
|
|
357
|
+
readonly minimum: 0;
|
|
358
|
+
readonly description: "The board index of this cast's `encryptedCast` entry.";
|
|
359
|
+
};
|
|
360
|
+
readonly entryHash: {
|
|
361
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
362
|
+
};
|
|
363
|
+
readonly head: {
|
|
364
|
+
readonly $ref: "#/$defs/BoardHead";
|
|
365
|
+
};
|
|
366
|
+
readonly receiptToken: {
|
|
367
|
+
readonly $ref: "#/$defs/Multibase";
|
|
368
|
+
};
|
|
369
|
+
readonly ext: {
|
|
370
|
+
readonly $ref: "#/$defs/Ext";
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
readonly Ext: {
|
|
375
|
+
readonly title: "Ext";
|
|
376
|
+
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.";
|
|
377
|
+
readonly type: "object";
|
|
378
|
+
readonly minProperties: 1;
|
|
379
|
+
readonly additionalProperties: true;
|
|
380
|
+
readonly propertyNames: {
|
|
381
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
382
|
+
};
|
|
383
|
+
};
|
|
384
|
+
readonly Multibase: {
|
|
385
|
+
readonly title: "Multibase";
|
|
386
|
+
readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
|
|
387
|
+
readonly type: "string";
|
|
388
|
+
readonly maxLength: 16384;
|
|
389
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
390
|
+
};
|
|
391
|
+
readonly BoardHead: {
|
|
392
|
+
readonly title: "BoardHead";
|
|
393
|
+
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.";
|
|
394
|
+
readonly type: "object";
|
|
395
|
+
readonly additionalProperties: false;
|
|
396
|
+
readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
|
|
397
|
+
readonly properties: {
|
|
398
|
+
readonly electionId: {
|
|
399
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
400
|
+
};
|
|
401
|
+
readonly treeSize: {
|
|
402
|
+
readonly type: "integer";
|
|
403
|
+
readonly minimum: 0;
|
|
404
|
+
};
|
|
405
|
+
readonly rootHash: {
|
|
406
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
407
|
+
readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
|
|
408
|
+
};
|
|
409
|
+
readonly issuedAt: {
|
|
410
|
+
readonly type: "string";
|
|
411
|
+
readonly format: "date-time";
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
readonly ElectionId: {
|
|
416
|
+
readonly title: "ElectionId";
|
|
417
|
+
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.";
|
|
418
|
+
readonly type: "string";
|
|
419
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
|
|
420
|
+
};
|
|
421
|
+
readonly DigestMultibase: {
|
|
422
|
+
readonly title: "DigestMultibase";
|
|
423
|
+
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`.";
|
|
424
|
+
readonly type: "string";
|
|
425
|
+
readonly minLength: 16;
|
|
426
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
427
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
428
|
+
};
|
|
429
|
+
readonly EncryptedCast: {
|
|
430
|
+
readonly title: "EncryptedCast";
|
|
431
|
+
readonly description: "A cast of a sealed or tallied-encrypted election: exactly one of `sealed` (the Ballot's JCS bytes sealed to the election key) or `encrypted`, with the tag and the attestation over the JCS bytes of whichever is present (CONVENTIONS §3.6, §9.5).";
|
|
432
|
+
readonly type: "object";
|
|
433
|
+
readonly additionalProperties: false;
|
|
434
|
+
readonly required: readonly ["tag", "attestation"];
|
|
435
|
+
readonly properties: {
|
|
436
|
+
readonly sealed: {
|
|
437
|
+
readonly $ref: "#/$defs/SealedPayload";
|
|
438
|
+
};
|
|
439
|
+
readonly encrypted: {
|
|
440
|
+
readonly $ref: "#/$defs/EncryptedBallot";
|
|
441
|
+
};
|
|
442
|
+
readonly tag: {
|
|
443
|
+
readonly $ref: "#/$defs/Multibase";
|
|
444
|
+
};
|
|
445
|
+
readonly attestation: {
|
|
446
|
+
readonly $ref: "#/$defs/Multibase";
|
|
447
|
+
};
|
|
448
|
+
};
|
|
449
|
+
readonly oneOf: readonly [{
|
|
450
|
+
readonly required: readonly ["sealed"];
|
|
451
|
+
}, {
|
|
452
|
+
readonly required: readonly ["encrypted"];
|
|
453
|
+
}];
|
|
454
|
+
};
|
|
455
|
+
readonly EncryptedBallot: {
|
|
456
|
+
readonly title: "EncryptedBallot";
|
|
457
|
+
readonly description: "A tallied-encrypted ballot: one EncryptedQuestion per manifest question, in the manifest's order. Never decrypted (VTI-VOT-064).";
|
|
458
|
+
readonly type: "object";
|
|
459
|
+
readonly additionalProperties: false;
|
|
460
|
+
readonly required: readonly ["electionId", "manifestDigest", "questions"];
|
|
461
|
+
readonly properties: {
|
|
462
|
+
readonly electionId: {
|
|
463
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
464
|
+
};
|
|
465
|
+
readonly manifestDigest: {
|
|
466
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
467
|
+
};
|
|
468
|
+
readonly questions: {
|
|
469
|
+
readonly type: "array";
|
|
470
|
+
readonly minItems: 1;
|
|
471
|
+
readonly maxItems: 64;
|
|
472
|
+
readonly items: {
|
|
473
|
+
readonly $ref: "#/$defs/EncryptedQuestion";
|
|
474
|
+
};
|
|
475
|
+
};
|
|
476
|
+
};
|
|
477
|
+
};
|
|
478
|
+
readonly EncryptedQuestion: {
|
|
479
|
+
readonly title: "EncryptedQuestion";
|
|
480
|
+
readonly description: "One choice question of a tallied-encrypted ballot: per option, in the manifest's order, an encryption of 0 or 1 with its proof; and a proof that the selections sum to a count the question admits (CONVENTIONS §9.5).";
|
|
481
|
+
readonly type: "object";
|
|
482
|
+
readonly additionalProperties: false;
|
|
483
|
+
readonly required: readonly ["question", "options", "sumProof"];
|
|
484
|
+
readonly properties: {
|
|
485
|
+
readonly question: {
|
|
486
|
+
readonly $ref: "#/$defs/Key";
|
|
487
|
+
};
|
|
488
|
+
readonly options: {
|
|
489
|
+
readonly type: "array";
|
|
490
|
+
readonly minItems: 1;
|
|
491
|
+
readonly maxItems: 64;
|
|
492
|
+
readonly items: {
|
|
493
|
+
readonly $ref: "#/$defs/EncryptedOption";
|
|
494
|
+
};
|
|
495
|
+
};
|
|
496
|
+
readonly sumProof: {
|
|
497
|
+
readonly $ref: "#/$defs/DisjunctiveProof";
|
|
498
|
+
};
|
|
499
|
+
};
|
|
500
|
+
};
|
|
501
|
+
readonly DisjunctiveProof: {
|
|
502
|
+
readonly title: "DisjunctiveProof";
|
|
503
|
+
readonly description: "A disjunctive proof that a ciphertext encrypts one value of a public list: one `(c, z)` per value, in the list's order (CONVENTIONS §9.3).";
|
|
504
|
+
readonly type: "array";
|
|
505
|
+
readonly minItems: 1;
|
|
506
|
+
readonly maxItems: 65;
|
|
507
|
+
readonly items: {
|
|
508
|
+
readonly $ref: "#/$defs/SigmaProof";
|
|
509
|
+
};
|
|
510
|
+
};
|
|
511
|
+
readonly SigmaProof: {
|
|
512
|
+
readonly title: "SigmaProof";
|
|
513
|
+
readonly description: "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).";
|
|
514
|
+
readonly type: "object";
|
|
515
|
+
readonly additionalProperties: false;
|
|
516
|
+
readonly required: readonly ["c", "z"];
|
|
517
|
+
readonly properties: {
|
|
518
|
+
readonly c: {
|
|
519
|
+
readonly $ref: "#/$defs/GroupScalar";
|
|
520
|
+
};
|
|
521
|
+
readonly z: {
|
|
522
|
+
readonly $ref: "#/$defs/GroupScalar";
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
readonly GroupScalar: {
|
|
527
|
+
readonly title: "GroupScalar";
|
|
528
|
+
readonly description: "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).";
|
|
529
|
+
readonly type: "string";
|
|
530
|
+
readonly minLength: 2;
|
|
531
|
+
readonly maxLength: 64;
|
|
532
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
533
|
+
};
|
|
534
|
+
readonly EncryptedOption: {
|
|
535
|
+
readonly title: "EncryptedOption";
|
|
536
|
+
readonly type: "object";
|
|
537
|
+
readonly additionalProperties: false;
|
|
538
|
+
readonly required: readonly ["ciphertext", "proof"];
|
|
539
|
+
readonly properties: {
|
|
540
|
+
readonly ciphertext: {
|
|
541
|
+
readonly $ref: "#/$defs/ElGamalCiphertext";
|
|
542
|
+
};
|
|
543
|
+
readonly proof: {
|
|
544
|
+
readonly $ref: "#/$defs/DisjunctiveProof";
|
|
545
|
+
};
|
|
546
|
+
};
|
|
547
|
+
};
|
|
548
|
+
readonly ElGamalCiphertext: {
|
|
549
|
+
readonly title: "ElGamalCiphertext";
|
|
550
|
+
readonly description: "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).";
|
|
551
|
+
readonly type: "object";
|
|
552
|
+
readonly additionalProperties: false;
|
|
553
|
+
readonly required: readonly ["a", "b"];
|
|
554
|
+
readonly properties: {
|
|
555
|
+
readonly a: {
|
|
556
|
+
readonly $ref: "#/$defs/GroupElement";
|
|
557
|
+
};
|
|
558
|
+
readonly b: {
|
|
559
|
+
readonly $ref: "#/$defs/GroupElement";
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
};
|
|
563
|
+
readonly GroupElement: {
|
|
564
|
+
readonly title: "GroupElement";
|
|
565
|
+
readonly description: "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).";
|
|
566
|
+
readonly type: "string";
|
|
567
|
+
readonly minLength: 2;
|
|
568
|
+
readonly maxLength: 64;
|
|
569
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
570
|
+
};
|
|
571
|
+
readonly Key: {
|
|
572
|
+
readonly title: "Key";
|
|
573
|
+
readonly description: "A question or option key, unique within its manifest or question.";
|
|
574
|
+
readonly type: "string";
|
|
575
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
|
|
576
|
+
};
|
|
577
|
+
readonly SealedPayload: {
|
|
578
|
+
readonly title: "SealedPayload";
|
|
579
|
+
readonly description: "Bytes sealed to a key: a random group element encrypted as `kem`, and the bytes under ChaCha20-Poly1305 with a key derived from it, multibase base58btc (CONVENTIONS §9.4).";
|
|
580
|
+
readonly type: "object";
|
|
581
|
+
readonly additionalProperties: false;
|
|
582
|
+
readonly required: readonly ["kem", "body"];
|
|
583
|
+
readonly properties: {
|
|
584
|
+
readonly kem: {
|
|
585
|
+
readonly $ref: "#/$defs/ElGamalCiphertext";
|
|
586
|
+
};
|
|
587
|
+
readonly body: {
|
|
588
|
+
readonly type: "string";
|
|
589
|
+
readonly minLength: 2;
|
|
590
|
+
readonly maxLength: 131072;
|
|
591
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
592
|
+
};
|
|
593
|
+
};
|
|
594
|
+
};
|
|
595
|
+
};
|
|
596
|
+
};
|
|
597
|
+
/**
|
|
598
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
599
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
600
|
+
* per-specification and cannot be derived from the document alone, and
|
|
601
|
+
* item 2 needs the schema this carries.
|
|
602
|
+
*/
|
|
603
|
+
export declare const SPEC: {
|
|
604
|
+
readonly typeUri: "https://trusttasks.org/spec/voting/ballot/cast-encrypted/0.1";
|
|
605
|
+
readonly isBearer: false;
|
|
606
|
+
readonly isProofRequired: true;
|
|
607
|
+
readonly isRecipientRequired: true;
|
|
608
|
+
readonly isIssuedAtRequired: true;
|
|
609
|
+
readonly payloadSchema: {
|
|
610
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
611
|
+
readonly $id: "https://trusttasks.org/spec/voting/ballot/cast-encrypted/0.1";
|
|
612
|
+
readonly title: "Voting — Ballot — Cast Encrypted — payload";
|
|
613
|
+
readonly description: "A voter casts a sealed or tallied-encrypted ballot, admitted by its PCS attestation and, when tallied-encrypted, by its proofs of validity.";
|
|
614
|
+
readonly type: "object";
|
|
615
|
+
readonly additionalProperties: false;
|
|
616
|
+
readonly required: readonly ["community", "electionId", "cast"];
|
|
617
|
+
readonly properties: {
|
|
618
|
+
readonly community: {
|
|
619
|
+
readonly type: "string";
|
|
620
|
+
readonly minLength: 1;
|
|
621
|
+
readonly maxLength: 2048;
|
|
622
|
+
readonly description: "The community's DID.";
|
|
623
|
+
};
|
|
624
|
+
readonly electionId: {
|
|
625
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
626
|
+
};
|
|
627
|
+
readonly cast: {
|
|
628
|
+
readonly $ref: "#/$defs/EncryptedCast";
|
|
629
|
+
};
|
|
630
|
+
readonly ext: {
|
|
631
|
+
readonly $ref: "#/$defs/Ext";
|
|
632
|
+
};
|
|
633
|
+
};
|
|
634
|
+
readonly $defs: {
|
|
635
|
+
readonly Response: {
|
|
636
|
+
readonly $anchor: "response";
|
|
637
|
+
readonly title: "Voting — Ballot — Cast Encrypted — response payload";
|
|
638
|
+
readonly type: "object";
|
|
639
|
+
readonly additionalProperties: false;
|
|
640
|
+
readonly required: readonly ["electionId", "outcome", "leafIndex", "entryHash", "head", "receiptToken"];
|
|
641
|
+
readonly properties: {
|
|
642
|
+
readonly electionId: {
|
|
643
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
644
|
+
};
|
|
645
|
+
readonly outcome: {
|
|
646
|
+
readonly type: "string";
|
|
647
|
+
readonly enum: readonly ["counted", "replaced", "alreadyCounted"];
|
|
648
|
+
readonly description: "As voting/ballot/cast.";
|
|
649
|
+
};
|
|
650
|
+
readonly leafIndex: {
|
|
651
|
+
readonly type: "integer";
|
|
652
|
+
readonly minimum: 0;
|
|
653
|
+
readonly description: "The board index of this cast's `encryptedCast` entry.";
|
|
654
|
+
};
|
|
655
|
+
readonly entryHash: {
|
|
656
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
657
|
+
};
|
|
658
|
+
readonly head: {
|
|
659
|
+
readonly $ref: "#/$defs/BoardHead";
|
|
660
|
+
};
|
|
661
|
+
readonly receiptToken: {
|
|
662
|
+
readonly $ref: "#/$defs/Multibase";
|
|
663
|
+
};
|
|
664
|
+
readonly ext: {
|
|
665
|
+
readonly $ref: "#/$defs/Ext";
|
|
666
|
+
};
|
|
667
|
+
};
|
|
668
|
+
};
|
|
669
|
+
readonly Ext: {
|
|
670
|
+
readonly title: "Ext";
|
|
671
|
+
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.";
|
|
672
|
+
readonly type: "object";
|
|
673
|
+
readonly minProperties: 1;
|
|
674
|
+
readonly additionalProperties: true;
|
|
675
|
+
readonly propertyNames: {
|
|
676
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
677
|
+
};
|
|
678
|
+
};
|
|
679
|
+
readonly Multibase: {
|
|
680
|
+
readonly title: "Multibase";
|
|
681
|
+
readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
|
|
682
|
+
readonly type: "string";
|
|
683
|
+
readonly maxLength: 16384;
|
|
684
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
685
|
+
};
|
|
686
|
+
readonly BoardHead: {
|
|
687
|
+
readonly title: "BoardHead";
|
|
688
|
+
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.";
|
|
689
|
+
readonly type: "object";
|
|
690
|
+
readonly additionalProperties: false;
|
|
691
|
+
readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
|
|
692
|
+
readonly properties: {
|
|
693
|
+
readonly electionId: {
|
|
694
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
695
|
+
};
|
|
696
|
+
readonly treeSize: {
|
|
697
|
+
readonly type: "integer";
|
|
698
|
+
readonly minimum: 0;
|
|
699
|
+
};
|
|
700
|
+
readonly rootHash: {
|
|
701
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
702
|
+
readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
|
|
703
|
+
};
|
|
704
|
+
readonly issuedAt: {
|
|
705
|
+
readonly type: "string";
|
|
706
|
+
readonly format: "date-time";
|
|
707
|
+
};
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
readonly ElectionId: {
|
|
711
|
+
readonly title: "ElectionId";
|
|
712
|
+
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.";
|
|
713
|
+
readonly type: "string";
|
|
714
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
|
|
715
|
+
};
|
|
716
|
+
readonly DigestMultibase: {
|
|
717
|
+
readonly title: "DigestMultibase";
|
|
718
|
+
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`.";
|
|
719
|
+
readonly type: "string";
|
|
720
|
+
readonly minLength: 16;
|
|
721
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
722
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
723
|
+
};
|
|
724
|
+
readonly EncryptedCast: {
|
|
725
|
+
readonly title: "EncryptedCast";
|
|
726
|
+
readonly description: "A cast of a sealed or tallied-encrypted election: exactly one of `sealed` (the Ballot's JCS bytes sealed to the election key) or `encrypted`, with the tag and the attestation over the JCS bytes of whichever is present (CONVENTIONS §3.6, §9.5).";
|
|
727
|
+
readonly type: "object";
|
|
728
|
+
readonly additionalProperties: false;
|
|
729
|
+
readonly required: readonly ["tag", "attestation"];
|
|
730
|
+
readonly properties: {
|
|
731
|
+
readonly sealed: {
|
|
732
|
+
readonly $ref: "#/$defs/SealedPayload";
|
|
733
|
+
};
|
|
734
|
+
readonly encrypted: {
|
|
735
|
+
readonly $ref: "#/$defs/EncryptedBallot";
|
|
736
|
+
};
|
|
737
|
+
readonly tag: {
|
|
738
|
+
readonly $ref: "#/$defs/Multibase";
|
|
739
|
+
};
|
|
740
|
+
readonly attestation: {
|
|
741
|
+
readonly $ref: "#/$defs/Multibase";
|
|
742
|
+
};
|
|
743
|
+
};
|
|
744
|
+
readonly oneOf: readonly [{
|
|
745
|
+
readonly required: readonly ["sealed"];
|
|
746
|
+
}, {
|
|
747
|
+
readonly required: readonly ["encrypted"];
|
|
748
|
+
}];
|
|
749
|
+
};
|
|
750
|
+
readonly EncryptedBallot: {
|
|
751
|
+
readonly title: "EncryptedBallot";
|
|
752
|
+
readonly description: "A tallied-encrypted ballot: one EncryptedQuestion per manifest question, in the manifest's order. Never decrypted (VTI-VOT-064).";
|
|
753
|
+
readonly type: "object";
|
|
754
|
+
readonly additionalProperties: false;
|
|
755
|
+
readonly required: readonly ["electionId", "manifestDigest", "questions"];
|
|
756
|
+
readonly properties: {
|
|
757
|
+
readonly electionId: {
|
|
758
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
759
|
+
};
|
|
760
|
+
readonly manifestDigest: {
|
|
761
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
762
|
+
};
|
|
763
|
+
readonly questions: {
|
|
764
|
+
readonly type: "array";
|
|
765
|
+
readonly minItems: 1;
|
|
766
|
+
readonly maxItems: 64;
|
|
767
|
+
readonly items: {
|
|
768
|
+
readonly $ref: "#/$defs/EncryptedQuestion";
|
|
769
|
+
};
|
|
770
|
+
};
|
|
771
|
+
};
|
|
772
|
+
};
|
|
773
|
+
readonly EncryptedQuestion: {
|
|
774
|
+
readonly title: "EncryptedQuestion";
|
|
775
|
+
readonly description: "One choice question of a tallied-encrypted ballot: per option, in the manifest's order, an encryption of 0 or 1 with its proof; and a proof that the selections sum to a count the question admits (CONVENTIONS §9.5).";
|
|
776
|
+
readonly type: "object";
|
|
777
|
+
readonly additionalProperties: false;
|
|
778
|
+
readonly required: readonly ["question", "options", "sumProof"];
|
|
779
|
+
readonly properties: {
|
|
780
|
+
readonly question: {
|
|
781
|
+
readonly $ref: "#/$defs/Key";
|
|
782
|
+
};
|
|
783
|
+
readonly options: {
|
|
784
|
+
readonly type: "array";
|
|
785
|
+
readonly minItems: 1;
|
|
786
|
+
readonly maxItems: 64;
|
|
787
|
+
readonly items: {
|
|
788
|
+
readonly $ref: "#/$defs/EncryptedOption";
|
|
789
|
+
};
|
|
790
|
+
};
|
|
791
|
+
readonly sumProof: {
|
|
792
|
+
readonly $ref: "#/$defs/DisjunctiveProof";
|
|
793
|
+
};
|
|
794
|
+
};
|
|
795
|
+
};
|
|
796
|
+
readonly DisjunctiveProof: {
|
|
797
|
+
readonly title: "DisjunctiveProof";
|
|
798
|
+
readonly description: "A disjunctive proof that a ciphertext encrypts one value of a public list: one `(c, z)` per value, in the list's order (CONVENTIONS §9.3).";
|
|
799
|
+
readonly type: "array";
|
|
800
|
+
readonly minItems: 1;
|
|
801
|
+
readonly maxItems: 65;
|
|
802
|
+
readonly items: {
|
|
803
|
+
readonly $ref: "#/$defs/SigmaProof";
|
|
804
|
+
};
|
|
805
|
+
};
|
|
806
|
+
readonly SigmaProof: {
|
|
807
|
+
readonly title: "SigmaProof";
|
|
808
|
+
readonly description: "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).";
|
|
809
|
+
readonly type: "object";
|
|
810
|
+
readonly additionalProperties: false;
|
|
811
|
+
readonly required: readonly ["c", "z"];
|
|
812
|
+
readonly properties: {
|
|
813
|
+
readonly c: {
|
|
814
|
+
readonly $ref: "#/$defs/GroupScalar";
|
|
815
|
+
};
|
|
816
|
+
readonly z: {
|
|
817
|
+
readonly $ref: "#/$defs/GroupScalar";
|
|
818
|
+
};
|
|
819
|
+
};
|
|
820
|
+
};
|
|
821
|
+
readonly GroupScalar: {
|
|
822
|
+
readonly title: "GroupScalar";
|
|
823
|
+
readonly description: "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).";
|
|
824
|
+
readonly type: "string";
|
|
825
|
+
readonly minLength: 2;
|
|
826
|
+
readonly maxLength: 64;
|
|
827
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
828
|
+
};
|
|
829
|
+
readonly EncryptedOption: {
|
|
830
|
+
readonly title: "EncryptedOption";
|
|
831
|
+
readonly type: "object";
|
|
832
|
+
readonly additionalProperties: false;
|
|
833
|
+
readonly required: readonly ["ciphertext", "proof"];
|
|
834
|
+
readonly properties: {
|
|
835
|
+
readonly ciphertext: {
|
|
836
|
+
readonly $ref: "#/$defs/ElGamalCiphertext";
|
|
837
|
+
};
|
|
838
|
+
readonly proof: {
|
|
839
|
+
readonly $ref: "#/$defs/DisjunctiveProof";
|
|
840
|
+
};
|
|
841
|
+
};
|
|
842
|
+
};
|
|
843
|
+
readonly ElGamalCiphertext: {
|
|
844
|
+
readonly title: "ElGamalCiphertext";
|
|
845
|
+
readonly description: "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).";
|
|
846
|
+
readonly type: "object";
|
|
847
|
+
readonly additionalProperties: false;
|
|
848
|
+
readonly required: readonly ["a", "b"];
|
|
849
|
+
readonly properties: {
|
|
850
|
+
readonly a: {
|
|
851
|
+
readonly $ref: "#/$defs/GroupElement";
|
|
852
|
+
};
|
|
853
|
+
readonly b: {
|
|
854
|
+
readonly $ref: "#/$defs/GroupElement";
|
|
855
|
+
};
|
|
856
|
+
};
|
|
857
|
+
};
|
|
858
|
+
readonly GroupElement: {
|
|
859
|
+
readonly title: "GroupElement";
|
|
860
|
+
readonly description: "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).";
|
|
861
|
+
readonly type: "string";
|
|
862
|
+
readonly minLength: 2;
|
|
863
|
+
readonly maxLength: 64;
|
|
864
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
865
|
+
};
|
|
866
|
+
readonly Key: {
|
|
867
|
+
readonly title: "Key";
|
|
868
|
+
readonly description: "A question or option key, unique within its manifest or question.";
|
|
869
|
+
readonly type: "string";
|
|
870
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
|
|
871
|
+
};
|
|
872
|
+
readonly SealedPayload: {
|
|
873
|
+
readonly title: "SealedPayload";
|
|
874
|
+
readonly description: "Bytes sealed to a key: a random group element encrypted as `kem`, and the bytes under ChaCha20-Poly1305 with a key derived from it, multibase base58btc (CONVENTIONS §9.4).";
|
|
875
|
+
readonly type: "object";
|
|
876
|
+
readonly additionalProperties: false;
|
|
877
|
+
readonly required: readonly ["kem", "body"];
|
|
878
|
+
readonly properties: {
|
|
879
|
+
readonly kem: {
|
|
880
|
+
readonly $ref: "#/$defs/ElGamalCiphertext";
|
|
881
|
+
};
|
|
882
|
+
readonly body: {
|
|
883
|
+
readonly type: "string";
|
|
884
|
+
readonly minLength: 2;
|
|
885
|
+
readonly maxLength: 131072;
|
|
886
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
887
|
+
};
|
|
888
|
+
};
|
|
889
|
+
};
|
|
890
|
+
};
|
|
891
|
+
};
|
|
892
|
+
};
|
|
893
|
+
/**
|
|
894
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
895
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
896
|
+
* parties (§7.3 item 5).
|
|
897
|
+
*/
|
|
898
|
+
export declare const RESPONSE_SPEC: {
|
|
899
|
+
readonly typeUri: "https://trusttasks.org/spec/voting/ballot/cast-encrypted/0.1#response";
|
|
900
|
+
readonly isBearer: false;
|
|
901
|
+
readonly isProofRequired: true;
|
|
902
|
+
readonly isRecipientRequired: true;
|
|
903
|
+
readonly isIssuedAtRequired: true;
|
|
904
|
+
readonly payloadSchema: {
|
|
905
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
906
|
+
readonly $ref: "#/$defs/Response";
|
|
907
|
+
readonly $defs: {
|
|
908
|
+
readonly Response: {
|
|
909
|
+
readonly $anchor: "response";
|
|
910
|
+
readonly title: "Voting — Ballot — Cast Encrypted — response payload";
|
|
911
|
+
readonly type: "object";
|
|
912
|
+
readonly additionalProperties: false;
|
|
913
|
+
readonly required: readonly ["electionId", "outcome", "leafIndex", "entryHash", "head", "receiptToken"];
|
|
914
|
+
readonly properties: {
|
|
915
|
+
readonly electionId: {
|
|
916
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
917
|
+
};
|
|
918
|
+
readonly outcome: {
|
|
919
|
+
readonly type: "string";
|
|
920
|
+
readonly enum: readonly ["counted", "replaced", "alreadyCounted"];
|
|
921
|
+
readonly description: "As voting/ballot/cast.";
|
|
922
|
+
};
|
|
923
|
+
readonly leafIndex: {
|
|
924
|
+
readonly type: "integer";
|
|
925
|
+
readonly minimum: 0;
|
|
926
|
+
readonly description: "The board index of this cast's `encryptedCast` entry.";
|
|
927
|
+
};
|
|
928
|
+
readonly entryHash: {
|
|
929
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
930
|
+
};
|
|
931
|
+
readonly head: {
|
|
932
|
+
readonly $ref: "#/$defs/BoardHead";
|
|
933
|
+
};
|
|
934
|
+
readonly receiptToken: {
|
|
935
|
+
readonly $ref: "#/$defs/Multibase";
|
|
936
|
+
};
|
|
937
|
+
readonly ext: {
|
|
938
|
+
readonly $ref: "#/$defs/Ext";
|
|
939
|
+
};
|
|
940
|
+
};
|
|
941
|
+
};
|
|
942
|
+
readonly Ext: {
|
|
943
|
+
readonly title: "Ext";
|
|
944
|
+
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.";
|
|
945
|
+
readonly type: "object";
|
|
946
|
+
readonly minProperties: 1;
|
|
947
|
+
readonly additionalProperties: true;
|
|
948
|
+
readonly propertyNames: {
|
|
949
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
950
|
+
};
|
|
951
|
+
};
|
|
952
|
+
readonly Multibase: {
|
|
953
|
+
readonly title: "Multibase";
|
|
954
|
+
readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
|
|
955
|
+
readonly type: "string";
|
|
956
|
+
readonly maxLength: 16384;
|
|
957
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
958
|
+
};
|
|
959
|
+
readonly BoardHead: {
|
|
960
|
+
readonly title: "BoardHead";
|
|
961
|
+
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.";
|
|
962
|
+
readonly type: "object";
|
|
963
|
+
readonly additionalProperties: false;
|
|
964
|
+
readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
|
|
965
|
+
readonly properties: {
|
|
966
|
+
readonly electionId: {
|
|
967
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
968
|
+
};
|
|
969
|
+
readonly treeSize: {
|
|
970
|
+
readonly type: "integer";
|
|
971
|
+
readonly minimum: 0;
|
|
972
|
+
};
|
|
973
|
+
readonly rootHash: {
|
|
974
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
975
|
+
readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
|
|
976
|
+
};
|
|
977
|
+
readonly issuedAt: {
|
|
978
|
+
readonly type: "string";
|
|
979
|
+
readonly format: "date-time";
|
|
980
|
+
};
|
|
981
|
+
};
|
|
982
|
+
};
|
|
983
|
+
readonly ElectionId: {
|
|
984
|
+
readonly title: "ElectionId";
|
|
985
|
+
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.";
|
|
986
|
+
readonly type: "string";
|
|
987
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
|
|
988
|
+
};
|
|
989
|
+
readonly DigestMultibase: {
|
|
990
|
+
readonly title: "DigestMultibase";
|
|
991
|
+
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`.";
|
|
992
|
+
readonly type: "string";
|
|
993
|
+
readonly minLength: 16;
|
|
994
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
995
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
996
|
+
};
|
|
997
|
+
readonly EncryptedCast: {
|
|
998
|
+
readonly title: "EncryptedCast";
|
|
999
|
+
readonly description: "A cast of a sealed or tallied-encrypted election: exactly one of `sealed` (the Ballot's JCS bytes sealed to the election key) or `encrypted`, with the tag and the attestation over the JCS bytes of whichever is present (CONVENTIONS §3.6, §9.5).";
|
|
1000
|
+
readonly type: "object";
|
|
1001
|
+
readonly additionalProperties: false;
|
|
1002
|
+
readonly required: readonly ["tag", "attestation"];
|
|
1003
|
+
readonly properties: {
|
|
1004
|
+
readonly sealed: {
|
|
1005
|
+
readonly $ref: "#/$defs/SealedPayload";
|
|
1006
|
+
};
|
|
1007
|
+
readonly encrypted: {
|
|
1008
|
+
readonly $ref: "#/$defs/EncryptedBallot";
|
|
1009
|
+
};
|
|
1010
|
+
readonly tag: {
|
|
1011
|
+
readonly $ref: "#/$defs/Multibase";
|
|
1012
|
+
};
|
|
1013
|
+
readonly attestation: {
|
|
1014
|
+
readonly $ref: "#/$defs/Multibase";
|
|
1015
|
+
};
|
|
1016
|
+
};
|
|
1017
|
+
readonly oneOf: readonly [{
|
|
1018
|
+
readonly required: readonly ["sealed"];
|
|
1019
|
+
}, {
|
|
1020
|
+
readonly required: readonly ["encrypted"];
|
|
1021
|
+
}];
|
|
1022
|
+
};
|
|
1023
|
+
readonly EncryptedBallot: {
|
|
1024
|
+
readonly title: "EncryptedBallot";
|
|
1025
|
+
readonly description: "A tallied-encrypted ballot: one EncryptedQuestion per manifest question, in the manifest's order. Never decrypted (VTI-VOT-064).";
|
|
1026
|
+
readonly type: "object";
|
|
1027
|
+
readonly additionalProperties: false;
|
|
1028
|
+
readonly required: readonly ["electionId", "manifestDigest", "questions"];
|
|
1029
|
+
readonly properties: {
|
|
1030
|
+
readonly electionId: {
|
|
1031
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
1032
|
+
};
|
|
1033
|
+
readonly manifestDigest: {
|
|
1034
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
1035
|
+
};
|
|
1036
|
+
readonly questions: {
|
|
1037
|
+
readonly type: "array";
|
|
1038
|
+
readonly minItems: 1;
|
|
1039
|
+
readonly maxItems: 64;
|
|
1040
|
+
readonly items: {
|
|
1041
|
+
readonly $ref: "#/$defs/EncryptedQuestion";
|
|
1042
|
+
};
|
|
1043
|
+
};
|
|
1044
|
+
};
|
|
1045
|
+
};
|
|
1046
|
+
readonly EncryptedQuestion: {
|
|
1047
|
+
readonly title: "EncryptedQuestion";
|
|
1048
|
+
readonly description: "One choice question of a tallied-encrypted ballot: per option, in the manifest's order, an encryption of 0 or 1 with its proof; and a proof that the selections sum to a count the question admits (CONVENTIONS §9.5).";
|
|
1049
|
+
readonly type: "object";
|
|
1050
|
+
readonly additionalProperties: false;
|
|
1051
|
+
readonly required: readonly ["question", "options", "sumProof"];
|
|
1052
|
+
readonly properties: {
|
|
1053
|
+
readonly question: {
|
|
1054
|
+
readonly $ref: "#/$defs/Key";
|
|
1055
|
+
};
|
|
1056
|
+
readonly options: {
|
|
1057
|
+
readonly type: "array";
|
|
1058
|
+
readonly minItems: 1;
|
|
1059
|
+
readonly maxItems: 64;
|
|
1060
|
+
readonly items: {
|
|
1061
|
+
readonly $ref: "#/$defs/EncryptedOption";
|
|
1062
|
+
};
|
|
1063
|
+
};
|
|
1064
|
+
readonly sumProof: {
|
|
1065
|
+
readonly $ref: "#/$defs/DisjunctiveProof";
|
|
1066
|
+
};
|
|
1067
|
+
};
|
|
1068
|
+
};
|
|
1069
|
+
readonly DisjunctiveProof: {
|
|
1070
|
+
readonly title: "DisjunctiveProof";
|
|
1071
|
+
readonly description: "A disjunctive proof that a ciphertext encrypts one value of a public list: one `(c, z)` per value, in the list's order (CONVENTIONS §9.3).";
|
|
1072
|
+
readonly type: "array";
|
|
1073
|
+
readonly minItems: 1;
|
|
1074
|
+
readonly maxItems: 65;
|
|
1075
|
+
readonly items: {
|
|
1076
|
+
readonly $ref: "#/$defs/SigmaProof";
|
|
1077
|
+
};
|
|
1078
|
+
};
|
|
1079
|
+
readonly SigmaProof: {
|
|
1080
|
+
readonly title: "SigmaProof";
|
|
1081
|
+
readonly description: "A non-interactive sigma proof as its challenge and response `(c, z)` (Schnorr or Chaum–Pedersen; CONVENTIONS §9.3).";
|
|
1082
|
+
readonly type: "object";
|
|
1083
|
+
readonly additionalProperties: false;
|
|
1084
|
+
readonly required: readonly ["c", "z"];
|
|
1085
|
+
readonly properties: {
|
|
1086
|
+
readonly c: {
|
|
1087
|
+
readonly $ref: "#/$defs/GroupScalar";
|
|
1088
|
+
};
|
|
1089
|
+
readonly z: {
|
|
1090
|
+
readonly $ref: "#/$defs/GroupScalar";
|
|
1091
|
+
};
|
|
1092
|
+
};
|
|
1093
|
+
};
|
|
1094
|
+
readonly GroupScalar: {
|
|
1095
|
+
readonly title: "GroupScalar";
|
|
1096
|
+
readonly description: "A scalar mod the Ristretto group order: 32 canonical little-endian bytes, multibase base58btc (CONVENTIONS §9.1).";
|
|
1097
|
+
readonly type: "string";
|
|
1098
|
+
readonly minLength: 2;
|
|
1099
|
+
readonly maxLength: 64;
|
|
1100
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
1101
|
+
};
|
|
1102
|
+
readonly EncryptedOption: {
|
|
1103
|
+
readonly title: "EncryptedOption";
|
|
1104
|
+
readonly type: "object";
|
|
1105
|
+
readonly additionalProperties: false;
|
|
1106
|
+
readonly required: readonly ["ciphertext", "proof"];
|
|
1107
|
+
readonly properties: {
|
|
1108
|
+
readonly ciphertext: {
|
|
1109
|
+
readonly $ref: "#/$defs/ElGamalCiphertext";
|
|
1110
|
+
};
|
|
1111
|
+
readonly proof: {
|
|
1112
|
+
readonly $ref: "#/$defs/DisjunctiveProof";
|
|
1113
|
+
};
|
|
1114
|
+
};
|
|
1115
|
+
};
|
|
1116
|
+
readonly ElGamalCiphertext: {
|
|
1117
|
+
readonly title: "ElGamalCiphertext";
|
|
1118
|
+
readonly description: "`(a, b) = (r·G, M + r·Y)` under the election key `Y` (CONVENTIONS §9.2).";
|
|
1119
|
+
readonly type: "object";
|
|
1120
|
+
readonly additionalProperties: false;
|
|
1121
|
+
readonly required: readonly ["a", "b"];
|
|
1122
|
+
readonly properties: {
|
|
1123
|
+
readonly a: {
|
|
1124
|
+
readonly $ref: "#/$defs/GroupElement";
|
|
1125
|
+
};
|
|
1126
|
+
readonly b: {
|
|
1127
|
+
readonly $ref: "#/$defs/GroupElement";
|
|
1128
|
+
};
|
|
1129
|
+
};
|
|
1130
|
+
};
|
|
1131
|
+
readonly GroupElement: {
|
|
1132
|
+
readonly title: "GroupElement";
|
|
1133
|
+
readonly description: "A Ristretto group element: its 32-byte compression, multibase base58btc. Never the identity (CONVENTIONS §9.1).";
|
|
1134
|
+
readonly type: "string";
|
|
1135
|
+
readonly minLength: 2;
|
|
1136
|
+
readonly maxLength: 64;
|
|
1137
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
1138
|
+
};
|
|
1139
|
+
readonly Key: {
|
|
1140
|
+
readonly title: "Key";
|
|
1141
|
+
readonly description: "A question or option key, unique within its manifest or question.";
|
|
1142
|
+
readonly type: "string";
|
|
1143
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
|
|
1144
|
+
};
|
|
1145
|
+
readonly SealedPayload: {
|
|
1146
|
+
readonly title: "SealedPayload";
|
|
1147
|
+
readonly description: "Bytes sealed to a key: a random group element encrypted as `kem`, and the bytes under ChaCha20-Poly1305 with a key derived from it, multibase base58btc (CONVENTIONS §9.4).";
|
|
1148
|
+
readonly type: "object";
|
|
1149
|
+
readonly additionalProperties: false;
|
|
1150
|
+
readonly required: readonly ["kem", "body"];
|
|
1151
|
+
readonly properties: {
|
|
1152
|
+
readonly kem: {
|
|
1153
|
+
readonly $ref: "#/$defs/ElGamalCiphertext";
|
|
1154
|
+
};
|
|
1155
|
+
readonly body: {
|
|
1156
|
+
readonly type: "string";
|
|
1157
|
+
readonly minLength: 2;
|
|
1158
|
+
readonly maxLength: 131072;
|
|
1159
|
+
readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
|
|
1160
|
+
};
|
|
1161
|
+
};
|
|
1162
|
+
};
|
|
1163
|
+
};
|
|
1164
|
+
};
|
|
1165
|
+
};
|
|
1166
|
+
//# sourceMappingURL=payload.d.ts.map
|