@cello-protocol/protocol-types 0.0.23 → 0.0.25
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/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/manifest.d.ts +37 -0
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +22 -0
- package/dist/manifest.js.map +1 -1
- package/dist/trust-signal.d.ts +21 -0
- package/dist/trust-signal.d.ts.map +1 -1
- package/dist/trust-signal.js +65 -1
- package/dist/trust-signal.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { encodeCbor, decodeCbor } from "./cbor.js";
|
|
2
|
-
export { TRUST_SIGNAL_DOMAIN, encodeTrustSignalEnvelope, hashTrustSignalEnvelope, verifyTrustSignalHash, } from "./trust-signal.js";
|
|
2
|
+
export { TRUST_SIGNAL_DOMAIN, encodeTrustSignalEnvelope, decodeTrustSignalEnvelope, hashTrustSignalEnvelope, verifyTrustSignalHash, } from "./trust-signal.js";
|
|
3
3
|
export type { TrustSignalEnvelope, SignalSubjectKind, SignalIssuerKind, } from "./trust-signal.js";
|
|
4
4
|
export type { MessageEnvelope, MessageEnvelopeV1, EnvelopeError, BuildResult, BuildResultV1, ValidateResult, ValidateResultV1, DeserializeResult, DeserializeResultV1, } from "./types.js";
|
|
5
5
|
export { MAX_CONTENT_BYTES } from "./limits.js";
|
|
@@ -18,8 +18,8 @@ export type { RevokeAgentRequest, AgentRevocationAck, AgentRevocationError, Agen
|
|
|
18
18
|
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";
|
|
19
19
|
export type { DkgRound1Broadcast, DkgRound2Share, FrostDkgRound1Request, FrostDkgRound1Response, FrostDkgRound2Request, FrostDkgRound2Response, FrostDkgRound3Request, FrostDkgRound3Response, FrostDkgRequest, FrostDkgResponse, } from "./frost-dkg.js";
|
|
20
20
|
export type { FrostRefreshContribution, FrostRefreshRound1Request, FrostRefreshRound1Response, FrostRefreshRound2Request, FrostRefreshRound2Response, FrostRefreshRequest, FrostRefreshResponse, } from "./frost-refresh.js";
|
|
21
|
-
export type { ConsortiumManifest, ConsortiumNode, OfficerSignature, ManifestError, } from "./manifest.js";
|
|
22
|
-
export { MANIFEST_SIGNATURE_INVALID, MANIFEST_VERSION_ROLLBACK, MANIFEST_EXPIRED, } from "./manifest.js";
|
|
21
|
+
export type { ConsortiumManifest, ConsortiumNode, OfficerSignature, ManifestError, NodeRole, } from "./manifest.js";
|
|
22
|
+
export { MANIFEST_SIGNATURE_INVALID, MANIFEST_VERSION_ROLLBACK, MANIFEST_EXPIRED, nodeRole, isValidator, validatorNodes, } from "./manifest.js";
|
|
23
23
|
export type { SealInterruptedLeaf, SealInterruptedRequest, SealInterruptedAck, SealInterruptedRejection, SessionInterruptedFrame, SealInterruptedSignalingMessage, } from "./seal-interrupted.js";
|
|
24
24
|
export type { ContentAckLevel, ContentDeliveryAck, ContentResendRequest, ContentParkDeposit, ContentParkDepositAck, ContentParkNotify, ContentParkPullRequest, ContentParkPullResponse, } from "./content-delivery.js";
|
|
25
25
|
export { IT_LENGTH_PREFIX_DEFAULT_MAX, CONTENT_PARK_PROTOCOL_ID, CONTENT_PARK_AUTH_DOMAIN, buildContentParkAuthMsg, PARK_CONTENT_DOMAIN, buildParkContentTbs, isContentDeliveryAck, isContentResendRequest, isContentParkDeposit, } from "./content-delivery.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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B,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export { encodeCbor, decodeCbor } from "./cbor.js";
|
|
|
2
2
|
// M10 / DOD-CBOR-1 — the canonical trust-signal envelope. ONE implementation, consumed by the
|
|
3
3
|
// portal (mint), the directory (submission + presentation), and both daemons (receipt +
|
|
4
4
|
// verification) — M10-D16.
|
|
5
|
-
export { TRUST_SIGNAL_DOMAIN, encodeTrustSignalEnvelope, hashTrustSignalEnvelope, verifyTrustSignalHash, } from "./trust-signal.js";
|
|
5
|
+
export { TRUST_SIGNAL_DOMAIN, encodeTrustSignalEnvelope, decodeTrustSignalEnvelope, hashTrustSignalEnvelope, verifyTrustSignalHash, } from "./trust-signal.js";
|
|
6
6
|
export { MAX_CONTENT_BYTES } from "./limits.js";
|
|
7
7
|
export { encodeStructure1, STRUCTURE1_VERSION } from "./structure1.js";
|
|
8
8
|
export { SCAN_RESULT_SENTINEL, buildStructure2, encodeStructure2, encodeScanResultSentinel, verifyStructure2Signature, } from "./structure2.js";
|
|
@@ -10,7 +10,7 @@ export { computeGenesisPrevRoot, encodeSealPayload, decodeSealPayload, buildSess
|
|
|
10
10
|
export { MAX_PSEUDONYM_LABEL_BYTES, ML_DSA_PUBKEY_BYTES, ML_DSA_SIGNATURE_BYTES, buildPseudonymBinding, verifyPseudonymBinding, verifyEndorsement, verifyAttestation, validateConnectionPackage, encodeConnectionPackage, decodeConnectionPackage, } from "./connection-package.js";
|
|
11
11
|
export { buildPrimaryTransferTbs, PRIMARY_TRANSFER_DOMAIN } from "./primary-transfer.js";
|
|
12
12
|
export { buildAgentRevocationTbs, AGENT_REVOCATION_DOMAIN } from "./revocation.js";
|
|
13
|
-
export { MANIFEST_SIGNATURE_INVALID, MANIFEST_VERSION_ROLLBACK, MANIFEST_EXPIRED, } from "./manifest.js";
|
|
13
|
+
export { MANIFEST_SIGNATURE_INVALID, MANIFEST_VERSION_ROLLBACK, MANIFEST_EXPIRED, nodeRole, isValidator, validatorNodes, } from "./manifest.js";
|
|
14
14
|
export { IT_LENGTH_PREFIX_DEFAULT_MAX, CONTENT_PARK_PROTOCOL_ID, CONTENT_PARK_AUTH_DOMAIN, buildContentParkAuthMsg, PARK_CONTENT_DOMAIN, buildParkContentTbs, isContentDeliveryAck, isContentResendRequest, isContentParkDeposit, } from "./content-delivery.js";
|
|
15
15
|
export { encodeSessionLivenessQuery, decodeSessionLivenessQuery, encodeSessionLivenessResponse, decodeSessionLivenessResponse, } from "./session-liveness.js";
|
|
16
16
|
// MONIKER-0 — the single home of the agent-name / moniker charset rule (wire contract).
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEnD,8FAA8F;AAC9F,wFAAwF;AACxF,2BAA2B;AAC3B,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAmB3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGvE,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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O,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,cAAc,GACf,MAAM,eAAe,CAAC;AAuBvB,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAO/B,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAE/B,wFAAwF;AACxF,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/manifest.d.ts
CHANGED
|
@@ -8,6 +8,15 @@
|
|
|
8
8
|
* Types defined here are consumed by core/crypto (verification logic) and core/daemon (manifest
|
|
9
9
|
* fetching, caching, and bootstrap).
|
|
10
10
|
*/
|
|
11
|
+
/**
|
|
12
|
+
* A node's role in the consortium (M12 role split).
|
|
13
|
+
*
|
|
14
|
+
* - `validator` holds FROST shares, participates in DKG, signs seals, and honors the kill
|
|
15
|
+
* switch — it is counted in `T = majority(validators)`.
|
|
16
|
+
* - `replica` holds no shares and never signs; it replicates state for redundancy and reads
|
|
17
|
+
* and is NEVER counted in the threshold arithmetic.
|
|
18
|
+
*/
|
|
19
|
+
export type NodeRole = "validator" | "replica";
|
|
11
20
|
/** A single directory node in the consortium. */
|
|
12
21
|
export interface ConsortiumNode {
|
|
13
22
|
nodeId: string;
|
|
@@ -16,7 +25,35 @@ export interface ConsortiumNode {
|
|
|
16
25
|
region: string;
|
|
17
26
|
provider: "aws" | "gcp" | "azure";
|
|
18
27
|
endpoint: string;
|
|
28
|
+
/**
|
|
29
|
+
* M12 role split. Absent ⇒ `validator` — every manifest written before the split has no
|
|
30
|
+
* `role` field, and every node in one was a validator, so the default preserves those
|
|
31
|
+
* manifests byte-for-byte (canonical body omits absent fields) AND semantically.
|
|
32
|
+
*/
|
|
33
|
+
role?: NodeRole;
|
|
34
|
+
/**
|
|
35
|
+
* libp2p PeerId, needed by directory↔directory anti-entropy to dial a peer (M12). Absent in
|
|
36
|
+
* pre-M12 manifests; PeerIds lived only in unsigned SSM before the split. Optional so those
|
|
37
|
+
* manifests still verify.
|
|
38
|
+
*/
|
|
39
|
+
peerId?: string;
|
|
19
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* The effective role of a node — the single defaulting rule, used everywhere.
|
|
43
|
+
* A node with no explicit `role` is a validator, and — since `role` is untrusted at runtime
|
|
44
|
+
* despite the type — anything that is not exactly "replica" is a validator. This matches the
|
|
45
|
+
* crypto verify-boundary count (`!== "replica"`) exactly; a manifest that reached a consumer
|
|
46
|
+
* has already passed `verifyManifest`, which rejects any role outside {validator, replica}, so
|
|
47
|
+
* the only values that survive here are the two valid ones.
|
|
48
|
+
*/
|
|
49
|
+
export declare function nodeRole(node: ConsortiumNode): NodeRole;
|
|
50
|
+
/** True iff the node is (effectively) a validator. */
|
|
51
|
+
export declare function isValidator(node: ConsortiumNode): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The validator-role nodes of a manifest — the ONLY set that enters threshold arithmetic
|
|
54
|
+
* (`consortiumNodeCount`, DKG quorum, kill-switch honoring). Replicas are excluded.
|
|
55
|
+
*/
|
|
56
|
+
export declare function validatorNodes(nodes: readonly ConsortiumNode[]): ConsortiumNode[];
|
|
20
57
|
/** An officer's Ed25519 signature over the canonical manifest body. */
|
|
21
58
|
export interface OfficerSignature {
|
|
22
59
|
/** 0-based officer index into the root key array. */
|
package/dist/manifest.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,iDAAiD;AACjD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,MAAM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xB,UAAU,EAAE,gBAAgB,EAAE,CAAC;CAChC;AAED,+DAA+D;AAC/D,MAAM,MAAM,aAAa,GACrB,4BAA4B,GAC5B,2BAA2B,GAC3B,kBAAkB,CAAC;AAEvB,qDAAqD;AACrD,eAAO,MAAM,0BAA0B,EAAE,aAA4C,CAAC;AAEtF,mFAAmF;AACnF,eAAO,MAAM,yBAAyB,EAAE,aAA2C,CAAC;AAEpF,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,EAAE,aAAkC,CAAC"}
|
package/dist/manifest.js
CHANGED
|
@@ -8,6 +8,28 @@
|
|
|
8
8
|
* Types defined here are consumed by core/crypto (verification logic) and core/daemon (manifest
|
|
9
9
|
* fetching, caching, and bootstrap).
|
|
10
10
|
*/
|
|
11
|
+
/**
|
|
12
|
+
* The effective role of a node — the single defaulting rule, used everywhere.
|
|
13
|
+
* A node with no explicit `role` is a validator, and — since `role` is untrusted at runtime
|
|
14
|
+
* despite the type — anything that is not exactly "replica" is a validator. This matches the
|
|
15
|
+
* crypto verify-boundary count (`!== "replica"`) exactly; a manifest that reached a consumer
|
|
16
|
+
* has already passed `verifyManifest`, which rejects any role outside {validator, replica}, so
|
|
17
|
+
* the only values that survive here are the two valid ones.
|
|
18
|
+
*/
|
|
19
|
+
export function nodeRole(node) {
|
|
20
|
+
return node.role === "replica" ? "replica" : "validator";
|
|
21
|
+
}
|
|
22
|
+
/** True iff the node is (effectively) a validator. */
|
|
23
|
+
export function isValidator(node) {
|
|
24
|
+
return nodeRole(node) === "validator";
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The validator-role nodes of a manifest — the ONLY set that enters threshold arithmetic
|
|
28
|
+
* (`consortiumNodeCount`, DKG quorum, kill-switch honoring). Replicas are excluded.
|
|
29
|
+
*/
|
|
30
|
+
export function validatorNodes(nodes) {
|
|
31
|
+
return nodes.filter(isValidator);
|
|
32
|
+
}
|
|
11
33
|
/** Error constant: signature verification failed. */
|
|
12
34
|
export const MANIFEST_SIGNATURE_INVALID = "manifest_signature_invalid";
|
|
13
35
|
/** Error constant: manifest version is older than the currently cached version. */
|
package/dist/manifest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAkCH;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAoB;IAC3C,OAAQ,IAAI,CAAC,IAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC;AACxE,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,WAAW,CAAC,IAAoB;IAC9C,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,WAAW,CAAC;AACxC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,KAAgC;IAC7D,OAAO,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AACnC,CAAC;AA2BD,qDAAqD;AACrD,MAAM,CAAC,MAAM,0BAA0B,GAAkB,4BAA4B,CAAC;AAEtF,mFAAmF;AACnF,MAAM,CAAC,MAAM,yBAAyB,GAAkB,2BAA2B,CAAC;AAEpF,+DAA+D;AAC/D,MAAM,CAAC,MAAM,gBAAgB,GAAkB,kBAAkB,CAAC"}
|
package/dist/trust-signal.d.ts
CHANGED
|
@@ -91,4 +91,25 @@ export declare function hashTrustSignalEnvelope(envelope: TrustSignalEnvelope):
|
|
|
91
91
|
* which is the silent swallow that hides the attack. Let it throw, and log the cause.
|
|
92
92
|
*/
|
|
93
93
|
export declare function verifyTrustSignalHash(envelope: TrustSignalEnvelope, expected: Uint8Array): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Decode canonical envelope bytes back into the envelope — the inverse of `encodeTrustSignalEnvelope`,
|
|
96
|
+
* and the ONE decoder every party shares (INV-CANONICAL / M10-D7 — the holder's daemon that RECEIVES a
|
|
97
|
+
* delivered signal must decode with the SAME code the directory and portal encode with, never a vendored
|
|
98
|
+
* copy). The preimage is a fixed-order 11-element ARRAY (M10-D15); element 0 is the domain tag.
|
|
99
|
+
*
|
|
100
|
+
* REFUSES anything that is not EXACTLY canonical: it re-encodes the decoded envelope with
|
|
101
|
+
* `encodeTrustSignalEnvelope` and compares the bytes to the input. If they differ — a number that came
|
|
102
|
+
* back as a float, a byte string mis-read, a non-minimal integer, trailing bytes — it THROWS rather than
|
|
103
|
+
* return a "best-effort" envelope: a best-effort hash is one two parties can disagree about. Reusing the
|
|
104
|
+
* encoder (not a hand-rolled re-encode) guarantees the decoder cannot drift from it, AND runs the encoder's
|
|
105
|
+
* own field validation (epoch-seconds bounds, payload-is-bytes, 32-byte supersedes_hash) — so a
|
|
106
|
+
* canonical-at-the-byte-level-but-semantically-invalid array (e.g. an out-of-range subject_kind) still
|
|
107
|
+
* throws here rather than escaping as a bad envelope.
|
|
108
|
+
*
|
|
109
|
+
* ⚠️ THROWS on any malformed/non-canonical input (never returns a partial). The holder's chokepoint
|
|
110
|
+
* (`deliverWalletSignal`) and the recipient's verify both depend on that: a delivery that does not
|
|
111
|
+
* round-trip is corrupt or tampered and must not be stored. Do NOT wrap in try/catch → default — that is
|
|
112
|
+
* the silent swallow that turns "unhashable garbage" into "a valid-looking empty signal".
|
|
113
|
+
*/
|
|
114
|
+
export declare function decodeTrustSignalEnvelope(bytes: Uint8Array): TrustSignalEnvelope;
|
|
94
115
|
//# sourceMappingURL=trust-signal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trust-signal.d.ts","sourceRoot":"","sources":["../src/trust-signal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAKH;;gFAEgF;AAChF,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AAEnD;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Q,GAAG,OAAO,CAAC;AAElD;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,iBAAiB,CAAC;IAChC,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,gBAAgB,CAAC;IAC9B,qGAAqG;IACrG,aAAa,EAAE,MAAM,CAAC;IACtB,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,yFAAyF;IACzF,OAAO,EAAE,UAAU,CAAC;IACpB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,yEAAyE;IACzE,eAAe,EAAE,UAAU,GAAG,IAAI,CAAC;CACpC;AAmND,0FAA0F;AAC1F,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,UAAU,CAEnF;AAED;2EAC2E;AAC3E,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,UAAU,CAEjF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,mBAAmB,EAAE,QAAQ,EAAE,UAAU,GAAG,OAAO,CAMlG;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,CA6ChF"}
|
package/dist/trust-signal.js
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* on: a type this code has never seen must hash and flow through untouched.
|
|
37
37
|
*/
|
|
38
38
|
import { hash as sha256 } from "@cello-protocol/crypto";
|
|
39
|
-
import { encodeCbor } from "./cbor.js";
|
|
39
|
+
import { encodeCbor, decodeCbor } from "./cbor.js";
|
|
40
40
|
/** Domain separation, bound as element 0 of the preimage array — the house convention
|
|
41
41
|
* (`AGENT_REVOCATION_DOMAIN`, `PRIMARY_TRANSFER_DOMAIN`). A trust-signal hash can therefore never
|
|
42
42
|
* collide with, or be replayed as, any other hashed/signed CELLO structure. */
|
|
@@ -249,4 +249,68 @@ export function verifyTrustSignalHash(envelope, expected) {
|
|
|
249
249
|
diff |= actual[i] ^ expected[i];
|
|
250
250
|
return diff === 0;
|
|
251
251
|
}
|
|
252
|
+
/**
|
|
253
|
+
* Decode canonical envelope bytes back into the envelope — the inverse of `encodeTrustSignalEnvelope`,
|
|
254
|
+
* and the ONE decoder every party shares (INV-CANONICAL / M10-D7 — the holder's daemon that RECEIVES a
|
|
255
|
+
* delivered signal must decode with the SAME code the directory and portal encode with, never a vendored
|
|
256
|
+
* copy). The preimage is a fixed-order 11-element ARRAY (M10-D15); element 0 is the domain tag.
|
|
257
|
+
*
|
|
258
|
+
* REFUSES anything that is not EXACTLY canonical: it re-encodes the decoded envelope with
|
|
259
|
+
* `encodeTrustSignalEnvelope` and compares the bytes to the input. If they differ — a number that came
|
|
260
|
+
* back as a float, a byte string mis-read, a non-minimal integer, trailing bytes — it THROWS rather than
|
|
261
|
+
* return a "best-effort" envelope: a best-effort hash is one two parties can disagree about. Reusing the
|
|
262
|
+
* encoder (not a hand-rolled re-encode) guarantees the decoder cannot drift from it, AND runs the encoder's
|
|
263
|
+
* own field validation (epoch-seconds bounds, payload-is-bytes, 32-byte supersedes_hash) — so a
|
|
264
|
+
* canonical-at-the-byte-level-but-semantically-invalid array (e.g. an out-of-range subject_kind) still
|
|
265
|
+
* throws here rather than escaping as a bad envelope.
|
|
266
|
+
*
|
|
267
|
+
* ⚠️ THROWS on any malformed/non-canonical input (never returns a partial). The holder's chokepoint
|
|
268
|
+
* (`deliverWalletSignal`) and the recipient's verify both depend on that: a delivery that does not
|
|
269
|
+
* round-trip is corrupt or tampered and must not be stored. Do NOT wrap in try/catch → default — that is
|
|
270
|
+
* the silent swallow that turns "unhashable garbage" into "a valid-looking empty signal".
|
|
271
|
+
*/
|
|
272
|
+
export function decodeTrustSignalEnvelope(bytes) {
|
|
273
|
+
const arr = decodeCbor(bytes);
|
|
274
|
+
if (!Array.isArray(arr) || arr.length !== 11) {
|
|
275
|
+
throw new Error(`trust-signal envelope must be an 11-element CBOR array (the fixed preimage), got ` +
|
|
276
|
+
`${Array.isArray(arr) ? `${arr.length} elements` : typeof arr}`);
|
|
277
|
+
}
|
|
278
|
+
const [domain, subject_kind, subject, issuer_kind, issuer_pubkey, type, schema_version, payload, issued_at, expires_at, supersedes_hash] = arr;
|
|
279
|
+
if (domain !== TRUST_SIGNAL_DOMAIN) {
|
|
280
|
+
throw new Error(`trust-signal envelope domain tag is '${String(domain)}', expected '${TRUST_SIGNAL_DOMAIN}' — not a trust-signal envelope`);
|
|
281
|
+
}
|
|
282
|
+
// NORMALIZE to a plain, freshly-copied Uint8Array. node's CBOR decoder returns byte strings as a
|
|
283
|
+
// `Buffer` (a Uint8Array subclass) that can ALIAS a pooled ArrayBuffer — returning it as-is would leak a
|
|
284
|
+
// view over shared memory and make the decoded type Buffer, not Uint8Array. `new Uint8Array(v)` copies
|
|
285
|
+
// the bytes into an owned array, so the envelope's byte fields are the same type the encoder expects and
|
|
286
|
+
// never alias a pool.
|
|
287
|
+
const asBytes = (v, field) => {
|
|
288
|
+
if (v instanceof Uint8Array)
|
|
289
|
+
return new Uint8Array(v);
|
|
290
|
+
throw new Error(`trust-signal envelope: ${field} must be raw bytes, got ${v === null ? "null" : typeof v}`);
|
|
291
|
+
};
|
|
292
|
+
const env = {
|
|
293
|
+
subject_kind: subject_kind,
|
|
294
|
+
subject: subject,
|
|
295
|
+
issuer_kind: issuer_kind,
|
|
296
|
+
issuer_pubkey: issuer_pubkey,
|
|
297
|
+
type: type,
|
|
298
|
+
schema_version: Number(schema_version),
|
|
299
|
+
payload: asBytes(payload, "payload"),
|
|
300
|
+
issued_at: Number(issued_at),
|
|
301
|
+
expires_at: expires_at === null || expires_at === undefined ? null : Number(expires_at),
|
|
302
|
+
supersedes_hash: supersedes_hash === null || supersedes_hash === undefined ? null : asBytes(supersedes_hash, "supersedes_hash"),
|
|
303
|
+
};
|
|
304
|
+
// Canonical check: re-encode with the SAME encoder every party runs and compare EXACTLY.
|
|
305
|
+
const reencoded = encodeTrustSignalEnvelope(env);
|
|
306
|
+
if (reencoded.length !== bytes.length) {
|
|
307
|
+
throw new Error("trust-signal envelope bytes are not canonical — re-encoding does not reproduce the input");
|
|
308
|
+
}
|
|
309
|
+
for (let i = 0; i < reencoded.length; i++) {
|
|
310
|
+
if (reencoded[i] !== bytes[i]) {
|
|
311
|
+
throw new Error("trust-signal envelope bytes are not canonical — re-encoding does not reproduce the input");
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return env;
|
|
315
|
+
}
|
|
252
316
|
//# sourceMappingURL=trust-signal.js.map
|
package/dist/trust-signal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trust-signal.js","sourceRoot":"","sources":["../src/trust-signal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"trust-signal.js","sourceRoot":"","sources":["../src/trust-signal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEnD;;gFAEgF;AAChF,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAoCnD;0FAC0F;AAC1F,MAAM,eAAe,GAAG;IACtB,cAAc;IACd,SAAS;IACT,aAAa;IACb,eAAe;IACf,MAAM;IACN,gBAAgB;IAChB,SAAS;IACT,WAAW;IACX,YAAY;IACZ,iBAAiB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AM,IAAI,KAAK,CAAC,0FAA0F,CAAC,CAAC;IAC9G,CAAC;IACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,0FAA0F,CAAC,CAAC;QAC9G,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,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.25",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"cbor-x": "^1.6.4",
|
|
29
|
-
"@cello-protocol/crypto": "0.0.
|
|
29
|
+
"@cello-protocol/crypto": "0.0.23"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@claude-flow/testing": "3.0.0-alpha.6",
|