@interop/wallet-core 0.49.0 → 0.51.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/README.md +5 -2
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +127 -0
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -0
- package/dist/clientAnnex/credentialAnchoredGenesis.js +195 -0
- package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -0
- package/dist/clientAnnex/forget.d.ts +138 -0
- package/dist/clientAnnex/forget.d.ts.map +1 -0
- package/dist/clientAnnex/forget.js +133 -0
- package/dist/clientAnnex/forget.js.map +1 -0
- package/dist/clientAnnex/forgetLast.d.ts +291 -0
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -0
- package/dist/clientAnnex/forgetLast.js +408 -0
- package/dist/clientAnnex/forgetLast.js.map +1 -0
- package/dist/{webvh/companionGc.d.ts → clientAnnex/gc.d.ts} +50 -16
- package/dist/clientAnnex/gc.d.ts.map +1 -0
- package/dist/{webvh/companionGc.js → clientAnnex/gc.js} +103 -71
- package/dist/clientAnnex/gc.js.map +1 -0
- package/dist/clientAnnex/index.d.ts +60 -0
- package/dist/clientAnnex/index.d.ts.map +1 -0
- package/dist/clientAnnex/index.js +60 -0
- package/dist/clientAnnex/index.js.map +1 -0
- package/dist/{unlock → clientAnnex}/ladder.d.ts +89 -15
- package/dist/clientAnnex/ladder.d.ts.map +1 -0
- package/dist/clientAnnex/ladder.js +474 -0
- package/dist/clientAnnex/ladder.js.map +1 -0
- package/dist/clientAnnex/ladderAnchored.d.ts +276 -0
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -0
- package/dist/clientAnnex/ladderAnchored.js +631 -0
- package/dist/clientAnnex/ladderAnchored.js.map +1 -0
- package/dist/{webvh/companion.d.ts → clientAnnex/log.d.ts} +333 -119
- package/dist/clientAnnex/log.d.ts.map +1 -0
- package/dist/{webvh/companion.js → clientAnnex/log.js} +583 -199
- package/dist/clientAnnex/log.js.map +1 -0
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts +103 -0
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -0
- package/dist/clientAnnex/recoveryLadderAnchored.js +263 -0
- package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -0
- package/dist/{unlock → clientAnnex}/selfEnroll.d.ts +1 -1
- package/dist/clientAnnex/selfEnroll.d.ts.map +1 -0
- package/dist/{unlock → clientAnnex}/selfEnroll.js +1 -1
- package/dist/clientAnnex/selfEnroll.js.map +1 -0
- package/dist/clientAnnex/zcap.d.ts +49 -0
- package/dist/clientAnnex/zcap.d.ts.map +1 -0
- package/dist/clientAnnex/zcap.js +101 -0
- package/dist/clientAnnex/zcap.js.map +1 -0
- package/dist/clients/index.d.ts +9 -6
- package/dist/clients/index.d.ts.map +1 -1
- package/dist/clients/index.js +8 -5
- package/dist/clients/index.js.map +1 -1
- package/dist/clients/listing.d.ts +32 -0
- package/dist/clients/listing.d.ts.map +1 -1
- package/dist/clients/listing.js +47 -1
- package/dist/clients/listing.js.map +1 -1
- package/dist/clients/revocation.d.ts +33 -1
- package/dist/clients/revocation.d.ts.map +1 -1
- package/dist/clients/revocation.js +16 -4
- package/dist/clients/revocation.js.map +1 -1
- package/dist/enrollment/index.d.ts +6 -4
- package/dist/enrollment/index.d.ts.map +1 -1
- package/dist/enrollment/index.js +6 -4
- package/dist/enrollment/index.js.map +1 -1
- package/dist/enrollment/onboardingInvite.d.ts +5 -88
- package/dist/enrollment/onboardingInvite.d.ts.map +1 -1
- package/dist/enrollment/onboardingInvite.js +5 -168
- package/dist/enrollment/onboardingInvite.js.map +1 -1
- package/dist/genesis/accountGenesis.d.ts +12 -0
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js.map +1 -1
- package/dist/genesis/index.d.ts +5 -0
- package/dist/genesis/index.d.ts.map +1 -1
- package/dist/genesis/index.js +5 -0
- package/dist/genesis/index.js.map +1 -1
- package/dist/keys/index.d.ts +1 -1
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +1 -1
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/spaceEpochs.d.ts +7 -2
- package/dist/keys/spaceEpochs.d.ts.map +1 -1
- package/dist/keys/spaceEpochs.js +8 -2
- package/dist/keys/spaceEpochs.js.map +1 -1
- package/dist/keys/userKeyRoster.d.ts +39 -0
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +43 -1
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/recovery/index.d.ts +5 -3
- package/dist/recovery/index.d.ts.map +1 -1
- package/dist/recovery/index.js +4 -2
- package/dist/recovery/index.js.map +1 -1
- package/dist/recovery/recoveryDelegation.d.ts +35 -12
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
- package/dist/recovery/recoveryDelegation.js +84 -86
- package/dist/recovery/recoveryDelegation.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +32 -1
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +2 -2
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/request/capabilityRequest.d.ts +33 -0
- package/dist/request/capabilityRequest.d.ts.map +1 -0
- package/dist/request/capabilityRequest.js +35 -0
- package/dist/request/capabilityRequest.js.map +1 -0
- package/dist/request/ephemeralExchange.d.ts +118 -0
- package/dist/request/ephemeralExchange.d.ts.map +1 -0
- package/dist/request/ephemeralExchange.js +224 -0
- package/dist/request/ephemeralExchange.js.map +1 -0
- package/dist/request/index.d.ts +6 -0
- package/dist/request/index.d.ts.map +1 -1
- package/dist/request/index.js +6 -0
- package/dist/request/index.js.map +1 -1
- package/dist/space/activity.d.ts +2 -2
- package/dist/space/activity.js +3 -3
- package/dist/space/activity.js.map +1 -1
- package/dist/unlock/index.d.ts +11 -23
- package/dist/unlock/index.d.ts.map +1 -1
- package/dist/unlock/index.js +10 -21
- package/dist/unlock/index.js.map +1 -1
- package/dist/unlock/retire.d.ts +47 -3
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js +21 -5
- package/dist/unlock/retire.js.map +1 -1
- package/dist/unlock/standingWebvh.d.ts +37 -82
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +64 -247
- package/dist/unlock/standingWebvh.js.map +1 -1
- package/dist/unlock/unlockRecord.d.ts +13 -6
- package/dist/unlock/unlockRecord.d.ts.map +1 -1
- package/dist/unlock/unlockRecord.js +14 -8
- package/dist/unlock/unlockRecord.js.map +1 -1
- package/dist/webvh/delegatedLogStore.d.ts +5 -5
- package/dist/webvh/delegatedLogStore.js +1 -1
- package/dist/webvh/didWebvh.d.ts +19 -9
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +16 -16
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/index.d.ts +9 -25
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +9 -23
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/revokeClient.d.ts +77 -5
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +154 -61
- package/dist/webvh/revokeClient.js.map +1 -1
- package/dist/webvh/standingZcap.d.ts +11 -1
- package/dist/webvh/standingZcap.d.ts.map +1 -1
- package/dist/webvh/standingZcap.js +13 -14
- package/dist/webvh/standingZcap.js.map +1 -1
- package/dist/webvh/wasIdStore.d.ts +13 -7
- package/dist/webvh/wasIdStore.d.ts.map +1 -1
- package/dist/webvh/wasIdStore.js +8 -4
- package/dist/webvh/wasIdStore.js.map +1 -1
- package/dist/webvh/zcap.d.ts +0 -24
- package/dist/webvh/zcap.d.ts.map +1 -1
- package/dist/webvh/zcap.js +0 -42
- package/dist/webvh/zcap.js.map +1 -1
- package/package.json +41 -35
- package/dist/unlock/ladder.d.ts.map +0 -1
- package/dist/unlock/ladder.js +0 -258
- package/dist/unlock/ladder.js.map +0 -1
- package/dist/unlock/selfEnroll.d.ts.map +0 -1
- package/dist/unlock/selfEnroll.js.map +0 -1
- package/dist/webvh/companion.d.ts.map +0 -1
- package/dist/webvh/companion.js.map +0 -1
- package/dist/webvh/companionGc.d.ts.map +0 -1
- package/dist/webvh/companionGc.js.map +0 -1
package/dist/unlock/retire.d.ts
CHANGED
|
@@ -35,6 +35,24 @@
|
|
|
35
35
|
* the app deletes as part of the change-method ceremony, and no other
|
|
36
36
|
* credential's bridge chains through it.
|
|
37
37
|
*
|
|
38
|
+
* The client annex reach is its own stage (1b, the injected
|
|
39
|
+
* `retireClientAnnexPosture` closure), between the document edit and the
|
|
40
|
+
* roster tail: a standing credential's annex rung-0 key and hash live in
|
|
41
|
+
* the pointed generation's log, kept nowhere the account document edit can
|
|
42
|
+
* reach, so without it a retired credential keeps annex-write authority
|
|
43
|
+
* for the life of the generation. The closure runs strike-or-swap: a
|
|
44
|
+
* dedicated strike entry signed by a distinct committed rung
|
|
45
|
+
* (`retireClientAnnexRung`) where the ceremony holds one, else a fresh
|
|
46
|
+
* generation minted from a surviving credential's seed and re-pointed under
|
|
47
|
+
* account-log update authority (`swapClientAnnexGeneration`), the retired rung
|
|
48
|
+
* dying with the old generation. It also owns retiring the credential's
|
|
49
|
+
* `delegatedClients` sibling: no server revocation is possible or needed --
|
|
50
|
+
* the sibling delegation's record dies with the unlock Space the caller
|
|
51
|
+
* deletes, and a swap (or the ordinary GC cadence) retires the generation it
|
|
52
|
+
* targeted. Best-effort by contract: the closure catches its own failures
|
|
53
|
+
* and reports them, so the roster rotation -- the ceremony's essential
|
|
54
|
+
* remedy -- always runs.
|
|
55
|
+
*
|
|
38
56
|
* Convergence is the design: every stage detects its own completion from
|
|
39
57
|
* durable state alone -- the posture edit no-ops when the document is already
|
|
40
58
|
* settled, the rotation no-ops once every current-epoch recipient is
|
|
@@ -68,6 +86,20 @@ export interface UnlockCredentialRetirementResult {
|
|
|
68
86
|
document: object;
|
|
69
87
|
userKey?: UserKey;
|
|
70
88
|
rosterDescriptor?: CollectionEncryption;
|
|
89
|
+
clientAnnex?: ClientAnnexPostureRetirement;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* What the annex-posture stage reports: `struck` (a strike entry dropped
|
|
93
|
+
* the retired rung's key and hash), `swapped` (a fresh generation replaced
|
|
94
|
+
* the old one wholesale), `clean` (the pointed generation held no posture
|
|
95
|
+
* for the retired credential), or `skipped` with the reason (`no-pointer`:
|
|
96
|
+
* the account has no annex posture; `no-ladder-seed`: the ceremony holds
|
|
97
|
+
* no seed that could strike or swap; `failed`: the closure's best-effort
|
|
98
|
+
* catch).
|
|
99
|
+
*/
|
|
100
|
+
export interface ClientAnnexPostureRetirement {
|
|
101
|
+
action: 'struck' | 'swapped' | 'clean' | 'skipped';
|
|
102
|
+
reason?: 'no-pointer' | 'no-ladder-seed' | 'failed';
|
|
71
103
|
}
|
|
72
104
|
/**
|
|
73
105
|
* Retires one standing unlock credential from an account. See the module doc
|
|
@@ -80,8 +112,12 @@ export interface UnlockCredentialRetirementResult {
|
|
|
80
112
|
* @param options.updateKeys {ClientWebvhUpdateKeys} the RETIRING (enrolled)
|
|
81
113
|
* client's own did:webvh update-key seeds, which sign the posture edit
|
|
82
114
|
* @param options.unlockKeys {StandingUnlockKeys} the retired credential's
|
|
83
|
-
* public posture (its key-agreement publication and its
|
|
84
|
-
* key
|
|
115
|
+
* public posture (its key-agreement publication and its recorded update
|
|
116
|
+
* key, which the posture edit treats as a ladder anchor rather than truth
|
|
117
|
+
* -- see `removeUnlockKey`)
|
|
118
|
+
* @param [options.ladderSeed] {Uint8Array} the retired credential's ladder
|
|
119
|
+
* seed, when the ceremony holds the credential's secret; it strengthens the
|
|
120
|
+
* ladder attribution but is not required
|
|
85
121
|
* @param [options.expectedDid] {string} the account DID from the caller's
|
|
86
122
|
* stored account pointer; supplied, the posture edit refuses a `did.jsonl`
|
|
87
123
|
* resolving to any other account
|
|
@@ -98,15 +134,20 @@ export interface UnlockCredentialRetirementResult {
|
|
|
98
134
|
* called with `{ userKey, latestEpochId, descriptor }` after the roster read
|
|
99
135
|
* and BEFORE the fan-out. The key and the epoch pin must persist atomically
|
|
100
136
|
* @param options.collections {CascadeCollections} the fan-out's work
|
|
137
|
+
* @param [options.retireClientAnnexPosture] {Function} `({ document }) =>
|
|
138
|
+
* Promise<ClientAnnexPostureRetirement>` -- the annex reach (stage 1b in
|
|
139
|
+
* the module doc), run against the post-edit document; expected to catch
|
|
140
|
+
* its own failures and report them
|
|
101
141
|
* @param [options.onRotationAdopted] {Function} `({ userKey }) =>
|
|
102
142
|
* Promise<void>` -- the live-session adoption of a rotated key, run last so
|
|
103
143
|
* the session keeps operating without a re-login
|
|
104
144
|
* @returns {Promise<UnlockCredentialRetirementResult>}
|
|
105
145
|
*/
|
|
106
|
-
export declare function retireUnlockCredential({ idStore, updateKeys, unlockKeys, expectedDid, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, onRotationAdopted }: {
|
|
146
|
+
export declare function retireUnlockCredential({ idStore, updateKeys, unlockKeys, ladderSeed, expectedDid, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, retireClientAnnexPosture, onRotationAdopted }: {
|
|
107
147
|
idStore: WebvhIdStore;
|
|
108
148
|
updateKeys: ClientWebvhUpdateKeys;
|
|
109
149
|
unlockKeys: StandingUnlockKeys;
|
|
150
|
+
ladderSeed?: Uint8Array;
|
|
110
151
|
expectedDid?: string;
|
|
111
152
|
verb?: string;
|
|
112
153
|
rosterStore: EncryptionDescriptorStore;
|
|
@@ -119,6 +160,9 @@ export declare function retireUnlockCredential({ idStore, updateKeys, unlockKeys
|
|
|
119
160
|
descriptor: CollectionEncryption;
|
|
120
161
|
}) => Promise<void>;
|
|
121
162
|
collections: CascadeCollections;
|
|
163
|
+
retireClientAnnexPosture?: (options: {
|
|
164
|
+
document: object;
|
|
165
|
+
}) => Promise<ClientAnnexPostureRetirement>;
|
|
122
166
|
onRotationAdopted?: (rotation: {
|
|
123
167
|
userKey: UserKey;
|
|
124
168
|
}) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retire.d.ts","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"retire.d.ts","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAC5E,OAAO,EAAmB,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAE7E;;;;;;;GAOG;AACH,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,WAAW,EAAE,oBAAoB,CAAA;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC,WAAW,CAAC,EAAE,4BAA4B,CAAA;CAC3C;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,OA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ire.js
CHANGED
|
@@ -11,8 +11,12 @@ import { removeUnlockKey } from './standingWebvh.js';
|
|
|
11
11
|
* @param options.updateKeys {ClientWebvhUpdateKeys} the RETIRING (enrolled)
|
|
12
12
|
* client's own did:webvh update-key seeds, which sign the posture edit
|
|
13
13
|
* @param options.unlockKeys {StandingUnlockKeys} the retired credential's
|
|
14
|
-
* public posture (its key-agreement publication and its
|
|
15
|
-
* key
|
|
14
|
+
* public posture (its key-agreement publication and its recorded update
|
|
15
|
+
* key, which the posture edit treats as a ladder anchor rather than truth
|
|
16
|
+
* -- see `removeUnlockKey`)
|
|
17
|
+
* @param [options.ladderSeed] {Uint8Array} the retired credential's ladder
|
|
18
|
+
* seed, when the ceremony holds the credential's secret; it strengthens the
|
|
19
|
+
* ladder attribution but is not required
|
|
16
20
|
* @param [options.expectedDid] {string} the account DID from the caller's
|
|
17
21
|
* stored account pointer; supplied, the posture edit refuses a `did.jsonl`
|
|
18
22
|
* resolving to any other account
|
|
@@ -29,12 +33,16 @@ import { removeUnlockKey } from './standingWebvh.js';
|
|
|
29
33
|
* called with `{ userKey, latestEpochId, descriptor }` after the roster read
|
|
30
34
|
* and BEFORE the fan-out. The key and the epoch pin must persist atomically
|
|
31
35
|
* @param options.collections {CascadeCollections} the fan-out's work
|
|
36
|
+
* @param [options.retireClientAnnexPosture] {Function} `({ document }) =>
|
|
37
|
+
* Promise<ClientAnnexPostureRetirement>` -- the annex reach (stage 1b in
|
|
38
|
+
* the module doc), run against the post-edit document; expected to catch
|
|
39
|
+
* its own failures and report them
|
|
32
40
|
* @param [options.onRotationAdopted] {Function} `({ userKey }) =>
|
|
33
41
|
* Promise<void>` -- the live-session adoption of a rotated key, run last so
|
|
34
42
|
* the session keeps operating without a re-login
|
|
35
43
|
* @returns {Promise<UnlockCredentialRetirementResult>}
|
|
36
44
|
*/
|
|
37
|
-
export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys, expectedDid, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, onRotationAdopted }) {
|
|
45
|
+
export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys, ladderSeed, expectedDid, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, retireClientAnnexPosture, onRotationAdopted }) {
|
|
38
46
|
// 1. The document posture edit -- the credential's standing, first. It
|
|
39
47
|
// resolves the document as it now stands, which is what stage 2 resolves
|
|
40
48
|
// its remaining recipients from.
|
|
@@ -42,9 +50,15 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
|
|
|
42
50
|
idStore,
|
|
43
51
|
updateKeys,
|
|
44
52
|
unlockKeys,
|
|
53
|
+
...(ladderSeed ? { ladderSeed } : {}),
|
|
45
54
|
...(expectedDid !== undefined ? { expectedDid } : {}),
|
|
46
55
|
...(verb !== undefined ? { verb } : {})
|
|
47
56
|
});
|
|
57
|
+
// 1b. The annex reach, against the post-edit document: strike the
|
|
58
|
+
// retired credential's rung posture out of the pointed generation, or swap
|
|
59
|
+
// the generation out from under it. Best-effort by the closure's own
|
|
60
|
+
// contract, so the roster rotation below always runs.
|
|
61
|
+
const clientAnnex = await retireClientAnnexPosture?.({ document: doc });
|
|
48
62
|
// 2. The shared roster-and-cascade tail: the roster rotation onto the
|
|
49
63
|
// post-edit document (with its post-edit controller floor and its seal
|
|
50
64
|
// backstop), then the collection fan-out onto the fresh key.
|
|
@@ -65,7 +79,8 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
|
|
|
65
79
|
return {
|
|
66
80
|
rotated: false,
|
|
67
81
|
collections: tail.collections,
|
|
68
|
-
document: doc
|
|
82
|
+
document: doc,
|
|
83
|
+
...(clientAnnex ? { clientAnnex } : {})
|
|
69
84
|
};
|
|
70
85
|
}
|
|
71
86
|
if (tail.rotated) {
|
|
@@ -77,7 +92,8 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
|
|
|
77
92
|
collections: tail.collections,
|
|
78
93
|
document: doc,
|
|
79
94
|
userKey: tail.userKey,
|
|
80
|
-
rosterDescriptor: tail.rosterDescriptor
|
|
95
|
+
rosterDescriptor: tail.rosterDescriptor,
|
|
96
|
+
...(clientAnnex ? { clientAnnex } : {})
|
|
81
97
|
};
|
|
82
98
|
}
|
|
83
99
|
//# sourceMappingURL=retire.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retire.js","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"retire.js","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"AAsEA,OAAO,EACL,gCAAgC,EAKjC,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,eAAe,EAA2B,MAAM,oBAAoB,CAAA;AAkC7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,EAC3C,OAAO,EACP,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,IAAI,EACJ,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,wBAAwB,EACxB,iBAAiB,EAsBlB;IACC,uEAAuE;IACvE,yEAAyE;IACzE,iCAAiC;IACjC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,eAAe,CAAC;QAC9C,OAAO;QACP,UAAU;QACV,UAAU;QACV,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrC,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACxC,CAAC,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OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;QACvC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACxC,CAAA;AACH,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { DIDDoc, DIDLog, VerificationMethod } from '@interop/did-method-webvh';
|
|
2
|
-
import type { ClientWebvhUpdateKeys,
|
|
2
|
+
import type { ClientWebvhUpdateKeys, PublishedWebvhLog, WebvhIdStore } from '../webvh/didWebvh.js';
|
|
3
3
|
/**
|
|
4
|
-
* The narrow store seam the self-
|
|
5
|
-
* public read of the log and the delegated `did.jsonl` PUT.
|
|
6
|
-
* {@link WebvhIdStore}, so an app's remote-store class satisfies
|
|
4
|
+
* The narrow store seam the self-enrolling and delegated-bridge ceremonies
|
|
5
|
+
* write through: a public read of the log and the delegated `did.jsonl` PUT.
|
|
6
|
+
* A subset of {@link WebvhIdStore}, so an app's remote-store class satisfies
|
|
7
|
+
* it too.
|
|
7
8
|
*/
|
|
8
9
|
export type UnlockLogStore = Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>;
|
|
9
10
|
/**
|
|
@@ -63,44 +64,18 @@ export declare function unlockKeyVerificationMethod({ did, keyAgreement }: {
|
|
|
63
64
|
keyAgreement: UnlockKeyAgreementPublication;
|
|
64
65
|
}): VerificationMethod;
|
|
65
66
|
/**
|
|
66
|
-
*
|
|
67
|
-
* with zero enrolled durable clients, anchored on the minting credential's
|
|
68
|
-
* ladder alone. Everything derives from the ladder seed: rung 0 is the sole
|
|
69
|
-
* `updateKeys` member and signs the entry, `nextKeyHashes` commits rung 0's
|
|
70
|
-
* own carry-over hash plus rung 1 (the staged rung) -- the carry-over hash is
|
|
71
|
-
* what the first durable self-enrollment's reveal-and-commit entry,
|
|
72
|
-
* re-stating `updateKeys` containing rung 0, requires --
|
|
73
|
-
* and the ladder VM (the stable sibling) is published under `assertionMethod`
|
|
74
|
-
* and `capabilityDelegation` only. The credential's `keyAgreement` posture
|
|
75
|
-
* entry is FOLDED INTO GENESIS -- no enrolled client exists to run the
|
|
76
|
-
* separate bind entry ({@link publishUnlockKey}) -- so the genesis
|
|
77
|
-
* `keyAgreement` array holds only the credential's entry.
|
|
78
|
-
*
|
|
79
|
-
* The client-less window this opens is closed by the credential's first
|
|
80
|
-
* durable self-enrollment ({@link selfEnrollWebvhClient}), whose add entry
|
|
81
|
-
* atomically publishes the client, retires rung 0, and removes the ladder VM.
|
|
82
|
-
*
|
|
83
|
-
* The caller owns publication (conditional, create-only) and the pointer
|
|
84
|
-
* write that follows; this assembles and signs the log only.
|
|
67
|
+
* Reads and resolves the published log through the narrow store seam.
|
|
85
68
|
*
|
|
86
69
|
* @param options {object}
|
|
87
|
-
* @param options.
|
|
88
|
-
* @param options.
|
|
89
|
-
*
|
|
90
|
-
* @
|
|
91
|
-
* credential's key-agreement publication (commitment or verbatim)
|
|
92
|
-
* @returns {Promise<{ log: DIDLog, webDoc: object, did: string }>}
|
|
70
|
+
* @param options.store {UnlockLogStore}
|
|
71
|
+
* @param [options.expectedDid] {string} the account DID the log must resolve
|
|
72
|
+
* to, where the caller holds one
|
|
73
|
+
* @returns {Promise<PublishedWebvhLog>}
|
|
93
74
|
*/
|
|
94
|
-
export declare function
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
keyAgreement: UnlockKeyAgreementPublication;
|
|
99
|
-
}): Promise<{
|
|
100
|
-
log: DIDLog;
|
|
101
|
-
webDoc: object;
|
|
102
|
-
did: string;
|
|
103
|
-
}>;
|
|
75
|
+
export declare function readLogOrThrow({ store, expectedDid }: {
|
|
76
|
+
store: UnlockLogStore;
|
|
77
|
+
expectedDid?: string;
|
|
78
|
+
}): Promise<PublishedWebvhLog>;
|
|
104
79
|
/**
|
|
105
80
|
* BIND (run by an enrolled client, root authority): publishes a standing
|
|
106
81
|
* credential's split posture into the document -- one entry adding the
|
|
@@ -139,13 +114,29 @@ export declare function publishUnlockKey(options: {
|
|
|
139
114
|
}>;
|
|
140
115
|
/**
|
|
141
116
|
* REMOVAL (run by an enrolled client, root authority): removes a standing
|
|
142
|
-
* credential's posture from the document -- its `keyAgreement` entry and
|
|
143
|
-
*
|
|
144
|
-
* (rotating the user key epoch off the credential's wrap) is
|
|
145
|
-
* and runs after this so the resolver's document no longer
|
|
146
|
-
* entry.
|
|
117
|
+
* credential's posture from the document -- its `keyAgreement` entry and
|
|
118
|
+
* everything of its ladder that still stands -- in one entry. Idempotent. The
|
|
119
|
+
* roster-side half (rotating the user key epoch off the credential's wrap) is
|
|
120
|
+
* the caller's, and runs after this so the resolver's document no longer
|
|
121
|
+
* backs the removed entry.
|
|
122
|
+
*
|
|
123
|
+
* The recorded `unlockKeys.updateKeyMultibase` is treated as an ANCHOR, not
|
|
124
|
+
* as truth: a credential that has self-enrolled since its bind advanced its
|
|
125
|
+
* standing commitment past the recorded rung, so the removal resolves the
|
|
126
|
+
* ladder's current footprint from the log itself
|
|
127
|
+
* ({@link attributeLadderPosture}) and strikes all of it -- every committed
|
|
128
|
+
* hash the ladder accounts for AND, for a torn self-enrollment, the revealed
|
|
129
|
+
* rung key still sitting in `updateKeys` (plus the never-claimed hashes its
|
|
130
|
+
* reveal entry committed). Trusting the recorded multibase alone would leave
|
|
131
|
+
* the live rung commitment standing: a latent re-seizure credential via the
|
|
132
|
+
* reveal mechanism. A supplied `ladderSeed` strengthens the attribution (every
|
|
133
|
+
* rung known a priori, independent of the anchor's staleness); without it the
|
|
134
|
+
* log walk alone resolves the footprint. For a single-key credential (a
|
|
135
|
+
* recovery code, a never-self-enrolled bind) the resolution degenerates to
|
|
136
|
+
* exactly the recorded key's hash, as before.
|
|
147
137
|
*
|
|
148
|
-
* @param options {object} see {@link publishUnlockKey}
|
|
138
|
+
* @param options {object} see {@link publishUnlockKey}, plus
|
|
139
|
+
* `[ladderSeed]` -- the retired credential's ladder seed, when in hand
|
|
149
140
|
* @returns {Promise<{ did: string, doc: DIDDoc, log: DIDLog }>} see
|
|
150
141
|
* {@link publishUnlockKey}
|
|
151
142
|
*/
|
|
@@ -153,6 +144,7 @@ export declare function removeUnlockKey(options: {
|
|
|
153
144
|
idStore: WebvhIdStore;
|
|
154
145
|
updateKeys: ClientWebvhUpdateKeys;
|
|
155
146
|
unlockKeys: StandingUnlockKeys;
|
|
147
|
+
ladderSeed?: Uint8Array;
|
|
156
148
|
expectedDid?: string;
|
|
157
149
|
verb?: string;
|
|
158
150
|
}): Promise<{
|
|
@@ -160,41 +152,4 @@ export declare function removeUnlockKey(options: {
|
|
|
160
152
|
doc: DIDDoc;
|
|
161
153
|
log: DIDLog;
|
|
162
154
|
}>;
|
|
163
|
-
/**
|
|
164
|
-
* SELF-ENROLLMENT (run by the credential-derived client through the delegated
|
|
165
|
-
* `did.jsonl` PUT): writes the standing continuation described in the module
|
|
166
|
-
* doc -- the reveal-and-commit entry signed by the attributed ladder rung,
|
|
167
|
-
* then the add entry signed by the new ordinary client's update key, which
|
|
168
|
-
* also retires the spent rung. Resumable from durable state alone: a
|
|
169
|
-
* completed continuation is detected by the new client's update key already
|
|
170
|
-
* being authorized (no-op), a torn one by the attribution finding the rung
|
|
171
|
-
* already revealed. Both entries publish conditionally on the read they were
|
|
172
|
-
* built on, and a race lost to a concurrent ceremony re-runs from the top --
|
|
173
|
-
* re-attributing, which is exactly the retry-up-the-ladder resolution.
|
|
174
|
-
*
|
|
175
|
-
* @param options {object}
|
|
176
|
-
* @param options.store {UnlockLogStore} public log read + delegated PUT
|
|
177
|
-
* @param options.ladderSeed {Uint8Array} the credential's ladder seed, from
|
|
178
|
-
* its unlock record
|
|
179
|
-
* @param options.newClientKeys {WebvhEnrollmentKeys} the new ordinary
|
|
180
|
-
* client's public halves
|
|
181
|
-
* @param options.newClientUpdateSeeds {ClientWebvhUpdateKeys} the new
|
|
182
|
-
* client's update-key seeds (minted by the self-enrolling flow, which
|
|
183
|
-
* therefore holds them and can sign the add entry)
|
|
184
|
-
* @param [options.expectedDid] {string} the account DID the log must resolve
|
|
185
|
-
* to, from the credential-authenticated pointer
|
|
186
|
-
* @returns {Promise<{ did: string, webDoc?: object }>} the account DID and,
|
|
187
|
-
* when the add entry ran here, the final `did.json` projection for the
|
|
188
|
-
* enrolled session to republish
|
|
189
|
-
*/
|
|
190
|
-
export declare function selfEnrollWebvhClient(options: {
|
|
191
|
-
store: UnlockLogStore;
|
|
192
|
-
ladderSeed: Uint8Array;
|
|
193
|
-
newClientKeys: WebvhEnrollmentKeys;
|
|
194
|
-
newClientUpdateSeeds: ClientWebvhUpdateKeys;
|
|
195
|
-
expectedDid?: string;
|
|
196
|
-
}): Promise<{
|
|
197
|
-
did: string;
|
|
198
|
-
webDoc?: object;
|
|
199
|
-
}>;
|
|
200
155
|
//# sourceMappingURL=standingWebvh.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standingWebvh.d.ts","sourceRoot":"","sources":["../../src/unlock/standingWebvh.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"standingWebvh.d.ts","sourceRoot":"","sources":["../../src/unlock/standingWebvh.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EACV,MAAM,EACN,MAAM,EACN,kBAAkB,EACnB,MAAM,2BAA2B,CAAA;AAalC,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EACjB,YAAY,EACb,MAAM,sBAAsB,CAAA;AAQ7B;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,YAAY,EACZ,kBAAkB,GAAG,eAAe,CACrC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,MAAM,6BAA6B,GACvC;IAAE,kBAAkB,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CAAA;AAEzD;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,6BAA6B,CAAA;IAC3C,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