@cello-protocol/protocol-types 0.0.7 → 0.0.9
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/dist/frost-refresh.d.ts +117 -0
- package/dist/frost-refresh.d.ts.map +1 -0
- package/dist/frost-refresh.js +32 -0
- package/dist/frost-refresh.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/revocation.d.ts +59 -0
- package/dist/revocation.d.ts.map +1 -0
- package/dist/revocation.js +42 -0
- package/dist/revocation.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FROST Proactive Share Resharing (PSS) Wire Frame Types — M8B DOD-REFRESH-1.
|
|
3
|
+
*
|
|
4
|
+
* Exchanged on /cello/frost/1.0.0 streams during a proactive share refresh: every current shareholder
|
|
5
|
+
* (the client + each directory node) adds a zero-constant-term polynomial δ_i to its share, rotating all
|
|
6
|
+
* shares to a new epoch while keeping the group public key (commitments[0]) UNCHANGED. A share captured in
|
|
7
|
+
* epoch e is useless in e+1. Crypto core: `@cello-protocol/crypto` frost-resharing.ts (Herzberg et al.
|
|
8
|
+
* 1995; RFC 9591 Appendix C VSS commitments).
|
|
9
|
+
*
|
|
10
|
+
* Unlike DKG (3 interdependent rounds), a refresh contribution is generated INDEPENDENTLY (δ_i is a fresh
|
|
11
|
+
* random zero-constant polynomial that does not depend on any other party), so the protocol is TWO rounds,
|
|
12
|
+
* client-coordinated:
|
|
13
|
+
*
|
|
14
|
+
* Round 1 (contribute): client asks each node to generate its refresh contribution for the NEW epoch
|
|
15
|
+
* → each node returns { fromId, commitment[] (C[0]=identity), subShares{ j → δ_i(j) } }
|
|
16
|
+
* Round 2 (apply): client distributes the AGREED contribution set — to node j it sends, for every
|
|
17
|
+
* contributor i, { fromId:i, commitment:C_i, subShares:{ j → δ_i(j) } } (j's sub-share ONLY;
|
|
18
|
+
* other parties' sub-shares are NOT disclosed) → each node verifies the full roster + Feldman-
|
|
19
|
+
* checks each sub-share + applies → stores its NEW-epoch share and returns its shareCommitment.
|
|
20
|
+
*
|
|
21
|
+
* The client is the single uniform relay: it collects ONE commitment per party in Round 1 and distributes
|
|
22
|
+
* the IDENTICAL commitment set to every node in Round 2, which structurally prevents a directory from
|
|
23
|
+
* equivocating (the agent's own client node is the trusted aggregator). The coordinator verifies every
|
|
24
|
+
* node returns the SAME shareCommitment (= the unchanged group key) before accepting, and a post-refresh
|
|
25
|
+
* verification signature confirms the rotated shares are coherent (no divergence) before the epoch advances.
|
|
26
|
+
*
|
|
27
|
+
* DISTINCT from DKG frames (frost_dkg_round{1,2,3}) and signing frames (frost_commit/sign_*).
|
|
28
|
+
*
|
|
29
|
+
* Crypto reference: RFC 9591 (FROST / VSS), RFC 8032 (Ed25519).
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* One party's refresh contribution. Mirrors `RefreshContribution` in @cello-protocol/crypto.
|
|
33
|
+
* In Round 1 responses, `subShares` carries δ_i(j) for EVERY participant j (the contributor produced them
|
|
34
|
+
* all). In Round 2 requests, the client narrows each contribution's `subShares` to ONLY the recipient
|
|
35
|
+
* node's entry, so a node never sees sub-shares addressed to other parties.
|
|
36
|
+
*/
|
|
37
|
+
export interface FrostRefreshContribution {
|
|
38
|
+
/** The contributing party's FROST identifier (32-byte LE scalar hex). */
|
|
39
|
+
fromId: string;
|
|
40
|
+
/** Feldman VSS commitments C[k] = a_k·G, length T. C[0] is the curve identity (zero constant term). */
|
|
41
|
+
commitment: Uint8Array[];
|
|
42
|
+
/** δ_i(j) per participant identifier j (32-byte LE scalar). Round 1: all j. Round 2: only the recipient. */
|
|
43
|
+
subShares: Record<string, Uint8Array>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Client → Directory: generate this node's refresh contribution for the NEW epoch.
|
|
47
|
+
* The node MUST already hold a share for `fromEpochId` (the epoch being refreshed); it generates a fresh
|
|
48
|
+
* zero-constant polynomial over `participantIds` and returns its contribution. No share is rotated yet.
|
|
49
|
+
*/
|
|
50
|
+
export interface FrostRefreshRound1Request {
|
|
51
|
+
type: "frost_refresh_round1_request";
|
|
52
|
+
/** Hex-encoded K_local public key. */
|
|
53
|
+
agentPubkey: string;
|
|
54
|
+
/** The epoch being refreshed FROM, e.g. "${agentPubkey}:epoch:1" (the node must hold this share). */
|
|
55
|
+
fromEpochId: string;
|
|
56
|
+
/** The epoch being refreshed TO, e.g. "${agentPubkey}:epoch:2". */
|
|
57
|
+
toEpochId: string;
|
|
58
|
+
/** Threshold parameters of the group (min = T, max = participants + 1). */
|
|
59
|
+
signers: {
|
|
60
|
+
min: number;
|
|
61
|
+
max: number;
|
|
62
|
+
};
|
|
63
|
+
/** Every shareholder's FROST identifier (client + all directory nodes) — the agreed full roster. */
|
|
64
|
+
participantIds: string[];
|
|
65
|
+
}
|
|
66
|
+
export interface FrostRefreshRound1ResponseOk {
|
|
67
|
+
type: "frost_refresh_round1_response";
|
|
68
|
+
ok: true;
|
|
69
|
+
/** The node's contribution: commitment (C[0]=identity) + δ(j) for every participant j. */
|
|
70
|
+
contribution: FrostRefreshContribution;
|
|
71
|
+
}
|
|
72
|
+
export interface FrostRefreshRound1ResponseErr {
|
|
73
|
+
type: "frost_refresh_round1_response";
|
|
74
|
+
ok: false;
|
|
75
|
+
reason: "source_epoch_not_held" | "already_in_progress" | "agent_suspended" | "internal_error";
|
|
76
|
+
}
|
|
77
|
+
export type FrostRefreshRound1Response = FrostRefreshRound1ResponseOk | FrostRefreshRound1ResponseErr;
|
|
78
|
+
/**
|
|
79
|
+
* Client → Directory: deliver the AGREED full contribution set so the node can apply the refresh.
|
|
80
|
+
* `contributions` contains one entry per participant (the complete roster); each entry's `subShares`
|
|
81
|
+
* carries ONLY this node's sub-share δ_i(thisNode). The node verifies completeness + Feldman-checks each
|
|
82
|
+
* sub-share, then computes its new share s'_j = s_j + Σ_i δ_i(j), stores it under `toEpochId`, advances its
|
|
83
|
+
* current epoch, and returns its resulting group-key commitment (which must be UNCHANGED).
|
|
84
|
+
*/
|
|
85
|
+
export interface FrostRefreshRound2Request {
|
|
86
|
+
type: "frost_refresh_round2_request";
|
|
87
|
+
agentPubkey: string;
|
|
88
|
+
fromEpochId: string;
|
|
89
|
+
toEpochId: string;
|
|
90
|
+
signers: {
|
|
91
|
+
min: number;
|
|
92
|
+
max: number;
|
|
93
|
+
};
|
|
94
|
+
/** Every shareholder's identifier — the node verifies the contribution set matches this exactly. */
|
|
95
|
+
participantIds: string[];
|
|
96
|
+
/** The full agreed contribution set; each entry's subShares holds only the receiving node's sub-share. */
|
|
97
|
+
contributions: FrostRefreshContribution[];
|
|
98
|
+
}
|
|
99
|
+
export interface FrostRefreshRound2ResponseOk {
|
|
100
|
+
type: "frost_refresh_round2_response";
|
|
101
|
+
ok: true;
|
|
102
|
+
/**
|
|
103
|
+
* The node's group public key after applying the refresh — 32-byte Ed25519 point (commitments[0]).
|
|
104
|
+
* The coordinator verifies every node (and the client) returns the SAME value AND that it equals the
|
|
105
|
+
* pre-refresh group key. Any mismatch aborts the refresh (the old epoch stays current).
|
|
106
|
+
*/
|
|
107
|
+
shareCommitment: Uint8Array;
|
|
108
|
+
}
|
|
109
|
+
export interface FrostRefreshRound2ResponseErr {
|
|
110
|
+
type: "frost_refresh_round2_response";
|
|
111
|
+
ok: false;
|
|
112
|
+
reason: "incomplete_roster" | "vss_check_failed" | "source_epoch_not_held" | "agent_suspended" | "internal_error";
|
|
113
|
+
}
|
|
114
|
+
export type FrostRefreshRound2Response = FrostRefreshRound2ResponseOk | FrostRefreshRound2ResponseErr;
|
|
115
|
+
export type FrostRefreshRequest = FrostRefreshRound1Request | FrostRefreshRound2Request;
|
|
116
|
+
export type FrostRefreshResponse = FrostRefreshRound1Response | FrostRefreshRound2Response;
|
|
117
|
+
//# sourceMappingURL=frost-refresh.d.ts.map
|
|
@@ -0,0 +1 @@
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,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,oGAAoG;IACpG,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,0GAA0G;IAC1G,aAAa,EAAE,wBAAwB,EAAE,CAAC;CAC3C;AAED,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,+BAA+B,CAAC;IACtC,EAAE,EAAE,IAAI,CAAC;IACT;;;;OAIG;IACH,eAAe,EAAE,UAAU,CAAC;CAC7B;AAED,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,+BAA+B,CAAC;IACtC,EAAE,EAAE,KAAK,CAAC;IACV,MAAM,EACF,mBAAmB,GACnB,kBAAkB,GAClB,uBAAuB,GACvB,iBAAiB,GACjB,gBAAgB,CAAC;CACtB;AAED,MAAM,MAAM,0BAA0B,GAAG,4BAA4B,GAAG,6BAA6B,CAAC;AAItG,MAAM,MAAM,mBAAmB,GAAG,yBAAyB,GAAG,yBAAyB,CAAC;AAExF,MAAM,MAAM,oBAAoB,GAAG,0BAA0B,GAAG,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FROST Proactive Share Resharing (PSS) Wire Frame Types — M8B DOD-REFRESH-1.
|
|
3
|
+
*
|
|
4
|
+
* Exchanged on /cello/frost/1.0.0 streams during a proactive share refresh: every current shareholder
|
|
5
|
+
* (the client + each directory node) adds a zero-constant-term polynomial δ_i to its share, rotating all
|
|
6
|
+
* shares to a new epoch while keeping the group public key (commitments[0]) UNCHANGED. A share captured in
|
|
7
|
+
* epoch e is useless in e+1. Crypto core: `@cello-protocol/crypto` frost-resharing.ts (Herzberg et al.
|
|
8
|
+
* 1995; RFC 9591 Appendix C VSS commitments).
|
|
9
|
+
*
|
|
10
|
+
* Unlike DKG (3 interdependent rounds), a refresh contribution is generated INDEPENDENTLY (δ_i is a fresh
|
|
11
|
+
* random zero-constant polynomial that does not depend on any other party), so the protocol is TWO rounds,
|
|
12
|
+
* client-coordinated:
|
|
13
|
+
*
|
|
14
|
+
* Round 1 (contribute): client asks each node to generate its refresh contribution for the NEW epoch
|
|
15
|
+
* → each node returns { fromId, commitment[] (C[0]=identity), subShares{ j → δ_i(j) } }
|
|
16
|
+
* Round 2 (apply): client distributes the AGREED contribution set — to node j it sends, for every
|
|
17
|
+
* contributor i, { fromId:i, commitment:C_i, subShares:{ j → δ_i(j) } } (j's sub-share ONLY;
|
|
18
|
+
* other parties' sub-shares are NOT disclosed) → each node verifies the full roster + Feldman-
|
|
19
|
+
* checks each sub-share + applies → stores its NEW-epoch share and returns its shareCommitment.
|
|
20
|
+
*
|
|
21
|
+
* The client is the single uniform relay: it collects ONE commitment per party in Round 1 and distributes
|
|
22
|
+
* the IDENTICAL commitment set to every node in Round 2, which structurally prevents a directory from
|
|
23
|
+
* equivocating (the agent's own client node is the trusted aggregator). The coordinator verifies every
|
|
24
|
+
* node returns the SAME shareCommitment (= the unchanged group key) before accepting, and a post-refresh
|
|
25
|
+
* verification signature confirms the rotated shares are coherent (no divergence) before the epoch advances.
|
|
26
|
+
*
|
|
27
|
+
* DISTINCT from DKG frames (frost_dkg_round{1,2,3}) and signing frames (frost_commit/sign_*).
|
|
28
|
+
*
|
|
29
|
+
* Crypto reference: RFC 9591 (FROST / VSS), RFC 8032 (Ed25519).
|
|
30
|
+
*/
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=frost-refresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frost-refresh.js","sourceRoot":"","sources":["../src/frost-refresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,8 +7,11 @@ export type { SessionAssignment, SessionAssignmentFrost, SessionAssignmentSingle
|
|
|
7
7
|
export type { MlDsaKeyProvider, MlDsaVerifier, PseudonymBinding, Endorsement, Attestation, ConnectionPackage, EndorsementValidationStatus, AttestationValidationStatus, ValidatedEndorsement, ValidatedAttestation, PackageValidationResult, BuildPseudonymBindingResult, SignalCondition, SignalRequirement, ConnectionPolicy, DirectoryContext, } from "./connection-package.js";
|
|
8
8
|
export { MAX_PSEUDONYM_LABEL_BYTES, ML_DSA_PUBKEY_BYTES, ML_DSA_SIGNATURE_BYTES, buildPseudonymBinding, verifyPseudonymBinding, verifyEndorsement, verifyAttestation, validateConnectionPackage, encodeConnectionPackage, decodeConnectionPackage, } from "./connection-package.js";
|
|
9
9
|
export type { RegisterRequest, DkgComplete, DkgReady, RegisterSuccess, RegisterError, RegisterErrorReason, AgentProfile, RegistrationState, } from "./registration.js";
|
|
10
|
+
export { buildAgentRevocationTbs, AGENT_REVOCATION_DOMAIN } from "./revocation.js";
|
|
11
|
+
export type { RevokeAgentRequest, AgentRevocationAck, AgentRevocationError, AgentRevocationErrorReason, } from "./revocation.js";
|
|
10
12
|
export type { ConnectionRequest, ConnectionRequestInbound, ConnectionResponse, ConnectionResponseVerdict, ConnectionEstablished, ConnectionRejected, ConnectionInsufficient, ConnectionRequestError, ConnectionRequestErrorReason, DisclosureRequest, DisclosureRequestItem, DisclosureRequestInbound, DisclosureResponse, DisclosureResponseInbound, ConnectionRecord, PendingConnectionRequest, ClientConnectionRecord, SessionRequestM3, SessionRequestM3ErrorReason, } from "./connection-request.js";
|
|
11
13
|
export type { DkgRound1Broadcast, DkgRound2Share, FrostDkgRound1Request, FrostDkgRound1Response, FrostDkgRound2Request, FrostDkgRound2Response, FrostDkgRound3Request, FrostDkgRound3Response, FrostDkgRequest, FrostDkgResponse, } from "./frost-dkg.js";
|
|
14
|
+
export type { FrostRefreshContribution, FrostRefreshRound1Request, FrostRefreshRound1Response, FrostRefreshRound2Request, FrostRefreshRound2Response, FrostRefreshRequest, FrostRefreshResponse, } from "./frost-refresh.js";
|
|
12
15
|
export type { ConsortiumManifest, ConsortiumNode, OfficerSignature, ManifestError, } from "./manifest.js";
|
|
13
16
|
export { MANIFEST_SIGNATURE_INVALID, MANIFEST_VERSION_ROLLBACK, MANIFEST_EXPIRED, } from "./manifest.js";
|
|
14
17
|
export type { SealInterruptedLeaf, SealInterruptedRequest, SealInterruptedAck, SealInterruptedRejection, SessionInterruptedFrame, SealInterruptedSignalingMessage, } from "./seal-interrupted.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,kBAAkB,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACjK,YAAY,EACV,iBAAiB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,eAAe,EAAE,iBAAiB,EAAE,WAAW,EACnH,gBAAgB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,aAAa,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,YAAY,EAChI,eAAe,EAAE,cAAc,EAAE,yBAAyB,EAAE,0BAA0B,GACvF,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,2BAA2B,EAC3B,2BAA2B,EAC3B,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,2BAA2B,EAC3B,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EACV,eAAe,EACf,WAAW,EACX,QAAQ,EACR,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,yBAAyB,EACzB,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,EAC5B,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,EAClB,yBAAyB,EACzB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,EAChB,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,aAA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+B,GAChC,MAAM,uBAAuB,CAAC;AAG/B,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export { MAX_CONTENT_BYTES, buildEnvelope, serializeEnvelope, deserializeEnvelop
|
|
|
2
2
|
export { SCAN_RESULT_SENTINEL, buildStructure2, encodeStructure2, encodeScanResultSentinel, verifyStructure2Signature, } from "./structure2.js";
|
|
3
3
|
export { computeGenesisPrevRoot, encodeSealPayload, decodeSealPayload, buildSessionEstablishmentTbs, buildSealTbs, SEAL_RECEIPT_DISCLAIMER } from "./session.js";
|
|
4
4
|
export { MAX_PSEUDONYM_LABEL_BYTES, ML_DSA_PUBKEY_BYTES, ML_DSA_SIGNATURE_BYTES, buildPseudonymBinding, verifyPseudonymBinding, verifyEndorsement, verifyAttestation, validateConnectionPackage, encodeConnectionPackage, decodeConnectionPackage, } from "./connection-package.js";
|
|
5
|
+
export { buildAgentRevocationTbs, AGENT_REVOCATION_DOMAIN } from "./revocation.js";
|
|
5
6
|
export { MANIFEST_SIGNATURE_INVALID, MANIFEST_VERSION_ROLLBACK, MANIFEST_EXPIRED, } from "./manifest.js";
|
|
6
7
|
export { IT_LENGTH_PREFIX_DEFAULT_MAX, CONTENT_PARK_PROTOCOL_ID, CONTENT_PARK_AUTH_DOMAIN, buildContentParkAuthMsg, isContentDeliveryAck, isContentResendRequest, isContentParkDeposit, } from "./content-delivery.js";
|
|
7
8
|
export { encodeSessionLivenessQuery, decodeSessionLivenessQuery, encodeSessionLivenessResponse, decodeSessionLivenessResponse, } from "./session-liveness.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AA0BjK,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AA0BjK,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAcjC,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AA6DnF,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAuBvB,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAO/B,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CELLO-M7-REMOVE-001 (DOD-REMOVE-2) — agent revocation wire shapes + canonical TBS.
|
|
3
|
+
*
|
|
4
|
+
* Removal is recorded at the directory as an APPEND-ONLY, SELF-SIGNED revocation fact (design log
|
|
5
|
+
* §5 removal = revocation-not-erasure; §13 guardrail #5). The agent signs a canonical "to-be-signed"
|
|
6
|
+
* byte string with its OWN K_local (Ed25519, RFC 8032); the directory verifies it against the agent's
|
|
7
|
+
* registered K_local before appending, and the signature is stored so ANY sovereign node can
|
|
8
|
+
* re-verify the fact independently (AC-002).
|
|
9
|
+
*
|
|
10
|
+
* The TBS is keyed by the DIRECTORY-known agent_id (agent_profiles.agent_id), never a pubkey
|
|
11
|
+
* (guardrail #1 — pubkeys rotate). The k_local_pubkey bound in the TBS is the directory-RESOLVED
|
|
12
|
+
* registered key (the verifier never trusts a client-supplied key).
|
|
13
|
+
*
|
|
14
|
+
* Cross-repo (M7-WIRE-001 convention): the directory keeps a BYTE-IDENTICAL local copy of
|
|
15
|
+
* buildAgentRevocationTbs until a publish ships this helper to it; a drift-guard test + the live spine
|
|
16
|
+
* (sign here / verify there) catch any divergence.
|
|
17
|
+
*/
|
|
18
|
+
/** Domain separation tag — bound as the first TBS field so a revocation signature can never be
|
|
19
|
+
* replayed as any other CELLO signature (and vice-versa). */
|
|
20
|
+
export declare const AGENT_REVOCATION_DOMAIN = "CELLO-REVOKE-v1";
|
|
21
|
+
/**
|
|
22
|
+
* Canonical to-be-signed bytes for an agent revocation. Field order is LOAD-BEARING — both the
|
|
23
|
+
* signer (daemon) and the verifier (directory, and any re-verifying node) must produce identical
|
|
24
|
+
* bytes. All fields are recoverable from the stored agent_revocations row + agent_profiles, so the
|
|
25
|
+
* fact stays re-verifiable forever.
|
|
26
|
+
*/
|
|
27
|
+
export declare function buildAgentRevocationTbs(agentId: string, kLocalPubkeyHex: string, epochId: string, reason: string, revokedAt: number | bigint): Uint8Array;
|
|
28
|
+
/**
|
|
29
|
+
* Client asks the directory to record a revocation of its OWN agent. Sent on the K_local-authenticated
|
|
30
|
+
* signaling stream; `signature` is over buildAgentRevocationTbs(agent_id, <registered k_local_pubkey>,
|
|
31
|
+
* epoch_id ?? "", reason ?? "", revoked_at), signed by the agent's K_local.
|
|
32
|
+
*/
|
|
33
|
+
export interface RevokeAgentRequest {
|
|
34
|
+
type: "revoke_agent";
|
|
35
|
+
/** The DIRECTORY-assigned agent_id (agent_profiles.agent_id) being revoked. */
|
|
36
|
+
agent_id: string;
|
|
37
|
+
/** Optional key-epoch id (nullable in the agent_revocations row). */
|
|
38
|
+
epoch_id?: string;
|
|
39
|
+
/** Optional informational reason (e.g. "voluntary"). Never carries secrets. */
|
|
40
|
+
reason?: string;
|
|
41
|
+
/** Revocation timestamp (ms since epoch) — stored as BIGINT revoked_at. */
|
|
42
|
+
revoked_at: number;
|
|
43
|
+
/** Hex Ed25519 signature over the canonical TBS, by the agent's own K_local. */
|
|
44
|
+
signature: string;
|
|
45
|
+
}
|
|
46
|
+
/** Directory confirms the revocation was verified and appended (idempotent — also returned if it was
|
|
47
|
+
* already recorded). */
|
|
48
|
+
export interface AgentRevocationAck {
|
|
49
|
+
type: "agent_revocation_ack";
|
|
50
|
+
agent_id: string;
|
|
51
|
+
}
|
|
52
|
+
/** Directory refuses to record the revocation. Nothing is written (SI-001). */
|
|
53
|
+
export interface AgentRevocationError {
|
|
54
|
+
type: "agent_revocation_error";
|
|
55
|
+
reason: AgentRevocationErrorReason;
|
|
56
|
+
agent_id?: string;
|
|
57
|
+
}
|
|
58
|
+
export type AgentRevocationErrorReason = "unknown_agent" | "not_self_authorized" | "signature_invalid" | "malformed" | "persist_failed";
|
|
59
|
+
//# sourceMappingURL=revocation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revocation.d.ts","sourceRoot":"","sources":["../src/revocation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH;8DAC8D;AAC9D,eAAO,MAAM,uBAAuB,oBAAoB,CAAC;AAEzD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAAG,MAAM,GACzB,UAAU,CAUZ;AAID;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,cAAc,CAAC;IACrB,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,UAAU,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;yBACyB;AACzB,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,sBAAsB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,+EAA+E;AAC/E,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,MAAM,EAAE,0BAA0B,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,0BAA0B,GAClC,eAAe,GACf,qBAAqB,GACrB,mBAAmB,GACnB,WAAW,GACX,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CELLO-M7-REMOVE-001 (DOD-REMOVE-2) — agent revocation wire shapes + canonical TBS.
|
|
3
|
+
*
|
|
4
|
+
* Removal is recorded at the directory as an APPEND-ONLY, SELF-SIGNED revocation fact (design log
|
|
5
|
+
* §5 removal = revocation-not-erasure; §13 guardrail #5). The agent signs a canonical "to-be-signed"
|
|
6
|
+
* byte string with its OWN K_local (Ed25519, RFC 8032); the directory verifies it against the agent's
|
|
7
|
+
* registered K_local before appending, and the signature is stored so ANY sovereign node can
|
|
8
|
+
* re-verify the fact independently (AC-002).
|
|
9
|
+
*
|
|
10
|
+
* The TBS is keyed by the DIRECTORY-known agent_id (agent_profiles.agent_id), never a pubkey
|
|
11
|
+
* (guardrail #1 — pubkeys rotate). The k_local_pubkey bound in the TBS is the directory-RESOLVED
|
|
12
|
+
* registered key (the verifier never trusts a client-supplied key).
|
|
13
|
+
*
|
|
14
|
+
* Cross-repo (M7-WIRE-001 convention): the directory keeps a BYTE-IDENTICAL local copy of
|
|
15
|
+
* buildAgentRevocationTbs until a publish ships this helper to it; a drift-guard test + the live spine
|
|
16
|
+
* (sign here / verify there) catch any divergence.
|
|
17
|
+
*/
|
|
18
|
+
import { Encoder } from "cbor-x";
|
|
19
|
+
// Same config as session.ts buildSessionEstablishmentTbs — tagUint8Array:false so byte strings encode
|
|
20
|
+
// as definite-length CBOR byte strings (stable, encoder-independent layout).
|
|
21
|
+
const CBOR_ENC = new Encoder({ tagUint8Array: false });
|
|
22
|
+
/** Domain separation tag — bound as the first TBS field so a revocation signature can never be
|
|
23
|
+
* replayed as any other CELLO signature (and vice-versa). */
|
|
24
|
+
export const AGENT_REVOCATION_DOMAIN = "CELLO-REVOKE-v1";
|
|
25
|
+
/**
|
|
26
|
+
* Canonical to-be-signed bytes for an agent revocation. Field order is LOAD-BEARING — both the
|
|
27
|
+
* signer (daemon) and the verifier (directory, and any re-verifying node) must produce identical
|
|
28
|
+
* bytes. All fields are recoverable from the stored agent_revocations row + agent_profiles, so the
|
|
29
|
+
* fact stays re-verifiable forever.
|
|
30
|
+
*/
|
|
31
|
+
export function buildAgentRevocationTbs(agentId, kLocalPubkeyHex, epochId, reason, revokedAt) {
|
|
32
|
+
const tsEncoded = typeof revokedAt === "bigint" || revokedAt > 0xffffffff ? BigInt(revokedAt) : revokedAt;
|
|
33
|
+
return CBOR_ENC.encode([
|
|
34
|
+
AGENT_REVOCATION_DOMAIN,
|
|
35
|
+
agentId,
|
|
36
|
+
kLocalPubkeyHex,
|
|
37
|
+
epochId,
|
|
38
|
+
reason,
|
|
39
|
+
tsEncoded,
|
|
40
|
+
]);
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=revocation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revocation.js","sourceRoot":"","sources":["../src/revocation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,sGAAsG;AACtG,6EAA6E;AAC7E,MAAM,QAAQ,GAAG,IAAI,OAAO,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;AAEvD;8DAC8D;AAC9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAe,EACf,eAAuB,EACvB,OAAe,EACf,MAAc,EACd,SAA0B;IAE1B,MAAM,SAAS,GAAG,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1G,OAAO,QAAQ,CAAC,MAAM,CAAC;QACrB,uBAAuB;QACvB,OAAO;QACP,eAAe;QACf,OAAO;QACP,MAAM;QACN,SAAS;KACV,CAAe,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cello-protocol/protocol-types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"cbor-x": "^1.6.4",
|
|
26
|
-
"@cello-protocol/crypto": "0.0.
|
|
26
|
+
"@cello-protocol/crypto": "0.0.12"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@claude-flow/testing": "3.0.0-alpha.6",
|