@interop/wallet-core 0.89.0 → 0.91.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.
- package/dist/clientAnnex/grantRevocation.d.ts +9 -4
- package/dist/clientAnnex/grantRevocation.d.ts.map +1 -1
- package/dist/clientAnnex/grantRevocation.js +8 -4
- package/dist/clientAnnex/grantRevocation.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +1 -1
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +1 -1
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/ladder.d.ts +55 -13
- package/dist/clientAnnex/ladder.d.ts.map +1 -1
- package/dist/clientAnnex/ladder.js +143 -75
- package/dist/clientAnnex/ladder.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +7 -58
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +9 -72
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +4 -2
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +12 -2
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts +53 -17
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js +52 -24
- package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
- package/dist/clientAnnex/selfEnroll.d.ts +3 -8
- package/dist/clientAnnex/selfEnroll.d.ts.map +1 -1
- package/dist/clientAnnex/selfEnroll.js +2 -1
- package/dist/clientAnnex/selfEnroll.js.map +1 -1
- package/dist/recovery/continuation.d.ts +23 -9
- package/dist/recovery/continuation.d.ts.map +1 -1
- package/dist/recovery/continuation.js +85 -14
- package/dist/recovery/continuation.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +17 -4
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +14 -1
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/sync/contactsConflict.d.ts +9 -9
- package/dist/sync/contactsConflict.js +9 -9
- package/dist/sync/engine.d.ts +3 -3
- package/dist/sync/engine.js +3 -3
- package/dist/sync/engine.js.map +1 -1
- package/dist/sync/index.d.ts +3 -3
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +2 -2
- package/dist/sync/pull.d.ts +5 -5
- package/dist/sync/pull.js +5 -5
- package/dist/sync/push.d.ts +7 -6
- package/dist/sync/push.d.ts.map +1 -1
- package/dist/sync/push.js +65 -59
- package/dist/sync/push.js.map +1 -1
- package/dist/sync/remint.d.ts +37 -33
- package/dist/sync/remint.d.ts.map +1 -1
- package/dist/sync/remint.js +70 -64
- package/dist/sync/remint.js.map +1 -1
- package/dist/sync/types.d.ts +88 -83
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/sync/types.js +12 -12
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +3 -1
- package/dist/unlock/standingWebvh.js.map +1 -1
- package/dist/webvh/accountEntry.d.ts +10 -1
- package/dist/webvh/accountEntry.d.ts.map +1 -1
- package/dist/webvh/accountEntry.js +23 -1
- package/dist/webvh/accountEntry.js.map +1 -1
- package/dist/webvh/builtOnHead.d.ts +79 -0
- package/dist/webvh/builtOnHead.d.ts.map +1 -0
- package/dist/webvh/builtOnHead.js +77 -0
- package/dist/webvh/builtOnHead.js.map +1 -0
- package/dist/webvh/didWebvh.d.ts +14 -6
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +5 -2
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/enrollClient.d.ts +4 -1
- package/dist/webvh/enrollClient.d.ts.map +1 -1
- package/dist/webvh/enrollClient.js +38 -8
- package/dist/webvh/enrollClient.js.map +1 -1
- package/dist/webvh/index.d.ts +2 -0
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +1 -0
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +4 -6
- package/dist/webvh/revokeClient.js.map +1 -1
- package/dist/webvh/verifyLog.d.ts +5 -1
- package/dist/webvh/verifyLog.d.ts.map +1 -1
- package/dist/webvh/verifyLog.js +4 -2
- package/dist/webvh/verifyLog.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
* one local skip is a grant expired beyond the revocation clock-skew margin.
|
|
9
9
|
* Everything else is POSTed, since a revocation the server accepts is the
|
|
10
10
|
* only proof the grant is off the account, and a plain refusal is then
|
|
11
|
-
* classified on what the client can check.
|
|
11
|
+
* classified on what the client can check. A plain refusal is a
|
|
12
|
+
* `ValidationError` or a `NotFoundError`: the server answers a dead grant's
|
|
13
|
+
* revocation with the masked 404, since the invocation is denied before the
|
|
14
|
+
* chain is validated.
|
|
12
15
|
*
|
|
13
16
|
* What the client can check differs by how the grant was delegated. A grant
|
|
14
17
|
* delegated straight under the Space root is signed by an enrolled client's
|
|
@@ -96,9 +99,11 @@ export declare function classifyGrantRevocationRefusal({ zcap, signerCheck, now
|
|
|
96
99
|
* ({@link delegationExpired}). Everything else is POSTed, whatever the
|
|
97
100
|
* caller's document says about the signer: the document a login read is a
|
|
98
101
|
* snapshot. was-client's `AlreadyRevokedError` is success. A plain
|
|
99
|
-
* `ValidationError`
|
|
100
|
-
* and rethrown when the
|
|
101
|
-
*
|
|
102
|
+
* refusal, a `ValidationError` or a `NotFoundError` by exact name, is read
|
|
103
|
+
* through {@link classifyGrantRevocationRefusal}, and rethrown when the
|
|
104
|
+
* client cannot say why. A dead grant is refused with the 404, since the
|
|
105
|
+
* server denies an invocation whose chain does not verify before it
|
|
106
|
+
* validates the chain. Every other failure is rethrown. Errors are matched on `err.name`, since error classes do not
|
|
102
107
|
* survive crossing package copies.
|
|
103
108
|
*
|
|
104
109
|
* @param options {object}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grantRevocation.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/grantRevocation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"grantRevocation.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/grantRevocation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAEzE,OAAO,EAKL,KAAK,oBAAoB,EAC1B,MAAM,mBAAmB,CAAA;AAG1B;;;;;;;;;GASG;AACH,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC/B,GAAG,EAAE,oBAAoB,CAAA;IACzB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,sBAAsB,GAChC,SAAS,GAAG,UAAU,GAAG,aAAa,GAAG,oBAAoB,CAAA;AAE/D;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAChC,SAAS,GAAG,iBAAiB,GAAG,sBAAsB,CAAA;AAExD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,8BAA8B,CAAC,EAC7C,IAAI,EACJ,WAAW,EACX,GAAG,EACJ,EAAE;IACD,IAAI,EAAE,KAAK,CAAA;IACX,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,GAAG,EAAE,MAAM,CAAA;CACZ,GAAG,sBAAsB,GAAG,SAAS,CA6BrC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,MAAM,EACN,IAAI,EACJ,WAAW,EACX,GAAG,EACJ,EAAE;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/C,IAAI,EAAE,KAAK,CAAA;IACX,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,GAAG,EAAE,MAAM,CAAA;CACZ,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAsBlC;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,SAAS,CAYvE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAOrD"}
|
|
@@ -58,9 +58,11 @@ export function classifyGrantRevocationRefusal({ zcap, signerCheck, now }) {
|
|
|
58
58
|
* ({@link delegationExpired}). Everything else is POSTed, whatever the
|
|
59
59
|
* caller's document says about the signer: the document a login read is a
|
|
60
60
|
* snapshot. was-client's `AlreadyRevokedError` is success. A plain
|
|
61
|
-
* `ValidationError`
|
|
62
|
-
* and rethrown when the
|
|
63
|
-
*
|
|
61
|
+
* refusal, a `ValidationError` or a `NotFoundError` by exact name, is read
|
|
62
|
+
* through {@link classifyGrantRevocationRefusal}, and rethrown when the
|
|
63
|
+
* client cannot say why. A dead grant is refused with the 404, since the
|
|
64
|
+
* server denies an invocation whose chain does not verify before it
|
|
65
|
+
* validates the chain. Every other failure is rethrown. Errors are matched on `err.name`, since error classes do not
|
|
64
66
|
* survive crossing package copies.
|
|
65
67
|
*
|
|
66
68
|
* @param options {object}
|
|
@@ -84,7 +86,9 @@ export async function revokeRecordedGrant({ revoke, zcap, signerCheck, now }) {
|
|
|
84
86
|
if (name === 'AlreadyRevokedError') {
|
|
85
87
|
return 'already-revoked';
|
|
86
88
|
}
|
|
87
|
-
|
|
89
|
+
// Exact names only: `CapabilityRevokedError` and `CapabilityExpiredError`
|
|
90
|
+
// subclass `NotFoundError` under their own names and are rethrown.
|
|
91
|
+
if (name === 'ValidationError' || name === 'NotFoundError') {
|
|
88
92
|
const refusal = classifyGrantRevocationRefusal({ zcap, signerCheck, now });
|
|
89
93
|
if (refusal !== undefined) {
|
|
90
94
|
return refusal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grantRevocation.js","sourceRoot":"","sources":["../../src/clientAnnex/grantRevocation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"grantRevocation.js","sourceRoot":"","sources":["../../src/clientAnnex/grantRevocation.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EAErB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AA8C9C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,8BAA8B,CAAC,EAC7C,IAAI,EACJ,WAAW,EACX,GAAG,EAKJ;IACC,IAAI,kBAAkB,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;QACtC,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,MAAM,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAA;IAC7C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,sBAAsB,CAAC;YACnC,YAAY,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;YAC1C,UAAU,EAAE,WAAW,CAAC,UAAU;YAClC,kBAAkB,EAAE,WAAW,CAAC,kBAAkB;SACnD,CAAC,CAAA;QACF,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAA;IACtD,CAAC;IACD,IAAI,oBAAoB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAA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AAwB,CAAC,IAAW;IAClD,MAAM,EAAE,KAAK,EAAE,GAAG,IAA2B,CAAA;IAC7C,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IACtD,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC1C,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,KAAK,GAAI,MAAwC,CAAC,eAAe,CAAA;IACvE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChD,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,IAAI,GAAY,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IAC7C,OAAO,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAE,IAAc,CAAC,CAAC,CAAC,SAAS,CAAA;AAChF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,IAAI,CAAC;QACH,mBAAmB,CAAC,EAAE,GAAG,EAAE,CAAC,CAAA;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC"}
|
|
@@ -76,7 +76,7 @@ export { ensureRosterDeliveredEpochs } from './rosterDeliveredEpochs.js';
|
|
|
76
76
|
export type { RosterDeliveredEpochsResult } from './rosterDeliveredEpochs.js';
|
|
77
77
|
export { mendCredentialAnchoredAccount } from './mend.js';
|
|
78
78
|
export type { CredentialAnchoredAccountCore, CredentialAnchoredMendReport, CredentialAnchoredRegistryContext } from './mend.js';
|
|
79
|
-
export {
|
|
79
|
+
export { createLadderAnchoredAccountLog, ensureLadderAnchoredDidWebvh, forgetWebvhClient, installLadderVmWebvh, ladderSignedAccountEntry, LastEnrolledClientForgetError, revealLadderRungWebvh, selfEnrollWebvhClient, strikeLadderVmWebvh } from './ladderAnchored.js';
|
|
80
80
|
export type { LadderSignedEntry, LadderSignedEntryOutcome } from './ladderAnchored.js';
|
|
81
81
|
export { signAccountEntry } from '../webvh/accountEntry.js';
|
|
82
82
|
export type { AccountEntryFields, AccountEntryOutcome, AccountLogSigner, AccountLogStore } from '../webvh/accountEntry.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,YAAY,EACb,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,UAAU,EACV,eAAe,EACf,uBAAuB,EACxB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,+BAA+B,EAC/B,qBAAqB,EACrB,oBAAoB,EACpB,oCAAoC,EACpC,mCAAmC,EACnC,8BAA8B,EAC9B,gCAAgC,EAChC,iCAAiC,EACjC,uBAAuB,EACvB,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,EAC5B,gCAAgC,EAChC,qBAAqB,EACrB,sBAAsB,EACtB,iCAAiC,EACjC,6BAA6B,EAC7B,kCAAkC,EAClC,4BAA4B,EAC5B,oBAAoB,EACpB,2BAA2B,EAC3B,gCAAgC,EAChC,yBAAyB,EACzB,mCAAmC,EACnC,8BAA8B,EAC9B,wBAAwB,EACxB,gBAAgB,EAChB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AO,EACL,gCAAgC,EAChC,kCAAkC,EAClC,kCAAkC,EAClC,8BAA8B,EAC/B,MAAM,gBAAgB,CAAA;AACvB,YAAY,EACV,gCAAgC,EAChC,4BAA4B,EAC5B,+BAA+B,EAC/B,gCAAgC,EACjC,MAAM,gBAAgB,CAAA;AAKvB,OAAO,EACL,0BAA0B,EAC1B,+CAA+C,EAC/C,wCAAwC,EACxC,kCAAkC,EAClC,wBAAwB,EACzB,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,oCAAoC,EACpC,wCAAwC,EACxC,8BAA8B,EAC/B,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AACxE,YAAY,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAE7E,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAA;AACzD,YAAY,EACV,6BAA6B,EAC7B,4BAA4B,EAC5B,iCAAiC,EAClC,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,YAAY,EACb,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,UAAU,EACV,eAAe,EACf,uBAAuB,EACxB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,+BAA+B,EAC/B,qBAAqB,EACrB,oBAAoB,EACpB,oCAAoC,EACpC,mCAAmC,EACnC,8BAA8B,EAC9B,gCAAgC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AkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EAChB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACrB,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAE/D,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAC9E,YAAY,EACV,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,mCAAmC,EACpC,MAAM,iBAAiB,CAAA;AACxB,YAAY,EACV,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC/B,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,sCAAsC,EACtC,mCAAmC,EACpC,MAAM,gCAAgC,CAAA;AAEvC,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAA;AAOxE,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACzB,MAAM,sBAAsB,CAAA;AAO7B,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAM7D,YAAY,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -72,7 +72,7 @@ export { credentialAnchoredStandingFields, ensurePointedClientAnnexGeneration, e
|
|
|
72
72
|
export { CONTROLLER_PROMOTION_STAGE, CREDENTIAL_ANCHORED_ESTABLISHMENT_STAGE_ALIASES, CREDENTIAL_ANCHORED_ESTABLISHMENT_STAGES, CREDENTIAL_ANCHORED_GENESIS_STAGES, KMS_AUTHENTICATION_STAGE } from './stages.js';
|
|
73
73
|
export { ensureRosterDeliveredEpochs } from './rosterDeliveredEpochs.js';
|
|
74
74
|
export { mendCredentialAnchoredAccount } from './mend.js';
|
|
75
|
-
export {
|
|
75
|
+
export { createLadderAnchoredAccountLog, ensureLadderAnchoredDidWebvh, forgetWebvhClient, installLadderVmWebvh, ladderSignedAccountEntry, LastEnrolledClientForgetError, revealLadderRungWebvh, selfEnrollWebvhClient, strikeLadderVmWebvh } from './ladderAnchored.js';
|
|
76
76
|
// The account-entry seam, re-exported here beside the ladder ceremonies that
|
|
77
77
|
// spend it: a caller binding the ladder branch of an account-management
|
|
78
78
|
// ceremony reaches for both from this subpath.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/clientAnnex/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,YAAY,EACb,MAAM,aAAa,CAAA;AAOpB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,+BAA+B,EAC/B,qBAAqB,EACrB,oBAAoB,EACpB,oCAAoC,EACpC,mCAAmC,EACnC,8BAA8B,EAC9B,gCAAgC,EAChC,iCAAiC,EACjC,uBAAuB,EACvB,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,EAC5B,gCAAgC,EAChC,qBAAqB,EACrB,sBAAsB,EACtB,iCAAiC,EACjC,6BAA6B,EAC7B,kCAAkC,EAClC,4BAA4B,EAC5B,oBAAoB,EACpB,2BAA2B,EAC3B,gCAAgC,EAChC,yBAAyB,EACzB,mCAAmC,EACnC,8BAA8B,EAC9B,wBAAwB,EACxB,gBAAgB,EAChB,gCAAgC,EAChC,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EACrB,qCAAqC,EACrC,4BAA4B,EAC5B,0BAA0B,EAC1B,8BAA8B,EAC/B,MAAM,UAAU,CAAA;AAOjB,OAAO,EACL,kCAAkC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AAM,iBAAiB,CAAA;AAOxB,OAAO,EACL,sCAAsC,EACtC,mCAAmC,EACpC,MAAM,gCAAgC,CAAA;AAEvC,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAA;AAExE,4EAA4E;AAC5E,qEAAqE;AACrE,6EAA6E;AAC7E,4EAA4E;AAC5E,wBAAwB;AACxB,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACzB,MAAM,sBAAsB,CAAA"}
|
|
@@ -289,6 +289,50 @@ export declare function standingCredentialLatentHashes({ log, maxScan }: {
|
|
|
289
289
|
hashes: string[];
|
|
290
290
|
unclaimedCredentialVmIds: string[];
|
|
291
291
|
}>;
|
|
292
|
+
/**
|
|
293
|
+
* The commitments an ABANDONED attempt of a recovery continuation left
|
|
294
|
+
* standing: every hash a reveal-and-commit entry of this spend added to
|
|
295
|
+
* `nextKeyHashes` that the current attempt does not carry forward. A
|
|
296
|
+
* continuation torn at its seam and re-run with a different successor (a
|
|
297
|
+
* transient re-run mints a fresh ladder seed, and a re-run under a different
|
|
298
|
+
* passphrase persists a second unlock record) publishes a second reveal entry.
|
|
299
|
+
* The first attempt's successor pair, and the first replacement's hash when
|
|
300
|
+
* the replacement changed too, would otherwise stand committed with no member
|
|
301
|
+
* behind them. Any of them whose key is derivable from a record the first
|
|
302
|
+
* attempt persisted is a latent update key nothing would ever retire.
|
|
303
|
+
*
|
|
304
|
+
* The spend's reveal entries are the entries signed by the spent code's
|
|
305
|
+
* rung 0 after the entry that last newly committed its hash. That bound is
|
|
306
|
+
* what keeps an earlier spend of the same code out: a spent code issued again
|
|
307
|
+
* signs with the same rung 0, and the earlier spend's reveal entries committed
|
|
308
|
+
* the hashes of the client it enrolled. The successor's own hashes
|
|
309
|
+
* (`protectedHashes`) and anything the head no longer carries are left out.
|
|
310
|
+
*
|
|
311
|
+
* The candidates then pass the same structural guard a credential strike does
|
|
312
|
+
* ({@link survivingClientKeyProtection}): a surviving enrolled client's active
|
|
313
|
+
* key hash, carry-over hash, and staged hash are never struck. An abandoned
|
|
314
|
+
* hash rarely belongs to an enrolled client (a first attempt's successor
|
|
315
|
+
* enrolled later by an ordinary enrollment is the one case), so a hash the
|
|
316
|
+
* guard drops is warned about. When a listed client's active update key
|
|
317
|
+
* cannot be attributed, nothing is struck. The abandoned hashes then stay
|
|
318
|
+
* committed, and one whose key derives from a record the abandoned attempt
|
|
319
|
+
* persisted remains a latent update key that no mender retires.
|
|
320
|
+
*
|
|
321
|
+
* @param options {object}
|
|
322
|
+
* @param options.log {DIDLog} a resolved, caller-verified log, read BEFORE
|
|
323
|
+
* the add-and-retire entry
|
|
324
|
+
* @param options.spentKeyMultibase {string} the spent code's rung 0, the
|
|
325
|
+
* key every reveal entry of this spend is signed by
|
|
326
|
+
* @param options.protectedHashes {string[]} the hashes the current attempt
|
|
327
|
+
* committed, never struck
|
|
328
|
+
* @returns {Promise<string[]>} the abandoned commitments standing at the
|
|
329
|
+
* head, in the order they were committed
|
|
330
|
+
*/
|
|
331
|
+
export declare function abandonedSpendCommitments({ log, spentKeyMultibase, protectedHashes }: {
|
|
332
|
+
log: DIDLog;
|
|
333
|
+
spentKeyMultibase: string;
|
|
334
|
+
protectedHashes: string[];
|
|
335
|
+
}): Promise<string[]>;
|
|
292
336
|
/**
|
|
293
337
|
* The strike a retirement entry ALREADY published, recomputed by re-running
|
|
294
338
|
* {@link attributeRetiredCredentialRungs} over the log as it stood just before
|
|
@@ -433,19 +477,17 @@ export declare function attributeRetiredCredentialRungs({ log, credentialVmIds,
|
|
|
433
477
|
* publishes its successor's -- leaves the replacement credential's
|
|
434
478
|
* commitment in that position instead, and striking that would leave the
|
|
435
479
|
* replacement unusable and unhealable;
|
|
436
|
-
* -
|
|
437
|
-
*
|
|
438
|
-
* ladder-arm enrollment approval's add entry
|
|
439
|
-
* committed
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
*
|
|
443
|
-
*
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
*
|
|
447
|
-
* a rung-signed entry authorizing the ladder's own next rung while the
|
|
448
|
-
* current one stands still fails closed, seeded or not;
|
|
480
|
+
* - an entry authorizing a key whose hash sits among the claims while no
|
|
481
|
+
* pending rung leaves is a TRANSFER without a completion, whoever signs
|
|
482
|
+
* it: the ladder-arm enrollment approval's add entry. The hash and the one
|
|
483
|
+
* committed immediately after it in its committing entry transfer to the
|
|
484
|
+
* client as at a completion, and the key is not read as a rung reveal. A
|
|
485
|
+
* hash the ladder knows a priori, one the handover recovered, or one
|
|
486
|
+
* committed last among its entry's additions (the position a ladder's own
|
|
487
|
+
* next commitment takes under `decisions/0007` outside the handover) is
|
|
488
|
+
* never transferred this way, so an entry authorizing the ladder's own
|
|
489
|
+
* next rung while the current one stands still fails closed, seeded or
|
|
490
|
+
* not;
|
|
449
491
|
* - a claim or revealed key that later leaves the parameters without a
|
|
450
492
|
* completion was struck by some other edit and simply stops standing;
|
|
451
493
|
* - a ladder VM standing in the final document belongs to this ladder on
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ladder.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/ladder.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,2BAA2B,CAAA;AAepE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,YAAY,EACb,MAAM,+BAA+B,CAAA;AACtC,YAAY,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,eAAe,MAAM,CAAA;AAElC;;;;;;GAMG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,OAAO,EAAE,MAAM;CAI5B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,UAAU,CAE/C;AA6BD;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CAAC,EACpC,UAAU,E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nC,CAAC,CA2ED;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqJG;AACH,wBAAsB,wBAAwB,CAAC,EAC7C,GAAG,EACH,kBAAkB,EAClB,UAAU,EAAE,kBAAkB,EAC9B,UAAU,EACV,cAAc,EACd,OAAyB,EAC1B,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;IACX,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAoYnC"}
|
|
@@ -734,12 +734,15 @@ export async function ladderVmIdsIntroducedWithCredential({ log, credentialVmId,
|
|
|
734
734
|
* The earlier attempts behind a RESUMED reveal entry: one that appended
|
|
735
735
|
* exactly two hashes, the successor's and its staged partner's, because the
|
|
736
736
|
* replacement's was already committed by an earlier attempt. A transient
|
|
737
|
-
* continuation torn at its seam and re-run
|
|
738
|
-
*
|
|
739
|
-
*
|
|
740
|
-
*
|
|
741
|
-
*
|
|
742
|
-
*
|
|
737
|
+
* continuation torn at its seam and re-run with a freshly minted ladder seed
|
|
738
|
+
* and the same replacement wrote one: every reveal entry after the first
|
|
739
|
+
* dedups the replacement's hash away. An emitter on the resume contract no
|
|
740
|
+
* longer produces the shape -- a resumed transient spend hands the persisted
|
|
741
|
+
* ladder seed back and finds its reveal entry standing -- but logs written
|
|
742
|
+
* by one that minted a seed per call carry it, so the readers keep
|
|
743
|
+
* recognizing it. Such an entry's own last addition is the ladder's rung 1,
|
|
744
|
+
* not a handover; the replacement's hash is the last addition of a
|
|
745
|
+
* three-addition entry the same retired signer wrote earlier.
|
|
743
746
|
*
|
|
744
747
|
* Every earlier entry that signer wrote is read. A two-addition one is
|
|
745
748
|
* another resumed reveal, walked past (a continuation torn at its seam twice
|
|
@@ -852,6 +855,78 @@ export async function standingCredentialLatentHashes({ log, maxScan = LADDER_MAX
|
|
|
852
855
|
}
|
|
853
856
|
return { hashes: [...hashes], unclaimedCredentialVmIds };
|
|
854
857
|
}
|
|
858
|
+
/**
|
|
859
|
+
* The commitments an ABANDONED attempt of a recovery continuation left
|
|
860
|
+
* standing: every hash a reveal-and-commit entry of this spend added to
|
|
861
|
+
* `nextKeyHashes` that the current attempt does not carry forward. A
|
|
862
|
+
* continuation torn at its seam and re-run with a different successor (a
|
|
863
|
+
* transient re-run mints a fresh ladder seed, and a re-run under a different
|
|
864
|
+
* passphrase persists a second unlock record) publishes a second reveal entry.
|
|
865
|
+
* The first attempt's successor pair, and the first replacement's hash when
|
|
866
|
+
* the replacement changed too, would otherwise stand committed with no member
|
|
867
|
+
* behind them. Any of them whose key is derivable from a record the first
|
|
868
|
+
* attempt persisted is a latent update key nothing would ever retire.
|
|
869
|
+
*
|
|
870
|
+
* The spend's reveal entries are the entries signed by the spent code's
|
|
871
|
+
* rung 0 after the entry that last newly committed its hash. That bound is
|
|
872
|
+
* what keeps an earlier spend of the same code out: a spent code issued again
|
|
873
|
+
* signs with the same rung 0, and the earlier spend's reveal entries committed
|
|
874
|
+
* the hashes of the client it enrolled. The successor's own hashes
|
|
875
|
+
* (`protectedHashes`) and anything the head no longer carries are left out.
|
|
876
|
+
*
|
|
877
|
+
* The candidates then pass the same structural guard a credential strike does
|
|
878
|
+
* ({@link survivingClientKeyProtection}): a surviving enrolled client's active
|
|
879
|
+
* key hash, carry-over hash, and staged hash are never struck. An abandoned
|
|
880
|
+
* hash rarely belongs to an enrolled client (a first attempt's successor
|
|
881
|
+
* enrolled later by an ordinary enrollment is the one case), so a hash the
|
|
882
|
+
* guard drops is warned about. When a listed client's active update key
|
|
883
|
+
* cannot be attributed, nothing is struck. The abandoned hashes then stay
|
|
884
|
+
* committed, and one whose key derives from a record the abandoned attempt
|
|
885
|
+
* persisted remains a latent update key that no mender retires.
|
|
886
|
+
*
|
|
887
|
+
* @param options {object}
|
|
888
|
+
* @param options.log {DIDLog} a resolved, caller-verified log, read BEFORE
|
|
889
|
+
* the add-and-retire entry
|
|
890
|
+
* @param options.spentKeyMultibase {string} the spent code's rung 0, the
|
|
891
|
+
* key every reveal entry of this spend is signed by
|
|
892
|
+
* @param options.protectedHashes {string[]} the hashes the current attempt
|
|
893
|
+
* committed, never struck
|
|
894
|
+
* @returns {Promise<string[]>} the abandoned commitments standing at the
|
|
895
|
+
* head, in the order they were committed
|
|
896
|
+
*/
|
|
897
|
+
export async function abandonedSpendCommitments({ log, spentKeyMultibase, protectedHashes }) {
|
|
898
|
+
const { params, facts } = indexedLadderLog(log);
|
|
899
|
+
const spentHash = await deriveNextKeyHash(spentKeyMultibase);
|
|
900
|
+
const issuedAt = facts.reduce((last, entry, index) => entry.addedHashes.includes(spentHash) ? index : last, -1);
|
|
901
|
+
if (issuedAt === -1) {
|
|
902
|
+
return [];
|
|
903
|
+
}
|
|
904
|
+
const standing = params[params.length - 1]?.nextKeyHashes ?? [];
|
|
905
|
+
const candidates = [
|
|
906
|
+
...new Set(facts
|
|
907
|
+
.slice(issuedAt + 1)
|
|
908
|
+
.filter(entry => entry.signers.includes(spentKeyMultibase))
|
|
909
|
+
.flatMap(entry => entry.addedHashes)
|
|
910
|
+
.filter(hash => !protectedHashes.includes(hash) && standing.includes(hash)))
|
|
911
|
+
];
|
|
912
|
+
if (candidates.length === 0) {
|
|
913
|
+
return [];
|
|
914
|
+
}
|
|
915
|
+
const surviving = await survivingClientKeyProtection({
|
|
916
|
+
log,
|
|
917
|
+
derivedLatentHashes: candidates
|
|
918
|
+
});
|
|
919
|
+
if (surviving.ambiguous.length > 0) {
|
|
920
|
+
logger.warn('Withholding an abandoned spend strike: an enrolled client whose ' +
|
|
921
|
+
'active update key the log cannot attribute would be unprotected', { clients: surviving.ambiguous });
|
|
922
|
+
return [];
|
|
923
|
+
}
|
|
924
|
+
const kept = candidates.filter(hash => surviving.hashes.has(hash));
|
|
925
|
+
if (kept.length > 0) {
|
|
926
|
+
logger.warn('Keeping abandoned spend commitments a surviving enrolled client holds', { count: kept.length });
|
|
927
|
+
}
|
|
928
|
+
return candidates.filter(hash => !surviving.hashes.has(hash));
|
|
929
|
+
}
|
|
855
930
|
/**
|
|
856
931
|
* The strike a retirement entry ALREADY published, recomputed by re-running
|
|
857
932
|
* {@link attributeRetiredCredentialRungs} over the log as it stood just before
|
|
@@ -1058,19 +1133,17 @@ export async function attributeRetiredCredentialRungs({ log, credentialVmIds, pr
|
|
|
1058
1133
|
* publishes its successor's -- leaves the replacement credential's
|
|
1059
1134
|
* commitment in that position instead, and striking that would leave the
|
|
1060
1135
|
* replacement unusable and unhealable;
|
|
1061
|
-
* -
|
|
1062
|
-
*
|
|
1063
|
-
* ladder-arm enrollment approval's add entry
|
|
1064
|
-
* committed
|
|
1065
|
-
*
|
|
1066
|
-
*
|
|
1067
|
-
*
|
|
1068
|
-
*
|
|
1069
|
-
*
|
|
1070
|
-
*
|
|
1071
|
-
*
|
|
1072
|
-
* a rung-signed entry authorizing the ladder's own next rung while the
|
|
1073
|
-
* current one stands still fails closed, seeded or not;
|
|
1136
|
+
* - an entry authorizing a key whose hash sits among the claims while no
|
|
1137
|
+
* pending rung leaves is a TRANSFER without a completion, whoever signs
|
|
1138
|
+
* it: the ladder-arm enrollment approval's add entry. The hash and the one
|
|
1139
|
+
* committed immediately after it in its committing entry transfer to the
|
|
1140
|
+
* client as at a completion, and the key is not read as a rung reveal. A
|
|
1141
|
+
* hash the ladder knows a priori, one the handover recovered, or one
|
|
1142
|
+
* committed last among its entry's additions (the position a ladder's own
|
|
1143
|
+
* next commitment takes under `decisions/0007` outside the handover) is
|
|
1144
|
+
* never transferred this way, so an entry authorizing the ladder's own
|
|
1145
|
+
* next rung while the current one stands still fails closed, seeded or
|
|
1146
|
+
* not;
|
|
1074
1147
|
* - a claim or revealed key that later leaves the parameters without a
|
|
1075
1148
|
* completion was struck by some other edit and simply stops standing;
|
|
1076
1149
|
* - a ladder VM standing in the final document belongs to this ladder on
|
|
@@ -1254,6 +1327,9 @@ export async function attributeLadderInventory({ log, anchorKeyMultibase, anchor
|
|
|
1254
1327
|
// update-key hash as its staged hash (the reveal entry's append order, a
|
|
1255
1328
|
// ratified convention).
|
|
1256
1329
|
const { addedKeys, removedKeys, addedHashes } = facts[index];
|
|
1330
|
+
// Each added key's hash, once per entry: the completion, the transfer,
|
|
1331
|
+
// and the reveal reading below all ask for it.
|
|
1332
|
+
const addedKeyHashes = await Promise.all(addedKeys.map(key => deriveNextKeyHash(key)));
|
|
1257
1333
|
// What this entry introduces, resolved before the reveal branch because
|
|
1258
1334
|
// the hash claims below turn on it: the ladder VMs it publishes that were
|
|
1259
1335
|
// not standing before, and the credential-class `keyAgreement` members it
|
|
@@ -1290,8 +1366,8 @@ export async function attributeLadderInventory({ log, anchorKeyMultibase, anchor
|
|
|
1290
1366
|
// struck, and its claims simply stop standing.
|
|
1291
1367
|
if (pending && !currentUpdateKeys.has(pending.key)) {
|
|
1292
1368
|
const transferred = new Set();
|
|
1293
|
-
for (const
|
|
1294
|
-
const at = pending.claims.indexOf(
|
|
1369
|
+
for (const keyHash of addedKeyHashes) {
|
|
1370
|
+
const at = pending.claims.indexOf(keyHash);
|
|
1295
1371
|
if (at === -1) {
|
|
1296
1372
|
continue;
|
|
1297
1373
|
}
|
|
@@ -1321,65 +1397,57 @@ export async function attributeLadderInventory({ log, anchorKeyMultibase, anchor
|
|
|
1321
1397
|
}
|
|
1322
1398
|
pending = undefined;
|
|
1323
1399
|
}
|
|
1324
|
-
// A TRANSFER
|
|
1325
|
-
//
|
|
1326
|
-
//
|
|
1327
|
-
//
|
|
1328
|
-
//
|
|
1329
|
-
//
|
|
1330
|
-
//
|
|
1331
|
-
//
|
|
1332
|
-
// immediately after it (the staged hash, the adjacency of
|
|
1400
|
+
// A TRANSFER without a completion: this entry authorizes a key whose
|
|
1401
|
+
// hash the ladder claims, while no pending rung leaves `updateKeys`. That
|
|
1402
|
+
// is the ladder-arm enrollment approval's add entry (`enrollWebvhClient`
|
|
1403
|
+
// with a ladder signer): the commit entry a rung signed committed the
|
|
1404
|
+
// enrollee's update-key and staged hashes, and the add entry authorizes
|
|
1405
|
+
// the enrollee's update key. The key is the client's rather than a rung
|
|
1406
|
+
// of this ladder, so the hash and the one committed immediately after it
|
|
1407
|
+
// in the same entry (the staged hash, the adjacency of
|
|
1333
1408
|
// `decisions/0007-ladder-reveal-hash-order.md`) transfer to the client,
|
|
1334
|
-
// as the completion above transfers them when the rung leaves.
|
|
1335
|
-
//
|
|
1336
|
-
// the
|
|
1337
|
-
//
|
|
1338
|
-
//
|
|
1339
|
-
//
|
|
1340
|
-
//
|
|
1341
|
-
//
|
|
1342
|
-
//
|
|
1343
|
-
//
|
|
1344
|
-
//
|
|
1345
|
-
//
|
|
1346
|
-
//
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
}
|
|
1409
|
+
// as the completion above transfers them when the rung leaves. No signer
|
|
1410
|
+
// check gates this: who signs the add entry does not change whose key it
|
|
1411
|
+
// authorizes, and the signer is a later rung of the same ladder when a
|
|
1412
|
+
// self-enrollment climbed between the approval's two entries (keeping
|
|
1413
|
+
// the approval's hashes as residue claims) and an enrolled client when
|
|
1414
|
+
// one resumed a torn ladder-arm approval. Three hashes never transfer:
|
|
1415
|
+
// one the ladder knows a priori (seed-derived, the anchor's, or
|
|
1416
|
+
// recovered), one the handover recovered (the continuation commits the
|
|
1417
|
+
// fresh ladder's `hash(rung 1)` in the middle of the spent code's
|
|
1418
|
+
// additions), and one committed LAST among its committing entry's
|
|
1419
|
+
// additions, the position a ladder's own next commitment takes
|
|
1420
|
+
// everywhere else (`decisions/0007`: the ladder-anchored genesis, the
|
|
1421
|
+
// reveal-and-commit entries, the pointer move all put it there, while
|
|
1422
|
+
// the approval's commit puts the enrollee's update-key hash first of
|
|
1423
|
+
// two). The last two rules are what hold on the seedless walk, whose
|
|
1424
|
+
// a-priori set stops at the anchor.
|
|
1425
|
+
const transferable = (hash) => ladderHashes.has(hash) &&
|
|
1426
|
+
!derivedHashes.has(hash) &&
|
|
1427
|
+
!handedOver.has(hash);
|
|
1428
|
+
for (const hash of addedKeyHashes) {
|
|
1429
|
+
if (!transferable(hash)) {
|
|
1430
|
+
continue;
|
|
1431
|
+
}
|
|
1432
|
+
const origin = commitIndex.get(hash);
|
|
1433
|
+
const committed = origin && facts[origin.entryIndex]?.addedHashes;
|
|
1434
|
+
if (!origin || !committed || origin.at === committed.length - 1) {
|
|
1435
|
+
continue;
|
|
1436
|
+
}
|
|
1437
|
+
const staged = committed[origin.at + 1];
|
|
1438
|
+
const transferred = new Set([hash]);
|
|
1439
|
+
if (staged !== undefined && transferable(staged)) {
|
|
1440
|
+
transferred.add(staged);
|
|
1441
|
+
}
|
|
1442
|
+
for (const claim of transferred) {
|
|
1443
|
+
ladderHashes.delete(claim);
|
|
1444
|
+
}
|
|
1445
|
+
if (pending) {
|
|
1372
1446
|
pending.claims = pending.claims.filter(claim => !transferred.has(claim));
|
|
1373
1447
|
}
|
|
1374
1448
|
}
|
|
1375
1449
|
// A newly authorized key matching a known ladder commitment is a reveal.
|
|
1376
|
-
const reveals = [];
|
|
1377
|
-
for (const key of addedKeys) {
|
|
1378
|
-
if (ladderKeys.has(key) ||
|
|
1379
|
-
ladderHashes.has(await deriveNextKeyHash(key))) {
|
|
1380
|
-
reveals.push(key);
|
|
1381
|
-
}
|
|
1382
|
-
}
|
|
1450
|
+
const reveals = addedKeys.filter((key, at) => ladderKeys.has(key) || ladderHashes.has(addedKeyHashes[at]));
|
|
1383
1451
|
if (reveals.length > 1 || (reveals.length === 1 && pending)) {
|
|
1384
1452
|
throw new LadderAttributionError('The published log reveals more than one rung of this ladder at ' +
|
|
1385
1453
|
'once; refusing to attribute an ambiguous history.');
|