@interop/wallet-core 0.78.1 → 0.79.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 +16 -3
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +2 -2
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
- package/dist/clientAnnex/establish.d.ts +2 -2
- package/dist/clientAnnex/establish.d.ts.map +1 -1
- package/dist/clientAnnex/forget.d.ts +1 -1
- package/dist/clientAnnex/forget.d.ts.map +1 -1
- package/dist/clientAnnex/heal.d.ts.map +1 -1
- package/dist/clientAnnex/heal.js +3 -1
- package/dist/clientAnnex/heal.js.map +1 -1
- package/dist/clientAnnex/ladder.d.ts +3 -98
- package/dist/clientAnnex/ladder.d.ts.map +1 -1
- package/dist/clientAnnex/ladder.js +4 -140
- package/dist/clientAnnex/ladder.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +26 -10
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +39 -19
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/mend.d.ts +2 -2
- package/dist/clientAnnex/mend.d.ts.map +1 -1
- package/dist/clientAnnex/mend.js +1 -1
- package/dist/clientAnnex/mend.js.map +1 -1
- package/dist/clientAnnex/rosterDeliveredEpochs.d.ts +1 -1
- package/dist/clientAnnex/rosterDeliveredEpochs.d.ts.map +1 -1
- package/dist/clientAnnex/selfEnroll.d.ts +1 -1
- 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/clients/revocation.d.ts +1 -1
- package/dist/clients/revocation.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.d.ts +1 -1
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/descriptors/logSource.d.ts +2 -1
- package/dist/descriptors/logSource.d.ts.map +1 -1
- package/dist/descriptors/logSource.js +1 -1
- package/dist/descriptors/logSource.js.map +1 -1
- package/dist/enrollment/enrollment.d.ts +2 -2
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +2 -1
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/genesis/accountGenesis.d.ts +1 -1
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js +11 -5
- package/dist/genesis/accountGenesis.js.map +1 -1
- package/dist/keyring/fetch.d.ts +1 -1
- package/dist/keyring/fetch.d.ts.map +1 -1
- package/dist/keyring/fetch.js +1 -1
- package/dist/keyring/fetch.js.map +1 -1
- package/dist/keyring/index.d.ts +15 -8
- package/dist/keyring/index.d.ts.map +1 -1
- package/dist/keyring/index.js +11 -6
- package/dist/keyring/index.js.map +1 -1
- package/dist/keyring/kdf.d.ts +0 -69
- package/dist/keyring/kdf.d.ts.map +1 -1
- package/dist/keyring/kdf.js +7 -86
- package/dist/keyring/kdf.js.map +1 -1
- package/dist/keyring/record.d.ts +1 -200
- package/dist/keyring/record.d.ts.map +1 -1
- package/dist/keyring/record.js +5 -251
- package/dist/keyring/record.js.map +1 -1
- package/dist/keyring/recordEnvelope.d.ts +270 -0
- package/dist/keyring/recordEnvelope.d.ts.map +1 -0
- package/dist/keyring/recordEnvelope.js +282 -0
- package/dist/keyring/recordEnvelope.js.map +1 -0
- package/dist/keyring/unlockIdentity.d.ts +71 -0
- package/dist/keyring/unlockIdentity.d.ts.map +1 -0
- package/dist/keyring/unlockIdentity.js +96 -0
- package/dist/keyring/unlockIdentity.js.map +1 -0
- package/dist/keyring/unlockSpace.d.ts +12 -1
- package/dist/keyring/unlockSpace.d.ts.map +1 -1
- package/dist/keyring/unlockSpace.js +15 -2
- package/dist/keyring/unlockSpace.js.map +1 -1
- package/dist/keys/index.d.ts +6 -3
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +6 -3
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterLogStore.d.ts +1 -1
- package/dist/keys/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +1 -1
- package/dist/keys/rosterLogStore.js.map +1 -1
- package/dist/keys/rosterRecipientKid.d.ts +28 -0
- package/dist/keys/rosterRecipientKid.d.ts.map +1 -0
- package/dist/keys/rosterRecipientKid.js +27 -0
- package/dist/keys/rosterRecipientKid.js.map +1 -0
- package/dist/keys/spaceEpochs.d.ts +1 -1
- package/dist/keys/spaceEpochs.d.ts.map +1 -1
- package/dist/keys/spaceEpochs.js +2 -2
- package/dist/keys/spaceEpochs.js.map +1 -1
- package/dist/keys/userKey.d.ts +4 -46
- package/dist/keys/userKey.d.ts.map +1 -1
- package/dist/keys/userKey.js +8 -60
- package/dist/keys/userKey.js.map +1 -1
- package/dist/keys/userKeyCascade.d.ts +1 -33
- package/dist/keys/userKeyCascade.d.ts.map +1 -1
- package/dist/keys/userKeyCascade.js +2 -49
- package/dist/keys/userKeyCascade.js.map +1 -1
- package/dist/keys/userKeyGenerations.d.ts +47 -0
- package/dist/keys/userKeyGenerations.d.ts.map +1 -0
- package/dist/keys/userKeyGenerations.js +50 -0
- package/dist/keys/userKeyGenerations.js.map +1 -0
- package/dist/keys/userKeyRoster.d.ts +1 -19
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +13 -19
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/keys/userKeyRosterCascade.d.ts +1 -1
- package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
- package/dist/keys/userKeySigning.d.ts +44 -0
- package/dist/keys/userKeySigning.d.ts.map +1 -0
- package/dist/keys/userKeySigning.js +65 -0
- package/dist/keys/userKeySigning.js.map +1 -0
- package/dist/recovery/recoveryCode.d.ts.map +1 -1
- package/dist/recovery/recoveryCode.js +3 -4
- package/dist/recovery/recoveryCode.js.map +1 -1
- package/dist/recovery/recoveryDelegation.d.ts +1 -1
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
- package/dist/space/collections.d.ts +1 -43
- package/dist/space/collections.d.ts.map +1 -1
- package/dist/space/collections.js +2 -34
- package/dist/space/collections.js.map +1 -1
- package/dist/space/systemCollections.d.ts +55 -0
- package/dist/space/systemCollections.d.ts.map +1 -0
- package/dist/space/systemCollections.js +46 -0
- package/dist/space/systemCollections.js.map +1 -0
- package/dist/sync/contactsConflict.d.ts +56 -10
- package/dist/sync/contactsConflict.d.ts.map +1 -1
- package/dist/sync/contactsConflict.js +82 -18
- package/dist/sync/contactsConflict.js.map +1 -1
- package/dist/sync/engine.d.ts +9 -3
- package/dist/sync/engine.d.ts.map +1 -1
- package/dist/sync/engine.js.map +1 -1
- package/dist/sync/pull.d.ts +25 -4
- package/dist/sync/pull.d.ts.map +1 -1
- package/dist/sync/pull.js +27 -3
- package/dist/sync/pull.js.map +1 -1
- package/dist/sync/remint.d.ts +10 -4
- package/dist/sync/remint.d.ts.map +1 -1
- package/dist/sync/remint.js +28 -6
- package/dist/sync/remint.js.map +1 -1
- package/dist/unlock/ladderDerivation.d.ts +98 -0
- package/dist/unlock/ladderDerivation.d.ts.map +1 -0
- package/dist/unlock/ladderDerivation.js +157 -0
- package/dist/unlock/ladderDerivation.js.map +1 -0
- package/dist/unlock/retire.d.ts +1 -1
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/standingClient.js +1 -1
- package/dist/unlock/standingClient.js.map +1 -1
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +3 -3
- package/dist/unlock/standingWebvh.js.map +1 -1
- package/dist/unlock/unlockRecord.d.ts +2 -1
- package/dist/unlock/unlockRecord.d.ts.map +1 -1
- package/dist/unlock/unlockRecord.js +11 -2
- package/dist/unlock/unlockRecord.js.map +1 -1
- package/dist/webvh/accountEntry.d.ts +2 -1
- package/dist/webvh/accountEntry.d.ts.map +1 -1
- package/dist/webvh/accountEntry.js.map +1 -1
- package/dist/webvh/didWebvh.d.ts +1 -11
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +5 -13
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/updateKeyMultibase.d.ts +12 -0
- package/dist/webvh/updateKeyMultibase.d.ts.map +1 -0
- package/dist/webvh/updateKeyMultibase.js +23 -0
- package/dist/webvh/updateKeyMultibase.js.map +1 -0
- package/dist/webvh/wasIdStore.d.ts +5 -3
- package/dist/webvh/wasIdStore.d.ts.map +1 -1
- package/dist/webvh/wasIdStore.js.map +1 -1
- package/package.json +53 -11
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* current-epoch wrap) appends nothing, leaving the log's head carrying a
|
|
32
32
|
* controller version before the membership change it should have sealed.
|
|
33
33
|
*/
|
|
34
|
-
import { logGovernedDescriptorStore as wasLogGovernedDescriptorStore, EPOCH_CONFIGURATION_STATE_TYPE } from '@interop/was-client/edv';
|
|
34
|
+
import { logGovernedDescriptorStore as wasLogGovernedDescriptorStore, EPOCH_CONFIGURATION_STATE_TYPE } from '@interop/was-client/edv/core';
|
|
35
35
|
import { controllerForLogClass } from '../resourceLog/index.js';
|
|
36
36
|
export { EPOCH_CONFIGURATION_STATE_TYPE };
|
|
37
37
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterLogStore.js","sourceRoot":"","sources":["../../src/keys/rosterLogStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EACL,0BAA0B,IAAI,6BAA6B,EAC3D,8BAA8B,EAE/B,MAAM,
|
|
1
|
+
{"version":3,"file":"rosterLogStore.js","sourceRoot":"","sources":["../../src/keys/rosterLogStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAC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D,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,MAAM,KAAK,GAAG,6BAA6B,CAAC;QAC1C,GAAG;QACH,iBAAiB,EAAE,iBAAiB;QACpC,QAAQ;QACR,KAAK;QACL,MAAM;KACP,CAAC,CAAA;IAEF,OAAO;QACL,GAAG,KAAK;QACR,2BAA2B,CAAC,EAAE,UAAU,EAAE;YACxC,wBAAwB,GAAG,UAAU,CAAA;QACvC,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The roster recipient kid builder, in a leaf file with no imports: a caller
|
|
6
|
+
* that only derives a client identity (`unlock/standingClient.ts`) takes it
|
|
7
|
+
* from here without loading the roster store's did:webvh and resource-log
|
|
8
|
+
* graph.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* A wallet client's roster kid: its key-agreement key's id exactly as
|
|
12
|
+
* `agentsFromSeed` derives it at the client's own logins
|
|
13
|
+
* (`did:key:<ed-multibase>#<x-multibase>`). One builder for the whole
|
|
14
|
+
* lifecycle -- the wrap the enrollment ceremony mints, the entry a roster read
|
|
15
|
+
* looks for, and the recipient a rotation retires are the same string by
|
|
16
|
+
* construction rather than by three copies agreeing.
|
|
17
|
+
*
|
|
18
|
+
* @param options {object}
|
|
19
|
+
* @param options.signingKeyMultibase {string} the client's Ed25519 signing
|
|
20
|
+
* key
|
|
21
|
+
* @param options.keyAgreementKeyMultibase {string} its X25519 twin
|
|
22
|
+
* @returns {string}
|
|
23
|
+
*/
|
|
24
|
+
export declare function rosterRecipientKid({ signingKeyMultibase, keyAgreementKeyMultibase }: {
|
|
25
|
+
signingKeyMultibase: string;
|
|
26
|
+
keyAgreementKeyMultibase: string;
|
|
27
|
+
}): string;
|
|
28
|
+
//# sourceMappingURL=rosterRecipientKid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rosterRecipientKid.d.ts","sourceRoot":"","sources":["../../src/keys/rosterRecipientKid.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;GAKG;AAEH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,mBAAmB,EACnB,wBAAwB,EACzB,EAAE;IACD,mBAAmB,EAAE,MAAM,CAAA;IAC3B,wBAAwB,EAAE,MAAM,CAAA;CACjC,GAAG,MAAM,CAET"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The roster recipient kid builder, in a leaf file with no imports: a caller
|
|
6
|
+
* that only derives a client identity (`unlock/standingClient.ts`) takes it
|
|
7
|
+
* from here without loading the roster store's did:webvh and resource-log
|
|
8
|
+
* graph.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* A wallet client's roster kid: its key-agreement key's id exactly as
|
|
12
|
+
* `agentsFromSeed` derives it at the client's own logins
|
|
13
|
+
* (`did:key:<ed-multibase>#<x-multibase>`). One builder for the whole
|
|
14
|
+
* lifecycle -- the wrap the enrollment ceremony mints, the entry a roster read
|
|
15
|
+
* looks for, and the recipient a rotation retires are the same string by
|
|
16
|
+
* construction rather than by three copies agreeing.
|
|
17
|
+
*
|
|
18
|
+
* @param options {object}
|
|
19
|
+
* @param options.signingKeyMultibase {string} the client's Ed25519 signing
|
|
20
|
+
* key
|
|
21
|
+
* @param options.keyAgreementKeyMultibase {string} its X25519 twin
|
|
22
|
+
* @returns {string}
|
|
23
|
+
*/
|
|
24
|
+
export function rosterRecipientKid({ signingKeyMultibase, keyAgreementKeyMultibase }) {
|
|
25
|
+
return `did:key:${signingKeyMultibase}#${keyAgreementKeyMultibase}`;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=rosterRecipientKid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rosterRecipientKid.js","sourceRoot":"","sources":["../../src/keys/rosterRecipientKid.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;GAKG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,mBAAmB,EACnB,wBAAwB,EAIzB;IACC,OAAO,WAAW,mBAAmB,IAAI,wBAAwB,EAAE,CAAA;AACrE,CAAC"}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* record.
|
|
34
34
|
*/
|
|
35
35
|
import type { CollectionEncryption, WasClient } from '@interop/was-client';
|
|
36
|
-
import { type EncryptionDescriptorStore, type RecipientPublicKey } from '@interop/was-client/edv';
|
|
36
|
+
import { type EncryptionDescriptorStore, type RecipientPublicKey } from '@interop/was-client/edv/core';
|
|
37
37
|
import type { UserKey } from './userKey.js';
|
|
38
38
|
/**
|
|
39
39
|
* What the epoch[0] fan-out did, per collection id: the settled epoch-bearing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spaceEpochs.d.ts","sourceRoot":"","sources":["../../src/keys/spaceEpochs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACxB,MAAM,
|
|
1
|
+
{"version":3,"file":"spaceEpochs.d.ts","sourceRoot":"","sources":["../../src/keys/spaceEpochs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACxB,MAAM,8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,KAAK;IACrD,MAAM,EAAE,uBAAuB,CAAC,QAAQ,CAAC,CAAA;gBAC7B,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,uBAAuB,CAAC,QAAQ,CAAC,CAAA;KAAE;CAUtE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,GAAG,EACH,OAAO,EACP,aAAa,EACb,OAAO,EACP,QAAQ,EACR,aAAa,EACb,SAAS,EACV,EAAE;IACD,GAAG,EAAE,SAAS,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,yBAAyB,CAAA;IAC7D,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACtE,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAwBtB"}
|
package/dist/keys/spaceEpochs.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ensureFirstEpoch } from '@interop/was-client/edv';
|
|
1
|
+
import { ensureFirstEpoch } from '@interop/was-client/edv/core';
|
|
2
2
|
import { isResourceLogRefusal } from '../resourceLog/errors.js';
|
|
3
3
|
import { encryptedWalletCollectionIds } from '../space/collections.js';
|
|
4
4
|
import { provisionWalletSpace } from '../space/provisioning.js';
|
|
5
|
-
import { userKeyAsRecipient } from './
|
|
5
|
+
import { userKeyAsRecipient } from './userKeyGenerations.js';
|
|
6
6
|
/**
|
|
7
7
|
* Installs key epoch[0] on a collection together with its blinded-index HMAC
|
|
8
8
|
* key, so an encrypted collection is indexable at birth: the HMAC key is minted
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spaceEpochs.js","sourceRoot":"","sources":["../../src/keys/spaceEpochs.ts"],"names":[],"mappings":"AAmCA,OAAO,EACL,gBAAgB,EAGjB,MAAM,
|
|
1
|
+
{"version":3,"file":"spaceEpochs.js","sourceRoot":"","sources":["../../src/keys/spaceEpochs.ts"],"names":[],"mappings":"AAmCA,OAAO,EACL,gBAAgB,EAGjB,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AA4B5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,EAC5C,KAAK,EACL,UAAU,EAIX;IACC,IAAI,CAAC;QACH,OAAO,MAAM,gBAAgB,CAAC;YAC5B,KAAK;YACL,UAAU;YACV,YAAY,EAAE,IAAI;SACnB,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,sEAAsE;QACtE,sCAAsC;QACtC,IAAK,GAAoB,EAAE,IAAI,KAAK,iBAAiB,EAAE,CAAC;YACtD,MAAM,GAAG,CAAA;QACX,CAAC;QACD,OAAO,MAAM,gBAAgB,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAA;IACtD,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,EAC5C,QAAQ,EACR,OAAO,EACP,gBAAgB,EAChB,aAAa,EACb,OAAO,EAOR;IACC,cAAc,CAAC,QAAQ,CAAC,CAAA;IACxB,IAAI,gBAAgB,IAAI,gBAAgB,CAAC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d,CAAC,CAAA;QACF,MAAM,SAAS,EAAE,CAAC,MAAM,CAAC,CAAA;QACzB,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,4BAA4B,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;QACnE,CAAC;IACH,CAAC,CAAA;IACD,OAAO,KAAK,IAAI,EAAE;QAChB,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE;gBAC5B,QAAQ,GAAG,IAAI,CAAA;YACjB,CAAC,CAAC,CAAA;QACJ,CAAC;QACD,OAAO,QAAQ,CAAA;IACjB,CAAC,CAAA;AACH,CAAC"}
|
package/dist/keys/userKey.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { IKeyAgreementKey, IKeyResolver } from '@interop/data-integrity-core';
|
|
2
|
-
import type { RecordSigner } from '../keyring/record.js';
|
|
3
2
|
/**
|
|
4
|
-
* The HKDF salt for the user key's client-side expansions
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* other refuses.
|
|
3
|
+
* The HKDF salt for the user key's client-side expansions; the one info label
|
|
4
|
+
* under it lives with the signing half (`./userKeySigning.js`). Both
|
|
5
|
+
* permanent: two wallet apps must expand the same user key to byte-identical
|
|
6
|
+
* output, or a record one of them signs is a record the other refuses.
|
|
8
7
|
*/
|
|
9
8
|
export declare const USER_KEY_SALT = "freewallet/keys/user-key/v1";
|
|
10
9
|
/**
|
|
@@ -27,47 +26,6 @@ export interface UserKey {
|
|
|
27
26
|
* @returns {Promise<UserKey>}
|
|
28
27
|
*/
|
|
29
28
|
export declare function mintUserKey(): Promise<UserKey>;
|
|
30
|
-
/**
|
|
31
|
-
* Derives the 32-byte Ed25519 seed of the user key's signing half from the
|
|
32
|
-
* key-agreement half's raw secret: HKDF-SHA256 under {@link USER_KEY_SALT},
|
|
33
|
-
* info `signing`. Deterministic and wire-level -- the same user key always
|
|
34
|
-
* yields the same signing key, which is what lets one holder sign a record
|
|
35
|
-
* another holder verifies with nothing server-served in hand.
|
|
36
|
-
*
|
|
37
|
-
* @param options {object}
|
|
38
|
-
* @param options.userKey {UserKey}
|
|
39
|
-
* @returns {Uint8Array}
|
|
40
|
-
*/
|
|
41
|
-
export declare function userKeySigningSeed({ userKey }: {
|
|
42
|
-
userKey: UserKey;
|
|
43
|
-
}): Uint8Array;
|
|
44
|
-
/**
|
|
45
|
-
* The user key's record signer: the keyring record's signing seam over the
|
|
46
|
-
* derived Ed25519 half, for an app-side record sealed to the vault KAK
|
|
47
|
-
* (`signRecordFrame`). Its `keyMultibase` is exactly what a reader's
|
|
48
|
-
* allowlist holds, so a writer that already has the signer reads the multibase
|
|
49
|
-
* off it rather than calling {@link userKeySigningKeyMultibase} as well.
|
|
50
|
-
*
|
|
51
|
-
* @param options {object}
|
|
52
|
-
* @param options.userKey {UserKey}
|
|
53
|
-
* @returns {Promise<RecordSigner>}
|
|
54
|
-
*/
|
|
55
|
-
export declare function userKeyRecordSigner({ userKey }: {
|
|
56
|
-
userKey: UserKey;
|
|
57
|
-
}): Promise<RecordSigner>;
|
|
58
|
-
/**
|
|
59
|
-
* The public multibase of the user key's signing half: the one key a reader
|
|
60
|
-
* accepts on a record sealed under this user key, handed to
|
|
61
|
-
* `verifyRecordProof` as its allowlist. For a reader alone -- a writer takes
|
|
62
|
-
* the same value off {@link userKeyRecordSigner}'s `keyMultibase`.
|
|
63
|
-
*
|
|
64
|
-
* @param options {object}
|
|
65
|
-
* @param options.userKey {UserKey}
|
|
66
|
-
* @returns {Promise<string>}
|
|
67
|
-
*/
|
|
68
|
-
export declare function userKeySigningKeyMultibase({ userKey }: {
|
|
69
|
-
userKey: UserKey;
|
|
70
|
-
}): Promise<string>;
|
|
71
29
|
/**
|
|
72
30
|
* Reconstructs the user key's key-agreement key and its single-key resolver
|
|
73
31
|
* from the stored material -- the vault-key pair a session supplies to the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userKey.d.ts","sourceRoot":"","sources":["../../src/keys/userKey.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"userKey.d.ts","sourceRoot":"","sources":["../../src/keys/userKey.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8BAA8B,CAAA;AAIrC;;;;;GAKG;AACH,eAAO,MAAM,aAAa,gCAAgC,CAAA;AAE1D;;;;;;;GAOG;AACH,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,UAAU,CAAA;CACnB;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAGpD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG;IACnE,eAAe,EAAE,gBAAgB,CAAA;IACjC,WAAW,EAAE,YAAY,CAAA;CAC1B,CAQA"}
|
package/dist/keys/userKey.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* construction mints: a fresh X25519 pair whose did:key is the key's id and
|
|
14
14
|
* whose raw 32-byte secret is what gets wrapped to recipients -- so the roster
|
|
15
15
|
* machinery consumes the user key unchanged. The Ed25519 signing half DERIVES
|
|
16
|
-
* from that same secret (
|
|
16
|
+
* from that same secret (`userKeySigningSeed`), so it needs no storage
|
|
17
17
|
* and no delivery channel of its own: every holder of the user key holds it,
|
|
18
18
|
* an enrolled session, a transient one, and a session-less signup or recovery
|
|
19
19
|
* writer alike, and a roster rotation that hands a client the fresh
|
|
@@ -23,28 +23,19 @@
|
|
|
23
23
|
* KAK is not authenticated by being decryptable -- a storage host that knows
|
|
24
24
|
* the epoch's public half can seal a body of its own that decrypts perfectly,
|
|
25
25
|
* which is the property the keyring record's `proof` member exists to defeat.
|
|
26
|
-
* So such a record carries the same proof, signed by
|
|
27
|
-
*
|
|
28
|
-
* userKeySigningKeyMultibase} before it is decrypted.
|
|
26
|
+
* So such a record carries the same proof, signed by `userKeyRecordSigner`
|
|
27
|
+
* and verified against `userKeySigningKeyMultibase` before it is decrypted.
|
|
29
28
|
*/
|
|
30
|
-
import { hkdf } from '@noble/hashes/hkdf.js';
|
|
31
|
-
import { sha256 } from '@noble/hashes/sha2.js';
|
|
32
29
|
import { X25519KeyAgreementKey2020 } from '@interop/x25519-key-agreement-key';
|
|
33
|
-
import { epochKeyIdFor, mintEpoch } from '@interop/was-client/edv';
|
|
30
|
+
import { epochKeyIdFor, mintEpoch } from '@interop/was-client/edv/cipher';
|
|
34
31
|
import { singleKeyResolver } from '@interop/was-client/identity';
|
|
35
|
-
import { recordSignerFromSeed } from '../keyring/record.js';
|
|
36
32
|
/**
|
|
37
|
-
* The HKDF salt for the user key's client-side expansions
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* other refuses.
|
|
33
|
+
* The HKDF salt for the user key's client-side expansions; the one info label
|
|
34
|
+
* under it lives with the signing half (`./userKeySigning.js`). Both
|
|
35
|
+
* permanent: two wallet apps must expand the same user key to byte-identical
|
|
36
|
+
* output, or a record one of them signs is a record the other refuses.
|
|
41
37
|
*/
|
|
42
38
|
export const USER_KEY_SALT = 'freewallet/keys/user-key/v1';
|
|
43
|
-
const USER_KEY_SIGNING_INFO = 'signing';
|
|
44
|
-
/**
|
|
45
|
-
* The number of bytes the signing expansion produces (a 32-byte Ed25519 seed).
|
|
46
|
-
*/
|
|
47
|
-
const USER_KEY_SIGNING_SEED_BYTES = 32;
|
|
48
39
|
/**
|
|
49
40
|
* Mints a fresh user key: the X25519 key-agreement pair via the was-client
|
|
50
41
|
* epoch construction (its did:key is the key id, its raw secret is what wraps).
|
|
@@ -56,49 +47,6 @@ export async function mintUserKey() {
|
|
|
56
47
|
const { epochId, secret } = await mintEpoch();
|
|
57
48
|
return { id: epochId, secret };
|
|
58
49
|
}
|
|
59
|
-
/**
|
|
60
|
-
* Derives the 32-byte Ed25519 seed of the user key's signing half from the
|
|
61
|
-
* key-agreement half's raw secret: HKDF-SHA256 under {@link USER_KEY_SALT},
|
|
62
|
-
* info `signing`. Deterministic and wire-level -- the same user key always
|
|
63
|
-
* yields the same signing key, which is what lets one holder sign a record
|
|
64
|
-
* another holder verifies with nothing server-served in hand.
|
|
65
|
-
*
|
|
66
|
-
* @param options {object}
|
|
67
|
-
* @param options.userKey {UserKey}
|
|
68
|
-
* @returns {Uint8Array}
|
|
69
|
-
*/
|
|
70
|
-
export function userKeySigningSeed({ userKey }) {
|
|
71
|
-
const encoder = new TextEncoder();
|
|
72
|
-
return hkdf(sha256, userKey.secret, encoder.encode(USER_KEY_SALT), encoder.encode(USER_KEY_SIGNING_INFO), USER_KEY_SIGNING_SEED_BYTES);
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* The user key's record signer: the keyring record's signing seam over the
|
|
76
|
-
* derived Ed25519 half, for an app-side record sealed to the vault KAK
|
|
77
|
-
* (`signRecordFrame`). Its `keyMultibase` is exactly what a reader's
|
|
78
|
-
* allowlist holds, so a writer that already has the signer reads the multibase
|
|
79
|
-
* off it rather than calling {@link userKeySigningKeyMultibase} as well.
|
|
80
|
-
*
|
|
81
|
-
* @param options {object}
|
|
82
|
-
* @param options.userKey {UserKey}
|
|
83
|
-
* @returns {Promise<RecordSigner>}
|
|
84
|
-
*/
|
|
85
|
-
export async function userKeyRecordSigner({ userKey }) {
|
|
86
|
-
return recordSignerFromSeed({ seed: userKeySigningSeed({ userKey }) });
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* The public multibase of the user key's signing half: the one key a reader
|
|
90
|
-
* accepts on a record sealed under this user key, handed to
|
|
91
|
-
* `verifyRecordProof` as its allowlist. For a reader alone -- a writer takes
|
|
92
|
-
* the same value off {@link userKeyRecordSigner}'s `keyMultibase`.
|
|
93
|
-
*
|
|
94
|
-
* @param options {object}
|
|
95
|
-
* @param options.userKey {UserKey}
|
|
96
|
-
* @returns {Promise<string>}
|
|
97
|
-
*/
|
|
98
|
-
export async function userKeySigningKeyMultibase({ userKey }) {
|
|
99
|
-
const { keyMultibase } = await userKeyRecordSigner({ userKey });
|
|
100
|
-
return keyMultibase;
|
|
101
|
-
}
|
|
102
50
|
/**
|
|
103
51
|
* Reconstructs the user key's key-agreement key and its single-key resolver
|
|
104
52
|
* from the stored material -- the vault-key pair a session supplies to the
|
package/dist/keys/userKey.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userKey.js","sourceRoot":"","sources":["../../src/keys/userKey.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"userKey.js","sourceRoot":"","sources":["../../src/keys/userKey.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAK7E,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAEhE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,6BAA6B,CAAA;AAe1D;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,SAAS,EAAE,CAAA;IAC7C,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAA;AAChC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAAE,OAAO,EAAwB;IAIhE,MAAM,eAAe,GAAG,yBAAyB,CAAC,aAAa,CAAC;QAC9D,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,UAAU,EAAE,OAAO,CAAC,EAAE;QACtB,EAAE,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;KAC9B,CAAqB,CAAA;IACtB,MAAM,WAAW,GAAG,iBAAiB,CAAC,EAAE,eAAe,EAAE,CAAC,CAAA;IAC1D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,CAAA;AACzC,CAAC"}
|
|
@@ -35,41 +35,9 @@
|
|
|
35
35
|
*/
|
|
36
36
|
import type { IKeyAgreementKey } from '@interop/data-integrity-core';
|
|
37
37
|
import type { CollectionEncryption } from '@interop/was-client';
|
|
38
|
-
import { type EncryptionDescriptorStore
|
|
38
|
+
import { type EncryptionDescriptorStore } from '@interop/was-client/edv/core';
|
|
39
39
|
import type { WebvhResourceLogController } from '../resourceLog/index.js';
|
|
40
40
|
import { type UserKey } from './userKey.js';
|
|
41
|
-
/**
|
|
42
|
-
* A user key presented as an epoch-roster recipient: the kid is the
|
|
43
|
-
* self-describing `<did:key>#<fingerprint>` form every collection epoch names
|
|
44
|
-
* the user under, and the public key is the did:key's own multibase.
|
|
45
|
-
*
|
|
46
|
-
* @param options {object}
|
|
47
|
-
* @param options.userKey {UserKey}
|
|
48
|
-
* @returns {RecipientPublicKey}
|
|
49
|
-
*/
|
|
50
|
-
export declare function userKeyAsRecipient({ userKey }: {
|
|
51
|
-
userKey: UserKey;
|
|
52
|
-
}): RecipientPublicKey;
|
|
53
|
-
/**
|
|
54
|
-
* Recovers every user key generation from the roster descriptor: each roster
|
|
55
|
-
* epoch is one generation (its id the generation's did:key, its wrapped secret
|
|
56
|
-
* the generation's raw key), escrow-wrapped to every enrolled client -- so this
|
|
57
|
-
* client's key-agreement key unwraps them all, in roster (chronological) order.
|
|
58
|
-
* A generation whose wrap is missing or fails to unwrap is skipped rather than
|
|
59
|
-
* fatal (the cascade then simply cannot recognize or escrow that generation;
|
|
60
|
-
* the current epoch always unwraps or the roster read itself would have
|
|
61
|
-
* refused).
|
|
62
|
-
*
|
|
63
|
-
* @param options {object}
|
|
64
|
-
* @param options.descriptor {CollectionEncryption} the roster descriptor
|
|
65
|
-
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
66
|
-
* (identity) key-agreement key
|
|
67
|
-
* @returns {Promise<UserKey[]>} the generations, oldest first
|
|
68
|
-
*/
|
|
69
|
-
export declare function unwrapUserKeyGenerations({ descriptor, clientKeyAgreementKey }: {
|
|
70
|
-
descriptor: CollectionEncryption;
|
|
71
|
-
clientKeyAgreementKey: IKeyAgreementKey;
|
|
72
|
-
}): Promise<UserKey[]>;
|
|
73
41
|
/**
|
|
74
42
|
* What one collection's cascade step did: `noop` (already on the current user
|
|
75
43
|
* key), `sealed` (already on the current user key, but the collection's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userKeyCascade.d.ts","sourceRoot":"","sources":["../../src/keys/userKeyCascade.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"userKeyCascade.d.ts","sourceRoot":"","sources":["../../src/keys/userKeyCascade.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAKL,KAAK,yBAAyB,EAC/B,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AAGzE,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,cAAc,CAAA;AAM7D;;;;;;;GAOG;AACH,MAAM,MAAM,gCAAgC,GAC1C,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Epochs, replaceRecipient } from '@interop/was-client/edv/core';
|
|
2
2
|
import { isSealableDescriptorStore } from './rosterLogStore.js';
|
|
3
3
|
import { currentEpochOf } from './userKeyRoster.js';
|
|
4
4
|
import { userKeyVaultKeys } from './userKey.js';
|
|
5
|
-
|
|
6
|
-
* A user key presented as an epoch-roster recipient: the kid is the
|
|
7
|
-
* self-describing `<did:key>#<fingerprint>` form every collection epoch names
|
|
8
|
-
* the user under, and the public key is the did:key's own multibase.
|
|
9
|
-
*
|
|
10
|
-
* @param options {object}
|
|
11
|
-
* @param options.userKey {UserKey}
|
|
12
|
-
* @returns {RecipientPublicKey}
|
|
13
|
-
*/
|
|
14
|
-
export function userKeyAsRecipient({ userKey }) {
|
|
15
|
-
return {
|
|
16
|
-
id: epochKeyIdFor(userKey.id),
|
|
17
|
-
publicKeyMultibase: userKey.id.split(':')[2]
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Recovers every user key generation from the roster descriptor: each roster
|
|
22
|
-
* epoch is one generation (its id the generation's did:key, its wrapped secret
|
|
23
|
-
* the generation's raw key), escrow-wrapped to every enrolled client -- so this
|
|
24
|
-
* client's key-agreement key unwraps them all, in roster (chronological) order.
|
|
25
|
-
* A generation whose wrap is missing or fails to unwrap is skipped rather than
|
|
26
|
-
* fatal (the cascade then simply cannot recognize or escrow that generation;
|
|
27
|
-
* the current epoch always unwraps or the roster read itself would have
|
|
28
|
-
* refused).
|
|
29
|
-
*
|
|
30
|
-
* @param options {object}
|
|
31
|
-
* @param options.descriptor {CollectionEncryption} the roster descriptor
|
|
32
|
-
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
33
|
-
* (identity) key-agreement key
|
|
34
|
-
* @returns {Promise<UserKey[]>} the generations, oldest first
|
|
35
|
-
*/
|
|
36
|
-
export async function unwrapUserKeyGenerations({ descriptor, clientKeyAgreementKey }) {
|
|
37
|
-
const generations = [];
|
|
38
|
-
for (const epoch of descriptor.epochs ?? []) {
|
|
39
|
-
const entry = epoch.recipients.find(recipient => recipient.header.kid === clientKeyAgreementKey.id);
|
|
40
|
-
if (!entry) {
|
|
41
|
-
continue;
|
|
42
|
-
}
|
|
43
|
-
const secret = await unwrapEpochSecret({
|
|
44
|
-
entry,
|
|
45
|
-
keyAgreementKey: clientKeyAgreementKey
|
|
46
|
-
});
|
|
47
|
-
if (secret) {
|
|
48
|
-
generations.push({ id: epoch.id, secret });
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return generations;
|
|
52
|
-
}
|
|
5
|
+
import { unwrapUserKeyGenerations, userKeyAsRecipient } from './userKeyGenerations.js';
|
|
53
6
|
/**
|
|
54
7
|
* Brings ONE encrypted collection's epoch roster onto the current user key --
|
|
55
8
|
* the per-collection op of the revocation cascade and of the completion sweep:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userKeyCascade.js","sourceRoot":"","sources":["../../src/keys/userKeyCascade.ts"],"names":[],"mappings":"AAqCA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,gBAAgB,
|
|
1
|
+
{"version":3,"file":"userKeyCascade.js","sourceRoot":"","sources":["../../src/keys/userKeyCascade.ts"],"names":[],"mappings":"AAqCA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,gBAAgB,EAEjB,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAgB,MAAM,cAAc,CAAA;AAC7D,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,yBAAyB,CAAA;AAahC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,CAAC,KAAK,UAAU,+BAA+B,CAAC,EACpD,KAAK,EACL,OAAO,EACP,WAAW,EAKZ;IACC,MAAM,OAAO,GA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,CAAC,CAAA;IACF,MAAM,QAAQ,GAAqD,EAAE,CAAA;IACrE,MAAM,MAAM,GAAoD,EAAE,CAAA;IAClE,MAAM,OAAO,CAAC,GAAG,CACf,aAAa,CAAC,GAAG,CAAC,KAAK,EAAC,YAAY,EAAC,EAAE;QACrC,IAAI,CAAC;YACH,IAAI,WAAW,IAAI,CAAC,CAAC,MAAM,WAAW,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;gBACtD,OAAM;YACR,CAAC;YACD,MAAM,KAAK,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAA;YACpC,IAAI,UAAU,KAAK,SAAS,IAAI,yBAAyB,CAAC,KAAK,CAAC,EAAE,CAAC;gBACjE,KAAK,CAAC,2BAA2B,CAAC,EAAE,UAAU,EAAE,CAAC,CAAA;YACnD,CAAC;YACD,QAAQ,CAAC,YAAY,CAAC,GAAG,MAAM,+BAA+B,CAAC;gBAC7D,KAAK;gBACL,OAAO;gBACP,WAAW;aACZ,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAA;QAC3C,CAAC;IACH,CAAC,CAAC,CACH,CAAA;IACD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;AAC7B,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The pure readers over user key generations: a user key presented as an
|
|
6
|
+
* epoch-roster recipient, and the unwrap of every generation a roster
|
|
7
|
+
* descriptor carries. Both run offline over data already in hand, so this file
|
|
8
|
+
* imports the epoch primitives alone and stays clear of the rotation cascade's
|
|
9
|
+
* store and log graph.
|
|
10
|
+
*/
|
|
11
|
+
import type { IKeyAgreementKey } from '@interop/data-integrity-core';
|
|
12
|
+
import type { CollectionEncryption } from '@interop/was-client';
|
|
13
|
+
import { type RecipientPublicKey } from '@interop/was-client/edv/cipher';
|
|
14
|
+
import type { UserKey } from './userKey.js';
|
|
15
|
+
/**
|
|
16
|
+
* A user key presented as an epoch-roster recipient: the kid is the
|
|
17
|
+
* self-describing `<did:key>#<fingerprint>` form every collection epoch names
|
|
18
|
+
* the user under, and the public key is the did:key's own multibase.
|
|
19
|
+
*
|
|
20
|
+
* @param options {object}
|
|
21
|
+
* @param options.userKey {UserKey}
|
|
22
|
+
* @returns {RecipientPublicKey}
|
|
23
|
+
*/
|
|
24
|
+
export declare function userKeyAsRecipient({ userKey }: {
|
|
25
|
+
userKey: UserKey;
|
|
26
|
+
}): RecipientPublicKey;
|
|
27
|
+
/**
|
|
28
|
+
* Recovers every user key generation from the roster descriptor: each roster
|
|
29
|
+
* epoch is one generation (its id the generation's did:key, its wrapped secret
|
|
30
|
+
* the generation's raw key), escrow-wrapped to every enrolled client -- so this
|
|
31
|
+
* client's key-agreement key unwraps them all, in roster (chronological) order.
|
|
32
|
+
* A generation whose wrap is missing or fails to unwrap is skipped rather than
|
|
33
|
+
* fatal (the cascade then simply cannot recognize or escrow that generation;
|
|
34
|
+
* the current epoch always unwraps or the roster read itself would have
|
|
35
|
+
* refused).
|
|
36
|
+
*
|
|
37
|
+
* @param options {object}
|
|
38
|
+
* @param options.descriptor {CollectionEncryption} the roster descriptor
|
|
39
|
+
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
40
|
+
* (identity) key-agreement key
|
|
41
|
+
* @returns {Promise<UserKey[]>} the generations, oldest first
|
|
42
|
+
*/
|
|
43
|
+
export declare function unwrapUserKeyGenerations({ descriptor, clientKeyAgreementKey }: {
|
|
44
|
+
descriptor: CollectionEncryption;
|
|
45
|
+
clientKeyAgreementKey: IKeyAgreementKey;
|
|
46
|
+
}): Promise<UserKey[]>;
|
|
47
|
+
//# sourceMappingURL=userKeyGenerations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userKeyGenerations.d.ts","sourceRoot":"","sources":["../../src/keys/userKeyGenerations.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACR,EAAE;IACD,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,kBAAkB,CAKrB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,wBAAwB,CAAC,EAC7C,UAAU,EACV,qBAAqB,EACtB,EAAE;IACD,UAAU,EAAE,oBAAoB,CAAA;IAChC,qBAAqB,EAAE,gBAAgB,CAAA;CACxC,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAkBrB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { epochKeyIdFor, unwrapEpochSecret } from '@interop/was-client/edv/cipher';
|
|
2
|
+
/**
|
|
3
|
+
* A user key presented as an epoch-roster recipient: the kid is the
|
|
4
|
+
* self-describing `<did:key>#<fingerprint>` form every collection epoch names
|
|
5
|
+
* the user under, and the public key is the did:key's own multibase.
|
|
6
|
+
*
|
|
7
|
+
* @param options {object}
|
|
8
|
+
* @param options.userKey {UserKey}
|
|
9
|
+
* @returns {RecipientPublicKey}
|
|
10
|
+
*/
|
|
11
|
+
export function userKeyAsRecipient({ userKey }) {
|
|
12
|
+
return {
|
|
13
|
+
id: epochKeyIdFor(userKey.id),
|
|
14
|
+
publicKeyMultibase: userKey.id.split(':')[2]
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Recovers every user key generation from the roster descriptor: each roster
|
|
19
|
+
* epoch is one generation (its id the generation's did:key, its wrapped secret
|
|
20
|
+
* the generation's raw key), escrow-wrapped to every enrolled client -- so this
|
|
21
|
+
* client's key-agreement key unwraps them all, in roster (chronological) order.
|
|
22
|
+
* A generation whose wrap is missing or fails to unwrap is skipped rather than
|
|
23
|
+
* fatal (the cascade then simply cannot recognize or escrow that generation;
|
|
24
|
+
* the current epoch always unwraps or the roster read itself would have
|
|
25
|
+
* refused).
|
|
26
|
+
*
|
|
27
|
+
* @param options {object}
|
|
28
|
+
* @param options.descriptor {CollectionEncryption} the roster descriptor
|
|
29
|
+
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
30
|
+
* (identity) key-agreement key
|
|
31
|
+
* @returns {Promise<UserKey[]>} the generations, oldest first
|
|
32
|
+
*/
|
|
33
|
+
export async function unwrapUserKeyGenerations({ descriptor, clientKeyAgreementKey }) {
|
|
34
|
+
const generations = [];
|
|
35
|
+
for (const epoch of descriptor.epochs ?? []) {
|
|
36
|
+
const entry = epoch.recipients.find(recipient => recipient.header.kid === clientKeyAgreementKey.id);
|
|
37
|
+
if (!entry) {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
const secret = await unwrapEpochSecret({
|
|
41
|
+
entry,
|
|
42
|
+
keyAgreementKey: clientKeyAgreementKey
|
|
43
|
+
});
|
|
44
|
+
if (secret) {
|
|
45
|
+
generations.push({ id: epoch.id, secret });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return generations;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=userKeyGenerations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userKeyGenerations.js","sourceRoot":"","sources":["../../src/keys/userKeyGenerations.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,aAAa,EACb,iBAAiB,EAElB,MAAM,gCAAgC,CAAA;AAGvC;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,OAAO,EAGR;IACC,OAAO;QACL,EAAE,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7B,kBAAkB,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE;KAC9C,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,EAC7C,UAAU,EACV,qBAAqB,EAItB;IACC,MAAM,WAAW,GAAc,EAAE,CAAA;IACjC,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;QAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CACjC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,KAAK,qBAAqB,CAAC,EAAE,CAC/D,CAAA;QACD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,SAAQ;QACV,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC;YACrC,KAAK;YACL,eAAe,EAAE,qBAAqB;SACvC,CAAC,CAAA;QACF,IAAI,MAAM,EAAE,CAAC;YACX,WAAW,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;QAC5C,CAAC;IACH,CAAC;IACD,OAAO,WAAW,CAAA;AACpB,CAAC"}
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
*/
|
|
50
50
|
import type { IKeyAgreementKey } from '@interop/data-integrity-core';
|
|
51
51
|
import type { CollectionEncryption, CollectionEncryptionEpoch } from '@interop/was-client';
|
|
52
|
-
import { type EncryptionDescriptorStore, type RecipientPublicKey } from '@interop/was-client/edv';
|
|
52
|
+
import { type EncryptionDescriptorStore, type RecipientPublicKey } from '@interop/was-client/edv/core';
|
|
53
53
|
import { type ResourceLogSigner } from '@interop/vh-resource-log';
|
|
54
54
|
import type { KeyAgreementDocument } from '../resourceLog/document.js';
|
|
55
55
|
import { type ICapabilityAgent } from '../webvh/zcap.js';
|
|
@@ -141,24 +141,6 @@ export declare class UserKeyRosterUnwrapError extends Error {
|
|
|
141
141
|
export declare function userKeyRosterLogSigner({ keyAgent }: {
|
|
142
142
|
keyAgent: ICapabilityAgent;
|
|
143
143
|
}): ResourceLogSigner;
|
|
144
|
-
/**
|
|
145
|
-
* A wallet client's roster kid: its key-agreement key's id exactly as
|
|
146
|
-
* `agentsFromSeed` derives it at the client's own logins
|
|
147
|
-
* (`did:key:<ed-multibase>#<x-multibase>`). One builder for the whole
|
|
148
|
-
* lifecycle -- the wrap the enrollment ceremony mints, the entry a roster read
|
|
149
|
-
* looks for, and the recipient a rotation retires are the same string by
|
|
150
|
-
* construction rather than by three copies agreeing.
|
|
151
|
-
*
|
|
152
|
-
* @param options {object}
|
|
153
|
-
* @param options.signingKeyMultibase {string} the client's Ed25519 signing
|
|
154
|
-
* key
|
|
155
|
-
* @param options.keyAgreementKeyMultibase {string} its X25519 twin
|
|
156
|
-
* @returns {string}
|
|
157
|
-
*/
|
|
158
|
-
export declare function rosterRecipientKid({ signingKeyMultibase, keyAgreementKeyMultibase }: {
|
|
159
|
-
signingKeyMultibase: string;
|
|
160
|
-
keyAgreementKeyMultibase: string;
|
|
161
|
-
}): string;
|
|
162
144
|
/**
|
|
163
145
|
* Builds the recipient resolver for roster rotations, backed by a locally
|
|
164
146
|
* verified did:webvh document -- the enforcement point for "the roster
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userKeyRoster.d.ts","sourceRoot":"","sources":["../../src/keys/userKeyRoster.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EACV,oBAAoB,EACpB,yBAAyB,E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