@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
@@ -0,0 +1,352 @@
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * Seedless ladder-rung attribution over a verified account log: which update
6
+ * keys are rungs of which standing ladder, read from the log alone. The
7
+ * ceremony-tail license's third shape needs it -- shape 3 admits a
8
+ * ladder-signed roster append only when the document version it anchors at was
9
+ * itself signed by a rung of the SAME ladder that signs the append, and a
10
+ * reader on the verify side holds no ladder seed to answer that with.
11
+ *
12
+ * The walk is deliberately narrow and fails closed. A ladder is anchored at
13
+ * the entry that introduces its verification method, in the two shapes that
14
+ * entry can take: the ladder-anchored genesis, where the entry authorizes
15
+ * exactly one update key and that key signed it (rung 0 revealed outright);
16
+ * and the bind another signer publishes, where rung 0 arrives as the one hash
17
+ * the entry newly commits, revealed by whichever later entry authorizes its
18
+ * pre-image. Anything else leaves the ladder unattributed, and an
19
+ * unattributed ladder never satisfies shape 3.
20
+ *
21
+ * Which of the two an entry is takes one question first: whose the key it
22
+ * reveals already is. An entry authorizing exactly one self-signing key is
23
+ * the genesis shape only when no ladder already holds that key and the entry
24
+ * publishes no enrolled client. A ladder-branch bind is the counterexample --
25
+ * the ACTING credential's rung reveals itself in the very entry that
26
+ * introduces another credential's ladder VM and commits its rung-0 hash -- so
27
+ * the newcomer anchors on that commitment and the acting ladder climbs onto
28
+ * the rung it just revealed. Reading it the other way would anchor the
29
+ * newcomer on a key it does not hold and hand the acting ladder a shot at a
30
+ * version the newcomer's bind minted. The remembered recovery spend's
31
+ * add-and-retire entry is the enrolled-client counterexample: it introduces
32
+ * the replacement code's ladder VM while the one key it authorizes is the new
33
+ * CLIENT's update key.
34
+ *
35
+ * An anchored ladder then CLIMBS with the log, by the last-position rule of
36
+ * `decisions/0007-ladder-reveal-hash-order.md` read forward. An entry that
37
+ * authorizes exactly one new update key and was signed by that key is a
38
+ * prerotation reveal; when the key's hash was committed LAST among some
39
+ * earlier entry's additions, and that earlier entry itself authorized exactly
40
+ * one key and was signed by it, the committer was committing for itself, so
41
+ * the revealed key is the next rung of the ladder that earlier key belongs
42
+ * to. The step is taken only while the ladder's own VM still stands in the
43
+ * revealing entry's document. Without the climb a self-enrollment would end
44
+ * the attribution outright -- it retires the spent rung, so the ladder would
45
+ * be frozen at a key the account no longer authorizes -- and a passkey
46
+ * account, which self-enrolls by construction, could never satisfy shape 3.
47
+ *
48
+ * Two states stay out of reach on purpose, and both refuse rather than guess.
49
+ * An entry introducing more than one ladder VM names no rung for any of them.
50
+ * And a hash committed anywhere but last is never climbed: an enrollment
51
+ * approval reuses its rung, so its commit entry authorizes no key at all and
52
+ * the client update key its add entry authorizes sits in the commit's first
53
+ * position rather than its last. Under-attributing costs a refused append,
54
+ * which the ceremony surfaces and a retry cannot mend; over-attributing would
55
+ * hand a ladder a shot minted by an enrolled client's own entry, which is the
56
+ * class the license exists to exclude.
57
+ *
58
+ * The parameter carry-forward here is the did:webvh log format's own rule (an
59
+ * entry that omits `updateKeys` or `nextKeyHashes` keeps the previous entry's)
60
+ * read at layer 0, where the `webvh` layer's reader cannot be imported.
61
+ */
62
+ import { deriveNextKeyHash } from '@interop/did-method-webvh';
63
+ import { vmFragmentOf } from '@interop/vh-resource-log';
64
+ import { ladderVmMethods, resolvedRelationMethods } from './document.js';
65
+ /**
66
+ * The update-key multibases that signed one log entry: the fragment of each
67
+ * proof's `did:key:<multibase>#<multibase>` verification method.
68
+ *
69
+ * @param entry {DIDLogEntry | undefined}
70
+ * @returns {Set<string>}
71
+ */
72
+ export function entrySignerKeysOf(entry) {
73
+ const keys = new Set();
74
+ for (const proof of entry?.proof ?? []) {
75
+ const id = proof.verificationMethod;
76
+ const keyMultibase = id === undefined ? undefined : vmFragmentOf(id);
77
+ if (keyMultibase !== undefined) {
78
+ keys.add(keyMultibase);
79
+ }
80
+ }
81
+ return keys;
82
+ }
83
+ /**
84
+ * The ladder VMs' key multibases in one entry's document.
85
+ *
86
+ * @param doc {AccountDocument | undefined}
87
+ * @returns {Set<string>}
88
+ */
89
+ function ladderKeysOf(doc) {
90
+ const keys = new Set();
91
+ if (!doc) {
92
+ return keys;
93
+ }
94
+ for (const method of ladderVmMethods({ doc })) {
95
+ if (typeof method.publicKeyMultibase === 'string') {
96
+ keys.add(method.publicKeyMultibase);
97
+ }
98
+ }
99
+ return keys;
100
+ }
101
+ /**
102
+ * The enrolled clients' signing-key multibases in one entry's document: the
103
+ * `capabilityInvocation` methods, which is what an enrolled client publishes
104
+ * and a ladder VM deliberately does not. Only the SET matters here -- an
105
+ * entry that grows it published a client, and the update key such an entry
106
+ * authorizes is that client's rather than any ladder's rung.
107
+ *
108
+ * @param doc {AccountDocument | undefined}
109
+ * @returns {Set<string>}
110
+ */
111
+ function enrolledClientKeysOf(doc) {
112
+ const keys = new Set();
113
+ if (!doc) {
114
+ return keys;
115
+ }
116
+ for (const method of resolvedRelationMethods({
117
+ doc,
118
+ relation: 'capabilityInvocation'
119
+ })) {
120
+ if (typeof method.publicKeyMultibase === 'string') {
121
+ keys.add(method.publicKeyMultibase);
122
+ }
123
+ }
124
+ return keys;
125
+ }
126
+ /**
127
+ * The ladder a key is already a rung of, or `undefined` when no ladder holds
128
+ * it. Asked of the revealed key before the anchoring branch runs, since a key
129
+ * another ladder owns can anchor nothing.
130
+ *
131
+ * @param options {object}
132
+ * @param options.rungsByLadder {LadderRungKeys}
133
+ * @param options.key {string}
134
+ * @returns {string | undefined}
135
+ */
136
+ function ownerOfRung({ rungsByLadder, key }) {
137
+ for (const [ladderKey, rungs] of rungsByLadder) {
138
+ if (rungs.has(key)) {
139
+ return ladderKey;
140
+ }
141
+ }
142
+ return undefined;
143
+ }
144
+ /**
145
+ * Members of `next` that `previous` does not carry, in order.
146
+ *
147
+ * @param options {object}
148
+ * @param options.next {Iterable<string>}
149
+ * @param options.previous {Set<string>}
150
+ * @returns {string[]}
151
+ */
152
+ function addedMembers({ next, previous }) {
153
+ const added = [];
154
+ for (const member of next) {
155
+ if (!previous.has(member) && !added.includes(member)) {
156
+ added.push(member);
157
+ }
158
+ }
159
+ return added;
160
+ }
161
+ /**
162
+ * Attributes each standing ladder VM's rung keys, one snapshot per log entry:
163
+ * the returned array is indexed by entry position, and each snapshot names
164
+ * what the log attributes as of that version and no later one. A ladder is
165
+ * anchored at the entry introducing its VM and climbs from there by the
166
+ * last-position rule (the module header states both).
167
+ *
168
+ * A snapshot names a ladder's rungs that the version still authorizes in
169
+ * `updateKeys`, plus any rung that signed the version's own entry -- the one
170
+ * question the ceremony-tail license asks of this map, so a rung retired by
171
+ * the very entry it signed still answers it. A ladder left with no such rung
172
+ * is absent from that snapshot rather than present and empty, as is a ladder
173
+ * the walk refuses, so a caller cannot mistake "no rung attributed" for "this
174
+ * key signed nothing".
175
+ *
176
+ * @param log {DIDLog} a resolved, caller-verified account log
177
+ * @returns {Promise<LadderRungKeys[]>} one snapshot per entry, in log order
178
+ */
179
+ export async function attributeLadderRungsPerVersion(log) {
180
+ const snapshots = [];
181
+ const rungsByLadder = new Map();
182
+ // A rung-0 hash a bind entry committed, awaiting the entry that authorizes
183
+ // its pre-image. One owner per hash: a second claimant retires the claim,
184
+ // since neither ladder can then be told from the other.
185
+ const claims = new Map();
186
+ // Ladder VMs the walk refused, so a later snapshot cannot resurrect one.
187
+ const refused = new Set();
188
+ // A hash an entry committed LAST among its additions, mapped to the ladder
189
+ // whose rung both authorized and signed that entry: the pre-image, when a
190
+ // later entry reveals it, is that ladder's next rung. Spent on sight.
191
+ const climbs = new Map();
192
+ let previousLadderKeys = new Set();
193
+ let previousClientKeys = new Set();
194
+ let previousUpdateKeys = new Set();
195
+ let previousNextKeyHashes = new Set();
196
+ let updateKeys = [];
197
+ let nextKeyHashes = [];
198
+ for (const entry of log) {
199
+ if (entry.parameters?.updateKeys) {
200
+ updateKeys = entry.parameters.updateKeys;
201
+ }
202
+ if (entry.parameters?.nextKeyHashes) {
203
+ nextKeyHashes = entry.parameters.nextKeyHashes;
204
+ }
205
+ const doc = entry.state;
206
+ const ladderKeys = ladderKeysOf(doc);
207
+ const introduced = addedMembers({
208
+ next: ladderKeys,
209
+ previous: previousLadderKeys
210
+ });
211
+ const addedKeys = addedMembers({
212
+ next: updateKeys,
213
+ previous: previousUpdateKeys
214
+ });
215
+ const addedHashes = addedMembers({
216
+ next: nextKeyHashes,
217
+ previous: previousNextKeyHashes
218
+ });
219
+ const signers = entrySignerKeysOf(entry);
220
+ // A committed rung-0 hash whose pre-image this entry authorizes: the bind
221
+ // shape's second half. The claim is spent whether or not it names a
222
+ // ladder, so a retired claim can never be picked up later.
223
+ for (const key of addedKeys) {
224
+ const hash = await deriveNextKeyHash(key);
225
+ if (!claims.has(hash)) {
226
+ continue;
227
+ }
228
+ const owner = claims.get(hash);
229
+ claims.delete(hash);
230
+ if (owner !== null && owner !== undefined && !refused.has(owner)) {
231
+ rungsByLadder.set(owner, (rungsByLadder.get(owner) ?? new Set()).add(key));
232
+ }
233
+ }
234
+ // The CLIMB: this entry authorizes exactly one new key and that key
235
+ // signed it (a prerotation reveal), and an earlier entry committed the
236
+ // key's hash in last position under a rung of a known ladder. The
237
+ // candidate is spent whether or not the guard below admits it, so a
238
+ // released hash can never be climbed later.
239
+ const revealedRung = addedKeys.length === 1 ? addedKeys[0] : undefined;
240
+ if (revealedRung !== undefined && signers.has(revealedRung)) {
241
+ const hash = await deriveNextKeyHash(revealedRung);
242
+ const owner = climbs.get(hash);
243
+ climbs.delete(hash);
244
+ // The ladder's own VM must still stand in THIS entry's document. That
245
+ // is what keeps a recovery spend out: the spent credential's
246
+ // reveal-and-commit entry commits the REPLACEMENT credential's hash
247
+ // last, and the entry revealing that hash is the one that strikes the
248
+ // spent credential's ladder VM.
249
+ if (owner !== undefined &&
250
+ !refused.has(owner) &&
251
+ ladderKeys.has(owner) &&
252
+ rungsByLadder.has(owner)) {
253
+ rungsByLadder.set(owner, (rungsByLadder.get(owner) ?? new Set()).add(revealedRung));
254
+ }
255
+ }
256
+ // WHOSE the revealed key already is, resolved BEFORE the anchoring
257
+ // branch: the claim resolution and the climb above have just credited it
258
+ // where it belongs, so a hit here names a ladder that already holds it.
259
+ // A ladder-branch bind entry is the shape this orders: the ACTING
260
+ // credential's rung reveals itself in the very entry that introduces
261
+ // another credential's ladder VM, and reading that rung as the newcomer's
262
+ // rung 0 would anchor the newcomer on a key it does not hold AND credit
263
+ // the acting ladder with the newcomer's rung-0 commitment below.
264
+ const revealedOwner = revealedRung === undefined
265
+ ? undefined
266
+ : ownerOfRung({ rungsByLadder, key: revealedRung });
267
+ // Whether this entry also published an enrolled client. The one key such
268
+ // an entry authorizes is that client's update key (the remembered
269
+ // recovery spend's add-and-retire entry, which introduces the replacement
270
+ // code's ladder VM beside the new client), so it anchors no ladder.
271
+ const introducedClients = addedMembers({
272
+ next: enrolledClientKeysOf(doc),
273
+ previous: previousClientKeys
274
+ });
275
+ // The introduction, the one place a ladder is anchored. A VM introduced
276
+ // beside another names no rung for either.
277
+ let claimedHere;
278
+ if (introduced.length > 1) {
279
+ for (const ladderKey of introduced) {
280
+ refused.add(ladderKey);
281
+ rungsByLadder.delete(ladderKey);
282
+ }
283
+ }
284
+ else if (introduced.length === 1) {
285
+ const ladderKey = introduced[0];
286
+ refused.delete(ladderKey);
287
+ rungsByLadder.delete(ladderKey);
288
+ const revealed = addedKeys[0];
289
+ // Rung 0 revealed outright, the ladder-anchored genesis shape: one key
290
+ // authorized, signing its own entry, owned by no other ladder and not a
291
+ // client's.
292
+ const revealsOwnRungZero = addedKeys.length === 1 &&
293
+ revealed !== undefined &&
294
+ signers.has(revealed) &&
295
+ revealedOwner === undefined &&
296
+ introducedClients.length === 0;
297
+ // The commitment arm: the bind another signer publishes, where rung 0
298
+ // arrives as a commitment and is picked up when a later entry reveals
299
+ // its pre-image. It covers the bind an enrolled client signs (which
300
+ // authorizes no key of its own) and the ladder-branch bind another
301
+ // credential's rung signs (which authorizes that rung and nothing
302
+ // else), both of which commit exactly the newcomer's rung-0 hash.
303
+ const commitsRungZero = addedHashes.length === 1 &&
304
+ (addedKeys.length === 0 || revealedOwner !== undefined);
305
+ if (revealsOwnRungZero) {
306
+ rungsByLadder.set(ladderKey, new Set([revealed]));
307
+ }
308
+ else if (commitsRungZero) {
309
+ const hash = addedHashes[0];
310
+ // A hash two binds commit is nobody's: retire the claim outright.
311
+ claims.set(hash, claims.has(hash) ? null : ladderKey);
312
+ claimedHere = hash;
313
+ }
314
+ else {
315
+ refused.add(ladderKey);
316
+ }
317
+ }
318
+ // What this entry committed for ITSELF: the last of its newly committed
319
+ // hashes, recorded against the ladder whose rung authorized and signed
320
+ // the entry. Recorded after the introduction branch, so a ladder-anchored
321
+ // genesis stages its own rung 1. An entry that reuses its rung authorizes
322
+ // no key of its own and so records nothing, and a hash the introduction
323
+ // above claimed for the ladder this entry BINDS is that ladder's rung 0
324
+ // rather than the signer's next rung.
325
+ const committedLast = addedHashes[addedHashes.length - 1];
326
+ const signingLadder = revealedRung === undefined
327
+ ? undefined
328
+ : ownerOfRung({ rungsByLadder, key: revealedRung });
329
+ if (revealedRung !== undefined &&
330
+ signers.has(revealedRung) &&
331
+ signingLadder !== undefined &&
332
+ committedLast !== undefined &&
333
+ committedLast !== claimedHere) {
334
+ climbs.set(committedLast, signingLadder);
335
+ }
336
+ const authorized = new Set(updateKeys);
337
+ const snapshot = new Map();
338
+ for (const [ladderKey, rungs] of rungsByLadder) {
339
+ const standing = [...rungs].filter(rung => authorized.has(rung) || signers.has(rung));
340
+ if (standing.length > 0) {
341
+ snapshot.set(ladderKey, new Set(standing));
342
+ }
343
+ }
344
+ snapshots.push(snapshot);
345
+ previousLadderKeys = ladderKeys;
346
+ previousClientKeys = enrolledClientKeysOf(doc);
347
+ previousUpdateKeys = new Set(updateKeys);
348
+ previousNextKeyHashes = new Set(nextKeyHashes);
349
+ }
350
+ return snapshots;
351
+ }
352
+ //# sourceMappingURL=ladderRungs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ladderRungs.js","sourceRoot":"","sources":["../../src/resourceLog/ladderRungs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EACL,eAAe,EACf,uBAAuB,EAExB,MAAM,eAAe,CAAA;AAStB;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA8B;IAC9D,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE,KAAK,IAAI,EAAE,EAAE,CAAC;QACvC,MAAM,EAAE,GAAG,KAAK,CAAC,kBAAkB,CAAA;QACnC,MAAM,YAAY,GAAG,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAA;QACpE,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;YAC/B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;;;;GAKG;AACH,SAAS,YAAY,CAAC,GAAgC;IACpD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,IAAI,CAAA;IACb,CAAC;IACD,KAAK,MAAM,MAAM,IAAI,eAAe,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;QAC9C,IAAI,OAAO,MAAM,CAAC,kBAAkB,KAAK,QAAQ,EAAE,CAAC;YAClD,IAAI,CAAC,GAAG,CA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B,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAA;QAC9C,kBAAkB,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAA;QACxC,qBAAqB,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,CAAA;IAChD,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC"}
@@ -4,30 +4,55 @@
4
4
  /**
5
5
  * The ceremony-tail license on ladder-signed resource-log appends (clause B
6
6
  * of the ladder VM's authority clauses). A ladder-signed append is accepted
7
- * in exactly two shapes: the log's first entry (creation, not extension --
8
- * callers admit that shape by not calling this check on a genesis entry),
9
- * or a rotation that carries an inventory-changing controller document
10
- * version, one-shot -- refused when the verified log head already carries
11
- * an entry at that version or later. Both shapes carry a per-entry rule: at
12
- * most one of an entry's proofs may be by a ladder key, so a second ladder
13
- * key cannot co-sign its way around the one-shot. A rotation co-signed by an
14
- * ordinary member stays licensed. Everything else, above all a rotation
7
+ * in exactly three shapes: the log's first entry (creation, not extension --
8
+ * callers admit that shape by not calling this check on a genesis entry);
9
+ * a rotation that carries an inventory-changing controller document version
10
+ * (shape 2); or a rotation carrying a version whose ENROLLED-CLIENT set
11
+ * changed and whose entry a rung of the appending ladder signed (shape 3).
12
+ * Shapes 2 and 3 are one-shot -- refused when the verified log head already
13
+ * carries an entry at that version or later -- and both carry a per-entry
14
+ * rule: at most one of an entry's proofs may be by a ladder key, so a second
15
+ * ladder key cannot co-sign its way around the one-shot. A rotation co-signed
16
+ * by an ordinary member stays licensed. Everything else, above all a rotation
15
17
  * against an unchanged document (the silent-rekey shape), is refused with
16
18
  * {@link ResourceLogLicenseError}. Controller versions compare by position
17
19
  * in the controller's verified version history, the structural twin of the
18
20
  * sealing sweep's `headControllerVersionIndex >= removalIndex` check.
21
+ *
22
+ * Shape 3's signer conjunct is the whole of what keeps it out of the
23
+ * any-`keyAgreement`-change predicate the clause rejects. A client's own
24
+ * enrollment or revocation entry is signed by a client, so it mints no shot
25
+ * for any ladder; only a ladder-signed enrollment or removal does, and only
26
+ * for the ladder that signed it. Whose rung signed a version is read from the
27
+ * log alone (`ladderRungKeys` on the controller inventory), so a verifier
28
+ * needs no ladder seed, and a ladder the log does not attribute is refused.
29
+ *
30
+ * Shape 3 is a verifier-side rule on an append-only log: a reader that has
31
+ * not shipped it refuses the whole roster log, because this refusal is thrown
32
+ * from the admission hook and the verifier propagates it. Rollout is
33
+ * therefore verifier-first -- every reader of a roster log ships shape 3
34
+ * before any writer emits an append that needs it.
19
35
  */
20
36
  import type { WebvhResourceLogController } from './controller.js';
21
37
  /**
22
- * Evaluates the ceremony-tail license's second shape for one ladder-signed
23
- * append: the append must carry an inventory-changing document version V --
24
- * S(V) differs from S(V-1) in either direction, with S(-1) empty for the
25
- * genesis version -- and no verified entry may already carry V or later
26
- * (`headControllerVersionIndex >= controllerVersionIndex` refuses; the
27
- * license is one-shot, so a torn ceremony's late-arriving tail still passes
28
- * while a second rotation against the same version does not). A `null`
29
- * controller version index (an unversioned controller, where no version
30
- * exists to license against) is refused fail-closed.
38
+ * Evaluates the ceremony-tail license's second and third shapes for one
39
+ * ladder-signed append. Shape 2: the append carries an inventory-changing
40
+ * document version V -- S(V) differs from S(V-1) in either direction, with
41
+ * S(-1) empty for the genesis version. Shape 3: the version's enrolled-client
42
+ * set differs from V-1's, in either direction, AND one of the update keys
43
+ * that signed the version's own entry is a rung the log attributes to the
44
+ * ladder signing this append. Either shape then meets the same one-shot
45
+ * check: no verified entry may already carry V or later
46
+ * (`headControllerVersionIndex >= controllerVersionIndex` refuses, so a torn
47
+ * ceremony's late-arriving tail still passes while a second rotation against
48
+ * the same version does not). A `null` controller version index (an
49
+ * unversioned controller, where no version exists to license against) is
50
+ * refused fail-closed.
51
+ *
52
+ * The appending ladder is read off `proofKeys` rather than passed: the entry
53
+ * carries at most one ladder proof (the refusal below), and the port promises
54
+ * the calling proof's own key is among them, so the intersection with the
55
+ * version's ladder keys names exactly the ladder whose shot is being spent.
31
56
  *
32
57
  * The one-shot is spent per entry, so the entry itself may carry at most one
33
58
  * ladder-key proof: a second ladder key among `proofKeys` refuses, because
@@ -1 +1 @@
1
- {"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../../src/resourceLog/license.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAsBjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAsB,0BAA0B,CAAC,EAC/C,UAAU,EACV,sBAAsB,EACtB,0BAA0B,EAC1B,SAAS,EACV,EAAE;IACD,UAAU,EAAE,IAAI,CAAC,0BAA0B,EAAE,YAAY,GAAG,aAAa,CAAC,CAAA;IAC1E,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAA;IACrC,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAA;IACzC,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoDhB"}
1
+ {"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../../src/resourceLog/license.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAsBjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAsB,0BAA0B,CAAC,EAC/C,UAAU,EACV,sBAAsB,EACtB,0BAA0B,EAC1B,SAAS,EACV,EAAE;IACD,UAAU,EAAE,IAAI,CAAC,0BAA0B,EAAE,YAAY,GAAG,aAAa,CAAC,CAAA;IAC1E,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAA;IACrC,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAA;IACzC,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgEhB"}
@@ -18,15 +18,24 @@ function setsEqual(left, right) {
18
18
  return true;
19
19
  }
20
20
  /**
21
- * Evaluates the ceremony-tail license's second shape for one ladder-signed
22
- * append: the append must carry an inventory-changing document version V --
23
- * S(V) differs from S(V-1) in either direction, with S(-1) empty for the
24
- * genesis version -- and no verified entry may already carry V or later
25
- * (`headControllerVersionIndex >= controllerVersionIndex` refuses; the
26
- * license is one-shot, so a torn ceremony's late-arriving tail still passes
27
- * while a second rotation against the same version does not). A `null`
28
- * controller version index (an unversioned controller, where no version
29
- * exists to license against) is refused fail-closed.
21
+ * Evaluates the ceremony-tail license's second and third shapes for one
22
+ * ladder-signed append. Shape 2: the append carries an inventory-changing
23
+ * document version V -- S(V) differs from S(V-1) in either direction, with
24
+ * S(-1) empty for the genesis version. Shape 3: the version's enrolled-client
25
+ * set differs from V-1's, in either direction, AND one of the update keys
26
+ * that signed the version's own entry is a rung the log attributes to the
27
+ * ladder signing this append. Either shape then meets the same one-shot
28
+ * check: no verified entry may already carry V or later
29
+ * (`headControllerVersionIndex >= controllerVersionIndex` refuses, so a torn
30
+ * ceremony's late-arriving tail still passes while a second rotation against
31
+ * the same version does not). A `null` controller version index (an
32
+ * unversioned controller, where no version exists to license against) is
33
+ * refused fail-closed.
34
+ *
35
+ * The appending ladder is read off `proofKeys` rather than passed: the entry
36
+ * carries at most one ladder proof (the refusal below), and the port promises
37
+ * the calling proof's own key is among them, so the intersection with the
38
+ * version's ladder keys names exactly the ladder whose shot is being spent.
30
39
  *
31
40
  * The one-shot is spent per entry, so the entry itself may carry at most one
32
41
  * ladder-key proof: a second ladder key among `proofKeys` refuses, because
@@ -57,30 +66,35 @@ export async function assertLadderAppendLicensed({ controller, controllerVersion
57
66
  'without a controller document version to license against.');
58
67
  }
59
68
  const inventory = await controller.inventoryAt(controller.versionIds[controllerVersionIndex]);
60
- let ladderProofs = 0;
61
- for (const key of proofKeys) {
62
- if (inventory.ladderKeys.has(key)) {
63
- ladderProofs += 1;
64
- }
65
- }
66
- if (ladderProofs > 1) {
69
+ const ladderProofKeys = proofKeys.filter(key => inventory.ladderKeys.has(key));
70
+ if (ladderProofKeys.length > 1) {
67
71
  throw new ResourceLogLicenseError('The append carries more than one ladder-signed proof (at most one ' +
68
72
  'ladder key may sign an entry, so a co-signing ladder key cannot ' +
69
73
  'spend the one-shot twice).');
70
74
  }
71
- const current = inventory.inventoryKeys;
72
75
  const previous = controllerVersionIndex === 0
73
- ? new Set()
74
- : (await controller.inventoryAt(controller.versionIds[controllerVersionIndex - 1])).inventoryKeys;
75
- if (setsEqual(current, previous)) {
76
- throw new ResourceLogLicenseError('The ladder-signed append carries a controller document version ' +
77
- 'that did not change the credential inventory (a rotation against an ' +
78
- 'unchanged document is never licensed).');
76
+ ? undefined
77
+ : await controller.inventoryAt(controller.versionIds[controllerVersionIndex - 1]);
78
+ const inventoryChanged = !setsEqual(inventory.inventoryKeys, previous?.inventoryKeys ?? new Set());
79
+ const clientSetChanged = !setsEqual(inventory.enrolledClientKeys, previous?.enrolledClientKeys ?? new Set());
80
+ // Shape 3's signer conjunct: a rung the log attributes to THIS ladder signed
81
+ // the version's entry. An unattributed ladder holds no rungs here, so it
82
+ // never satisfies the conjunct.
83
+ const appendingLadderKey = ladderProofKeys[0];
84
+ const ownRungs = appendingLadderKey === undefined
85
+ ? undefined
86
+ : inventory.ladderRungKeys.get(appendingLadderKey);
87
+ const signedByOwnLadder = [...(ownRungs ?? [])].some(rung => inventory.entrySignerKeys.has(rung));
88
+ if (!inventoryChanged && !(clientSetChanged && signedByOwnLadder)) {
89
+ throw new ResourceLogLicenseError('The ladder-signed append carries a controller document version that ' +
90
+ 'neither changed the credential inventory nor changed the ' +
91
+ 'enrolled-client set under a rung of this ladder (a rotation ' +
92
+ 'against an unchanged document is never licensed).');
79
93
  }
80
94
  if (headControllerVersionIndex !== null &&
81
95
  headControllerVersionIndex >= controllerVersionIndex) {
82
96
  throw new ResourceLogLicenseError('The verified log head already carries an entry at or past this ' +
83
- 'inventory-changing document version (the license is one-shot).');
97
+ 'licensed document version (the license is one-shot).');
84
98
  }
85
99
  }
86
100
  //# sourceMappingURL=license.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"license.js","sourceRoot":"","sources":["../../src/resourceLog/license.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAErD;;;;;;GAMG;AACH,SAAS,SAAS,CAAC,IAAiB,EAAE,KAAkB;IACtD,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAA;IACd,CAAC;IACD,KAAK,MAAM,MAAM,IAAI,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACvB,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,EAC/C,UAAU,EACV,sBAAsB,EACtB,0BAA0B,EAC1B,SAAS,EAMV;IACC,IACE,sBAAsB,KAAK,IAAI;QAC/B,sBAAsB,GAAG,CAAC;QAC1B,sBAAsB,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,EACtD,CAAC;QACD,MAAM,IAAI,uBAAuB,CAC/B,mEAAmE;YACjE,2DAA2D,CAC9D,CAAA;IACH,CAAC;IACD,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,WAAW,CAC5C,UAAU,CAAC,UAAU,CAAC,sBAAsB,CAAE,CAC/C,CAAA;IACD,IAAI,YAAY,GAAG,CAAC,CAAA;IACpB,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;QAC5B,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAClC,YAAY,IAAI,CAAC,CAAA;QACnB,CAAC;IACH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Ae,CAAC,CAAC,CAAC,CAAA;IAC7C,MAAM,QAAQ,GACZ,kBAAkB,KAAK,SAAS;QAC9B,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;IACtD,MAAM,iBAAiB,GAAG,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC1D,SAAS,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CACpC,CAAA;IACD,IAAI,CAAC,gBAAgB,IAAI,CAAC,CAAC,gBAAgB,IAAI,iBAAiB,CAAC,EAAE,CAAC;QAClE,MAAM,IAAI,uBAAuB,CAC/B,sEAAsE;YACpE,2DAA2D;YAC3D,8DAA8D;YAC9D,mDAAmD,CACtD,CAAA;IACH,CAAC;IACD,IACE,0BAA0B,KAAK,IAAI;QACnC,0BAA0B,IAAI,sBAAsB,EACpD,CAAC;QACD,MAAM,IAAI,uBAAuB,CAC/B,iEAAiE;YAC/D,sDAAsD,CACzD,CAAA;IACH,CAAC;AACH,CAAC"}
@@ -193,21 +193,6 @@ export declare function addHistoryWalletLogin({ user, id, created }?: {
193
193
  id?: string;
194
194
  created?: string;
195
195
  }): WalletActivity;
196
- /**
197
- * The Revoke activity: the user revoked a connected app's access, retiring its
198
- * app-key credential and its storage grants.
199
- *
200
- * @param options {object}
201
- * @param options.user {Actor}
202
- * @param options.origin {string} the connected app's origin
203
- * @param options.name {string} the connected app's display name
204
- * @param [options.cid] {string} the retired app-key credential's cid
205
- * @param [options.revoked] {number} how many storage grants were revoked
206
- * @param [options.skipped] {number} how many grants needed no revocation
207
- * @param [options.id] {string}
208
- * @param [options.created] {string}
209
- * @returns {WalletActivity}
210
- */
211
196
  /**
212
197
  * The ClientRevoke activity: the user disconnected an enrolled wallet client
213
198
  * -- its verification methods and update key left the did:webvh document, the
@@ -313,6 +298,21 @@ export declare function addHistoryAgentRevoke({ user, origin, controller, zcaps,
313
298
  id?: string;
314
299
  created?: string;
315
300
  }): WalletActivity;
301
+ /**
302
+ * The Revoke activity: the user revoked a connected app's access, retiring its
303
+ * app-key credential and its storage grants.
304
+ *
305
+ * @param options {object}
306
+ * @param options.user {Actor}
307
+ * @param options.origin {string} the connected app's origin
308
+ * @param options.name {string} the connected app's display name
309
+ * @param [options.cid] {string} the retired app-key credential's cid
310
+ * @param [options.revoked] {number} how many storage grants were revoked
311
+ * @param [options.skipped] {number} how many grants needed no revocation
312
+ * @param [options.id] {string}
313
+ * @param [options.created] {string}
314
+ * @returns {WalletActivity}
315
+ */
316
316
  export declare function addHistoryAppRevoke({ user, origin, name, cid, revoked, skipped, id, created }: {
317
317
  user: Actor;
318
318
  origin: string;
@@ -1 +1 @@
1
- {"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../src/space/activity.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;CAWhB,CAAA;AAEV;;GAEG;AACH,KAAK,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAY5C;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EACJ,EAAE,EACF,OAAO,EACR,EAAE;IACD,IAAI,EAAE,KAAK,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,OAAO,CAAC,EAAE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