@interop/wallet-core 0.60.0 → 0.62.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.
Files changed (83) hide show
  1. package/dist/clientAnnex/forgetLast.d.ts +66 -19
  2. package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
  3. package/dist/clientAnnex/forgetLast.js +120 -38
  4. package/dist/clientAnnex/forgetLast.js.map +1 -1
  5. package/dist/clientAnnex/heal.d.ts +64 -29
  6. package/dist/clientAnnex/heal.d.ts.map +1 -1
  7. package/dist/clientAnnex/heal.js +292 -54
  8. package/dist/clientAnnex/heal.js.map +1 -1
  9. package/dist/clientAnnex/index.d.ts +2 -2
  10. package/dist/clientAnnex/index.d.ts.map +1 -1
  11. package/dist/clientAnnex/index.js +2 -2
  12. package/dist/clientAnnex/index.js.map +1 -1
  13. package/dist/clientAnnex/ladder.d.ts +246 -18
  14. package/dist/clientAnnex/ladder.d.ts.map +1 -1
  15. package/dist/clientAnnex/ladder.js +742 -53
  16. package/dist/clientAnnex/ladder.js.map +1 -1
  17. package/dist/clientAnnex/ladderAnchored.d.ts +113 -6
  18. package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
  19. package/dist/clientAnnex/ladderAnchored.js +208 -27
  20. package/dist/clientAnnex/ladderAnchored.js.map +1 -1
  21. package/dist/clientAnnex/log.d.ts +37 -1
  22. package/dist/clientAnnex/log.d.ts.map +1 -1
  23. package/dist/clientAnnex/log.js +34 -10
  24. package/dist/clientAnnex/log.js.map +1 -1
  25. package/dist/clientAnnex/recoveryLadderAnchored.d.ts +32 -7
  26. package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
  27. package/dist/clientAnnex/recoveryLadderAnchored.js +124 -23
  28. package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
  29. package/dist/clientAnnex/zcap.js +2 -2
  30. package/dist/clientAnnex/zcap.js.map +1 -1
  31. package/dist/identity/agents.js +2 -2
  32. package/dist/identity/agents.js.map +1 -1
  33. package/dist/keys/index.d.ts +1 -1
  34. package/dist/keys/index.d.ts.map +1 -1
  35. package/dist/keys/index.js +1 -1
  36. package/dist/keys/index.js.map +1 -1
  37. package/dist/keys/userKeyRoster.d.ts +32 -2
  38. package/dist/keys/userKeyRoster.d.ts.map +1 -1
  39. package/dist/keys/userKeyRoster.js +40 -2
  40. package/dist/keys/userKeyRoster.js.map +1 -1
  41. package/dist/recovery/recoveryDelegation.d.ts +4 -1
  42. package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
  43. package/dist/recovery/recoveryDelegation.js +9 -7
  44. package/dist/recovery/recoveryDelegation.js.map +1 -1
  45. package/dist/recovery/recoveryWebvh.d.ts +42 -2
  46. package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
  47. package/dist/recovery/recoveryWebvh.js +160 -18
  48. package/dist/recovery/recoveryWebvh.js.map +1 -1
  49. package/dist/unlock/index.d.ts +2 -2
  50. package/dist/unlock/index.d.ts.map +1 -1
  51. package/dist/unlock/index.js +1 -1
  52. package/dist/unlock/index.js.map +1 -1
  53. package/dist/unlock/retire.d.ts +62 -9
  54. package/dist/unlock/retire.d.ts.map +1 -1
  55. package/dist/unlock/retire.js +59 -5
  56. package/dist/unlock/retire.js.map +1 -1
  57. package/dist/unlock/standingWebvh.d.ts +131 -21
  58. package/dist/unlock/standingWebvh.d.ts.map +1 -1
  59. package/dist/unlock/standingWebvh.js +239 -54
  60. package/dist/unlock/standingWebvh.js.map +1 -1
  61. package/dist/webvh/didWebvh.d.ts +3 -2
  62. package/dist/webvh/didWebvh.d.ts.map +1 -1
  63. package/dist/webvh/didWebvh.js +7 -5
  64. package/dist/webvh/didWebvh.js.map +1 -1
  65. package/dist/webvh/index.d.ts +5 -4
  66. package/dist/webvh/index.d.ts.map +1 -1
  67. package/dist/webvh/index.js +4 -3
  68. package/dist/webvh/index.js.map +1 -1
  69. package/dist/webvh/keyAgreement.d.ts +25 -0
  70. package/dist/webvh/keyAgreement.d.ts.map +1 -1
  71. package/dist/webvh/keyAgreement.js +24 -0
  72. package/dist/webvh/keyAgreement.js.map +1 -1
  73. package/dist/webvh/listClients.d.ts +31 -18
  74. package/dist/webvh/listClients.d.ts.map +1 -1
  75. package/dist/webvh/listClients.js +60 -16
  76. package/dist/webvh/listClients.js.map +1 -1
  77. package/dist/webvh/revokeClient.d.ts +48 -0
  78. package/dist/webvh/revokeClient.d.ts.map +1 -1
  79. package/dist/webvh/revokeClient.js +85 -1
  80. package/dist/webvh/revokeClient.js.map +1 -1
  81. package/dist/webvh/zcap.js +3 -3
  82. package/dist/webvh/zcap.js.map +1 -1
  83. package/package.json +5 -5
@@ -34,8 +34,54 @@
34
34
  * with the same key material converges without forking the log.
35
35
  */
36
36
  import { deriveNextKeyHash, updateDID } from '@interop/did-method-webvh';
37
- import { assertCanonicalClientKeys, assertCarryOverCommitments, markedVerificationMethodPair, MULTIKEY_VM_TYPE, pinOfLog, putLogResource, readPublishedLog, relationIds, servedHead, updateKeySigner, withLogConflictRetry } from '../webvh/didWebvh.js';
37
+ import { assertCanonicalClientKeys, assertCarryOverCommitments, effectiveParameters, markedVerificationMethodPair, MULTIKEY_VM_TYPE, pinOfLog, putLogResource, readPublishedLog, relationIds, servedHead, updateKeySigner, withLogConflictRetry } from '../webvh/didWebvh.js';
38
38
  import { publishUnlockKey, removeUnlockKey } from '../unlock/standingWebvh.js';
39
+ import { ladderVmIds } from '../webvh/listClients.js';
40
+ import { credentialKeyAgreementMethods } from '../webvh/keyAgreement.js';
41
+ // The base-side dependency the lint config pins: the ladder ATTRIBUTION
42
+ // helpers only, never the annex log machinery. The add-and-retire entry
43
+ // resolves each retired credential's standing rungs from the log with them.
44
+ import { assertNextKeyHashesRemain, attributeRetiredCredentialRungs, retiredCredentialRungsBeforeKey } from '../clientAnnex/ladder.js';
45
+ /**
46
+ * What the add-and-retire entry retired, read back OFF THE LOG -- the resumed
47
+ * spend's answer to the same question the live run answers from the document
48
+ * it is editing. A run torn after that entry but before the caller's registry
49
+ * and unlock-Space teardown resumes into the already-complete branch, and
50
+ * without this it would be told nothing was retired and leave every other
51
+ * credential's registry entry standing.
52
+ *
53
+ * The entry is located by its own signature on the log: it is the first entry
54
+ * whose effective `updateKeys` authorize the successor key (the fresh
55
+ * ladder's rung 0 on the transient continuation, the new client's update key
56
+ * on the remembered one), which only that entry writes. What it retired is
57
+ * then the credential-class `keyAgreement` ids its predecessor published and
58
+ * it does not, less the spent code's own id -- the same exclusion the live
59
+ * branch makes, since the caller retires that one by name.
60
+ *
61
+ * @param options {object}
62
+ * @param options.log {DIDLog} the verified account log
63
+ * @param options.did {string} the account DID the log resolves to
64
+ * @param options.successorKeyMultibase {string} the update key only the
65
+ * add-and-retire entry authorizes
66
+ * @param options.spentVmId {string} the spent code's key-agreement
67
+ * verification-method id, excluded from the result
68
+ * @returns {string[]} the retired credentials' key-agreement ids, empty
69
+ * when no entry authorizes the successor key or it is the genesis entry
70
+ */
71
+ export function retiredCredentialVmIdsFromLog({ log, did, successorKeyMultibase, spentVmId }) {
72
+ const params = effectiveParameters(log);
73
+ const index = params.findIndex(entry => (entry.updateKeys ?? []).includes(successorKeyMultibase));
74
+ const previous = index > 0 ? log[index - 1]?.state : undefined;
75
+ const entryDoc = index > 0 ? log[index]?.state : undefined;
76
+ if (previous === undefined || entryDoc === undefined) {
77
+ return [];
78
+ }
79
+ const standing = new Set(credentialKeyAgreementMethods({ doc: entryDoc, did }).map(method => method.id));
80
+ return credentialKeyAgreementMethods({ doc: previous, did })
81
+ .map(method => method.id)
82
+ .filter((id) => typeof id === 'string')
83
+ .filter(id => !standing.has(id) && id !== spentVmId);
84
+ }
39
85
  /**
40
86
  * The verification-method id a code's key-agreement key publishes under --
41
87
  * the ordinary `<did>#<multibase>` form, indistinguishable by id from any
@@ -143,6 +189,9 @@ export async function publishRecoveryKey({ idStore, updateKeys, recovery, expect
143
189
  },
144
190
  updateKeyMultibase: recovery.updateKeyMultibase
145
191
  },
192
+ // A code carries no ladder: its whole inventory is one key-agreement
193
+ // method and one committed update key.
194
+ ladderSeed: null,
146
195
  ...(expectedDid !== undefined ? { expectedDid } : {}),
147
196
  ...(pinStore ? { pinStore } : {}),
148
197
  ...(logId !== undefined ? { logId } : {}),
@@ -242,7 +291,7 @@ export async function removeRecoveryKey({ idStore, updateKeys, recovery, expecte
242
291
  * @param [options.logId] {string} the account log's pin slot
243
292
  * (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
244
293
  * supplied
245
- * @returns {Promise<{ did: string, webDoc?: object, committed: boolean }>}
294
+ * @returns {Promise<object>}
246
295
  * the account DID, the final `did.json` projection when the add-and-retire
247
296
  * entry ran here, and `committed` -- whether THIS call published the pivot
248
297
  * entry (`false` exactly on the idempotent completed branch, where a torn
@@ -250,7 +299,12 @@ export async function removeRecoveryKey({ idStore, updateKeys, recovery, expecte
250
299
  * a success flag: a returning call means the continuation stands either
251
300
  * way, so a caller clears its pending state on the RETURN, whatever
252
301
  * `committed` says. Its absence from a return value is a build skew, which
253
- * is why it is stated rather than inferred
302
+ * is why it is stated rather than inferred.
303
+ * `retiredCredentialVmIds` lists the `keyAgreement` verification-method ids
304
+ * this entry struck for pre-recovery credentials OTHER than the spent code
305
+ * -- what the caller drops registry entries and deletes unlock Spaces for.
306
+ * On the completed branch, whose entry already landed, it is derived from
307
+ * the log, so a resume reports the same list the first run did
254
308
  */
255
309
  export async function recoverWebvhClient(options) {
256
310
  // The seam is what gets the successor material persisted before the pivot
@@ -274,7 +328,7 @@ export async function recoverWebvhClient(options) {
274
328
  * One attempt of {@link recoverWebvhClient}, re-invoked by the conflict retry.
275
329
  *
276
330
  * @param options {object} see {@link recoverWebvhClient}
277
- * @returns {Promise<{ did: string, webDoc?: object, committed: boolean }>}
331
+ * @returns {Promise<object>} see {@link recoverWebvhClient}
278
332
  */
279
333
  async function recoverWebvhClientOnce({ store, recovery, newClientKeys, newClientUpdateSeeds, replacement, onCommitted, expectedDid, pinStore, logId }) {
280
334
  // Each attempt's own read is what the CAS publish is built on, so the
@@ -289,17 +343,49 @@ async function recoverWebvhClientOnce({ store, recovery, newClientKeys, newClien
289
343
  ...(expectedDid !== undefined ? { expectedDid } : {}),
290
344
  ...pinned
291
345
  });
346
+ // Derived before the completion check, because a resume recomputes the
347
+ // strike with the same protected sets the first run used.
348
+ const recoveryHash = await deriveNextKeyHash(recovery.updateKeyMultibase);
349
+ const newUpdateHash = await deriveNextKeyHash(newClientKeys.updateKeyMultibase);
350
+ const newStagedHash = await deriveNextKeyHash(newClientKeys.stagedUpdateKeyMultibase);
351
+ const replacementHash = await deriveNextKeyHash(replacement.updateKeyMultibase);
292
352
  // Already complete (a torn earlier run finished the add entry): the new
293
353
  // client's update key is authorized, which only the add entry writes. The
294
354
  // seam is deliberately NOT entered here -- nothing is about to be
295
355
  // published, so there is no pivot to persist ahead of.
296
356
  if (published.updateKeys.includes(newClientKeys.updateKeyMultibase)) {
297
- return { did: published.did, committed: false };
357
+ // The add entry already struck the pre-recovery credentials, so the
358
+ // document names none of them any more. The report is derived from the
359
+ // log instead ({@link retiredCredentialVmIdsFromLog}), so a resume tells
360
+ // the caller exactly what the first run told it.
361
+ const retired = retiredCredentialVmIdsFromLog({
362
+ log: published.log,
363
+ did: published.did,
364
+ successorKeyMultibase: newClientKeys.updateKeyMultibase,
365
+ spentVmId: recoveryVmId({
366
+ did: published.did,
367
+ keyAgreementKeyMultibase: recovery.keyAgreementKeyMultibase
368
+ })
369
+ });
370
+ // The strike is recomputed by re-running it over the log as it stood just
371
+ // before the add entry, with the same protected sets, so a resume reports
372
+ // exactly what the first run reported rather than a second definition of
373
+ // the same question.
374
+ const strike = await retiredCredentialRungsBeforeKey({
375
+ log: published.log,
376
+ authorizedKeyMultibase: newClientKeys.updateKeyMultibase,
377
+ credentialVmIds: retired,
378
+ protectedHashes: [newUpdateHash, newStagedHash, replacementHash],
379
+ protectedKeys: [newClientKeys.updateKeyMultibase]
380
+ });
381
+ return {
382
+ did: published.did,
383
+ committed: false,
384
+ retiredCredentialVmIds: retired,
385
+ struckRungHashes: strike.struckHashes,
386
+ unclaimedCredentialVmIds: strike.unclaimedCredentialVmIds
387
+ };
298
388
  }
299
- const recoveryHash = await deriveNextKeyHash(recovery.updateKeyMultibase);
300
- const newUpdateHash = await deriveNextKeyHash(newClientKeys.updateKeyMultibase);
301
- const newStagedHash = await deriveNextKeyHash(newClientKeys.stagedUpdateKeyMultibase);
302
- const replacementHash = await deriveNextKeyHash(replacement.updateKeyMultibase);
303
389
  // The reveal-and-commit entry, skipped when a torn earlier run already
304
390
  // published it (the revealed key authorized AND every needed hash
305
391
  // committed).
@@ -355,9 +441,12 @@ async function recoverWebvhClientOnce({ store, recovery, newClientKeys, newClien
355
441
  // above, or a torn earlier run's reveal entry standing already.
356
442
  await onCommitted({ builtOnHead: servedHead(published.log) });
357
443
  // The add-and-retire entry: the new client's verification methods and
358
- // update key in; the spent code's VM, update key, and hash out; the
359
- // replacement code's VM in. Signed by the new client's update key, whose
360
- // hash the commit entry just committed.
444
+ // update key in; the replacement code's VM in; every pre-recovery standing
445
+ // credential fully retired -- the spent code by name, and every other one
446
+ // by the same structural rule the transient continuation uses (its ladder
447
+ // VM by the relation asymmetry, its keyAgreement member by the account-DID
448
+ // controller). Signed by the new client's update key, whose hash the commit
449
+ // entry just committed.
361
450
  const { did, doc } = published;
362
451
  const vmId = (publicKeyMultibase) => `${did}#${publicKeyMultibase}`;
363
452
  const spentVmId = recoveryVmId({
@@ -389,13 +478,55 @@ async function recoverWebvhClientOnce({ store, recovery, newClientKeys, newClien
389
478
  publicKeyMultibase: replacement.keyAgreementKeyMultibase
390
479
  }
391
480
  ];
481
+ // The full retirement, recognized structurally rather than from a list the
482
+ // caller supplies: every standing ladder VM, and every keyAgreement member
483
+ // the account DID controls, less the ids this entry itself adds. Other
484
+ // unspent recovery codes retire with the rest -- a code's member is
485
+ // unmarked and verbatim, indistinguishable from a passkey's. Each retired
486
+ // credential's committed rungs and revealed rungs go in the same entry (see
487
+ // the strike below and `decisions/0014`), because striking the VM rots only
488
+ // a ladder-signed bridge and a bridge an enrolled client minted outlives
489
+ // this entry. The bridge itself stays live but inert; nothing revokes it.
490
+ // The new client's marked pair and the KMS
491
+ // convenience key are untouched -- neither is account-DID-controlled
492
+ // keyAgreement.
493
+ const ladderVms = ladderVmIds({ doc });
494
+ const addedVmIds = addedMethods
495
+ .map(method => method.id)
496
+ .filter((id) => typeof id === 'string');
497
+ const struckCredentialVmIds = credentialKeyAgreementMethods({ doc, did })
498
+ .map(method => method.id)
499
+ .filter((id) => typeof id === 'string')
500
+ .filter(id => !addedVmIds.includes(id));
501
+ const retiredCredentialVmIds = struckCredentialVmIds.filter(id => id !== spentVmId);
502
+ // Each retired credential's committed rungs and any revealed rung of its own
503
+ // go in the SAME entry. Striking the ladder VM rots only a ladder-signed
504
+ // bridge; a bridge an enrolled client minted outlives the strike, and that
505
+ // client survives this entry, so a committed rung left standing is a reveal
506
+ // the retired credential could still perform. Anchored from the log alone,
507
+ // and an unanchorable credential is reported rather than struck.
508
+ const strike = await attributeRetiredCredentialRungs({
509
+ log: published.log,
510
+ credentialVmIds: retiredCredentialVmIds,
511
+ protectedHashes: [newUpdateHash, newStagedHash, replacementHash],
512
+ protectedKeys: [newClientKeys.updateKeyMultibase]
513
+ });
514
+ const struck = (id) => id !== undefined &&
515
+ (id === spentVmId ||
516
+ ladderVms.includes(id) ||
517
+ struckCredentialVmIds.includes(id));
392
518
  const existingMethods = (doc.verificationMethod ?? []);
393
519
  const verificationMethods = [
394
- ...existingMethods.filter(method => method.id !== spentVmId &&
520
+ ...existingMethods.filter(method => !struck(method.id) &&
395
521
  !addedMethods.some(added => added.id === method.id)),
396
522
  ...addedMethods
397
523
  ];
398
- const withReference = (relation, id) => [...new Set([...relationIds(relation), id])];
524
+ const withReference = (relation, id) => [
525
+ ...new Set([
526
+ ...relationIds(relation).filter(referencedId => !struck(referencedId)),
527
+ id
528
+ ])
529
+ ];
399
530
  const signingVmId = vmId(newClientKeys.signingKeyMultibase);
400
531
  const signer = await updateKeySigner({
401
532
  seed: newClientUpdateSeeds.updateSeed
@@ -406,17 +537,21 @@ async function recoverWebvhClientOnce({ store, recovery, newClientKeys, newClien
406
537
  alsoKnownAsWeb: true,
407
538
  updateKeys: [
408
539
  ...new Set([
409
- ...published.updateKeys.filter(key => key !== recovery.updateKeyMultibase),
540
+ ...published.updateKeys.filter(key => key !== recovery.updateKeyMultibase &&
541
+ !strike.struckKeys.includes(key)),
410
542
  newClientKeys.updateKeyMultibase
411
543
  ])
412
544
  ],
413
- nextKeyHashes: published.nextKeyHashes.filter(hash => hash !== recoveryHash),
545
+ nextKeyHashes: assertNextKeyHashesRemain({
546
+ nextKeyHashes: published.nextKeyHashes.filter(hash => hash !== recoveryHash && !strike.struckHashes.includes(hash)),
547
+ ceremony: 'the recovery add-and-retire entry'
548
+ }),
414
549
  verificationMethods,
415
550
  authentication: withReference(doc.authentication, signingVmId),
416
551
  assertionMethod: withReference(doc.assertionMethod, signingVmId),
417
552
  keyAgreement: [
418
553
  ...new Set([
419
- ...relationIds(doc.keyAgreement).filter(id => id !== spentVmId),
554
+ ...relationIds(doc.keyAgreement).filter(id => !struck(id)),
420
555
  vmId(newClientKeys.keyAgreementKeyMultibase),
421
556
  replacementVmId
422
557
  ])
@@ -432,6 +567,13 @@ async function recoverWebvhClientOnce({ store, recovery, newClientKeys, newClien
432
567
  if (pinStore && logId !== undefined) {
433
568
  await pinStore.write({ logId, pin: pinOfLog(updated.log) });
434
569
  }
435
- return { did: updated.did, webDoc: updated.webDoc, committed: true };
570
+ return {
571
+ did: updated.did,
572
+ webDoc: updated.webDoc,
573
+ committed: true,
574
+ retiredCredentialVmIds,
575
+ struckRungHashes: strike.struckHashes,
576
+ unclaimedCredentialVmIds: strike.unclaimedCredentialVmIds
577
+ };
436
578
  }
437
579
  //# sourceMappingURL=recoveryWebvh.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"recoveryWebvh.js","sourceRoot":"","sources":["../../src/recovery/recoveryWebvh.ts"],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lockClient, UnlockClientIdentity } from './standingClient.js';
36
36
  export { computeUnlockBinding, LADDER_SEED_BYTES, recordSealedRecipientKeys, remintUnlockRecordDelegations, UnlockBindingError, unlockRecordBinding, unlockRecordSealedTo, unwrapUnlockRecord, wrapUnlockRecord } from './unlockRecord.js';
37
37
  export type { SealedRecordMember, SignedUnlockRecord, UnlockRecordContents, UnlockRecordProofState } from './unlockRecord.js';
38
- export { publishUnlockKey, removeUnlockKey, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
39
- export type { StandingUnlockKeys, UnlockKeyAgreementPublication, UnlockLogStore } from './standingWebvh.js';
38
+ export { LadderInventoryDriftError, publishUnlockKey, removeUnlockKey, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
39
+ export type { LadderVmRemovalReport, StandingUnlockKeys, UnlockKeyAgreementPublication, UnlockLogStore } from './standingWebvh.js';
40
40
  export { retireUnlockCredential } from './retire.js';
41
41
  export type { ClientAnnexInventoryRetirement, UnlockCredentialRetirementResult } from './retire.js';
42
42
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACV,kBAAkB,EAClB,6BAA6B,EAC7B,cAAc,EACf,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpD,YAAY,EACV,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,eAAe,EACf,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,6BAA6B,EAC7B,cAAc,EACf,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpD,YAAY,EACV,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,aAAa,CAAA"}
@@ -33,6 +33,6 @@
33
33
  */
34
34
  export { standingClientFromUnlockSeed, STANDING_CLIENT_SALT, unlockClientIdentityFromSeed } from './standingClient.js';
35
35
  export { computeUnlockBinding, LADDER_SEED_BYTES, recordSealedRecipientKeys, remintUnlockRecordDelegations, UnlockBindingError, unlockRecordBinding, unlockRecordSealedTo, unwrapUnlockRecord, wrapUnlockRecord } from './unlockRecord.js';
36
- export { publishUnlockKey, removeUnlockKey, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
36
+ export { LadderInventoryDriftError, publishUnlockKey, removeUnlockKey, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
37
37
  export { retireUnlockCredential } from './retire.js';
38
38
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAM5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAQ1B,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAO3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAM5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAQ1B,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,eAAe,EACf,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAQ3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA"}
@@ -9,6 +9,13 @@
9
9
  * inventory in the account's did:webvh document -- so retiring one is a real
10
10
  * rotation, on the same stages the client-revocation cascade runs.
11
11
  *
12
+ * 0. **The dependent-record re-mint** (the injected `remintDependentRecords`
13
+ * closure), against the PRE-edit document: the credential's ladder VM is
14
+ * about to be struck, and a struck VM rots every record and bridge
15
+ * delegation it signed for OTHER credentials -- the last-client transition
16
+ * signs siblings' records with one, and `currentAccountRecordSigners`
17
+ * accepts it. The stage names the doomed VM ids to the pass, which
18
+ * re-signs those records under a key that outlives the edit.
12
19
  * 1. **The document inventory edit** (`removeUnlockKey`): the credential's
13
20
  * `keyAgreement` entry (verbatim key or commitment) and its committed
14
21
  * update-key hash leave the document in one log entry. That kills the
@@ -29,11 +36,21 @@
29
36
  * inventory still standing would simply re-escrow the credential and look
30
37
  * healthy.
31
38
  *
32
- * There is deliberately no recovery-delegation re-mint stage here (the
33
- * client-revocation cascade's fourth stage). A retired credential signs no
34
- * delegations: its own bridge delegation dies with its unlock Space, which
35
- * the app deletes as part of the change-method ceremony, and no other
36
- * credential's bridge chains through it.
39
+ * Stage 0 is the one stage that runs BEFORE the edit, and its placement is
40
+ * the point. Run after the edit it would leave a window in which every
41
+ * sibling credential's record is unverifiable, and a run torn there bricks
42
+ * exactly what the stage exists to protect: a record whose frame proof names
43
+ * a struck key refuses before decryption, and the credential's own login dies
44
+ * at that check with no repair arm. Run before it, a tear leaves the sibling
45
+ * records signed by a key that still stands and the retiring credential still
46
+ * standing -- the correct resting state, converged by a re-run. So the stage
47
+ * is fail-closed rather than best-effort: a throw from the closure aborts the
48
+ * retirement before anything is published, unlike the annex closure at 1b.
49
+ *
50
+ * That corrects what this module used to reason. A retired credential's own
51
+ * bridge delegation does die with its unlock Space, which the app deletes as
52
+ * part of the change-method ceremony. Its ladder VM is the part that reaches
53
+ * further: other credentials' records and bridges chain through it.
37
54
  *
38
55
  * The client annex reach is its own stage (1b, the injected
39
56
  * `retireClientAnnexInventory` closure), between the document edit and the
@@ -54,6 +71,15 @@
54
71
  * skip, so the roster rotation -- the ceremony's essential remedy -- always
55
72
  * runs.
56
73
  *
74
+ * Stage 0 and stage 1 each read the log for themselves, and the two reads are
75
+ * tied by a cross-check rather than by luck: stage 0 hands its attributed
76
+ * ladder VM ids to the edit as `expectedLadderVmIds`, and the edit refuses
77
+ * before writing when its own attribution resolves a different set
78
+ * (`LadderInventoryDriftError`). So a concurrent ceremony, or a host serving
79
+ * different log versions to the two reads, cannot leave the strike diverging
80
+ * from what the re-mint pass acted on. Both reads take the caller's
81
+ * `pinStore` and `logId`, so both are checked against the same chain head.
82
+ *
57
83
  * Convergence is the design: every stage detects its own completion from
58
84
  * durable state alone -- the inventory edit no-ops when the document is already
59
85
  * settled, the rotation no-ops once every current-epoch recipient is
@@ -71,23 +97,30 @@ import type { CollectionEncryption } from '@interop/was-client';
71
97
  import type { EncryptionDescriptorStore } from '@interop/was-client/edv';
72
98
  import { type CascadeCollections, type RosterSealReport, type UserKey, type UserKeyCascadeResult } from '../keys/index.js';
73
99
  import type { ClientWebvhUpdateKeys, WebvhIdStore } from '../webvh/index.js';
74
- import { type StandingUnlockKeys } from './standingWebvh.js';
100
+ import type { ResourceLogPinStore } from '@interop/vh-resource-log';
101
+ import { type LadderVmRemovalReport, type StandingUnlockKeys } from './standingWebvh.js';
75
102
  /**
76
103
  * What a completed retirement reports: whether the roster actually rotated on
77
104
  * this run (a re-run of an already-complete retirement reports `false`), the
78
105
  * roster's seal-backstop report (present when the roster store is sealable and
79
106
  * the roster stage ran), the per-collection fan-out result, the document as
80
- * the inventory edit left it, and the rotated key with the roster descriptor it
81
- * was read from.
107
+ * the inventory edit left it, the rotated key with the roster descriptor it
108
+ * was read from, whatever the dependent-record re-mint pass returned
109
+ * (`dependentRecords`, absent when no closure was supplied), and the
110
+ * inventory edit's ladder VM report (`ladderVm`: what the edit struck, and
111
+ * what stands unclaimed after it -- a seedless strike that claimed nothing
112
+ * reports its credential's VM there rather than reading as clean).
82
113
  */
83
114
  export interface UnlockCredentialRetirementResult {
84
115
  rotated: boolean;
116
+ ladderVm: LadderVmRemovalReport;
85
117
  rosterSeal?: RosterSealReport;
86
118
  collections: UserKeyCascadeResult;
87
119
  document: object;
88
120
  userKey?: UserKey;
89
121
  rosterDescriptor?: CollectionEncryption;
90
122
  clientAnnex?: ClientAnnexInventoryRetirement;
123
+ dependentRecords?: unknown;
91
124
  }
92
125
  /**
93
126
  * What the annex-inventory stage reports: `struck` (a strike entry dropped
@@ -122,6 +155,14 @@ export interface ClientAnnexInventoryRetirement {
122
155
  * @param [options.expectedDid] {string} the account DID from the caller's
123
156
  * stored account pointer; supplied, the inventory edit refuses a `did.jsonl`
124
157
  * resolving to any other account
158
+ * @param [options.pinStore] {ResourceLogPinStore} this client's chain-head
159
+ * pins, threaded to BOTH account-log reads the ceremony makes -- stage 0's
160
+ * attribution read and the inventory edit's own read inside its
161
+ * conflict-retry loop -- so a served rollback or fork is refused before
162
+ * anything is published
163
+ * @param [options.logId] {string} the account log's pin slot
164
+ * (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
165
+ * supplied
125
166
  * @param [options.verb] {string} what the caller is doing, for the
126
167
  * pending-rotation refusal message (e.g. `'changing your passphrase'`)
127
168
  * @param options.rosterStore {EncryptionDescriptorStore} the
@@ -135,6 +176,12 @@ export interface ClientAnnexInventoryRetirement {
135
176
  * called with `{ userKey, latestEpochId, descriptor }` after the roster read
136
177
  * and BEFORE the fan-out. The key and the epoch pin must persist atomically
137
178
  * @param options.collections {CascadeCollections} the fan-out's work
179
+ * @param [options.remintDependentRecords] {Function} `({ document,
180
+ * retiringKeyMultibases }) => Promise<unknown>` -- the dependent-record
181
+ * re-mint (stage 0), run against the PRE-edit document with the ladder VM
182
+ * ids this retirement is about to strike. Fail-closed: a throw aborts the
183
+ * retirement before the document edit. Absent, the stage is skipped and no
184
+ * log read happens for it (the no-WAS path)
138
185
  * @param [options.retireClientAnnexInventory] {Function} `({ document }) =>
139
186
  * Promise<ClientAnnexInventoryRetirement>` -- the annex reach (stage 1b in
140
187
  * the module doc), run against the post-edit document; a throw is caught
@@ -144,12 +191,14 @@ export interface ClientAnnexInventoryRetirement {
144
191
  * the session keeps operating without a re-login
145
192
  * @returns {Promise<UnlockCredentialRetirementResult>}
146
193
  */
147
- export declare function retireUnlockCredential({ idStore, updateKeys, unlockKeys, ladderSeed, expectedDid, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, retireClientAnnexInventory, onRotationAdopted }: {
194
+ export declare function retireUnlockCredential({ idStore, updateKeys, unlockKeys, ladderSeed, expectedDid, pinStore, logId, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, remintDependentRecords, retireClientAnnexInventory, onRotationAdopted }: {
148
195
  idStore: WebvhIdStore;
149
196
  updateKeys: ClientWebvhUpdateKeys;
150
197
  unlockKeys: StandingUnlockKeys;
151
198
  ladderSeed?: Uint8Array;
152
199
  expectedDid?: string;
200
+ pinStore?: ResourceLogPinStore;
201
+ logId?: string;
153
202
  verb?: string;
154
203
  rosterStore: EncryptionDescriptorStore;
155
204
  userKey?: UserKey;
@@ -161,6 +210,10 @@ export declare function retireUnlockCredential({ idStore, updateKeys, unlockKeys
161
210
  descriptor: CollectionEncryption;
162
211
  }) => Promise<void>;
163
212
  collections: CascadeCollections;
213
+ remintDependentRecords?: (options: {
214
+ document: object;
215
+ retiringKeyMultibases: string[];
216
+ }) => Promise<unknown>;
164
217
  retireClientAnnexInventory?: (options: {
165
218
  document: object;
166
219
  }) => Promise<ClientAnnexInventoryRetirement>;
@@ -1 +1 @@
1
- {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import { rotateRosterToDocumentAndCascade } from '../keys/index.js';
2
- import { removeUnlockKey } from './standingWebvh.js';
2
+ import { attributeUnlockLadderInventory, readLogOrThrow, removeUnlockKey } from './standingWebvh.js';
3
3
  /**
4
4
  * Retires one standing unlock credential from an account. See the module doc
5
5
  * for the order and the convergence story. Once the inventory edit lands, a
@@ -20,6 +20,14 @@ import { removeUnlockKey } from './standingWebvh.js';
20
20
  * @param [options.expectedDid] {string} the account DID from the caller's
21
21
  * stored account pointer; supplied, the inventory edit refuses a `did.jsonl`
22
22
  * resolving to any other account
23
+ * @param [options.pinStore] {ResourceLogPinStore} this client's chain-head
24
+ * pins, threaded to BOTH account-log reads the ceremony makes -- stage 0's
25
+ * attribution read and the inventory edit's own read inside its
26
+ * conflict-retry loop -- so a served rollback or fork is refused before
27
+ * anything is published
28
+ * @param [options.logId] {string} the account log's pin slot
29
+ * (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
30
+ * supplied
23
31
  * @param [options.verb] {string} what the caller is doing, for the
24
32
  * pending-rotation refusal message (e.g. `'changing your passphrase'`)
25
33
  * @param options.rosterStore {EncryptionDescriptorStore} the
@@ -33,6 +41,12 @@ import { removeUnlockKey } from './standingWebvh.js';
33
41
  * called with `{ userKey, latestEpochId, descriptor }` after the roster read
34
42
  * and BEFORE the fan-out. The key and the epoch pin must persist atomically
35
43
  * @param options.collections {CascadeCollections} the fan-out's work
44
+ * @param [options.remintDependentRecords] {Function} `({ document,
45
+ * retiringKeyMultibases }) => Promise<unknown>` -- the dependent-record
46
+ * re-mint (stage 0), run against the PRE-edit document with the ladder VM
47
+ * ids this retirement is about to strike. Fail-closed: a throw aborts the
48
+ * retirement before the document edit. Absent, the stage is skipped and no
49
+ * log read happens for it (the no-WAS path)
36
50
  * @param [options.retireClientAnnexInventory] {Function} `({ document }) =>
37
51
  * Promise<ClientAnnexInventoryRetirement>` -- the annex reach (stage 1b in
38
52
  * the module doc), run against the post-edit document; a throw is caught
@@ -42,16 +56,52 @@ import { removeUnlockKey } from './standingWebvh.js';
42
56
  * the session keeps operating without a re-login
43
57
  * @returns {Promise<UnlockCredentialRetirementResult>}
44
58
  */
45
- export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys, ladderSeed, expectedDid, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, retireClientAnnexInventory, onRotationAdopted }) {
59
+ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys, ladderSeed, expectedDid, pinStore, logId, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, remintDependentRecords, retireClientAnnexInventory, onRotationAdopted }) {
60
+ // 0. The dependent-record re-mint, against the PRE-edit document: whatever
61
+ // the doomed ladder VM signed for OTHER credentials is re-signed under a
62
+ // key that outlives the edit. The pass is named the VM ids the attribution
63
+ // claims for this credential, and it runs even when that list is empty:
64
+ // the pass has an expiry axis of its own, and a near-lapse sibling bridge
65
+ // is worth refreshing in the same window. Fail-closed -- a throw aborts
66
+ // here, with the credential still standing.
67
+ const pinned = {
68
+ ...(pinStore ? { pinStore } : {}),
69
+ ...(logId !== undefined ? { logId } : {})
70
+ };
71
+ let dependentRecords;
72
+ let expectedLadderVmIds;
73
+ if (remintDependentRecords) {
74
+ const published = await readLogOrThrow({
75
+ store: idStore,
76
+ ...(expectedDid !== undefined ? { expectedDid } : {}),
77
+ ...pinned
78
+ });
79
+ const inventory = await attributeUnlockLadderInventory({
80
+ log: published.log,
81
+ did: published.did,
82
+ unlockKeys,
83
+ ...(ladderSeed ? { ladderSeed } : {})
84
+ });
85
+ // What the edit's own attribution must resolve to: the pass below acts on
86
+ // this list, so an edit that resolved a different one would strike
87
+ // something the pass never covered.
88
+ expectedLadderVmIds = inventory.ladderVmIds;
89
+ dependentRecords = await remintDependentRecords({
90
+ document: published.doc,
91
+ retiringKeyMultibases: inventory.ladderVmIds
92
+ });
93
+ }
46
94
  // 1. The document inventory edit -- the credential's standing, first. It
47
95
  // resolves the document as it now stands, which is what stage 2 resolves
48
96
  // its remaining recipients from.
49
- const { did, doc, log } = await removeUnlockKey({
97
+ const { did, doc, log, ladderVm } = await removeUnlockKey({
50
98
  idStore,
51
99
  updateKeys,
52
100
  unlockKeys,
53
101
  ...(ladderSeed ? { ladderSeed } : {}),
102
+ ...(expectedLadderVmIds !== undefined ? { expectedLadderVmIds } : {}),
54
103
  ...(expectedDid !== undefined ? { expectedDid } : {}),
104
+ ...pinned,
55
105
  ...(verb !== undefined ? { verb } : {})
56
106
  });
57
107
  // 1b. The annex reach, against the post-edit document: strike the
@@ -87,9 +137,11 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
87
137
  // retired -- a completed ceremony with nothing rotated.
88
138
  return {
89
139
  rotated: false,
140
+ ladderVm,
90
141
  collections: tail.collections,
91
142
  document: doc,
92
- ...(clientAnnex ? { clientAnnex } : {})
143
+ ...(clientAnnex ? { clientAnnex } : {}),
144
+ ...(remintDependentRecords ? { dependentRecords } : {})
93
145
  };
94
146
  }
95
147
  if (tail.rotated) {
@@ -97,12 +149,14 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
97
149
  }
98
150
  return {
99
151
  rotated: tail.rotated,
152
+ ladderVm,
100
153
  ...(tail.rosterSeal ? { rosterSeal: tail.rosterSeal } : {}),
101
154
  collections: tail.collections,
102
155
  document: doc,
103
156
  userKey: tail.userKey,
104
157
  rosterDescriptor: tail.rosterDescriptor,
105
- ...(clientAnnex ? { clientAnnex } : {})
158
+ ...(clientAnnex ? { clientAnnex } : {}),
159
+ ...(remintDependentRecords ? { dependentRecords } : {})
106
160
  };
107
161
  }
108
162
  //# sourceMappingURL=retire.js.map