@openvtc/trust-tasks 0.26.29 → 0.27.1
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 +64 -0
- package/dist/_shared/components.d.ts +15 -1
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/persona/contact/get/1.1/payload.d.ts +12 -5
- package/dist/persona/contact/get/1.1/payload.d.ts.map +1 -1
- package/dist/persona/contact/get/1.1/payload.js +4 -4
- package/dist/persona/contact/get/1.1/payload.js.map +1 -1
- package/dist/persona/contact/list/1.1/payload.d.ts +12 -5
- package/dist/persona/contact/list/1.1/payload.d.ts.map +1 -1
- package/dist/persona/contact/list/1.1/payload.js +4 -4
- package/dist/persona/contact/list/1.1/payload.js.map +1 -1
- package/dist/persona/contact/put/1.1/payload.d.ts +32 -6
- package/dist/persona/contact/put/1.1/payload.d.ts.map +1 -1
- package/dist/persona/contact/put/1.1/payload.js +32 -2
- package/dist/persona/contact/put/1.1/payload.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/board/read/0.1/payload.d.ts +58 -2
- package/dist/voting/board/read/0.1/payload.d.ts.map +1 -1
- package/dist/voting/board/read/0.1/payload.js +36 -0
- package/dist/voting/board/read/0.1/payload.js.map +1 -1
- package/dist/voting/trustees/authorize/0.1/payload.d.ts +617 -0
- package/dist/voting/trustees/authorize/0.1/payload.d.ts.map +1 -0
- package/dist/voting/trustees/authorize/0.1/payload.js +386 -0
- package/dist/voting/trustees/authorize/0.1/payload.js.map +1 -0
- package/dist/voting/trustees/status/0.1/payload.d.ts +106 -2
- package/dist/voting/trustees/status/0.1/payload.d.ts.map +1 -1
- package/dist/voting/trustees/status/0.1/payload.js +48 -0
- package/dist/voting/trustees/status/0.1/payload.js.map +1 -1
- package/dist/vta/pcs/trustee/deal/0.2/payload.d.ts +1832 -0
- package/dist/vta/pcs/trustee/deal/0.2/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/deal/0.2/payload.js +1077 -0
- package/dist/vta/pcs/trustee/deal/0.2/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/decrypt/0.2/payload.d.ts +758 -0
- package/dist/vta/pcs/trustee/decrypt/0.2/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/decrypt/0.2/payload.js +423 -0
- package/dist/vta/pcs/trustee/decrypt/0.2/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/justify/0.2/payload.d.ts +1867 -0
- package/dist/vta/pcs/trustee/justify/0.2/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/justify/0.2/payload.js +1095 -0
- package/dist/vta/pcs/trustee/justify/0.2/payload.js.map +1 -0
- package/dist/vta/pcs/trustee/keys/0.2/payload.d.ts +1912 -0
- package/dist/vta/pcs/trustee/keys/0.2/payload.d.ts.map +1 -0
- package/dist/vta/pcs/trustee/keys/0.2/payload.js +1115 -0
- package/dist/vta/pcs/trustee/keys/0.2/payload.js.map +1 -0
- package/dist/vta/pcs/vote-encrypted/0.2/payload.d.ts +2228 -0
- package/dist/vta/pcs/vote-encrypted/0.2/payload.d.ts.map +1 -0
- package/dist/vta/pcs/vote-encrypted/0.2/payload.js +1300 -0
- package/dist/vta/pcs/vote-encrypted/0.2/payload.js.map +1 -0
- package/dist/vtc/elections/show/0.1/payload.d.ts +86 -2
- package/dist/vtc/elections/show/0.1/payload.d.ts.map +1 -1
- package/dist/vtc/elections/show/0.1/payload.js +40 -0
- package/dist/vtc/elections/show/0.1/payload.js.map +1 -1
- package/package.json +1 -1
- package/src/_shared/components.ts +16 -1
- package/src/index.ts +6 -0
- package/src/persona/contact/get/1.1/payload.ts +8 -5
- package/src/persona/contact/list/1.1/payload.ts +8 -5
- package/src/persona/contact/put/1.1/payload.ts +34 -4
- package/src/voting/_shared/0.1/voting.ts +1 -1
- package/src/voting/board/read/0.1/payload.ts +38 -2
- package/src/voting/trustees/authorize/0.1/payload.ts +434 -0
- package/src/voting/trustees/status/0.1/payload.ts +58 -2
- package/src/vta/pcs/trustee/deal/0.2/payload.ts +1148 -0
- package/src/vta/pcs/trustee/decrypt/0.2/payload.ts +500 -0
- package/src/vta/pcs/trustee/justify/0.2/payload.ts +1167 -0
- package/src/vta/pcs/trustee/keys/0.2/payload.ts +1194 -0
- package/src/vta/pcs/vote-encrypted/0.2/payload.ts +1369 -0
- package/src/vtc/elections/show/0.1/payload.ts +46 -2
|
@@ -7,7 +7,7 @@ import type { ClaimType, ContactDocument, DirectoryEntryId, DirectoryRef, Ext, L
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* File what a peer disclosed, or change the holder's own annotations on a contact, or both.
|
|
10
|
+
* File what a peer disclosed, or change the holder's own annotations on a contact, or both. Three forms. FILING (`subjectDid`, `knownByPersona`, `document`; no `contactId`) appends a revision, never overwrites, so a changed value is visible as a change rather than arriving silently — exactly as 1.0. ANNOTATING (`contactId`; no `subjectDid`, `knownByPersona`, `document` or `credentialRefs`) changes the holder's star, petname, lists, directory link or notes on an existing contact and appends no revision. LINKING (`directoryRef`, `knownByPersona`; no `contactId`, `subjectDid`, `document` or `credentialRefs`) keeps annotations on a member of a community's directory whose DID the holder has not been shown: it finds, or makes, the contact for that entry and persona, and appends no revision. In every form each annotation given replaces the stored one, each `removeX` removes one, and each annotation absent is unchanged. The outer document members are owned by the framework — SPEC §6.3.
|
|
11
11
|
*/
|
|
12
12
|
export type PersonaContactPutPayload = {
|
|
13
13
|
contextId: string;
|
|
@@ -20,7 +20,7 @@ export type PersonaContactPutPayload = {
|
|
|
20
20
|
*/
|
|
21
21
|
subjectDid?: string;
|
|
22
22
|
/**
|
|
23
|
-
* Filing
|
|
23
|
+
* Filing and linking forms. Which of the holder's personas knows this contact. A contact belongs to the relationship, not to the holder at large — the same peer met through two personas is two contacts, and collapsing them would correlate the holder's own personas in their own address book.
|
|
24
24
|
*/
|
|
25
25
|
knownByPersona?: string;
|
|
26
26
|
document?: ContactDocument;
|
|
@@ -125,7 +125,7 @@ export const PAYLOAD_SCHEMA = {
|
|
|
125
125
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
126
126
|
"$id": "https://trusttasks.org/spec/persona/contact/put/1.1",
|
|
127
127
|
"title": "Persona Contact Put — payload",
|
|
128
|
-
"description": "File what a peer disclosed, or change the holder's own annotations on a contact, or both.
|
|
128
|
+
"description": "File what a peer disclosed, or change the holder's own annotations on a contact, or both. Three forms. FILING (`subjectDid`, `knownByPersona`, `document`; no `contactId`) appends a revision, never overwrites, so a changed value is visible as a change rather than arriving silently — exactly as 1.0. ANNOTATING (`contactId`; no `subjectDid`, `knownByPersona`, `document` or `credentialRefs`) changes the holder's star, petname, lists, directory link or notes on an existing contact and appends no revision. LINKING (`directoryRef`, `knownByPersona`; no `contactId`, `subjectDid`, `document` or `credentialRefs`) keeps annotations on a member of a community's directory whose DID the holder has not been shown: it finds, or makes, the contact for that entry and persona, and appends no revision. In every form each annotation given replaces the stored one, each `removeX` removes one, and each annotation absent is unchanged. The outer document members are owned by the framework — SPEC §6.3.",
|
|
129
129
|
"type": "object",
|
|
130
130
|
"additionalProperties": false,
|
|
131
131
|
"required": [
|
|
@@ -219,6 +219,36 @@ export const PAYLOAD_SCHEMA = {
|
|
|
219
219
|
]
|
|
220
220
|
}
|
|
221
221
|
]
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"required": [
|
|
225
|
+
"directoryRef",
|
|
226
|
+
"knownByPersona"
|
|
227
|
+
],
|
|
228
|
+
"not": {
|
|
229
|
+
"anyOf": [
|
|
230
|
+
{
|
|
231
|
+
"required": [
|
|
232
|
+
"contactId"
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"required": [
|
|
237
|
+
"subjectDid"
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"required": [
|
|
242
|
+
"document"
|
|
243
|
+
]
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"required": [
|
|
247
|
+
"credentialRefs"
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
]
|
|
251
|
+
}
|
|
222
252
|
}
|
|
223
253
|
],
|
|
224
254
|
"dependentSchemas": {
|
|
@@ -270,7 +300,7 @@ export const PAYLOAD_SCHEMA = {
|
|
|
270
300
|
"type": "string",
|
|
271
301
|
"minLength": 1,
|
|
272
302
|
"maxLength": 2048,
|
|
273
|
-
"description": "Filing
|
|
303
|
+
"description": "Filing and linking forms. Which of the holder's personas knows this contact. A contact belongs to the relationship, not to the holder at large — the same peer met through two personas is two contacts, and collapsing them would correlate the holder's own personas in their own address book."
|
|
274
304
|
},
|
|
275
305
|
"document": {
|
|
276
306
|
"$ref": "#/$defs/ContactDocument"
|
|
@@ -14,4 +14,4 @@ export interface CommunityVotingSharedDefinitions {
|
|
|
14
14
|
* The definitions this shared schema publishes, hoisted to one declaration each.
|
|
15
15
|
* See "../../../_shared/components.js".
|
|
16
16
|
*/
|
|
17
|
-
export type { Answer, Ballot, BoardEntry, BoardHead, BoardVisibility, Cast, Dealing, DecryptionTarget, Disclosure, DisjunctiveProof, ElectionId, ElectionKey, ElectionResult, ElectionState, ElectionSummary, ElGamalCiphertext, EncryptedBallot, EncryptedCast, EncryptedOption, EncryptedQuestion, GroupElement, GroupScalar, Key_VotingV0_1 as Key, Manifest, MerklePath, Multibase_VotingV0_1 as Multibase, PartialDecryption, Question, QuestionOption, QuestionResult, Revote, RollRule, SealedPayload, SealedShare, SecrecyLevel, SigmaProof, SignedRequest, TransportKey, TrusteeIndex, TrusteePhase, Trustees, VotingParameters } from "../../../_shared/components.js";
|
|
17
|
+
export type { Answer, Ballot, BoardEntry, BoardHead, BoardVisibility, Cast, Dealing, DecryptionTarget, Disclosure, DisjunctiveProof, ElectionId, ElectionKey, ElectionResult, ElectionState, ElectionSummary, ElGamalCiphertext, EncryptedBallot, EncryptedCast, EncryptedOption, EncryptedQuestion, GroupElement, GroupScalar, Key_VotingV0_1 as Key, Manifest, MerklePath, Multibase_VotingV0_1 as Multibase, PartialDecryption, Question, QuestionOption, QuestionResult, Revote, RollRule, SealedPayload, SealedShare, SecrecyLevel, SigmaProof, SignedRequest, TransportKey, TrusteeCeremony, TrusteeIndex, TrusteePhase, Trustees, VotingParameters } from "../../../_shared/components.js";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Source: specs/voting/board/read/0.1/payload.schema.json
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { Answer, Ballot, BoardEntry, BoardHead, Cast, CastEntry, ConfirmationEntry, Dealing, DealingEntry, DecryptionTarget, DigestMultibase, ElectionId, ElectionKey, ElectionKeyEntry, ElectionResult, ElGamalCiphertext, EncryptedCast, EncryptedCastEntry, Ext, GroupElement, GroupScalar, JustificationEntry, Key_VotingV0_1 as Key, LifecycleEntry, Multibase_VotingV0_1 as Multibase, PartialDecryption, PartialDecryptionsEntry, QuestionResult, ReplacementEntry, ResultEntry, SealedPayload, SealedShare, SigmaProof, SignedRequest, SpoiledEntry, TransportKey, TransportKeyEntry, TrusteeIndex, TrusteeStepEntry, UnsealedEntry } from "../../../../_shared/components.js";
|
|
6
|
+
import type { Answer, Ballot, BoardEntry, BoardHead, Cast, CastEntry, ConfirmationEntry, Dealing, DealingEntry, DecryptionAuthorizedEntry, DecryptionTarget, DigestMultibase, ElectionId, ElectionKey, ElectionKeyEntry, ElectionResult, ElGamalCiphertext, EncryptedCast, EncryptedCastEntry, Ext, GroupElement, GroupScalar, JustificationEntry, Key_VotingV0_1 as Key, LifecycleEntry, Multibase_VotingV0_1 as Multibase, PartialDecryption, PartialDecryptionsEntry, QuestionResult, ReplacementEntry, ResultEntry, SealedPayload, SealedShare, SigmaProof, SignedRequest, SpoiledEntry, TransportKey, TransportKeyEntry, TrusteeIndex, TrusteeStepEntry, UnsealedEntry } from "../../../../_shared/components.js";
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -51,7 +51,7 @@ export interface VotingBoardReadResponsePayload {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
54
|
-
export type { Answer, Ballot, BoardEntry, BoardHead, Cast, CastEntry, ConfirmationEntry, Dealing, DealingEntry, DecryptionTarget, DigestMultibase, ElectionId, ElectionKey, ElectionKeyEntry, ElectionResult, ElGamalCiphertext, EncryptedCast, EncryptedCastEntry, Ext, GroupElement, GroupScalar, JustificationEntry, Key, LifecycleEntry, Multibase, PartialDecryption, PartialDecryptionsEntry, QuestionResult, ReplacementEntry, ResultEntry, SealedPayload, SealedShare, SigmaProof, SignedRequest, SpoiledEntry, TransportKey, TransportKeyEntry, TrusteeIndex, TrusteeStepEntry, UnsealedEntry };
|
|
54
|
+
export type { Answer, Ballot, BoardEntry, BoardHead, Cast, CastEntry, ConfirmationEntry, Dealing, DealingEntry, DecryptionAuthorizedEntry, DecryptionTarget, DigestMultibase, ElectionId, ElectionKey, ElectionKeyEntry, ElectionResult, ElGamalCiphertext, EncryptedCast, EncryptedCastEntry, Ext, GroupElement, GroupScalar, JustificationEntry, Key, LifecycleEntry, Multibase, PartialDecryption, PartialDecryptionsEntry, QuestionResult, ReplacementEntry, ResultEntry, SealedPayload, SealedShare, SigmaProof, SignedRequest, SpoiledEntry, TransportKey, TransportKeyEntry, TrusteeIndex, TrusteeStepEntry, UnsealedEntry };
|
|
55
55
|
|
|
56
56
|
/** Trust Task type URI. */
|
|
57
57
|
export const TYPE_URI = "https://trusttasks.org/spec/voting/board/read/0.1" as const;
|
|
@@ -470,6 +470,24 @@ export const PAYLOAD_SCHEMA = {
|
|
|
470
470
|
"$ref": "#/$defs/SignedRequest"
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"title": "DecryptionAuthorizedEntry",
|
|
476
|
+
"description": "The community's voting/trustees/authorize request, exactly as the ballot box received it: the decryption targets of a closed election, pinned by digest to a head of the board (CONVENTIONS §9.7).",
|
|
477
|
+
"type": "object",
|
|
478
|
+
"additionalProperties": false,
|
|
479
|
+
"required": [
|
|
480
|
+
"kind",
|
|
481
|
+
"request"
|
|
482
|
+
],
|
|
483
|
+
"properties": {
|
|
484
|
+
"kind": {
|
|
485
|
+
"const": "decryptionAuthorized"
|
|
486
|
+
},
|
|
487
|
+
"request": {
|
|
488
|
+
"$ref": "#/$defs/SignedRequest"
|
|
489
|
+
}
|
|
490
|
+
}
|
|
473
491
|
}
|
|
474
492
|
]
|
|
475
493
|
},
|
|
@@ -1480,6 +1498,24 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
1480
1498
|
"$ref": "#/$defs/SignedRequest"
|
|
1481
1499
|
}
|
|
1482
1500
|
}
|
|
1501
|
+
},
|
|
1502
|
+
{
|
|
1503
|
+
"title": "DecryptionAuthorizedEntry",
|
|
1504
|
+
"description": "The community's voting/trustees/authorize request, exactly as the ballot box received it: the decryption targets of a closed election, pinned by digest to a head of the board (CONVENTIONS §9.7).",
|
|
1505
|
+
"type": "object",
|
|
1506
|
+
"additionalProperties": false,
|
|
1507
|
+
"required": [
|
|
1508
|
+
"kind",
|
|
1509
|
+
"request"
|
|
1510
|
+
],
|
|
1511
|
+
"properties": {
|
|
1512
|
+
"kind": {
|
|
1513
|
+
"const": "decryptionAuthorized"
|
|
1514
|
+
},
|
|
1515
|
+
"request": {
|
|
1516
|
+
"$ref": "#/$defs/SignedRequest"
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1483
1519
|
}
|
|
1484
1520
|
]
|
|
1485
1521
|
},
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/voting/trustees/authorize/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { BoardHead, DigestMultibase, ElectionId, ElectionState, ElectionSummary, Ext, TrusteePhase } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* After voting closes, the community authorizes the decryption of exactly the targets it computed from the board: a digest of them, and the head they were computed under.
|
|
11
|
+
*/
|
|
12
|
+
export interface VotingTrusteesAuthorizePayload {
|
|
13
|
+
/**
|
|
14
|
+
* The community's DID: the registrar that registered the election.
|
|
15
|
+
*/
|
|
16
|
+
community: string;
|
|
17
|
+
electionId: ElectionId;
|
|
18
|
+
manifestDigest: DigestMultibase;
|
|
19
|
+
/**
|
|
20
|
+
* The head the targets were computed under: the board through its `closed` or `closedEarly` entry.
|
|
21
|
+
*/
|
|
22
|
+
head: BoardHead;
|
|
23
|
+
/**
|
|
24
|
+
* The `at` of the board's `closed` or `closedEarly` entry.
|
|
25
|
+
*/
|
|
26
|
+
closedAt: string;
|
|
27
|
+
targetCount: number;
|
|
28
|
+
/**
|
|
29
|
+
* SHA-256 over the JCS of the array of DecryptionTarget the community computed, in the order of CONVENTIONS §9.7, as a multihash.
|
|
30
|
+
*/
|
|
31
|
+
targetsDigest: DigestMultibase;
|
|
32
|
+
ext?: Ext;
|
|
33
|
+
}
|
|
34
|
+
export interface VotingTrusteesAuthorizeResponsePayload {
|
|
35
|
+
election: ElectionSummary;
|
|
36
|
+
phase: TrusteePhase;
|
|
37
|
+
ext?: Ext;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
41
|
+
export type { BoardHead, DigestMultibase, ElectionId, ElectionState, ElectionSummary, Ext, TrusteePhase };
|
|
42
|
+
|
|
43
|
+
/** Trust Task type URI. */
|
|
44
|
+
export const TYPE_URI = "https://trusttasks.org/spec/voting/trustees/authorize/0.1" as const;
|
|
45
|
+
|
|
46
|
+
/** Stable alias for this specification's request payload shape. */
|
|
47
|
+
export type Payload = VotingTrusteesAuthorizePayload;
|
|
48
|
+
|
|
49
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
50
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/voting/trustees/authorize/0.1#response" as const;
|
|
51
|
+
|
|
52
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
53
|
+
export type Response = VotingTrusteesAuthorizeResponsePayload;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* This specification's payload schema, as a value.
|
|
57
|
+
*
|
|
58
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
59
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
60
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
61
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
62
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
63
|
+
*/
|
|
64
|
+
export const PAYLOAD_SCHEMA = {
|
|
65
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
66
|
+
"$id": "https://trusttasks.org/spec/voting/trustees/authorize/0.1",
|
|
67
|
+
"title": "Voting — Trustees — Authorize — payload",
|
|
68
|
+
"description": "After voting closes, the community authorizes the decryption of exactly the targets it computed from the board: a digest of them, and the head they were computed under.",
|
|
69
|
+
"type": "object",
|
|
70
|
+
"additionalProperties": false,
|
|
71
|
+
"required": [
|
|
72
|
+
"community",
|
|
73
|
+
"electionId",
|
|
74
|
+
"manifestDigest",
|
|
75
|
+
"head",
|
|
76
|
+
"closedAt",
|
|
77
|
+
"targetCount",
|
|
78
|
+
"targetsDigest"
|
|
79
|
+
],
|
|
80
|
+
"properties": {
|
|
81
|
+
"community": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"minLength": 1,
|
|
84
|
+
"maxLength": 2048,
|
|
85
|
+
"description": "The community's DID: the registrar that registered the election."
|
|
86
|
+
},
|
|
87
|
+
"electionId": {
|
|
88
|
+
"$ref": "#/$defs/ElectionId"
|
|
89
|
+
},
|
|
90
|
+
"manifestDigest": {
|
|
91
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
92
|
+
},
|
|
93
|
+
"head": {
|
|
94
|
+
"$ref": "#/$defs/BoardHead",
|
|
95
|
+
"description": "The head the targets were computed under: the board through its `closed` or `closedEarly` entry."
|
|
96
|
+
},
|
|
97
|
+
"closedAt": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"format": "date-time",
|
|
100
|
+
"description": "The `at` of the board's `closed` or `closedEarly` entry."
|
|
101
|
+
},
|
|
102
|
+
"targetCount": {
|
|
103
|
+
"type": "integer",
|
|
104
|
+
"minimum": 0,
|
|
105
|
+
"maximum": 100000
|
|
106
|
+
},
|
|
107
|
+
"targetsDigest": {
|
|
108
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
109
|
+
"description": "SHA-256 over the JCS of the array of DecryptionTarget the community computed, in the order of CONVENTIONS §9.7, as a multihash."
|
|
110
|
+
},
|
|
111
|
+
"ext": {
|
|
112
|
+
"$ref": "#/$defs/Ext"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"$defs": {
|
|
116
|
+
"Response": {
|
|
117
|
+
"$anchor": "response",
|
|
118
|
+
"title": "Voting — Trustees — Authorize — response payload",
|
|
119
|
+
"type": "object",
|
|
120
|
+
"additionalProperties": false,
|
|
121
|
+
"required": [
|
|
122
|
+
"election",
|
|
123
|
+
"phase"
|
|
124
|
+
],
|
|
125
|
+
"properties": {
|
|
126
|
+
"election": {
|
|
127
|
+
"$ref": "#/$defs/ElectionSummary"
|
|
128
|
+
},
|
|
129
|
+
"phase": {
|
|
130
|
+
"$ref": "#/$defs/TrusteePhase"
|
|
131
|
+
},
|
|
132
|
+
"ext": {
|
|
133
|
+
"$ref": "#/$defs/Ext"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"Ext": {
|
|
138
|
+
"title": "Ext",
|
|
139
|
+
"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.",
|
|
140
|
+
"type": "object",
|
|
141
|
+
"minProperties": 1,
|
|
142
|
+
"additionalProperties": true,
|
|
143
|
+
"propertyNames": {
|
|
144
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"TrusteePhase": {
|
|
148
|
+
"title": "TrusteePhase",
|
|
149
|
+
"description": "`enrolling`: transport keys are being published. `dealing`: dealings are. `confirming`: each trustee confirms or complains. `keyed`: the election key is formed. `decrypting`: voting has closed and partial decryptions are being published. `done`: every target is decrypted. `failed`: the key could not be formed in time.",
|
|
150
|
+
"type": "string",
|
|
151
|
+
"enum": [
|
|
152
|
+
"enrolling",
|
|
153
|
+
"dealing",
|
|
154
|
+
"confirming",
|
|
155
|
+
"keyed",
|
|
156
|
+
"decrypting",
|
|
157
|
+
"done",
|
|
158
|
+
"failed"
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
"ElectionSummary": {
|
|
162
|
+
"title": "ElectionSummary",
|
|
163
|
+
"description": "A ballot box's view of one election.",
|
|
164
|
+
"type": "object",
|
|
165
|
+
"additionalProperties": false,
|
|
166
|
+
"required": [
|
|
167
|
+
"electionId",
|
|
168
|
+
"community",
|
|
169
|
+
"manifestDigest",
|
|
170
|
+
"state",
|
|
171
|
+
"ballotsAdmitted",
|
|
172
|
+
"head"
|
|
173
|
+
],
|
|
174
|
+
"properties": {
|
|
175
|
+
"electionId": {
|
|
176
|
+
"$ref": "#/$defs/ElectionId"
|
|
177
|
+
},
|
|
178
|
+
"community": {
|
|
179
|
+
"type": "string",
|
|
180
|
+
"minLength": 1,
|
|
181
|
+
"maxLength": 2048
|
|
182
|
+
},
|
|
183
|
+
"manifestDigest": {
|
|
184
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
185
|
+
},
|
|
186
|
+
"state": {
|
|
187
|
+
"$ref": "#/$defs/ElectionState"
|
|
188
|
+
},
|
|
189
|
+
"ballotsAdmitted": {
|
|
190
|
+
"type": "integer",
|
|
191
|
+
"minimum": 0,
|
|
192
|
+
"description": "Distinct tags with a counted ballot."
|
|
193
|
+
},
|
|
194
|
+
"head": {
|
|
195
|
+
"$ref": "#/$defs/BoardHead"
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"BoardHead": {
|
|
200
|
+
"title": "BoardHead",
|
|
201
|
+
"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.",
|
|
202
|
+
"type": "object",
|
|
203
|
+
"additionalProperties": false,
|
|
204
|
+
"required": [
|
|
205
|
+
"electionId",
|
|
206
|
+
"treeSize",
|
|
207
|
+
"rootHash",
|
|
208
|
+
"issuedAt"
|
|
209
|
+
],
|
|
210
|
+
"properties": {
|
|
211
|
+
"electionId": {
|
|
212
|
+
"$ref": "#/$defs/ElectionId"
|
|
213
|
+
},
|
|
214
|
+
"treeSize": {
|
|
215
|
+
"type": "integer",
|
|
216
|
+
"minimum": 0
|
|
217
|
+
},
|
|
218
|
+
"rootHash": {
|
|
219
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
220
|
+
"description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
|
|
221
|
+
},
|
|
222
|
+
"issuedAt": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"format": "date-time"
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"ElectionId": {
|
|
229
|
+
"title": "ElectionId",
|
|
230
|
+
"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.",
|
|
231
|
+
"type": "string",
|
|
232
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
233
|
+
},
|
|
234
|
+
"DigestMultibase": {
|
|
235
|
+
"title": "DigestMultibase",
|
|
236
|
+
"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`.",
|
|
237
|
+
"type": "string",
|
|
238
|
+
"minLength": 16,
|
|
239
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
240
|
+
"examples": [
|
|
241
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
"ElectionState": {
|
|
245
|
+
"title": "ElectionState",
|
|
246
|
+
"type": "string",
|
|
247
|
+
"enum": [
|
|
248
|
+
"registered",
|
|
249
|
+
"registration",
|
|
250
|
+
"voting",
|
|
251
|
+
"closed",
|
|
252
|
+
"tallied",
|
|
253
|
+
"cancelled"
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
} as const;
|
|
258
|
+
|
|
259
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
260
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
261
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
262
|
+
"$ref": "#/$defs/Response",
|
|
263
|
+
"$defs": {
|
|
264
|
+
"Response": {
|
|
265
|
+
"$anchor": "response",
|
|
266
|
+
"title": "Voting — Trustees — Authorize — response payload",
|
|
267
|
+
"type": "object",
|
|
268
|
+
"additionalProperties": false,
|
|
269
|
+
"required": [
|
|
270
|
+
"election",
|
|
271
|
+
"phase"
|
|
272
|
+
],
|
|
273
|
+
"properties": {
|
|
274
|
+
"election": {
|
|
275
|
+
"$ref": "#/$defs/ElectionSummary"
|
|
276
|
+
},
|
|
277
|
+
"phase": {
|
|
278
|
+
"$ref": "#/$defs/TrusteePhase"
|
|
279
|
+
},
|
|
280
|
+
"ext": {
|
|
281
|
+
"$ref": "#/$defs/Ext"
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
"Ext": {
|
|
286
|
+
"title": "Ext",
|
|
287
|
+
"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.",
|
|
288
|
+
"type": "object",
|
|
289
|
+
"minProperties": 1,
|
|
290
|
+
"additionalProperties": true,
|
|
291
|
+
"propertyNames": {
|
|
292
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
"TrusteePhase": {
|
|
296
|
+
"title": "TrusteePhase",
|
|
297
|
+
"description": "`enrolling`: transport keys are being published. `dealing`: dealings are. `confirming`: each trustee confirms or complains. `keyed`: the election key is formed. `decrypting`: voting has closed and partial decryptions are being published. `done`: every target is decrypted. `failed`: the key could not be formed in time.",
|
|
298
|
+
"type": "string",
|
|
299
|
+
"enum": [
|
|
300
|
+
"enrolling",
|
|
301
|
+
"dealing",
|
|
302
|
+
"confirming",
|
|
303
|
+
"keyed",
|
|
304
|
+
"decrypting",
|
|
305
|
+
"done",
|
|
306
|
+
"failed"
|
|
307
|
+
]
|
|
308
|
+
},
|
|
309
|
+
"ElectionSummary": {
|
|
310
|
+
"title": "ElectionSummary",
|
|
311
|
+
"description": "A ballot box's view of one election.",
|
|
312
|
+
"type": "object",
|
|
313
|
+
"additionalProperties": false,
|
|
314
|
+
"required": [
|
|
315
|
+
"electionId",
|
|
316
|
+
"community",
|
|
317
|
+
"manifestDigest",
|
|
318
|
+
"state",
|
|
319
|
+
"ballotsAdmitted",
|
|
320
|
+
"head"
|
|
321
|
+
],
|
|
322
|
+
"properties": {
|
|
323
|
+
"electionId": {
|
|
324
|
+
"$ref": "#/$defs/ElectionId"
|
|
325
|
+
},
|
|
326
|
+
"community": {
|
|
327
|
+
"type": "string",
|
|
328
|
+
"minLength": 1,
|
|
329
|
+
"maxLength": 2048
|
|
330
|
+
},
|
|
331
|
+
"manifestDigest": {
|
|
332
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
333
|
+
},
|
|
334
|
+
"state": {
|
|
335
|
+
"$ref": "#/$defs/ElectionState"
|
|
336
|
+
},
|
|
337
|
+
"ballotsAdmitted": {
|
|
338
|
+
"type": "integer",
|
|
339
|
+
"minimum": 0,
|
|
340
|
+
"description": "Distinct tags with a counted ballot."
|
|
341
|
+
},
|
|
342
|
+
"head": {
|
|
343
|
+
"$ref": "#/$defs/BoardHead"
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
"BoardHead": {
|
|
348
|
+
"title": "BoardHead",
|
|
349
|
+
"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.",
|
|
350
|
+
"type": "object",
|
|
351
|
+
"additionalProperties": false,
|
|
352
|
+
"required": [
|
|
353
|
+
"electionId",
|
|
354
|
+
"treeSize",
|
|
355
|
+
"rootHash",
|
|
356
|
+
"issuedAt"
|
|
357
|
+
],
|
|
358
|
+
"properties": {
|
|
359
|
+
"electionId": {
|
|
360
|
+
"$ref": "#/$defs/ElectionId"
|
|
361
|
+
},
|
|
362
|
+
"treeSize": {
|
|
363
|
+
"type": "integer",
|
|
364
|
+
"minimum": 0
|
|
365
|
+
},
|
|
366
|
+
"rootHash": {
|
|
367
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
368
|
+
"description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
|
|
369
|
+
},
|
|
370
|
+
"issuedAt": {
|
|
371
|
+
"type": "string",
|
|
372
|
+
"format": "date-time"
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
"ElectionId": {
|
|
377
|
+
"title": "ElectionId",
|
|
378
|
+
"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.",
|
|
379
|
+
"type": "string",
|
|
380
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
381
|
+
},
|
|
382
|
+
"DigestMultibase": {
|
|
383
|
+
"title": "DigestMultibase",
|
|
384
|
+
"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`.",
|
|
385
|
+
"type": "string",
|
|
386
|
+
"minLength": 16,
|
|
387
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
388
|
+
"examples": [
|
|
389
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
390
|
+
]
|
|
391
|
+
},
|
|
392
|
+
"ElectionState": {
|
|
393
|
+
"title": "ElectionState",
|
|
394
|
+
"type": "string",
|
|
395
|
+
"enum": [
|
|
396
|
+
"registered",
|
|
397
|
+
"registration",
|
|
398
|
+
"voting",
|
|
399
|
+
"closed",
|
|
400
|
+
"tallied",
|
|
401
|
+
"cancelled"
|
|
402
|
+
]
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
} as const;
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
409
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
410
|
+
* per-specification and cannot be derived from the document alone, and
|
|
411
|
+
* item 2 needs the schema this carries.
|
|
412
|
+
*/
|
|
413
|
+
export const SPEC = {
|
|
414
|
+
typeUri: TYPE_URI,
|
|
415
|
+
isBearer: false,
|
|
416
|
+
isProofRequired: true,
|
|
417
|
+
isRecipientRequired: true,
|
|
418
|
+
isIssuedAtRequired: true,
|
|
419
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
420
|
+
} as const;
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
424
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
425
|
+
* parties (§7.3 item 5).
|
|
426
|
+
*/
|
|
427
|
+
export const RESPONSE_SPEC = {
|
|
428
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
429
|
+
isBearer: false,
|
|
430
|
+
isProofRequired: true,
|
|
431
|
+
isRecipientRequired: true,
|
|
432
|
+
isIssuedAtRequired: true,
|
|
433
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
434
|
+
} as const;
|