@interop/wallet-core 0.62.0 → 0.65.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 (312) hide show
  1. package/README.md +41 -16
  2. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +46 -26
  3. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
  4. package/dist/clientAnnex/credentialAnchoredGenesis.js +91 -39
  5. package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
  6. package/dist/clientAnnex/establish.d.ts +55 -34
  7. package/dist/clientAnnex/establish.d.ts.map +1 -1
  8. package/dist/clientAnnex/establish.js +102 -56
  9. package/dist/clientAnnex/establish.js.map +1 -1
  10. package/dist/clientAnnex/forget.d.ts +16 -2
  11. package/dist/clientAnnex/forget.d.ts.map +1 -1
  12. package/dist/clientAnnex/forget.js +11 -9
  13. package/dist/clientAnnex/forget.js.map +1 -1
  14. package/dist/clientAnnex/forgetLast.d.ts +62 -18
  15. package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
  16. package/dist/clientAnnex/forgetLast.js +92 -26
  17. package/dist/clientAnnex/forgetLast.js.map +1 -1
  18. package/dist/clientAnnex/gc.d.ts +3 -2
  19. package/dist/clientAnnex/gc.d.ts.map +1 -1
  20. package/dist/clientAnnex/gc.js +7 -7
  21. package/dist/clientAnnex/gc.js.map +1 -1
  22. package/dist/clientAnnex/heal.d.ts +38 -5
  23. package/dist/clientAnnex/heal.d.ts.map +1 -1
  24. package/dist/clientAnnex/heal.js +346 -236
  25. package/dist/clientAnnex/heal.js.map +1 -1
  26. package/dist/clientAnnex/index.d.ts +21 -5
  27. package/dist/clientAnnex/index.d.ts.map +1 -1
  28. package/dist/clientAnnex/index.js +24 -5
  29. package/dist/clientAnnex/index.js.map +1 -1
  30. package/dist/clientAnnex/ladder.d.ts +58 -0
  31. package/dist/clientAnnex/ladder.d.ts.map +1 -1
  32. package/dist/clientAnnex/ladder.js +222 -33
  33. package/dist/clientAnnex/ladder.js.map +1 -1
  34. package/dist/clientAnnex/ladderAnchored.d.ts +148 -22
  35. package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
  36. package/dist/clientAnnex/ladderAnchored.js +391 -346
  37. package/dist/clientAnnex/ladderAnchored.js.map +1 -1
  38. package/dist/clientAnnex/log.d.ts +162 -43
  39. package/dist/clientAnnex/log.d.ts.map +1 -1
  40. package/dist/clientAnnex/log.js +423 -192
  41. package/dist/clientAnnex/log.js.map +1 -1
  42. package/dist/clientAnnex/mend.d.ts +12 -6
  43. package/dist/clientAnnex/mend.d.ts.map +1 -1
  44. package/dist/clientAnnex/mend.js +26 -12
  45. package/dist/clientAnnex/mend.js.map +1 -1
  46. package/dist/clientAnnex/recoveryLadderAnchored.d.ts +6 -4
  47. package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
  48. package/dist/clientAnnex/recoveryLadderAnchored.js +56 -35
  49. package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
  50. package/dist/clientAnnex/spaceCapability.d.ts +123 -0
  51. package/dist/clientAnnex/spaceCapability.d.ts.map +1 -0
  52. package/dist/clientAnnex/spaceCapability.js +152 -0
  53. package/dist/clientAnnex/spaceCapability.js.map +1 -0
  54. package/dist/clientAnnex/stages.d.ts +63 -0
  55. package/dist/clientAnnex/stages.d.ts.map +1 -0
  56. package/dist/clientAnnex/stages.js +64 -0
  57. package/dist/clientAnnex/stages.js.map +1 -0
  58. package/dist/clientAnnex/zcap.d.ts +1 -1
  59. package/dist/clientAnnex/zcap.d.ts.map +1 -1
  60. package/dist/clientAnnex/zcap.js +42 -35
  61. package/dist/clientAnnex/zcap.js.map +1 -1
  62. package/dist/clients/policy.d.ts +15 -1
  63. package/dist/clients/policy.d.ts.map +1 -1
  64. package/dist/clients/policy.js +12 -6
  65. package/dist/clients/policy.js.map +1 -1
  66. package/dist/clients/revocation.d.ts +18 -10
  67. package/dist/clients/revocation.d.ts.map +1 -1
  68. package/dist/clients/revocation.js +13 -5
  69. package/dist/clients/revocation.js.map +1 -1
  70. package/dist/clients/rosterPolicy.d.ts +10 -2
  71. package/dist/clients/rosterPolicy.d.ts.map +1 -1
  72. package/dist/clients/rosterPolicy.js +41 -24
  73. package/dist/clients/rosterPolicy.js.map +1 -1
  74. package/dist/descriptors/acquire.d.ts.map +1 -1
  75. package/dist/descriptors/acquire.js +6 -23
  76. package/dist/descriptors/acquire.js.map +1 -1
  77. package/dist/descriptors/cipher.d.ts.map +1 -1
  78. package/dist/descriptors/cipher.js +5 -0
  79. package/dist/descriptors/cipher.js.map +1 -1
  80. package/dist/descriptors/errors.d.ts +43 -0
  81. package/dist/descriptors/errors.d.ts.map +1 -0
  82. package/dist/descriptors/errors.js +45 -0
  83. package/dist/descriptors/errors.js.map +1 -0
  84. package/dist/descriptors/index.d.ts +5 -0
  85. package/dist/descriptors/index.d.ts.map +1 -1
  86. package/dist/descriptors/index.js +5 -0
  87. package/dist/descriptors/index.js.map +1 -1
  88. package/dist/enrollment/enrollment.d.ts +37 -10
  89. package/dist/enrollment/enrollment.d.ts.map +1 -1
  90. package/dist/enrollment/enrollment.js +52 -15
  91. package/dist/enrollment/enrollment.js.map +1 -1
  92. package/dist/genesis/accountGenesis.d.ts +42 -11
  93. package/dist/genesis/accountGenesis.d.ts.map +1 -1
  94. package/dist/genesis/accountGenesis.js +80 -22
  95. package/dist/genesis/accountGenesis.js.map +1 -1
  96. package/dist/genesis/index.d.ts +3 -1
  97. package/dist/genesis/index.d.ts.map +1 -1
  98. package/dist/genesis/index.js +3 -1
  99. package/dist/genesis/index.js.map +1 -1
  100. package/dist/identity/agents.d.ts +17 -1
  101. package/dist/identity/agents.d.ts.map +1 -1
  102. package/dist/identity/agents.js +23 -7
  103. package/dist/identity/agents.js.map +1 -1
  104. package/dist/identity/index.d.ts +3 -1
  105. package/dist/identity/index.d.ts.map +1 -1
  106. package/dist/identity/index.js +3 -1
  107. package/dist/identity/index.js.map +1 -1
  108. package/dist/index.d.ts +6 -3
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +6 -3
  111. package/dist/index.js.map +1 -1
  112. package/dist/keyring/index.d.ts +2 -1
  113. package/dist/keyring/index.d.ts.map +1 -1
  114. package/dist/keyring/index.js +2 -1
  115. package/dist/keyring/index.js.map +1 -1
  116. package/dist/keyring/record.d.ts.map +1 -1
  117. package/dist/keyring/record.js +3 -6
  118. package/dist/keyring/record.js.map +1 -1
  119. package/dist/keyring/unlockSpace.d.ts +14 -5
  120. package/dist/keyring/unlockSpace.d.ts.map +1 -1
  121. package/dist/keyring/unlockSpace.js +31 -36
  122. package/dist/keyring/unlockSpace.js.map +1 -1
  123. package/dist/keys/index.d.ts +10 -6
  124. package/dist/keys/index.d.ts.map +1 -1
  125. package/dist/keys/index.js +9 -5
  126. package/dist/keys/index.js.map +1 -1
  127. package/dist/keys/rosterLogStore.d.ts +12 -11
  128. package/dist/keys/rosterLogStore.d.ts.map +1 -1
  129. package/dist/keys/rosterLogStore.js +15 -13
  130. package/dist/keys/rosterLogStore.js.map +1 -1
  131. package/dist/keys/rosterStore.d.ts +3 -6
  132. package/dist/keys/rosterStore.d.ts.map +1 -1
  133. package/dist/keys/rosterStore.js +10 -9
  134. package/dist/keys/rosterStore.js.map +1 -1
  135. package/dist/keys/spaceEpochs.d.ts.map +1 -1
  136. package/dist/keys/spaceEpochs.js +2 -3
  137. package/dist/keys/spaceEpochs.js.map +1 -1
  138. package/dist/keys/userKeyRoster.d.ts +57 -7
  139. package/dist/keys/userKeyRoster.d.ts.map +1 -1
  140. package/dist/keys/userKeyRoster.js +222 -17
  141. package/dist/keys/userKeyRoster.js.map +1 -1
  142. package/dist/keys/userKeyRosterCascade.d.ts +7 -6
  143. package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
  144. package/dist/keys/userKeyRosterCascade.js +7 -6
  145. package/dist/keys/userKeyRosterCascade.js.map +1 -1
  146. package/dist/keys/wasLabelsStore.d.ts +9 -2
  147. package/dist/keys/wasLabelsStore.d.ts.map +1 -1
  148. package/dist/keys/wasLabelsStore.js +14 -6
  149. package/dist/keys/wasLabelsStore.js.map +1 -1
  150. package/dist/log.d.ts +7 -2
  151. package/dist/log.d.ts.map +1 -1
  152. package/dist/log.js +6 -1
  153. package/dist/log.js.map +1 -1
  154. package/dist/recovery/index.d.ts +12 -8
  155. package/dist/recovery/index.d.ts.map +1 -1
  156. package/dist/recovery/index.js +11 -7
  157. package/dist/recovery/index.js.map +1 -1
  158. package/dist/recovery/recoveryCode.d.ts +27 -7
  159. package/dist/recovery/recoveryCode.d.ts.map +1 -1
  160. package/dist/recovery/recoveryCode.js +18 -6
  161. package/dist/recovery/recoveryCode.js.map +1 -1
  162. package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
  163. package/dist/recovery/recoveryDelegation.js +21 -34
  164. package/dist/recovery/recoveryDelegation.js.map +1 -1
  165. package/dist/recovery/recoveryWebvh.d.ts +75 -63
  166. package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
  167. package/dist/recovery/recoveryWebvh.js +127 -116
  168. package/dist/recovery/recoveryWebvh.js.map +1 -1
  169. package/dist/request/classify.d.ts +32 -8
  170. package/dist/request/classify.d.ts.map +1 -1
  171. package/dist/request/classify.js +39 -14
  172. package/dist/request/classify.js.map +1 -1
  173. package/dist/request/ephemeralExchange.d.ts +1 -6
  174. package/dist/request/ephemeralExchange.d.ts.map +1 -1
  175. package/dist/request/ephemeralExchange.js.map +1 -1
  176. package/dist/request/onboarding.d.ts.map +1 -1
  177. package/dist/request/onboarding.js +2 -2
  178. package/dist/request/onboarding.js.map +1 -1
  179. package/dist/request/parse.d.ts.map +1 -1
  180. package/dist/request/parse.js +2 -3
  181. package/dist/request/parse.js.map +1 -1
  182. package/dist/resourceLog/controller.d.ts +34 -12
  183. package/dist/resourceLog/controller.d.ts.map +1 -1
  184. package/dist/resourceLog/controller.js +79 -86
  185. package/dist/resourceLog/controller.js.map +1 -1
  186. package/dist/resourceLog/document.d.ts +182 -0
  187. package/dist/resourceLog/document.d.ts.map +1 -0
  188. package/dist/resourceLog/document.js +159 -0
  189. package/dist/resourceLog/document.js.map +1 -0
  190. package/dist/resourceLog/errors.d.ts +47 -8
  191. package/dist/resourceLog/errors.d.ts.map +1 -1
  192. package/dist/resourceLog/errors.js +54 -8
  193. package/dist/resourceLog/errors.js.map +1 -1
  194. package/dist/resourceLog/index.d.ts +7 -3
  195. package/dist/resourceLog/index.d.ts.map +1 -1
  196. package/dist/resourceLog/index.js +7 -3
  197. package/dist/resourceLog/index.js.map +1 -1
  198. package/dist/resourceLog/ladderRungs.d.ts +35 -0
  199. package/dist/resourceLog/ladderRungs.d.ts.map +1 -0
  200. package/dist/resourceLog/ladderRungs.js +352 -0
  201. package/dist/resourceLog/ladderRungs.js.map +1 -0
  202. package/dist/resourceLog/license.d.ts +42 -17
  203. package/dist/resourceLog/license.d.ts.map +1 -1
  204. package/dist/resourceLog/license.js +38 -24
  205. package/dist/resourceLog/license.js.map +1 -1
  206. package/dist/space/activity.d.ts +15 -15
  207. package/dist/space/activity.d.ts.map +1 -1
  208. package/dist/space/activity.js +15 -15
  209. package/dist/space/activity.js.map +1 -1
  210. package/dist/space/collections.d.ts +11 -0
  211. package/dist/space/collections.d.ts.map +1 -1
  212. package/dist/space/collections.js +13 -0
  213. package/dist/space/collections.js.map +1 -1
  214. package/dist/space/deleteSpace.d.ts +28 -0
  215. package/dist/space/deleteSpace.d.ts.map +1 -0
  216. package/dist/space/deleteSpace.js +44 -0
  217. package/dist/space/deleteSpace.js.map +1 -0
  218. package/dist/space/errors.d.ts.map +1 -1
  219. package/dist/space/errors.js +0 -1
  220. package/dist/space/errors.js.map +1 -1
  221. package/dist/space/index.d.ts +6 -0
  222. package/dist/space/index.d.ts.map +1 -1
  223. package/dist/space/index.js +6 -0
  224. package/dist/space/index.js.map +1 -1
  225. package/dist/space/plaintextCollection.d.ts +43 -0
  226. package/dist/space/plaintextCollection.d.ts.map +1 -0
  227. package/dist/space/plaintextCollection.js +17 -0
  228. package/dist/space/plaintextCollection.js.map +1 -0
  229. package/dist/stages.d.ts +23 -0
  230. package/dist/stages.d.ts.map +1 -0
  231. package/dist/stages.js +23 -0
  232. package/dist/stages.js.map +1 -0
  233. package/dist/sync/index.d.ts +7 -0
  234. package/dist/sync/index.d.ts.map +1 -1
  235. package/dist/sync/index.js +7 -0
  236. package/dist/sync/index.js.map +1 -1
  237. package/dist/sync/push.js +4 -4
  238. package/dist/sync/push.js.map +1 -1
  239. package/dist/sync/remint.js +2 -2
  240. package/dist/sync/remint.js.map +1 -1
  241. package/dist/sync/types.d.ts +41 -1
  242. package/dist/sync/types.d.ts.map +1 -1
  243. package/dist/sync/types.js +47 -1
  244. package/dist/sync/types.js.map +1 -1
  245. package/dist/unlock/index.d.ts +5 -1
  246. package/dist/unlock/index.d.ts.map +1 -1
  247. package/dist/unlock/index.js +5 -1
  248. package/dist/unlock/index.js.map +1 -1
  249. package/dist/unlock/retire.d.ts +35 -7
  250. package/dist/unlock/retire.d.ts.map +1 -1
  251. package/dist/unlock/retire.js +52 -14
  252. package/dist/unlock/retire.js.map +1 -1
  253. package/dist/unlock/standingClient.d.ts.map +1 -1
  254. package/dist/unlock/standingClient.js +5 -1
  255. package/dist/unlock/standingClient.js.map +1 -1
  256. package/dist/unlock/standingWebvh.d.ts +217 -35
  257. package/dist/unlock/standingWebvh.d.ts.map +1 -1
  258. package/dist/unlock/standingWebvh.js +469 -210
  259. package/dist/unlock/standingWebvh.js.map +1 -1
  260. package/dist/webvh/accountEntry.d.ts +146 -0
  261. package/dist/webvh/accountEntry.d.ts.map +1 -0
  262. package/dist/webvh/accountEntry.js +239 -0
  263. package/dist/webvh/accountEntry.js.map +1 -0
  264. package/dist/webvh/didWeb.d.ts +12 -7
  265. package/dist/webvh/didWeb.d.ts.map +1 -1
  266. package/dist/webvh/didWeb.js +2 -2
  267. package/dist/webvh/didWeb.js.map +1 -1
  268. package/dist/webvh/didWebProjection.d.ts +164 -0
  269. package/dist/webvh/didWebProjection.d.ts.map +1 -0
  270. package/dist/webvh/didWebProjection.js +230 -0
  271. package/dist/webvh/didWebProjection.js.map +1 -0
  272. package/dist/webvh/didWebvh.d.ts +275 -136
  273. package/dist/webvh/didWebvh.d.ts.map +1 -1
  274. package/dist/webvh/didWebvh.js +307 -340
  275. package/dist/webvh/didWebvh.js.map +1 -1
  276. package/dist/webvh/enrollClient.d.ts +65 -0
  277. package/dist/webvh/enrollClient.d.ts.map +1 -0
  278. package/dist/webvh/enrollClient.js +172 -0
  279. package/dist/webvh/enrollClient.js.map +1 -0
  280. package/dist/webvh/index.d.ts +37 -12
  281. package/dist/webvh/index.d.ts.map +1 -1
  282. package/dist/webvh/index.js +33 -10
  283. package/dist/webvh/index.js.map +1 -1
  284. package/dist/webvh/listClients.d.ts +1 -35
  285. package/dist/webvh/listClients.d.ts.map +1 -1
  286. package/dist/webvh/listClients.js +2 -30
  287. package/dist/webvh/listClients.js.map +1 -1
  288. package/dist/webvh/revokeClient.d.ts +41 -11
  289. package/dist/webvh/revokeClient.d.ts.map +1 -1
  290. package/dist/webvh/revokeClient.js +99 -48
  291. package/dist/webvh/revokeClient.js.map +1 -1
  292. package/dist/webvh/standingZcap.d.ts +61 -14
  293. package/dist/webvh/standingZcap.d.ts.map +1 -1
  294. package/dist/webvh/standingZcap.js +91 -0
  295. package/dist/webvh/standingZcap.js.map +1 -1
  296. package/dist/webvh/verifyLog.d.ts +59 -5
  297. package/dist/webvh/verifyLog.d.ts.map +1 -1
  298. package/dist/webvh/verifyLog.js +76 -11
  299. package/dist/webvh/verifyLog.js.map +1 -1
  300. package/dist/webvh/wasIdStore.d.ts +8 -8
  301. package/dist/webvh/wasIdStore.d.ts.map +1 -1
  302. package/dist/webvh/wasIdStore.js +39 -14
  303. package/dist/webvh/wasIdStore.js.map +1 -1
  304. package/dist/webvh/zcap.d.ts +14 -1
  305. package/dist/webvh/zcap.d.ts.map +1 -1
  306. package/dist/webvh/zcap.js +3 -27
  307. package/dist/webvh/zcap.js.map +1 -1
  308. package/package.json +2 -2
  309. package/dist/webvh/keyAgreement.d.ts +0 -97
  310. package/dist/webvh/keyAgreement.d.ts.map +0 -1
  311. package/dist/webvh/keyAgreement.js +0 -71
  312. package/dist/webvh/keyAgreement.js.map +0 -1
@@ -3,20 +3,24 @@
3
3
  */
4
4
  /**
5
5
  * The `@interop/wallet-core/recovery` subpath: recovery codes on the roster
6
- * identity model -- a code as a minimal always-enrolled wallet client.
6
+ * identity model -- a code as a standing unlock credential that retires on
7
+ * spend.
7
8
  *
8
9
  * - `generateRecoveryCode` / `formatRecoveryCode` / `normalizeRecoveryCode` /
9
10
  * `decodeRecoveryCode` / `RECOVERY_KDF` -- the format layer and the code's
10
11
  * own unlock-derivation parameter set (its salt distinct from every other
11
12
  * unlock method's).
12
- * - `recoveryClientFromCode` -- the deterministic client key set:
13
- * unlock identity, client seed (signing + key-agreement pair), and the
14
- * single did:webvh update key whose hash stands pre-committed.
13
+ * - `recoveryClientFromCode` -- the deterministic client key set: unlock
14
+ * identity, client seed (signing + key-agreement pair), binding MAC key,
15
+ * and the update-key ladder seed, whose rung 0 is the did:webvh update key
16
+ * whose hash stands pre-committed and whose VM signs the code's own bridge.
15
17
  * - The record codec lives in `@interop/wallet-core/unlock` now
16
18
  * (`wrapUnlockRecord` / `unwrapUnlockRecord`, re-exported here): a
17
- * recovery record is an unlock record with no ladder member -- the account
18
- * pointer plus the pre-minted PUT-on-`did.jsonl` bridge delegation (never
19
- * a seed, never a user key wrap), signed under the mixed-signer policy
19
+ * recovery record is an unlock record with no ladder member (the code's
20
+ * ladder seed derives from the code bytes rather than riding the record) --
21
+ * the account pointer plus the pre-minted PUT-on-`did.jsonl` bridge
22
+ * delegation (never a seed, never a user key wrap), signed under the
23
+ * mixed-signer policy
20
24
  * (the code's unlock key at issuance, an enrolled client's account key on
21
25
  * a re-mint), with the account core authenticated by a MAC under a
22
26
  * code-derived key, so a storage host can never redirect recovery at
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/recovery/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EACL,oBAAoB,EACpB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,2BAA2B,CAAA;AAOlC,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,sBAAsB,EACtB,YAAY,EACb,MAAM,yBAAyB,CAAA;AAMhC,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,4BAA4B,EAC5B,YAAY,EACZ,iBAAiB,EAClB,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/recovery/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EACL,oBAAoB,EACpB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,2BAA2B,CAAA;AAOlC,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,sBAAsB,EACtB,YAAY,EACb,MAAM,yBAAyB,CAAA;AAMhC,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,4BAA4B,EAC5B,YAAY,EACZ,iBAAiB,EAClB,MAAM,oBAAoB,CAAA"}
@@ -65,16 +65,27 @@ export declare function decodeRecoveryCode({ code }: {
65
65
  code: string;
66
66
  }): Uint8Array;
67
67
  /**
68
- * The code's full client identity, derived deterministically from
69
- * its bytes: the 32-byte client seed (behind the code's Ed25519 signing pair
70
- * and X25519 key-agreement twin), the single did:webvh update-key seed (one
71
- * key, no staged pair -- a code is spent on use, so it never self-rotates;
72
- * its recovery continuation commits whatever it needs next), the derived
73
- * agents, and the public multibases / ids the issuance and recovery flows
74
- * publish and look up.
68
+ * The code's full client identity, derived deterministically from its bytes:
69
+ * the 32-byte client seed (behind the code's Ed25519 signing pair and X25519
70
+ * key-agreement twin), the ladder seed behind its update authority, the
71
+ * derived agents, and the public multibases / ids the issuance and recovery
72
+ * flows publish and look up.
75
73
  */
76
74
  export interface RecoveryClient extends UnlockClientIdentity {
77
75
  codeBytes: Uint8Array;
76
+ /**
77
+ * The code's update-key ladder seed. Its VM is what signs the code's own
78
+ * bridge delegation, and its rung 0 is the code's committed update key, so
79
+ * the spend's reveal-and-commit entry is the ordinary ladder reveal. A code
80
+ * is spent on use and never self-rotates, so no rung past 0 is ever
81
+ * revealed; the ladder is what gives the code a verification method of its
82
+ * own beside that single rung.
83
+ */
84
+ ladderSeed: Uint8Array;
85
+ /**
86
+ * Rung 0's 32-byte update-key seed -- the key the code's committed hash
87
+ * stands for, and the one the reveal-and-commit entry signs with.
88
+ */
78
89
  updateSeed: Uint8Array;
79
90
  /**
80
91
  * The symmetric key that MACs the recovery record's account binding:
@@ -82,7 +93,16 @@ export interface RecoveryClient extends UnlockClientIdentity {
82
93
  * Derived from the code bytes, so the storage host never holds it.
83
94
  */
84
95
  bindingMacKey: Uint8Array;
96
+ /**
97
+ * Rung 0's public multibase: the code's `updateKeyMultibase` as the
98
+ * registry records it and the document commits its hash.
99
+ */
85
100
  updateKeyMultibase: string;
101
+ /**
102
+ * The ladder VM's public multibase, as the account document publishes it
103
+ * under `assertionMethod` and `capabilityDelegation`.
104
+ */
105
+ ladderVmKeyMultibase: string;
86
106
  }
87
107
  /**
88
108
  * Derives the code's whole client identity from a (possibly formatted) code.
@@ -1 +1 @@
1
- {"version":3,"file":"recoveryCode.d.ts","sourceRoot":"","sources":["../../src/recovery/recoveryCode.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAElD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAGvE;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,KAAK,CAAA;AAErC;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,SAM1B,CAAA;AAoBD;;;;;;GAMG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,SAAuC;CAI3D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAI7C;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAErE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE1E;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,UAAU,CAazE;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAe,SAAQ,oBAAoB;IAC1D,SAAS,EAAE,UAAU,CAAA;IACrB,UAAU,EAAE,UAAU,CAAA;IACtB;;;;OAIG;IACH,aAAa,EAAE,UAAU,CAAA;IACzB,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAAC,EAC3C,IAAI,EACL,EAAE;IACD,IAAI,EAAE,MAAM,CAAA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B,CAAC,EAC3C,IAAI,EACL,EAAE;IACD,IAAI,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAAC,cAAc,CAAC,CAqC1B"}
@@ -21,7 +21,10 @@ import { base58 } from '@scure/base';
21
21
  import { hkdf } from '@noble/hashes/hkdf.js';
22
22
  import { sha256 } from '@noble/hashes/sha2.js';
23
23
  import { unlockClientIdentityFromSeed } from '../unlock/standingClient.js';
24
- import { updateKeyMultibase } from '../webvh/didWebvh.js';
24
+ // The pinned base-side edge onto the ladder derivation helpers: a code's
25
+ // update authority IS a ladder, and re-deriving its rungs here would be a
26
+ // second copy of a permanent wire-level derivation.
27
+ import { ladderRung, ladderVmKeyMultibase } from '../clientAnnex/ladder.js';
25
28
  /**
26
29
  * The byte length of a recovery code: 16 random bytes is ~128 bits, enough
27
30
  * that the unlock derivation is a single expansion rather than a stretched
@@ -45,11 +48,15 @@ export const RECOVERY_KDF = {
45
48
  /**
46
49
  * The HKDF salt for the code's client-side key set (distinct from the unlock
47
50
  * salt above, so the unlock identity and the client identity can never
48
- * collide), and the per-key expansion labels. All permanent.
51
+ * collide), and the per-key expansion labels. All permanent. The
52
+ * `ladder-seed` expansion replaced a standalone `update-key` one, whose label
53
+ * is retired and never reused: a code's committed update key is rung 0 of the
54
+ * ladder now, which is a different key, so a code issued under the retired
55
+ * label commits a rung nothing derives and cannot spend.
49
56
  */
50
57
  const RECOVERY_CLIENT_SALT = 'freewallet/recovery/client-keys/v1';
51
58
  const RECOVERY_CLIENT_SEED_INFO = 'client-seed';
52
- const RECOVERY_UPDATE_SEED_INFO = 'update-key';
59
+ const RECOVERY_LADDER_SEED_INFO = 'ladder-seed';
53
60
  /**
54
61
  * The HKDF info string for the code's account-binding MAC key, expanded
55
62
  * under the unlock salt beside the unlock-seed expansion above. The key MACs
@@ -141,15 +148,20 @@ export async function recoveryClientFromCode({ code }) {
141
148
  const codeBytes = decodeRecoveryCode({ code });
142
149
  const salt = new TextEncoder().encode(RECOVERY_CLIENT_SALT);
143
150
  const clientSeed = hkdf(sha256, codeBytes, salt, new TextEncoder().encode(RECOVERY_CLIENT_SEED_INFO), 32);
144
- const updateSeed = hkdf(sha256, codeBytes, salt, new TextEncoder().encode(RECOVERY_UPDATE_SEED_INFO), 32);
151
+ const ladderSeed = hkdf(sha256, codeBytes, salt, new TextEncoder().encode(RECOVERY_LADDER_SEED_INFO), 32);
145
152
  const bindingMacKey = hkdf(sha256, codeBytes, new TextEncoder().encode(RECOVERY_KDF.salt), new TextEncoder().encode(RECOVERY_BINDING_MAC_INFO), 32);
146
153
  const identity = await unlockClientIdentityFromSeed({ clientSeed });
154
+ // Rung 0 through the shared ladder derivation, so the code's committed
155
+ // update key is the same key the ladder's own reveal attributes.
156
+ const rung0 = await ladderRung({ ladderSeed, index: 0 });
147
157
  return {
148
158
  ...identity,
149
159
  codeBytes,
150
- updateSeed,
160
+ ladderSeed,
161
+ updateSeed: rung0.seed,
151
162
  bindingMacKey,
152
- updateKeyMultibase: await updateKeyMultibase({ seed: updateSeed })
163
+ updateKeyMultibase: rung0.keyMultibase,
164
+ ladderVmKeyMultibase: await ladderVmKeyMultibase({ ladderSeed })
153
165
  };
154
166
  }
155
167
  //# sourceMappingURL=recoveryCode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"recoveryCode.js","sourceRoot":"","sources":["../../src/recovery/recoveryCode.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAE9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAE1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAA;AAErC;;;;;;GA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AAA;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAsB,yBAAyB,CAC7C,KAAK,SAAS,uBAAuB,EACrC,EACA,GAAG,EACH,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,WAAW,EACX,8BAA8B,EAC9B,qBAA0B,EAC1B,GAAgB,EACjB,EAAE;IACD,GAAG,EAAE,oBAAoB,CAAA;IACzB,OAAO,EAAE,KAAK,EAAE,CAAA;IAChB,OAAO,EAAE,cAAc,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,UAAU,CAAA;IACtB,YAAY,EAAE,YAAY,CAAA;IAC1B,oBAAoB,EAAE,CAAC,OAAO,EAAE;QAAE,UAAU,EAAE,KAAK,CAAA;KAAE,KAAK,UAAU,CAAA;IACpE,WAAW,EAAE,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACzD,8BAA8B,CAAC,EAAE,CAAC,OAAO,EAAE;QACzC,UAAU,EAAE,MAAM,CAAA;KACnB,KAAK,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,CAAA;IAChC,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAA;IAChC,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAAC;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,mBAAmB,EAAE,CAAA;CAChC,CAAC,CA4LD"}
@@ -47,11 +47,9 @@ import { X25519KeyAgreementKey2020 } from '@interop/x25519-key-agreement-key';
47
47
  import { resourcePath, toUrl } from '@interop/was-client/paths';
48
48
  import { log } from '../log.js';
49
49
  import { DID_LOG_RESOURCE, ID_COLLECTION } from '../space/collections.js';
50
- import { delegationKeyInDocument } from '../webvh/listClients.js';
51
- import { vmFragmentOf } from '@interop/vh-resource-log';
52
50
  import { getUnlockKeyringWithCapability, putUnlockKeyringWithCapability } from '../keyring/unlockSpace.js';
53
51
  import { remintUnlockRecordDelegations, unlockRecordSealedTo } from '../unlock/unlockRecord.js';
54
- import { delegationProofKeyId, STANDING_ZCAP_TTL_MS, zcapExpiring } from '../webvh/standingZcap.js';
52
+ import { delegationProofKeyId, recordedZcapStale, STANDING_ZCAP_TTL_MS } from '../webvh/standingZcap.js';
55
53
  /**
56
54
  * The recovery delegation's lifetime: the house standing-zcap value
57
55
  * ({@link STANDING_ZCAP_TTL_MS} -- one year, per NIST SP 800-57's
@@ -67,7 +65,7 @@ import { delegationProofKeyId, STANDING_ZCAP_TTL_MS, zcapExpiring } from '../web
67
65
  * client's verification method leaving the document).
68
66
  */
69
67
  export const RECOVERY_DELEGATION_TTL_MS = STANDING_ZCAP_TTL_MS;
70
- // Re-exported from their shared leaf home (`webvh/standingZcap.ts`), so this
68
+ // Re-exported from their shared home (`webvh/standingZcap.ts`), so this
71
69
  // module's public surface predating the move is unchanged.
72
70
  export { ZCAP_RENEWAL_WINDOW_MS, zcapExpiring } from '../webvh/standingZcap.js';
73
71
  /**
@@ -111,7 +109,7 @@ export async function delegateLogWrite({ zcapClient, pointer, recoveryClientDid,
111
109
  expires: new Date(now + RECOVERY_DELEGATION_TTL_MS)
112
110
  });
113
111
  }
114
- // Re-exported from its shared leaf home (`webvh/standingZcap.ts`), so this
112
+ // Re-exported from its shared home (`webvh/standingZcap.ts`), so this
115
113
  // module's public surface is unchanged.
116
114
  export { delegationProofKeyId };
117
115
  /**
@@ -168,40 +166,29 @@ export async function remintRecoveryDelegations({ doc, entries, pointer, storage
168
166
  let reminted = 0;
169
167
  let skipped = 0;
170
168
  const outcomes = [];
171
- // Retiring keys arrive as bare multibases or as verification-method ids;
172
- // either way the comparison is on the multibase.
173
- const retiring = new Set(retiringKeyMultibases.map(key => vmFragmentOf(key) ?? key));
174
- // The current-key-set rule, decided once in `webvh`: a recorded signing key
175
- // the document no longer lists under `capabilityDelegation` -- or no
176
- // recorded key at all -- is rotted; so is a key the caller names as retiring, which the document
177
- // still lists only until the entry that removes it lands.
178
- const keyStands = (keyId) => delegationKeyInDocument({
169
+ // The house staleness policy, decided once in `webvh` and asked here over
170
+ // the scalars a registry entry records: expiry, the current-key-set rule
171
+ // (a recorded signing key the document no longer lists under
172
+ // `capabilityDelegation` -- or no recorded key at all -- has rotted), and
173
+ // the caller's retiring set, which the document still lists only until the
174
+ // entry that removes those keys lands.
175
+ const recordedStale = (delegationKeyId, expires) => recordedZcapStale({
179
176
  doc,
180
- ...(keyId ? { delegationKeyId: keyId } : {})
181
- }) && !(keyId !== undefined && retiring.has(vmFragmentOf(keyId) ?? keyId));
177
+ ...(delegationKeyId ? { delegationKeyId } : {}),
178
+ ...(expires ? { expires } : {}),
179
+ retiringKeyMultibases,
180
+ now
181
+ });
182
182
  for (const entry of entries) {
183
- const stands = keyStands(entry.delegationKeyId);
184
- // Expiry is the other staleness axis: a delegation expired or inside the
185
- // renewal window (or recording no expiry at all) is re-minted even
186
- // though its key still stands.
187
- const expiring = zcapExpiring({
188
- ...(entry.delegationExpires ? { expires: entry.delegationExpires } : {}),
189
- now
190
- });
191
- // The annex Space sibling, where the entry records one, is checked
192
- // on the same two axes; either member going stale re-mints BOTH in one
193
- // atomic pass (both resealed, one registry-entry rewrite).
183
+ const stale = recordedStale(entry.delegationKeyId, entry.delegationExpires);
184
+ // The annex Space sibling, where the entry records one, is checked on the
185
+ // same axes; either member going stale re-mints BOTH in one atomic pass
186
+ // (both resealed, one registry-entry rewrite).
194
187
  const siblingRecorded = entry.delegatedClientsKeyId !== undefined ||
195
188
  entry.delegatedClientsExpires !== undefined;
196
189
  const siblingStale = siblingRecorded &&
197
- (!keyStands(entry.delegatedClientsKeyId) ||
198
- zcapExpiring({
199
- ...(entry.delegatedClientsExpires
200
- ? { expires: entry.delegatedClientsExpires }
201
- : {}),
202
- now
203
- }));
204
- if (stands && !expiring && !siblingStale) {
190
+ recordedStale(entry.delegatedClientsKeyId, entry.delegatedClientsExpires);
191
+ if (!stale && !siblingStale) {
205
192
  outcomes.push({
206
193
  label: entry.label,
207
194
  unlockSpaceId: entry.unlockSpaceId,
@@ -1 +1 @@
1
- {"version":3,"file":"recoveryDelegation.js","sourceRoot":"","sources":["../../src/recovery/recoveryDelegation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAG7E,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEvD,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC/B,MAAM,2BAA2B,CAAA;AAElC,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,EACrB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,EACb,MAAM,0BAA0B,CAAA;AAEjC;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAAoB,CAAA;AAE9D,6EAA6E;AAC7E,2DAA2D;AAC3D,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE/E;;;;;;;;;;;GAWG;AACH,SAAS,SAAS,CAAC,EAAE,OAAO,EAA+B;IACzD,OAAO,KAAK,CAAC;QACX,SAAS,EAAE,OAAO,CAAC,IAAI;QACvB,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,OAAO,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;aAC9D,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,GAAG,CAAC,IAAI,CAAC,2CAA2C,EAAE;gBACpD,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,GAAG;aACJ,CAAC,CAAA;YACF,OAAO,IAAI,CAAC,CAAA;YACZ,QAAQ,CAAC,IAAI,CAAC;gBACZ,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,aAAa,EAAE,KAAK,CAAC,aAAa;gBAClC,OAAO,EAAE,QAAQ;gBACjB,KAAK,EAAE,GAAG;aACX,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAA;AACxC,CAAC"}
@@ -1,6 +1,8 @@
1
1
  import type { DIDDoc, DIDLog } from '@interop/did-method-webvh';
2
- import type { ClientWebvhUpdateKeys, PublishedWebvhLog, WebvhEnrollmentKeys, WebvhIdStore } from '../webvh/didWebvh.js';
2
+ import type { ClientWebvhUpdateKeys, WebvhEnrollmentKeys, WebvhIdStore } from '../webvh/didWebvh.js';
3
3
  import type { ResourceLogPinStore } from '@interop/vh-resource-log';
4
+ import type { UnlockInventoryPart } from '../unlock/standingWebvh.js';
5
+ import type { AccountLogSigner } from '../webvh/accountEntry.js';
4
6
  /**
5
7
  * What the add-and-retire entry retired, read back OFF THE LOG -- the resumed
6
8
  * spend's answer to the same question the live run answers from the document
@@ -58,6 +60,18 @@ export interface RecoveryPublicKeys {
58
60
  keyAgreementKeyMultibase: string;
59
61
  updateKeyMultibase: string;
60
62
  }
63
+ /**
64
+ * The public halves a SPEND needs of the replacement code it publishes: the
65
+ * two above plus the code's ladder VM key, which the add-and-retire entry
66
+ * installs under `assertionMethod` and `capabilityDelegation`. A code is a
67
+ * standing unlock credential with a ladder (`decisions/0020`) and its bridge
68
+ * delegation is signed by that ladder's VM (`decisions/0019`), so a
69
+ * replacement published without the VM could neither sign its own bridge nor
70
+ * spend. `recoveryClientFromCode` produces all three.
71
+ */
72
+ export interface ReplacementRecoveryPublicKeys extends RecoveryPublicKeys {
73
+ ladderVmKeyMultibase: string;
74
+ }
61
75
  /**
62
76
  * Thrown by the recovery continuation when the log carries neither the code's
63
77
  * update key nor its committed hash -- the code was revoked (or never
@@ -73,59 +87,33 @@ export declare class RecoveryKeyNotCommittedError extends Error {
73
87
  */
74
88
  export type RecoveryLogStore = Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>;
75
89
  /**
76
- * Reads and resolves the published log through the narrow recovery seam.
77
- *
78
- * @param options {object}
79
- * @param options.store {RecoveryLogStore}
80
- * @param [options.expectedDid] {string} the account DID the log must resolve
81
- * to, where the caller holds one
82
- * @param [options.pinStore] {ResourceLogPinStore} the caller's chain-head
83
- * pins; a served log that is a rollback, a fork, or an identity switch
84
- * against the pinned head is refused (`ResourceLogContinuityError`)
85
- * @param [options.logId] {string} the account log's pin slot
86
- * (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
87
- * supplied
88
- * @returns {Promise<PublishedWebvhLog>}
89
- */
90
- export declare function readLogOrThrow({ store, expectedDid, pinStore, logId }: {
91
- store: RecoveryLogStore;
92
- expectedDid?: string;
93
- pinStore?: ResourceLogPinStore;
94
- logId?: string;
95
- }): Promise<PublishedWebvhLog>;
96
- /**
97
- * Publishes `did.jsonl` through the narrow recovery seam -- the log only,
98
- * never `did.json` (the delegation covers nothing else; the recovered
99
- * session republishes the projection once it is the controller). The write is
100
- * conditional on the read the entry was built on, and a lost race surfaces as
101
- * a `WebvhLogConflictError` (the mapping lives in `putLogResource`).
90
+ * ISSUANCE: publishes a recovery code's split configuration into the
91
+ * document -- the code's `keyAgreement` verification method (an ordinary,
92
+ * unmarked Multikey entry, the key published verbatim: a code is
93
+ * high-entropy, so no commitment is needed), its rung-0 hash committed in
94
+ * `nextKeyHashes`, and its ladder VM. The code's update key joins
95
+ * `updateKeys` nowhere. A thin wrapper over the
96
+ * standing unlock-key inventory core ({@link publishUnlockKey}), which owns
97
+ * idempotence and the conditional publish.
102
98
  *
103
- * @param options {object}
104
- * @param options.store {RecoveryLogStore}
105
- * @param options.log {DIDLog}
106
- * @param [options.ifMatch] {string} publish only if `did.jsonl` is unchanged
107
- * @returns {Promise<void>}
108
- */
109
- export declare function publishLogOnly({ store, log, ifMatch }: {
110
- store: RecoveryLogStore;
111
- log: DIDLog;
112
- ifMatch?: string;
113
- }): Promise<void>;
114
- /**
115
- * ISSUANCE (run by an enrolled client, root authority): publishes a recovery
116
- * code's split configuration into the document -- one entry adding the code's
117
- * `keyAgreement` verification method (an ordinary, unmarked Multikey entry,
118
- * the key published verbatim: a code is high-entropy, so no commitment is
119
- * needed) and committing its update-key hash in `nextKeyHashes`. The code's
120
- * update key joins `updateKeys` nowhere. A thin wrapper over the standing
121
- * unlock-key inventory core ({@link publishUnlockKey}), which owns idempotence
122
- * and the conditional publish.
99
+ * `part` is how the ladder branch splits the entry so the code's decryption
100
+ * material precedes its authority: a key entry (`'key'`), then the escrow,
101
+ * then an authority entry (`'authority'`) carrying the ladder VM and the
102
+ * rung-0 commitment. An enrolled client's issuance escrows before the entry
103
+ * and writes the merged `'all'` entry.
123
104
  *
124
105
  * @param options {object}
125
106
  * @param options.idStore {WebvhIdStore}
126
- * @param options.updateKeys {ClientWebvhUpdateKeys} the ISSUING client's
127
- * own did:webvh update-key seeds
107
+ * @param options.signer {AccountLogSigner} who signs the entry: the ISSUING
108
+ * client's own did:webvh update-key seeds, or the acting credential's
109
+ * ladder seed
128
110
  * @param options.recovery {RecoveryPublicKeys} the code's public halves
111
+ * @param options.ladderSeed {Uint8Array} the code's OWN ladder seed,
112
+ * derived from the code bytes (`recoveryClientFromCode`). The entry
113
+ * installs that ladder's VM, and `recovery.updateKeyMultibase` is its
114
+ * rung 0
115
+ * @param [options.part] {string} `'all'` (the default), `'key'`, or
116
+ * `'authority'` -- see above
129
117
  * @param [options.expectedDid] {string} the account DID the log must
130
118
  * resolve to, from the caller's stored account pointer
131
119
  * @param [options.pinStore] {ResourceLogPinStore} the caller's chain-head
@@ -137,10 +125,12 @@ export declare function publishLogOnly({ store, log, ifMatch }: {
137
125
  * @returns {Promise<{ did: string, doc: DIDDoc, log: DIDLog }>} the account
138
126
  * DID and the document and log as this call leaves them
139
127
  */
140
- export declare function publishRecoveryKey({ idStore, updateKeys, recovery, expectedDid, pinStore, logId }: {
128
+ export declare function publishRecoveryKey({ idStore, signer, recovery, ladderSeed, part, expectedDid, pinStore, logId }: {
141
129
  idStore: WebvhIdStore;
142
- updateKeys: ClientWebvhUpdateKeys;
130
+ signer: AccountLogSigner;
143
131
  recovery: RecoveryPublicKeys;
132
+ ladderSeed: Uint8Array;
133
+ part?: UnlockInventoryPart;
144
134
  expectedDid?: string;
145
135
  pinStore?: ResourceLogPinStore;
146
136
  logId?: string;
@@ -150,21 +140,41 @@ export declare function publishRecoveryKey({ idStore, updateKeys, recovery, expe
150
140
  log: DIDLog;
151
141
  }>;
152
142
  /**
153
- * REVOCATION (run by an enrolled client, root authority): removes a recovery
154
- * code's inventory from the document -- its `keyAgreement` verification method
155
- * and its committed update-key hash -- in one entry, through the same shared
156
- * inventory core ({@link removeUnlockKey}). The roster-side half (rotating the
157
- * user key epoch off the code's wrap) is the caller's, and runs after this so
158
- * the resolver's document no longer backs the removed entry.
143
+ * REVOCATION: removes a recovery code's whole inventory from the document --
144
+ * its `keyAgreement` verification method, its committed rung-0 hash, and its
145
+ * ladder VM -- in one entry, through the same shared inventory core
146
+ * ({@link removeUnlockKey}). The roster-side half (rotating the user key
147
+ * epoch off the code's wrap) is the caller's, and runs after this so the
148
+ * resolver's document no longer backs the removed entry.
149
+ *
150
+ * The revoker holds neither the code bytes nor its ladder seed, so the VM
151
+ * claim is seedless: the removal attributes it from the log, anchored on the
152
+ * rung-0 update-key multibase the registry recorded at issuance
153
+ * (`recovery.updateKeyMultibase`). The claim is required rather than
154
+ * best-effort. A VM no attribution arm claims refuses the whole revocation
155
+ * with `UnclaimedLadderVmRetirementError` before anything is written, since a
156
+ * standing ladder VM whose credential is otherwise retired keeps its
157
+ * delegation authority -- including the DELETE-only capability on the account
158
+ * Space that the account-deletion ceremony mints.
159
159
  *
160
- * @param options {object} see {@link publishRecoveryKey}
160
+ * @param options {object} see {@link publishRecoveryKey}, except that
161
+ * `ladderSeed` is optional here: a revoking client does not hold it, and
162
+ * the code's own holder is the only party who can supply it
163
+ * @param [options.projectionStore] {object} an `id`-collection store the
164
+ * caller may write through, passed straight to the inventory edit: the
165
+ * post-strike `did:web` projection is PUT through it immediately before
166
+ * that entry publishes, so a ladder-signed revocation does not leave
167
+ * `did.json` naming the revoked code. Best-effort, and omitted the
168
+ * behavior is unchanged (see `removeUnlockKey`)
161
169
  * @returns {Promise<{ did: string, doc: DIDDoc, log: DIDLog }>} see
162
170
  * {@link publishRecoveryKey}
163
171
  */
164
- export declare function removeRecoveryKey({ idStore, updateKeys, recovery, expectedDid, pinStore, logId }: {
172
+ export declare function removeRecoveryKey({ idStore, signer, recovery, ladderSeed, projectionStore, expectedDid, pinStore, logId }: {
165
173
  idStore: WebvhIdStore;
166
- updateKeys: ClientWebvhUpdateKeys;
174
+ signer: AccountLogSigner;
167
175
  recovery: RecoveryPublicKeys;
176
+ ladderSeed?: Uint8Array;
177
+ projectionStore?: Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>;
168
178
  expectedDid?: string;
169
179
  pinStore?: ResourceLogPinStore;
170
180
  logId?: string;
@@ -199,8 +209,10 @@ export declare function removeRecoveryKey({ idStore, updateKeys, recovery, expec
199
209
  * @param options.newClientUpdateSeeds {ClientWebvhUpdateKeys} the new
200
210
  * client's update-key seeds (minted by the recovery flow, which therefore
201
211
  * holds them and can sign the add entry)
202
- * @param options.replacement {RecoveryPublicKeys} the replacement code's
203
- * public halves, committed and published in the same continuation
212
+ * @param options.replacement {ReplacementRecoveryPublicKeys} the
213
+ * replacement code's public halves -- its key-agreement key, its rung-0
214
+ * update key, and its ladder VM key -- committed and published in the same
215
+ * continuation
204
216
  * @param options.onCommitted {function}
205
217
  * `(committed: { builtOnHead: { scid, versionId } }) => Promise<void>` --
206
218
  * the REQUIRED persist-before-publish seam. It runs once per attempt, after
@@ -260,7 +272,7 @@ export declare function recoverWebvhClient(options: {
260
272
  };
261
273
  newClientKeys: WebvhEnrollmentKeys;
262
274
  newClientUpdateSeeds: ClientWebvhUpdateKeys;
263
- replacement: RecoveryPublicKeys;
275
+ replacement: ReplacementRecoveryPublicKeys;
264
276
  onCommitted: (committed: {
265
277
  builtOnHead: {
266
278
  scid: string;
@@ -1 +1 @@
1
- {"version":3,"file":"recoveryWebvh.d.ts","sourceRoot":"","sources":["../../src/recovery/recoveryWebvh.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EACV,MAAM,EACN,MAAM,EAEP,MAAM,2BAA2B,CAAA;AAelC,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAanE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,6BAA6B,CAAC,EAC5C,GAAG,EACH,GAAG,EACH,qBAAqB,EACrB,SAAS,EACV,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,qBAAqB,EAAE,MAAM,CAAA;IAC7B,SAAS,EAAE,MAAM,CAAA;CAClB,GAAG,MAAM,EAAE,CAmBX;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,EAC3B,GAAG,EACH,wBAAwB,EACzB,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;IACX,wBAAwB,EAAE,MAAM,CAAA;CACjC,GAAG,MAAM,CAET;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,wBAAwB,EAAE,MAAM,CAAA;IAChC,kBAAkB,EAAE,MAAM,CAAA;CA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