@metalabel/dfos-protocol 0.52.0 → 0.53.0

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.
@@ -86,6 +86,25 @@ declare const verifyIdentityChain: (input: {
86
86
  */
87
87
  asOf?: string;
88
88
  }) => Promise<VerifiedIdentity>;
89
+ /**
90
+ * The trusted state cannot be extended incrementally: it does not carry the
91
+ * chain-wide id-to-material binding. The caller replays the log.
92
+ *
93
+ * THERE IS NO RECONSTRUCTION, and that is the whole point. `seenKeys` is a
94
+ * monotonic index that never forgets a key id once the chain declared it — even
95
+ * after the id is dropped from the declared arrays — and nothing else in the
96
+ * state remembers it: an id introduced without a proof and then removed is in
97
+ * neither `declared` (removed) nor `provedKeys` (never proved). Reading the
98
+ * binding off those two arrays therefore treats a re-declaration of that id,
99
+ * bound to DIFFERENT material, as a fresh introduction and accepts it — while a
100
+ * full replay of the same operations rejects it. A fast path that accepts what
101
+ * its own re-verification refuses is worse than one that says it cannot answer.
102
+ *
103
+ * The Go twin is `ErrIdentityStateNoSeenKeys`, with this exact message.
104
+ */
105
+ declare class IdentityStateNoSeenKeysError extends Error {
106
+ constructor();
107
+ }
89
108
  /**
90
109
  * Verify a single new operation against already-verified identity state
91
110
  *
@@ -100,7 +119,8 @@ declare const verifyIdentityChain: (input: {
100
119
  * is REJECTED on this path exactly as a replay of the same two operations would
101
120
  * reject it. Without that the fast path would accept a chain its own
102
121
  * re-verification refuses, and a relay's linear path is the path almost every
103
- * operation takes.
122
+ * operation takes. A state that does not carry `seenKeys` is therefore not
123
+ * extensible at all — see `IdentityStateNoSeenKeysError`.
104
124
  *
105
125
  * THE POSSESSION FOLD RUNS HERE TOO, and it needs both halves of the trusted
106
126
  * state: the EFFECTIVE arrays (to know what an introduction is a transition out
@@ -130,8 +150,16 @@ type AnchorKind = 'chain' | 'artifact' | 'invalid';
130
150
  * Enforce the services byte cap on the CBOR-encoded array — same encoding the
131
151
  * wire uses, so the bound is identical across implementations. Mirrors the
132
152
  * artifact payload size check.
153
+ *
154
+ * MEASURE THE RAW DECODED PAYLOAD'S ARRAY, never zod's output. The parameter is
155
+ * `unknown` to make that hard to get wrong: the schema is a validator, not a
156
+ * canonicalizer, and its output object is freshly built — a `__proto__` data
157
+ * member (constructible only by `JSON.parse`) does not survive the copy. Handing
158
+ * this the parsed `op.services` measured 19 bytes for a 33,032-byte signed
159
+ * array, which Go's `parseServices` — reading the wire map directly — rejects.
160
+ * Same rule as the operation CID, and for the same reason.
133
161
  */
134
- declare const assertServicesWithinCap: (services: ServiceEntry[]) => Promise<void>;
162
+ declare const assertServicesWithinCap: (services: unknown) => Promise<void>;
135
163
  /**
136
164
  * Classify a ContentAnchor target by structural form. Resolvers dispatch on the
137
165
  * result: 'chain' → resolve a content chain by contentId; 'artifact' → fetch by
@@ -560,4 +588,4 @@ declare const assertCanonicalSignRequestPayload: (payloadTyp: string, payloadByt
560
588
  subject: string;
561
589
  }) => void;
562
590
 
563
- export { type AnchorKind, ArtifactPayload, ContentOperation, CountersignPayload, type CreditClaimFailureReason, CreditClaimVerifyError, type CreditEntry, type CreditEntryState, ED25519_PRIV_MULTICODEC, ED25519_PUB_MULTICODEC, IdentityOperation, RECOGNIZED_SERVICE_TYPES, ServiceEntry, type SignRequestFailureReason, SignRequestVerifyError, Signer, type VerifiedArtifact, type VerifiedContentChain, type VerifiedCountersignature, type VerifiedCreditClaim, type VerifiedCreditEntry, VerifiedIdentity, type VerifiedRevocation, type VerifiedSignRequest, anchorsByLabel, assertCanonicalSignRequestPayload, assertServicesWithinCap, buildSignRequest, classifyAnchor, decodeEd25519PublicMultikey, decodeMultikey, deriveChainIdentifier, deriveContentId, encodeEd25519Multikey, isRecognizedServiceType, relayEndpoints, signArtifact, signContentOperation, signCountersignature, signCreditClaim, signIdentityOperation, signRevocation, verifyArtifact, verifyContentChain, verifyContentExtensionFromTrustedState, verifyCountersignature, verifyCreditClaim, verifyCreditEntry, verifyIdentityChain, verifyIdentityExtensionFromTrustedState, verifyRevocation, verifySignRequest };
591
+ export { type AnchorKind, ArtifactPayload, ContentOperation, CountersignPayload, type CreditClaimFailureReason, CreditClaimVerifyError, type CreditEntry, type CreditEntryState, ED25519_PRIV_MULTICODEC, ED25519_PUB_MULTICODEC, IdentityOperation, IdentityStateNoSeenKeysError, RECOGNIZED_SERVICE_TYPES, ServiceEntry, type SignRequestFailureReason, SignRequestVerifyError, Signer, type VerifiedArtifact, type VerifiedContentChain, type VerifiedCountersignature, type VerifiedCreditClaim, type VerifiedCreditEntry, VerifiedIdentity, type VerifiedRevocation, type VerifiedSignRequest, anchorsByLabel, assertCanonicalSignRequestPayload, assertServicesWithinCap, buildSignRequest, classifyAnchor, decodeEd25519PublicMultikey, decodeMultikey, deriveChainIdentifier, deriveContentId, encodeEd25519Multikey, isRecognizedServiceType, relayEndpoints, signArtifact, signContentOperation, signCountersignature, signCreditClaim, signIdentityOperation, signRevocation, verifyArtifact, verifyContentChain, verifyContentExtensionFromTrustedState, verifyCountersignature, verifyCreditClaim, verifyCreditEntry, verifyIdentityChain, verifyIdentityExtensionFromTrustedState, verifyRevocation, verifySignRequest };
@@ -8,6 +8,7 @@ import {
8
8
  CreditClaimVerifyError,
9
9
  DeclaredKeyState,
10
10
  IdentityOperation,
11
+ IdentityStateNoSeenKeysError,
11
12
  Iso8601,
12
13
  MAX_ARTIFACT_PAYLOAD_SIZE,
13
14
  MAX_CREDIT_CLAIM_SIZE,
@@ -52,9 +53,9 @@ import {
52
53
  verifyIdentityExtensionFromTrustedState,
53
54
  verifyRevocation,
54
55
  verifySignRequest
55
- } from "../chunk-OU2DPHCN.js";
56
- import "../chunk-IV3TIYKP.js";
57
- import "../chunk-QRCOMLAP.js";
56
+ } from "../chunk-WBFWGQTS.js";
57
+ import "../chunk-VEKRLXZ5.js";
58
+ import "../chunk-ISHAX5WN.js";
58
59
  import {
59
60
  ED25519_PRIV_MULTICODEC,
60
61
  ED25519_PUB_MULTICODEC,
@@ -62,7 +63,7 @@ import {
62
63
  decodeMultikey,
63
64
  encodeEd25519Multikey
64
65
  } from "../chunk-F7RHI2CK.js";
65
- import "../chunk-QTJZGXMH.js";
66
+ import "../chunk-NUIIVAZ3.js";
66
67
  export {
67
68
  ARTIFACT_CID_ANCHOR_RE,
68
69
  ArtifactPayload,
@@ -75,6 +76,7 @@ export {
75
76
  ED25519_PRIV_MULTICODEC,
76
77
  ED25519_PUB_MULTICODEC,
77
78
  IdentityOperation,
79
+ IdentityStateNoSeenKeysError,
78
80
  Iso8601,
79
81
  MAX_ARTIFACT_PAYLOAD_SIZE,
80
82
  MAX_CREDIT_CLAIM_SIZE,
@@ -9,7 +9,7 @@ import {
9
9
  isValidEd25519Signature,
10
10
  sha256,
11
11
  signPayloadEd25519
12
- } from "./chunk-QTJZGXMH.js";
12
+ } from "./chunk-NUIIVAZ3.js";
13
13
 
14
14
  // src/key-proof/role-set.ts
15
15
  var KEY_ROLES = ["auth", "assert", "controller"];
@@ -161,10 +161,15 @@ var assertJwsProfile = (header, makeError) => {
161
161
  var decodeJwsSegment = (segmentB64) => {
162
162
  let text;
163
163
  try {
164
- text = new TextDecoder("utf-8", { fatal: true }).decode(base64urlDecode(segmentB64));
164
+ text = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(
165
+ base64urlDecode(segmentB64)
166
+ );
165
167
  } catch {
166
168
  return null;
167
169
  }
170
+ if (text.charCodeAt(0) === 65279) {
171
+ throw new Error("leading byte order mark is not canonicalizable");
172
+ }
168
173
  assertCanonicalJsonText(text);
169
174
  let value;
170
175
  try {
@@ -178,7 +183,7 @@ var decodeJwsSegment = (segmentB64) => {
178
183
  var asJwsHeader = (raw) => {
179
184
  if (typeof raw["alg"] !== "string") return null;
180
185
  if (typeof raw["typ"] !== "string") return null;
181
- if (typeof raw["kid"] !== "string") return null;
186
+ if ("kid" in raw && typeof raw["kid"] !== "string") return null;
182
187
  if ("cid" in raw && typeof raw["cid"] !== "string") return null;
183
188
  return raw;
184
189
  };
@@ -10,7 +10,7 @@ import {
10
10
  decodeJwsUnsafe,
11
11
  sha256,
12
12
  verifyJws
13
- } from "./chunk-QTJZGXMH.js";
13
+ } from "./chunk-NUIIVAZ3.js";
14
14
 
15
15
  // src/credentials/schemas.ts
16
16
  import { z } from "zod";
@@ -438,6 +438,7 @@ var verifyDFOSCredential = async (jwsToken, options) => {
438
438
  }
439
439
  const payload = result.data;
440
440
  const kid = decoded.header.kid;
441
+ if (kid === void 0) throw new CredentialVerificationError("credential kid must be present");
441
442
  const hashIdx = kid.indexOf("#");
442
443
  if (hashIdx < 0) throw new CredentialVerificationError("credential kid must be a DID URL");
443
444
  const kidDid = kid.substring(0, hashIdx);
@@ -596,7 +597,7 @@ var matchesResource = async (att, resource, action) => {
596
597
  };
597
598
  var decodeDFOSCredentialUnsafe = (jwsToken) => {
598
599
  const decoded = decodeJwsUnsafe(jwsToken);
599
- if (!decoded) return null;
600
+ if (!decoded || decoded.header.kid === void 0) return null;
600
601
  const result = DFOSCredentialPayload.safeParse(decoded.payload);
601
602
  if (!result.success) return null;
602
603
  return {
@@ -6,13 +6,13 @@ import {
6
6
  matchesResource,
7
7
  verifyDFOSCredential,
8
8
  verifyDelegationChain
9
- } from "./chunk-IV3TIYKP.js";
9
+ } from "./chunk-VEKRLXZ5.js";
10
10
  import {
11
11
  KEY_ADD_JWS_TYP,
12
12
  KEY_ROLES,
13
13
  unsafeKeyProofSubject,
14
14
  verifyChainKeyProof
15
- } from "./chunk-QRCOMLAP.js";
15
+ } from "./chunk-ISHAX5WN.js";
16
16
  import {
17
17
  decodeEd25519PublicMultikey
18
18
  } from "./chunk-F7RHI2CK.js";
@@ -25,7 +25,7 @@ import {
25
25
  decodeJwsUnsafe,
26
26
  generateIdNoPrefix,
27
27
  verifyJws
28
- } from "./chunk-QTJZGXMH.js";
28
+ } from "./chunk-NUIIVAZ3.js";
29
29
 
30
30
  // src/chain/schemas.ts
31
31
  import { z } from "zod";
@@ -540,7 +540,7 @@ var verifyIdentityChain = async (input) => {
540
540
  });
541
541
  if (op.services) {
542
542
  try {
543
- await assertServicesWithinCap(op.services);
543
+ await assertServicesWithinCap(decoded.payload["services"]);
544
544
  } catch (e) {
545
545
  throw new Error(`log[${idx}]: ${e.message}`);
546
546
  }
@@ -560,6 +560,7 @@ var verifyIdentityChain = async (input) => {
560
560
  throw new Error(`log[${idx}]: cid mismatch in protected header`);
561
561
  }
562
562
  const kid = decoded.header.kid;
563
+ if (kid === void 0) throw new Error(`log[${idx}]: kid must be present`);
563
564
  let signingKeyId;
564
565
  if (kid.includes("#")) {
565
566
  const hashIdx = kid.indexOf("#");
@@ -660,14 +661,19 @@ var verifyIdentityChain = async (input) => {
660
661
  seenKeys: [...state.seenKeys.values()]
661
662
  };
662
663
  };
664
+ var IdentityStateNoSeenKeysError = class extends Error {
665
+ constructor() {
666
+ super("identity state has no seenKeys; replay the chain");
667
+ this.name = "IdentityStateNoSeenKeysError";
668
+ }
669
+ };
663
670
  var verifyIdentityExtensionFromTrustedState = async (input) => {
664
671
  const { currentState, headCID, lastCreatedAt, newOp } = input;
665
672
  const priorEffective = keyStateOf(currentState);
666
673
  const priorDeclared = currentState.declared ?? priorEffective;
667
674
  const priorProved = currentState.provedKeys ?? priorEffective;
668
- const seenKeys = keyMaterialIndex(
669
- currentState.seenKeys ?? [...flatKeys(priorDeclared), ...flatKeys(priorProved)]
670
- );
675
+ if (!currentState.seenKeys?.length) throw new IdentityStateNoSeenKeysError();
676
+ const seenKeys = keyMaterialIndex(currentState.seenKeys);
671
677
  const priorSeenKeys = [...seenKeys.values()];
672
678
  const decoded = decodeJwsUnsafe(newOp);
673
679
  if (!decoded) throw new Error("failed to decode JWS");
@@ -704,6 +710,7 @@ var verifyIdentityExtensionFromTrustedState = async (input) => {
704
710
  if (!decoded.header.cid) throw new Error("missing cid in protected header");
705
711
  if (decoded.header.cid !== operationCID) throw new Error("cid mismatch in protected header");
706
712
  const kid = decoded.header.kid;
713
+ if (kid === void 0) throw new Error("kid must be present");
707
714
  if (!kid.includes("#")) {
708
715
  throw new Error("non-genesis op kid must be DID URL, got bare key ID");
709
716
  }
@@ -731,7 +738,7 @@ var verifyIdentityExtensionFromTrustedState = async (input) => {
731
738
  throw new Error("cannot repeat key ids in same usage");
732
739
  }
733
740
  });
734
- if (op.services) await assertServicesWithinCap(op.services);
741
+ if (op.services) await assertServicesWithinCap(decoded.payload["services"]);
735
742
  }
736
743
  const newState = (() => {
737
744
  switch (op.type) {
@@ -892,6 +899,7 @@ var verifyContentChain = async (input) => {
892
899
  }
893
900
  }
894
901
  const kid = decoded.header.kid;
902
+ if (kid === void 0) throw new Error(`log[${idx}]: kid must be present`);
895
903
  const hashIdx = kid.indexOf("#");
896
904
  if (hashIdx < 0) throw new Error(`log[${idx}]: kid must be a DID URL`);
897
905
  const kidDid = kid.substring(0, hashIdx);
@@ -1002,6 +1010,7 @@ var verifyContentExtensionFromTrustedState = async (input) => {
1002
1010
  throw new Error("createdAt must be after last op");
1003
1011
  }
1004
1012
  const kid = decoded.header.kid;
1013
+ if (kid === void 0) throw new Error("kid must be present");
1005
1014
  const hashIdx = kid.indexOf("#");
1006
1015
  if (hashIdx < 0) throw new Error("kid must be a DID URL");
1007
1016
  const kidDid = kid.substring(0, hashIdx);
@@ -1080,6 +1089,7 @@ var verifyCountersignature = async (input) => {
1080
1089
  }
1081
1090
  const payload = result.data;
1082
1091
  const kid = decoded.header.kid;
1092
+ if (kid === void 0) throw new Error("kid must be present");
1083
1093
  const hashIdx = kid.indexOf("#");
1084
1094
  if (hashIdx < 0) throw new Error("countersignature kid must be a DID URL");
1085
1095
  const kidDid = kid.substring(0, hashIdx);
@@ -1133,6 +1143,7 @@ var verifyArtifact = async (input) => {
1133
1143
  throw new Error(`invalid artifact typ: ${decoded.header.typ}`);
1134
1144
  }
1135
1145
  const kid = decoded.header.kid;
1146
+ if (kid === void 0) throw new Error("kid must be present");
1136
1147
  const hashIdx = kid.indexOf("#");
1137
1148
  if (hashIdx < 0) throw new Error("artifact kid must be a DID URL");
1138
1149
  const kidDid = kid.substring(0, hashIdx);
@@ -1190,6 +1201,7 @@ var verifyRevocation = async (input) => {
1190
1201
  throw new Error(`invalid revocation typ: ${decoded.header.typ}`);
1191
1202
  }
1192
1203
  const kid = decoded.header.kid;
1204
+ if (kid === void 0) throw new Error("kid must be present");
1193
1205
  const hashIdx = kid.indexOf("#");
1194
1206
  if (hashIdx < 0) throw new Error("revocation kid must be a DID URL");
1195
1207
  const kidDid = kid.substring(0, hashIdx);
@@ -1295,8 +1307,7 @@ var verifyCreditClaim = async (jwsToken, options) => {
1295
1307
  }
1296
1308
  const decoded = decodeJwsUnsafe(jwsToken);
1297
1309
  if (!decoded) throw invalid("failed to decode credit claim JWS");
1298
- const rawHeader = decoded.header;
1299
- if (typeof rawHeader["typ"] !== "string" || typeof rawHeader["kid"] !== "string") {
1310
+ if (typeof decoded.header.kid !== "string") {
1300
1311
  throw invalid("credit claim header must carry a string typ and kid");
1301
1312
  }
1302
1313
  if (decoded.header.typ !== "did:dfos:credit-claim") {
@@ -1522,7 +1533,7 @@ var verifySignRequest = async (jwsToken, options) => {
1522
1533
  throw invalid2("sign request protected header must be an object");
1523
1534
  }
1524
1535
  assertJwsProfile(rawHeader, invalid2);
1525
- if (typeof rawHeader["typ"] !== "string" || typeof rawHeader["kid"] !== "string") {
1536
+ if (typeof rawHeader["typ"] !== "string" || typeof decoded.header.kid !== "string") {
1526
1537
  throw invalid2("sign request header must carry a string typ and kid");
1527
1538
  }
1528
1539
  if (decoded.header.typ !== "did:dfos:sign-request") {
@@ -1673,6 +1684,7 @@ export {
1673
1684
  anchorsByLabel,
1674
1685
  signIdentityOperation,
1675
1686
  verifyIdentityChain,
1687
+ IdentityStateNoSeenKeysError,
1676
1688
  verifyIdentityExtensionFromTrustedState,
1677
1689
  signContentOperation,
1678
1690
  verifyContentChain,
@@ -34,9 +34,9 @@ import {
34
34
  verifyDelegationChain,
35
35
  verifyIdentityProofEnvelope,
36
36
  verifyRequestProofEnvelope
37
- } from "../chunk-IV3TIYKP.js";
37
+ } from "../chunk-VEKRLXZ5.js";
38
38
  import "../chunk-F7RHI2CK.js";
39
- import "../chunk-QTJZGXMH.js";
39
+ import "../chunk-NUIIVAZ3.js";
40
40
  export {
41
41
  ApiRequestVerifyError,
42
42
  Attenuation,
@@ -85,7 +85,7 @@ declare const normalizedId: <T extends string>(prefix: T, id: string) => `${T}_$
85
85
  interface JwsHeader {
86
86
  alg: 'EdDSA';
87
87
  typ: string;
88
- kid: string;
88
+ kid?: string;
89
89
  /** CIDv1 of the operation payload (dag-cbor + SHA-256), signed in the protected header */
90
90
  cid?: string;
91
91
  }
@@ -96,7 +96,9 @@ interface JwsHeader {
96
96
  * signature (64 bytes)
97
97
  */
98
98
  declare const createJws: (options: {
99
- header: JwsHeader;
99
+ header: JwsHeader & {
100
+ kid: string;
101
+ };
100
102
  payload: Record<string, unknown>;
101
103
  sign: (message: Uint8Array) => Promise<Uint8Array>;
102
104
  }) => Promise<string>;
@@ -23,7 +23,7 @@ import {
23
23
  signPayloadEd25519,
24
24
  verifyJws,
25
25
  verifyJwt
26
- } from "../chunk-QTJZGXMH.js";
26
+ } from "../chunk-NUIIVAZ3.js";
27
27
  export {
28
28
  JwsVerificationError,
29
29
  JwtVerificationError,
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { JwsHeader, JwsVerificationError, JwtClaims, JwtCreateOptions, JwtHeader, JwtVerificationError, JwtVerifyOptions, PrefixedID, assertCanonicalJsonText, assertJwsProfile, base64urlDecode, base64urlEncode, createJws, createJwt, createNewEd25519Keypair, dagCborCanonicalEncode, decodeJwsUnsafe, decodeJwtUnsafe, generateId, generateIdNoPrefix, importEd25519Keypair, isCanonicallyEqual, isValidEd25519Signature, isValidId, normalizedId, parseDagCborCID, sha256, signPayloadEd25519, verifyJws, verifyJwt } from './crypto/index.js';
2
2
  export { A as ARTIFACT_CID_ANCHOR_RE, a as ArtifactPayload, b as Attenuation, C as CONTENT_ID_ANCHOR_RE, c as ContentOperation, d as CountersignPayload, e as CredentialVerificationError, f as CreditClaimPayload, D as DFOSCredentialPayload, g as DeclaredKeyState, I as IdentityOperation, h as Iso8601, M as MAX_ARTIFACT_PAYLOAD_SIZE, i as MAX_CREDENTIAL_SIZE, j as MAX_CREDIT_CLAIM_SIZE, k as MAX_KEY_PROOFS, l as MAX_OPERATION_SIZE, m as MAX_SERVICES_ENTRIES, n as MAX_SERVICES_PAYLOAD_SIZE, o as MAX_SIGN_REQUEST_PAYLOAD_SIZE, p as MAX_SIGN_REQUEST_SIZE, q as MultikeyPublicKey, R as ResolvedIdentity, r as RevocationChecker, s as RevocationPayload, S as ServiceEntry, t as ServicesArray, u as SignRequestPayload, v as Signer, V as VerifiedDFOSCredential, w as VerifiedDelegationChain, x as VerifiedIdentity, y as VoidKeyMembership, z as createDFOSCredential, B as decodeDFOSCredentialUnsafe, E as isAttenuated, F as matchesResource, G as parseProtocolTimestampUnix, H as verifyDFOSCredential, J as verifyDelegationChain } from './dfos-credential-j-kHtFvG.js';
3
- export { AnchorKind, CreditClaimFailureReason, CreditClaimVerifyError, CreditEntry, CreditEntryState, ED25519_PRIV_MULTICODEC, ED25519_PUB_MULTICODEC, RECOGNIZED_SERVICE_TYPES, SignRequestFailureReason, SignRequestVerifyError, VerifiedArtifact, VerifiedContentChain, VerifiedCountersignature, VerifiedCreditClaim, VerifiedCreditEntry, VerifiedRevocation, VerifiedSignRequest, anchorsByLabel, assertCanonicalSignRequestPayload, assertServicesWithinCap, buildSignRequest, classifyAnchor, decodeEd25519PublicMultikey, decodeMultikey, deriveChainIdentifier, deriveContentId, encodeEd25519Multikey, isRecognizedServiceType, relayEndpoints, signArtifact, signContentOperation, signCountersignature, signCreditClaim, signIdentityOperation, signRevocation, verifyArtifact, verifyContentChain, verifyContentExtensionFromTrustedState, verifyCountersignature, verifyCreditClaim, verifyCreditEntry, verifyIdentityChain, verifyIdentityExtensionFromTrustedState, verifyRevocation, verifySignRequest } from './chain/index.js';
3
+ export { AnchorKind, CreditClaimFailureReason, CreditClaimVerifyError, CreditEntry, CreditEntryState, ED25519_PRIV_MULTICODEC, ED25519_PUB_MULTICODEC, IdentityStateNoSeenKeysError, RECOGNIZED_SERVICE_TYPES, SignRequestFailureReason, SignRequestVerifyError, VerifiedArtifact, VerifiedContentChain, VerifiedCountersignature, VerifiedCreditClaim, VerifiedCreditEntry, VerifiedRevocation, VerifiedSignRequest, anchorsByLabel, assertCanonicalSignRequestPayload, assertServicesWithinCap, buildSignRequest, classifyAnchor, decodeEd25519PublicMultikey, decodeMultikey, deriveChainIdentifier, deriveContentId, encodeEd25519Multikey, isRecognizedServiceType, relayEndpoints, signArtifact, signContentOperation, signCountersignature, signCreditClaim, signIdentityOperation, signRevocation, verifyArtifact, verifyContentChain, verifyContentExtensionFromTrustedState, verifyCountersignature, verifyCreditClaim, verifyCreditEntry, verifyIdentityChain, verifyIdentityExtensionFromTrustedState, verifyRevocation, verifySignRequest } from './chain/index.js';
4
4
  export { ApiRequestVerifyError, DEFAULT_PROOF_SKEW_SECONDS, DEFAULT_PROOF_WINDOW_SECONDS, DFOS_AUTH_SCHEME, EMPTY_BODY_SHA256, IDENTITY_PROOF_JWS_TYP, IdentityProofPayload, MAX_BODY_BYTES, MAX_PROOF_FRESHNESS_SPAN_SECONDS, MAX_REQUEST_PROOF_SIZE, ParsedProofPayload, ProofEnvelopeInput, ProofExtraMembers, ProofPresenterState, REQUEST_PROOF_JWS_TYP, RequestProofFailurePhase, RequestProofFailureReason, RequestProofPayload, ResolveProofPresenter, SignApiIdentityRequestInput, SignApiRequestInput, VerifiedProofEnvelope, apiIdentitySigningInput, apiRequestSigningInput, assertProofVerifierConfig, buildApiAuthHeaders, buildApiIdentityHeaders, canonicalExtraMembers, invalidProof, misconfiguredProof, parseDfosAuthorization, sha256BodyHash, signApiIdentityRequest, signApiRequest, unverifiableProof, verifyIdentityProofEnvelope, verifyRequestProofEnvelope } from './credentials/index.js';
5
5
  export { DEFAULT_KEY_PROOF_SKEW_SECONDS, KEY_ADD_JWS_TYP, KEY_ROLES, KeyProofFailureReason, KeyProofPayload, KeyProofVerifyError, KeyRole, MAX_KEY_PROOF_SIZE, SignKeyProofInput, VerifiedKeyProof, VerifyChainKeyProofOptions, VerifyKeyProofOptions, isCanonicalRoleSet, keyProofSigningInput, keyWordFingerprint, parseRoleSet, roleSetCovers, serializeRoleSet, signKeyProof, unsafeKeyProofSubject, verifyChainKeyProof, verifyKeyProof } from './key-proof/index.js';
6
6
  export { FoldOperation, INDEX_V1_SCHEMA, IndexDelta, IndexDocument, IndexEntry, LwwDelta, OrderKey, byteCompare, compareHeadPreference, compareLinear, foldIndexV1, foldLwwMap, linearize } from './fold/index.js';
package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  CreditClaimVerifyError,
9
9
  DeclaredKeyState,
10
10
  IdentityOperation,
11
+ IdentityStateNoSeenKeysError,
11
12
  Iso8601,
12
13
  MAX_ARTIFACT_PAYLOAD_SIZE,
13
14
  MAX_CREDIT_CLAIM_SIZE,
@@ -52,7 +53,7 @@ import {
52
53
  verifyIdentityExtensionFromTrustedState,
53
54
  verifyRevocation,
54
55
  verifySignRequest
55
- } from "./chunk-OU2DPHCN.js";
56
+ } from "./chunk-WBFWGQTS.js";
56
57
  import {
57
58
  ApiRequestVerifyError,
58
59
  Attenuation,
@@ -92,7 +93,7 @@ import {
92
93
  verifyDelegationChain,
93
94
  verifyIdentityProofEnvelope,
94
95
  verifyRequestProofEnvelope
95
- } from "./chunk-IV3TIYKP.js";
96
+ } from "./chunk-VEKRLXZ5.js";
96
97
  import {
97
98
  DEFAULT_KEY_PROOF_SKEW_SECONDS,
98
99
  KEY_ADD_JWS_TYP,
@@ -109,7 +110,7 @@ import {
109
110
  unsafeKeyProofSubject,
110
111
  verifyChainKeyProof,
111
112
  verifyKeyProof
112
- } from "./chunk-QRCOMLAP.js";
113
+ } from "./chunk-ISHAX5WN.js";
113
114
  import {
114
115
  ED25519_PRIV_MULTICODEC,
115
116
  ED25519_PUB_MULTICODEC,
@@ -142,7 +143,7 @@ import {
142
143
  signPayloadEd25519,
143
144
  verifyJws,
144
145
  verifyJwt
145
- } from "./chunk-QTJZGXMH.js";
146
+ } from "./chunk-NUIIVAZ3.js";
146
147
  import {
147
148
  INDEX_V1_SCHEMA,
148
149
  byteCompare,
@@ -175,6 +176,7 @@ export {
175
176
  IDENTITY_PROOF_JWS_TYP,
176
177
  INDEX_V1_SCHEMA,
177
178
  IdentityOperation,
179
+ IdentityStateNoSeenKeysError,
178
180
  Iso8601,
179
181
  JwsVerificationError,
180
182
  JwtVerificationError,
@@ -143,7 +143,7 @@ interface SignKeyProofInput {
143
143
  * The protected header is EXACTLY `{"alg":"EdDSA","typ":"<purpose>"}` — two
144
144
  * members, no `kid` (the key is in no chain and rides in the payload) and no
145
145
  * `cid` (there is no operation to bind). It is assembled by hand rather than
146
- * through `createJws`, whose `JwsHeader` requires a `kid` this envelope must not
146
+ * through `createJws`, whose header input requires a `kid` this envelope must not
147
147
  * carry.
148
148
  *
149
149
  * HOLDER OBLIGATIONS THIS FUNCTION CANNOT DISCHARGE (INTEGRATIONS.md, Holder
@@ -14,9 +14,9 @@ import {
14
14
  unsafeKeyProofSubject,
15
15
  verifyChainKeyProof,
16
16
  verifyKeyProof
17
- } from "../chunk-QRCOMLAP.js";
17
+ } from "../chunk-ISHAX5WN.js";
18
18
  import "../chunk-F7RHI2CK.js";
19
- import "../chunk-QTJZGXMH.js";
19
+ import "../chunk-NUIIVAZ3.js";
20
20
  export {
21
21
  DEFAULT_KEY_PROOF_SKEW_SECONDS,
22
22
  KEY_ADD_JWS_TYP,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metalabel/dfos-protocol",
3
- "version": "0.52.0",
3
+ "version": "0.53.0",
4
4
  "type": "module",
5
5
  "description": "DFOS Protocol — Ed25519 signed chain primitives, services, credentials, and verification",
6
6
  "license": "MIT",