@interop/wallet-core 0.98.0 → 0.99.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 -4
- 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/log.d.ts +15 -0
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +26 -8
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/keyring/index.d.ts +9 -7
- package/dist/keyring/index.d.ts.map +1 -1
- package/dist/keyring/index.js +9 -7
- package/dist/keyring/index.js.map +1 -1
- package/dist/keyring/unlockSpace.d.ts +45 -4
- package/dist/keyring/unlockSpace.d.ts.map +1 -1
- package/dist/keyring/unlockSpace.js +71 -19
- package/dist/keyring/unlockSpace.js.map +1 -1
- package/dist/resourceLog/controller.d.ts +6 -5
- package/dist/resourceLog/controller.d.ts.map +1 -1
- package/dist/resourceLog/controller.js +10 -21
- package/dist/resourceLog/controller.js.map +1 -1
- package/dist/resourceLog/document.d.ts +69 -52
- package/dist/resourceLog/document.d.ts.map +1 -1
- package/dist/resourceLog/document.js +77 -84
- package/dist/resourceLog/document.js.map +1 -1
- package/dist/resourceLog/ladderRungs.d.ts.map +1 -1
- package/dist/resourceLog/ladderRungs.js +7 -47
- package/dist/resourceLog/ladderRungs.js.map +1 -1
- package/dist/webvh/documentDids.d.ts +46 -0
- package/dist/webvh/documentDids.d.ts.map +1 -0
- package/dist/webvh/documentDids.js +50 -0
- package/dist/webvh/documentDids.js.map +1 -0
- package/dist/webvh/index.d.ts +7 -1
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +7 -1
- package/dist/webvh/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -3,95 +3,33 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* The account-document reading conventions every reader shares, in one place:
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* which `capabilityDelegation` members are ladder VMs, which `keyAgreement`
|
|
7
|
+
* methods are the account's credential inventory, and which key multibases
|
|
8
|
+
* the two account-document key classes (the enrolled clients' signing keys,
|
|
9
|
+
* the ladder VMs' keys) publish. How a verification relation resolves, and
|
|
10
|
+
* which key multibase a relation member names, are the generic rules every
|
|
11
|
+
* consumer of the stack shares; they come from `@interop/vh-resource-log`
|
|
12
|
+
* and are re-exported here under the names this module always had.
|
|
10
13
|
*
|
|
11
14
|
* Each of those rules is a wire-level convention of the account document, so
|
|
12
15
|
* a second implementation of one is a place the readers can disagree: the
|
|
13
16
|
* ceremony-tail license's inventory comparison and the client listing's
|
|
14
17
|
* ladder-VM recognition must answer identically over the same document, and
|
|
15
18
|
* so must the roster's recipient resolver and the client listing's marker
|
|
16
|
-
* filter
|
|
19
|
+
* filter, and so must the ladder-rung attribution and the account's did:key
|
|
20
|
+
* census. They are consumers of the readers here rather than re-readings of
|
|
17
21
|
* the document.
|
|
18
22
|
*
|
|
19
|
-
* Deliberately dependency-light -- it imports
|
|
20
|
-
* layer
|
|
21
|
-
*
|
|
22
|
-
* Its public home is
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* Deliberately dependency-light -- it imports only the resource-log library
|
|
24
|
+
* the layer beside it already sits over -- so both the layer-0 controller
|
|
25
|
+
* adapter and the `webvh` and `keys` layers above can share the readers
|
|
26
|
+
* without pulling the ceremony or signing graph. Its public home is
|
|
27
|
+
* `@interop/wallet-core/webvh`, which re-exports the `keyAgreement` readers,
|
|
28
|
+
* the ladder recognition, and the two key-class readers; this subpath
|
|
29
|
+
* exports none of them, so each name has one owner.
|
|
25
30
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
* ids, tolerating embedded objects beside string references.
|
|
29
|
-
*
|
|
30
|
-
* @param relation {Array} the relationship array, when present
|
|
31
|
-
* @returns {string[]}
|
|
32
|
-
*/
|
|
33
|
-
export function relationIds(relation) {
|
|
34
|
-
const ids = [];
|
|
35
|
-
for (const entry of relation ?? []) {
|
|
36
|
-
const id = typeof entry === 'string' ? entry : entry?.id;
|
|
37
|
-
if (id) {
|
|
38
|
-
ids.push(id);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return ids;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* The per-document `verificationMethod` index the relation readers resolve
|
|
45
|
-
* string references through, memoized on the array itself. A verified
|
|
46
|
-
* document is read many times over -- the controller adapter resolves four
|
|
47
|
-
* relations per log entry, and every ceremony re-reads the head -- and no
|
|
48
|
-
* reader mutates a `verificationMethod` array in place (a rebuilt document
|
|
49
|
-
* carries a fresh array, so it keys a fresh index).
|
|
50
|
-
*
|
|
51
|
-
* @param doc {AccountDocument}
|
|
52
|
-
* @returns {Map<string, ResolvedKeyAgreementMethod>}
|
|
53
|
-
*/
|
|
54
|
-
function verificationMethodIndex(doc) {
|
|
55
|
-
const methods = doc.verificationMethod;
|
|
56
|
-
if (methods === undefined) {
|
|
57
|
-
return new Map();
|
|
58
|
-
}
|
|
59
|
-
let byId = verificationMethodIndexes.get(methods);
|
|
60
|
-
if (byId === undefined) {
|
|
61
|
-
byId = new Map();
|
|
62
|
-
for (const method of methods) {
|
|
63
|
-
if (typeof method?.id === 'string') {
|
|
64
|
-
byId.set(method.id, method);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
verificationMethodIndexes.set(methods, byId);
|
|
68
|
-
}
|
|
69
|
-
return byId;
|
|
70
|
-
}
|
|
71
|
-
const verificationMethodIndexes = new WeakMap();
|
|
72
|
-
/**
|
|
73
|
-
* The verification methods one relation publishes, materialized: string
|
|
74
|
-
* references resolved against `verificationMethod` (a reference nothing backs
|
|
75
|
-
* is dropped), embedded methods taken verbatim. Document order is preserved,
|
|
76
|
-
* and nothing is filtered -- deciding which of these methods belongs to whom
|
|
77
|
-
* is each caller's own rule.
|
|
78
|
-
*
|
|
79
|
-
* @param options {object}
|
|
80
|
-
* @param options.doc {AccountDocument} a locally verified document
|
|
81
|
-
* @param options.relation {DocumentRelation} the relation to resolve
|
|
82
|
-
* @returns {ResolvedKeyAgreementMethod[]}
|
|
83
|
-
*/
|
|
84
|
-
export function resolvedRelationMethods({ doc, relation }) {
|
|
85
|
-
const byId = verificationMethodIndex(doc);
|
|
86
|
-
const methods = [];
|
|
87
|
-
for (const entry of doc[relation] ?? []) {
|
|
88
|
-
const method = typeof entry === 'string' ? byId.get(entry) : entry;
|
|
89
|
-
if (method) {
|
|
90
|
-
methods.push(method);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return methods;
|
|
94
|
-
}
|
|
31
|
+
import { memberKeyMultibase, relationIds, relationKeyMultibases, relationMembers, resolvedRelationMethods } from '@interop/vh-resource-log';
|
|
32
|
+
export { relationIds, resolvedRelationMethods };
|
|
95
33
|
/**
|
|
96
34
|
* The `keyAgreement` verification methods a document publishes, materialized:
|
|
97
35
|
* string references resolved against `verificationMethod` (a reference nothing
|
|
@@ -202,12 +140,16 @@ export function ladderVmIds({ doc }) {
|
|
|
202
140
|
* The ladder VMs' verification methods, materialized: the
|
|
203
141
|
* `capabilityDelegation` methods {@link ladderVmIds} names, resolved the way
|
|
204
142
|
* every other relation read resolves. Recognition therefore has exactly one
|
|
205
|
-
* definition -- a reader needing the ladder
|
|
206
|
-
*
|
|
143
|
+
* definition -- a reader needing the ladder VMs' resolved methods asks here
|
|
144
|
+
* rather than re-deriving the asymmetry. A reader needing the ladder KEYS
|
|
145
|
+
* asks {@link ladderVmKeyMultibases} instead, which applies the library's one
|
|
146
|
+
* key-multibase rule; this reader hands back the methods as resolved, with no
|
|
147
|
+
* fragment check.
|
|
207
148
|
*
|
|
208
149
|
* A method the recognition cannot name -- an embedded `capabilityDelegation`
|
|
209
|
-
* entry carrying no `id`, or a reference nothing backs --
|
|
210
|
-
* here, the same refuse-not-guess answer the id-keyed recognition
|
|
150
|
+
* entry carrying no `id`, or a reference nothing backs -- has no resolved
|
|
151
|
+
* method here, the same refuse-not-guess answer the id-keyed recognition
|
|
152
|
+
* gives. (The key reader names such a reference's key by fragment alone.)
|
|
211
153
|
*
|
|
212
154
|
* @param options {object}
|
|
213
155
|
* @param options.doc {AccountDocument} a locally verified document
|
|
@@ -220,4 +162,55 @@ export function ladderVmMethods({ doc }) {
|
|
|
220
162
|
relation: 'capabilityDelegation'
|
|
221
163
|
}).filter(method => typeof method.id === 'string' && ids.has(method.id));
|
|
222
164
|
}
|
|
165
|
+
/**
|
|
166
|
+
* The enrolled clients' signing-key multibases a document publishes: the
|
|
167
|
+
* keys of its `capabilityInvocation` members, which is the relation an
|
|
168
|
+
* enrolled client publishes its signing key under and a ladder VM, a
|
|
169
|
+
* credential's key-agreement key, a transient annex VM, and the KMS
|
|
170
|
+
* convenience key deliberately do not (`enrolledClientVmIds` is the same
|
|
171
|
+
* convention read as ids). Each member is read under the library's one
|
|
172
|
+
* key-multibase rule (`memberKeyMultibase`): its id fragment and its
|
|
173
|
+
* resolved method's `publicKeyMultibase` must agree when both are present,
|
|
174
|
+
* either alone is the key, and a member whose two readings disagree names no
|
|
175
|
+
* key. The ladder-rung attribution and the account's did:key census both read
|
|
176
|
+
* this set, so a malformed member drops out of both rather than naming a
|
|
177
|
+
* different key in each.
|
|
178
|
+
*
|
|
179
|
+
* @param options {object}
|
|
180
|
+
* @param options.doc {AccountDocument} a locally verified document
|
|
181
|
+
* @returns {Set<string>}
|
|
182
|
+
*/
|
|
183
|
+
export function enrolledClientKeyMultibases({ doc }) {
|
|
184
|
+
return relationKeyMultibases({ doc, relation: 'capabilityInvocation' });
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* The ladder VMs' key multibases a document publishes: the keys of the
|
|
188
|
+
* `capabilityDelegation` members {@link ladderVmIds} recognizes, each read
|
|
189
|
+
* under the same one key-multibase rule as
|
|
190
|
+
* {@link enrolledClientKeyMultibases}. Recognition stays id-keyed, so an
|
|
191
|
+
* id-less embedded delegation member is not a ladder VM here either; a
|
|
192
|
+
* recognized member that is a reference nothing backs names its key by
|
|
193
|
+
* fragment alone.
|
|
194
|
+
*
|
|
195
|
+
* @param options {object}
|
|
196
|
+
* @param options.doc {AccountDocument} a locally verified document
|
|
197
|
+
* @returns {Set<string>}
|
|
198
|
+
*/
|
|
199
|
+
export function ladderVmKeyMultibases({ doc }) {
|
|
200
|
+
const ids = new Set(ladderVmIds({ doc }));
|
|
201
|
+
const keys = new Set();
|
|
202
|
+
for (const member of relationMembers({
|
|
203
|
+
doc,
|
|
204
|
+
relation: 'capabilityDelegation'
|
|
205
|
+
})) {
|
|
206
|
+
if (member.id === undefined || !ids.has(member.id)) {
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
const key = memberKeyMultibase(member);
|
|
210
|
+
if (key !== undefined) {
|
|
211
|
+
keys.add(key);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return keys;
|
|
215
|
+
}
|
|
223
216
|
//# sourceMappingURL=document.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../src/resourceLog/document.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../src/resourceLog/document.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,qBAAqB,EACrB,eAAe,EACf,uBAAuB,EAGxB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAA;AAiD/C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,2BAA2B,CAAC,EAC1C,GAAG,EAGJ;IACC,OAAO,uBAAuB,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC,CAAA;A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;IACC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAA;IACzC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,KAAK,MAAM,MAAM,IAAI,eAAe,CAAC;QACnC,GAAG;QACH,QAAQ,EAAE,sBAAsB;KACjC,CAAC,EAAE,CAAC;QACH,IAAI,MAAM,CAAC,EAAE,KAAK,SAAS,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;YACnD,SAAQ;QACV,CAAC;QACD,MAAM,GAAG,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAA;QACtC,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACf,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ladderRungs.d.ts","sourceRoot":"","sources":["../../src/resourceLog/ladderRungs.ts"],"names":[],"mappings":"AA8DA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAQpE;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;AAErD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,CAU7E;
|
|
1
|
+
{"version":3,"file":"ladderRungs.d.ts","sourceRoot":"","sources":["../../src/resourceLog/ladderRungs.ts"],"names":[],"mappings":"AA8DA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAQpE;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;AAErD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,CAU7E;AAmDD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,8BAA8B,CAClD,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,cAAc,EAAE,CAAC,CAmM3B"}
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
*/
|
|
62
62
|
import { deriveNextKeyHash } from '@interop/did-method-webvh';
|
|
63
63
|
import { vmFragmentOf } from '@interop/vh-resource-log';
|
|
64
|
-
import {
|
|
64
|
+
import { enrolledClientKeyMultibases, ladderVmKeyMultibases } from './document.js';
|
|
65
65
|
/**
|
|
66
66
|
* The update-key multibases that signed one log entry: the fragment of each
|
|
67
67
|
* proof's `did:key:<multibase>#<multibase>` verification method.
|
|
@@ -80,49 +80,6 @@ export function entrySignerKeysOf(entry) {
|
|
|
80
80
|
}
|
|
81
81
|
return keys;
|
|
82
82
|
}
|
|
83
|
-
/**
|
|
84
|
-
* The ladder VMs' key multibases in one entry's document.
|
|
85
|
-
*
|
|
86
|
-
* @param doc {AccountDocument | undefined}
|
|
87
|
-
* @returns {Set<string>}
|
|
88
|
-
*/
|
|
89
|
-
function ladderKeysOf(doc) {
|
|
90
|
-
const keys = new Set();
|
|
91
|
-
if (!doc) {
|
|
92
|
-
return keys;
|
|
93
|
-
}
|
|
94
|
-
for (const method of ladderVmMethods({ doc })) {
|
|
95
|
-
if (typeof method.publicKeyMultibase === 'string') {
|
|
96
|
-
keys.add(method.publicKeyMultibase);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return keys;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* The enrolled clients' signing-key multibases in one entry's document: the
|
|
103
|
-
* `capabilityInvocation` methods, which is what an enrolled client publishes
|
|
104
|
-
* and a ladder VM deliberately does not. Only the SET matters here -- an
|
|
105
|
-
* entry that grows it published a client, and the update key such an entry
|
|
106
|
-
* authorizes is that client's rather than any ladder's rung.
|
|
107
|
-
*
|
|
108
|
-
* @param doc {AccountDocument | undefined}
|
|
109
|
-
* @returns {Set<string>}
|
|
110
|
-
*/
|
|
111
|
-
function enrolledClientKeysOf(doc) {
|
|
112
|
-
const keys = new Set();
|
|
113
|
-
if (!doc) {
|
|
114
|
-
return keys;
|
|
115
|
-
}
|
|
116
|
-
for (const method of resolvedRelationMethods({
|
|
117
|
-
doc,
|
|
118
|
-
relation: 'capabilityInvocation'
|
|
119
|
-
})) {
|
|
120
|
-
if (typeof method.publicKeyMultibase === 'string') {
|
|
121
|
-
keys.add(method.publicKeyMultibase);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
return keys;
|
|
125
|
-
}
|
|
126
83
|
/**
|
|
127
84
|
* The ladder a key is already a rung of, or `undefined` when no ladder holds
|
|
128
85
|
* it. Asked of the revealed key before the anchoring branch runs, since a key
|
|
@@ -202,9 +159,12 @@ export async function attributeLadderRungsPerVersion(log) {
|
|
|
202
159
|
if (entry.parameters?.nextKeyHashes) {
|
|
203
160
|
nextKeyHashes = entry.parameters.nextKeyHashes;
|
|
204
161
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
162
|
+
// The two key classes, read once each per document: an entry that grows
|
|
163
|
+
// the client set published a client, and the update key such an entry
|
|
164
|
+
// authorizes is that client's rather than any ladder's rung.
|
|
165
|
+
const doc = (entry.state ?? {});
|
|
166
|
+
const ladderKeys = ladderVmKeyMultibases({ doc });
|
|
167
|
+
const clientKeys = enrolledClientKeyMultibases({ doc });
|
|
208
168
|
const introduced = addedMembers({
|
|
209
169
|
next: ladderKeys,
|
|
210
170
|
previous: previousLadderKeys
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ladderRungs.js","sourceRoot":"","sources":["../../src/resourceLog/ladderRungs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;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,IAAI,GAAG,CAAC,UAAU,CAAC,CAAA;QACtC,MAAM,QAAQ,GAAmB,IAAI,GAAG,EAAE,CAAA;QAC1C,KAAK,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,aAAa,EAAE,CAAC;YAC/C,MAAM,QAAQ,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,CAChC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAClD,CAAA;YACD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxB,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAA;YAC5C,CAAC;QACH,CAAC;QACD,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACxB,kBAAkB,GAAG,UAAU,CAAA;QAC/B,kBAAkB,GAAG,UAAU,CAAA;QAC/B,kBAAkB,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAA;QACxC,qBAAqB,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,CAAA;IAChD,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The DIDs an account document names, read off a verified log: one walk over
|
|
6
|
+
* every entry, for a wallet that asks "is this DID one of mine". A revoked
|
|
7
|
+
* client's did:key stays public in the log for good, so the sets cover it,
|
|
8
|
+
* and a revision a since-revoked client made still reads as the account's.
|
|
9
|
+
*/
|
|
10
|
+
import type { DIDLog } from '@interop/did-method-webvh';
|
|
11
|
+
/**
|
|
12
|
+
* A wallet client's did:key, from the signing-key multibase the account
|
|
13
|
+
* document lists for it. For an Ed25519 did:key the method-specific id is
|
|
14
|
+
* exactly that multibase, so this is the inverse of
|
|
15
|
+
* `signingKeyMultibaseOfDid` on `/connections`: the id a wallet client's
|
|
16
|
+
* `connections` entry is keyed by. It is the one string
|
|
17
|
+
* {@link clientKeyAgreementController} writes as the controller marker, read
|
|
18
|
+
* under the name a directory consumer asks for.
|
|
19
|
+
*
|
|
20
|
+
* @param options {object}
|
|
21
|
+
* @param options.signingKeyMultibase {string}
|
|
22
|
+
* @returns {string}
|
|
23
|
+
*/
|
|
24
|
+
export declare function walletClientDid({ signingKeyMultibase }: {
|
|
25
|
+
signingKeyMultibase: string;
|
|
26
|
+
}): string;
|
|
27
|
+
/**
|
|
28
|
+
* Every did:key the account log's documents name across every entry: each
|
|
29
|
+
* enrolled client's ({@link enrolledClientKeyMultibases}) and each ladder
|
|
30
|
+
* VM's ({@link ladderVmKeyMultibases}) bare did:key, from the key multibase
|
|
31
|
+
* the shared readers name for the method. A member the readers name no key
|
|
32
|
+
* for (no fragment and no `publicKeyMultibase`, or the two disagreeing) is
|
|
33
|
+
* skipped, the same answer the ladder-rung attribution gives it. An entry
|
|
34
|
+
* carrying no document state is skipped too.
|
|
35
|
+
*
|
|
36
|
+
* @param options {object}
|
|
37
|
+
* @param options.log {DIDLog} the VERIFIED account log
|
|
38
|
+
* @returns {{ clientDids: Set<string>; ladderDids: Set<string> }}
|
|
39
|
+
*/
|
|
40
|
+
export declare function accountLogDids({ log }: {
|
|
41
|
+
log: DIDLog;
|
|
42
|
+
}): {
|
|
43
|
+
clientDids: Set<string>;
|
|
44
|
+
ladderDids: Set<string>;
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=documentDids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentDids.d.ts","sourceRoot":"","sources":["../../src/webvh/documentDids.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;GAKG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAQvD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,EAC9B,mBAAmB,EACpB,EAAE;IACD,mBAAmB,EAAE,MAAM,CAAA;CAC5B,GAAG,MAAM,CAET;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG;IACxD,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACvB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CACxB,CAiBA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { enrolledClientKeyMultibases, ladderVmKeyMultibases } from '../resourceLog/document.js';
|
|
2
|
+
import { clientKeyAgreementController } from './didWebvh.js';
|
|
3
|
+
/**
|
|
4
|
+
* A wallet client's did:key, from the signing-key multibase the account
|
|
5
|
+
* document lists for it. For an Ed25519 did:key the method-specific id is
|
|
6
|
+
* exactly that multibase, so this is the inverse of
|
|
7
|
+
* `signingKeyMultibaseOfDid` on `/connections`: the id a wallet client's
|
|
8
|
+
* `connections` entry is keyed by. It is the one string
|
|
9
|
+
* {@link clientKeyAgreementController} writes as the controller marker, read
|
|
10
|
+
* under the name a directory consumer asks for.
|
|
11
|
+
*
|
|
12
|
+
* @param options {object}
|
|
13
|
+
* @param options.signingKeyMultibase {string}
|
|
14
|
+
* @returns {string}
|
|
15
|
+
*/
|
|
16
|
+
export function walletClientDid({ signingKeyMultibase }) {
|
|
17
|
+
return clientKeyAgreementController({ signingKeyMultibase });
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Every did:key the account log's documents name across every entry: each
|
|
21
|
+
* enrolled client's ({@link enrolledClientKeyMultibases}) and each ladder
|
|
22
|
+
* VM's ({@link ladderVmKeyMultibases}) bare did:key, from the key multibase
|
|
23
|
+
* the shared readers name for the method. A member the readers name no key
|
|
24
|
+
* for (no fragment and no `publicKeyMultibase`, or the two disagreeing) is
|
|
25
|
+
* skipped, the same answer the ladder-rung attribution gives it. An entry
|
|
26
|
+
* carrying no document state is skipped too.
|
|
27
|
+
*
|
|
28
|
+
* @param options {object}
|
|
29
|
+
* @param options.log {DIDLog} the VERIFIED account log
|
|
30
|
+
* @returns {{ clientDids: Set<string>; ladderDids: Set<string> }}
|
|
31
|
+
*/
|
|
32
|
+
export function accountLogDids({ log }) {
|
|
33
|
+
const clientDids = new Set();
|
|
34
|
+
const ladderDids = new Set();
|
|
35
|
+
const addDids = (target, keys) => {
|
|
36
|
+
for (const signingKeyMultibase of keys) {
|
|
37
|
+
target.add(walletClientDid({ signingKeyMultibase }));
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
for (const entry of log) {
|
|
41
|
+
const doc = entry?.state;
|
|
42
|
+
if (doc === undefined || doc === null) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
addDids(clientDids, enrolledClientKeyMultibases({ doc }));
|
|
46
|
+
addDids(ladderDids, ladderVmKeyMultibases({ doc }));
|
|
47
|
+
}
|
|
48
|
+
return { clientDids, ladderDids };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=documentDids.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentDids.js","sourceRoot":"","sources":["../../src/webvh/documentDids.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EAEtB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAA;AAE5D;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,mBAAmB,EAGpB;IACC,OAAO,4BAA4B,CAAC,EAAE,mBAAmB,EAAE,CAAC,CAAA;AAC9D,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,GAAG,EAAmB;IAIrD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAA;IACpC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAA;IACpC,MAAM,OAAO,GAAG,CAAC,MAAmB,EAAE,IAAiB,EAAE,EAAE;QACzD,KAAK,MAAM,mBAAmB,IAAI,IAAI,EAAE,CAAC;YACvC,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAA;QACtD,CAAC;IACH,CAAC,CAAA;IACD,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE,CAAC;QACxB,MAAM,GAAG,GAAG,KAAK,EAAE,KAA2C,CAAA;QAC9D,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YACtC,SAAQ;QACV,CAAC;QACD,OAAO,CAAC,UAAU,EAAE,2BAA2B,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAA;QACzD,OAAO,CAAC,UAAU,EAAE,qBAAqB,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAA;IACrD,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAA;AACnC,CAAC"}
|
package/dist/webvh/index.d.ts
CHANGED
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
* - `enrolledClientVmIds` / `isLastEnrolledClient` -- the one read of which
|
|
27
27
|
* methods are enrolled clients, and the last-client rule over it, which the
|
|
28
28
|
* plain forget, the last-client transition, and the listing all decide on.
|
|
29
|
+
* - `accountLogDids` / `walletClientDid` -- the did:keys the account log's
|
|
30
|
+
* documents name across every entry (each enrolled client's, each ladder
|
|
31
|
+
* VM's), for a wallet asking whether a DID is one of its own, and the
|
|
32
|
+
* did:key a signing-key multibase names (the inverse of `/connections`'
|
|
33
|
+
* `signingKeyMultibaseOfDid`).
|
|
29
34
|
* - `ladderVmIds` / `relationIds` / `resolvedKeyAgreementMethods` /
|
|
30
35
|
* `credentialKeyAgreementMethods` -- the account-document reading
|
|
31
36
|
* conventions, defined once in the dependency-free leaf beside the
|
|
@@ -98,8 +103,9 @@ export { delegationAtExpiry, delegationExpired, delegationProofKeyId, delegation
|
|
|
98
103
|
export { attributeClientUpdateKey, delegationKeyInDocument, documentKeyMultibases, enrolledClientVmIds, isLastEnrolledClient, listEnrolledWebvhClients, markedKeyAgreementMethods, markedKeyAgreementMultibases } from './listClients.js';
|
|
99
104
|
export type { EnrolledWebvhClient, PublishedKeyDocument } from './listClients.js';
|
|
100
105
|
export { mergeVerificationMethods } from './mergeMethods.js';
|
|
106
|
+
export { accountLogDids, walletClientDid } from './documentDids.js';
|
|
101
107
|
export type { RelationMembership } from './mergeMethods.js';
|
|
102
|
-
export { credentialKeyAgreementMethods, introducedCredentialKeys, ladderVmIds, relationIds, resolvedKeyAgreementMethods, retiredCredentialKeys } from '../resourceLog/document.js';
|
|
108
|
+
export { credentialKeyAgreementMethods, enrolledClientKeyMultibases, introducedCredentialKeys, ladderVmIds, ladderVmKeyMultibases, relationIds, resolvedKeyAgreementMethods, retiredCredentialKeys } from '../resourceLog/document.js';
|
|
103
109
|
export type { KeyAgreementDocument, ResolvedKeyAgreementMethod } from '../resourceLog/document.js';
|
|
104
110
|
export { revokeWebvhClient, StagedCommitmentAmbiguousError } from './revokeClient.js';
|
|
105
111
|
export { enrollWebvhClient } from './enrollClient.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/webvh/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/webvh/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AACH,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,oBAAoB,EACpB,4BAA4B,EAC5B,oBAAoB,EACpB,0BAA0B,EAC1B,cAAc,EACd,sBAAsB,EACtB,yBAAyB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ACzB,gBAAgB,EAChB,UAAU,EACV,oBAAoB,EACpB,WAAW,EACX,eAAe,EAChB,MAAM,WAAW,CAAA;AAClB,YAAY,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA"}
|
package/dist/webvh/index.js
CHANGED
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
* - `enrolledClientVmIds` / `isLastEnrolledClient` -- the one read of which
|
|
27
27
|
* methods are enrolled clients, and the last-client rule over it, which the
|
|
28
28
|
* plain forget, the last-client transition, and the listing all decide on.
|
|
29
|
+
* - `accountLogDids` / `walletClientDid` -- the did:keys the account log's
|
|
30
|
+
* documents name across every entry (each enrolled client's, each ladder
|
|
31
|
+
* VM's), for a wallet asking whether a DID is one of its own, and the
|
|
32
|
+
* did:key a signing-key multibase names (the inverse of `/connections`'
|
|
33
|
+
* `signingKeyMultibaseOfDid`).
|
|
29
34
|
* - `ladderVmIds` / `relationIds` / `resolvedKeyAgreementMethods` /
|
|
30
35
|
* `credentialKeyAgreementMethods` -- the account-document reading
|
|
31
36
|
* conventions, defined once in the dependency-free leaf beside the
|
|
@@ -94,7 +99,8 @@ export { delegatedWebvhLogStore } from './delegatedLogStore.js';
|
|
|
94
99
|
export { delegationAtExpiry, delegationExpired, delegationProofKeyId, delegationSignerGone, recordedZcapStale, REVOCATION_CLOCK_SKEW_MS, STANDING_ZCAP_TTL_MS, standingZcapStale, ZCAP_RENEWAL_WINDOW_MS, zcapExpiring } from './standingZcap.js';
|
|
95
100
|
export { attributeClientUpdateKey, delegationKeyInDocument, documentKeyMultibases, enrolledClientVmIds, isLastEnrolledClient, listEnrolledWebvhClients, markedKeyAgreementMethods, markedKeyAgreementMultibases } from './listClients.js';
|
|
96
101
|
export { mergeVerificationMethods } from './mergeMethods.js';
|
|
97
|
-
export {
|
|
102
|
+
export { accountLogDids, walletClientDid } from './documentDids.js';
|
|
103
|
+
export { credentialKeyAgreementMethods, enrolledClientKeyMultibases, introducedCredentialKeys, ladderVmIds, ladderVmKeyMultibases, relationIds, resolvedKeyAgreementMethods, retiredCredentialKeys } from '../resourceLog/document.js';
|
|
98
104
|
export { revokeWebvhClient, StagedCommitmentAmbiguousError } from './revokeClient.js';
|
|
99
105
|
export { enrollWebvhClient } from './enrollClient.js';
|
|
100
106
|
export { ladderRung, ladderRungSeed, ladderVmKeyMultibase, ladderVmSeed } from './ladderDerivation.js';
|
package/dist/webvh/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/webvh/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/webvh/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AACH,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,oBAAoB,EACpB,4BAA4B,EAC5B,oBAAoB,EACpB,0BAA0B,EAC1B,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,EAC5B,yBAAyB,EACzB,oBAAoB,EACpB,UAAU,EACV,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAEnE,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB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/wallet-core",
|
|
3
3
|
"description": "Shared wallet-domain logic (WAS sync engine core and wallet Space layout contracts) for Interop wallet apps.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.99.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "pnpm run clear && tsc",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@interop/ed25519-verification-key": "^8.2.1",
|
|
28
28
|
"@interop/ezcap": "^7.5.0",
|
|
29
29
|
"@interop/social-core": "^0.8.1",
|
|
30
|
-
"@interop/vh-resource-log": "^0.
|
|
30
|
+
"@interop/vh-resource-log": "^0.6.0",
|
|
31
31
|
"@interop/x25519-key-agreement-key": "^5.4.1",
|
|
32
32
|
"@noble/ciphers": "^2.3.0",
|
|
33
33
|
"@noble/hashes": "^2.3.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@eslint/js": "^10.0.1",
|
|
39
39
|
"@interop/logger": "^0.2.0",
|
|
40
40
|
"@interop/storage-core": "^0.26.0",
|
|
41
|
-
"@interop/was-client": "^0.
|
|
41
|
+
"@interop/was-client": "^0.85.0",
|
|
42
42
|
"@playwright/test": "^1.60.0",
|
|
43
43
|
"@types/node": "^26.0.1",
|
|
44
44
|
"@vitest/coverage-v8": "^4.1.7",
|