@interop/wallet-core 0.40.0 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/README.md +17 -3
  2. package/dist/clients/listing.d.ts +4 -3
  3. package/dist/clients/listing.d.ts.map +1 -1
  4. package/dist/clients/listing.js.map +1 -1
  5. package/dist/clients/policy.d.ts +3 -2
  6. package/dist/clients/policy.d.ts.map +1 -1
  7. package/dist/clients/policy.js +3 -3
  8. package/dist/clients/policy.js.map +1 -1
  9. package/dist/clients/revocation.d.ts +14 -4
  10. package/dist/clients/revocation.d.ts.map +1 -1
  11. package/dist/clients/revocation.js +29 -14
  12. package/dist/clients/revocation.js.map +1 -1
  13. package/dist/clients/rosterPolicy.d.ts +22 -15
  14. package/dist/clients/rosterPolicy.d.ts.map +1 -1
  15. package/dist/clients/rosterPolicy.js +32 -15
  16. package/dist/clients/rosterPolicy.js.map +1 -1
  17. package/dist/descriptors/index.d.ts +1 -1
  18. package/dist/descriptors/index.d.ts.map +1 -1
  19. package/dist/descriptors/index.js +1 -1
  20. package/dist/descriptors/index.js.map +1 -1
  21. package/dist/descriptors/logSource.d.ts +58 -6
  22. package/dist/descriptors/logSource.d.ts.map +1 -1
  23. package/dist/descriptors/logSource.js +57 -15
  24. package/dist/descriptors/logSource.js.map +1 -1
  25. package/dist/enrollment/enrollment.d.ts +30 -2
  26. package/dist/enrollment/enrollment.d.ts.map +1 -1
  27. package/dist/enrollment/enrollment.js +58 -30
  28. package/dist/enrollment/enrollment.js.map +1 -1
  29. package/dist/enrollment/index.d.ts +4 -1
  30. package/dist/enrollment/index.d.ts.map +1 -1
  31. package/dist/enrollment/index.js +4 -1
  32. package/dist/enrollment/index.js.map +1 -1
  33. package/dist/keyring/fetch.d.ts +12 -0
  34. package/dist/keyring/fetch.d.ts.map +1 -1
  35. package/dist/keyring/fetch.js +0 -2
  36. package/dist/keyring/fetch.js.map +1 -1
  37. package/dist/keyring/index.d.ts +7 -6
  38. package/dist/keyring/index.d.ts.map +1 -1
  39. package/dist/keyring/index.js +7 -6
  40. package/dist/keyring/index.js.map +1 -1
  41. package/dist/keyring/kdf.d.ts +22 -6
  42. package/dist/keyring/kdf.d.ts.map +1 -1
  43. package/dist/keyring/kdf.js +9 -14
  44. package/dist/keyring/kdf.js.map +1 -1
  45. package/dist/keyring/record.d.ts +30 -10
  46. package/dist/keyring/record.d.ts.map +1 -1
  47. package/dist/keyring/record.js +31 -15
  48. package/dist/keyring/record.js.map +1 -1
  49. package/dist/keys/index.d.ts +5 -3
  50. package/dist/keys/index.d.ts.map +1 -1
  51. package/dist/keys/index.js +3 -2
  52. package/dist/keys/index.js.map +1 -1
  53. package/dist/keys/rosterLogStore.d.ts +22 -2
  54. package/dist/keys/rosterLogStore.d.ts.map +1 -1
  55. package/dist/keys/rosterLogStore.js +40 -20
  56. package/dist/keys/rosterLogStore.js.map +1 -1
  57. package/dist/keys/rosterStore.d.ts +13 -1
  58. package/dist/keys/rosterStore.d.ts.map +1 -1
  59. package/dist/keys/rosterStore.js +18 -0
  60. package/dist/keys/rosterStore.js.map +1 -1
  61. package/dist/keys/userKeyCascade.d.ts +10 -3
  62. package/dist/keys/userKeyCascade.d.ts.map +1 -1
  63. package/dist/keys/userKeyCascade.js +10 -4
  64. package/dist/keys/userKeyCascade.js.map +1 -1
  65. package/dist/keys/userKeyRoster.d.ts +29 -21
  66. package/dist/keys/userKeyRoster.d.ts.map +1 -1
  67. package/dist/keys/userKeyRoster.js +47 -23
  68. package/dist/keys/userKeyRoster.js.map +1 -1
  69. package/dist/recovery/index.d.ts +21 -11
  70. package/dist/recovery/index.d.ts.map +1 -1
  71. package/dist/recovery/index.js +19 -10
  72. package/dist/recovery/index.js.map +1 -1
  73. package/dist/recovery/recoveryCode.d.ts +5 -17
  74. package/dist/recovery/recoveryCode.d.ts.map +1 -1
  75. package/dist/recovery/recoveryCode.js +4 -14
  76. package/dist/recovery/recoveryCode.js.map +1 -1
  77. package/dist/recovery/recoveryDelegation.d.ts +151 -0
  78. package/dist/recovery/recoveryDelegation.d.ts.map +1 -0
  79. package/dist/recovery/recoveryDelegation.js +261 -0
  80. package/dist/recovery/recoveryDelegation.js.map +1 -0
  81. package/dist/recovery/recoveryWebvh.d.ts +13 -22
  82. package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
  83. package/dist/recovery/recoveryWebvh.js +53 -139
  84. package/dist/recovery/recoveryWebvh.js.map +1 -1
  85. package/dist/resourceLog/append.d.ts +12 -3
  86. package/dist/resourceLog/append.d.ts.map +1 -1
  87. package/dist/resourceLog/append.js +17 -10
  88. package/dist/resourceLog/append.js.map +1 -1
  89. package/dist/resourceLog/index.d.ts +1 -1
  90. package/dist/resourceLog/index.d.ts.map +1 -1
  91. package/dist/resourceLog/index.js +1 -1
  92. package/dist/resourceLog/index.js.map +1 -1
  93. package/dist/resourceLog/pin.d.ts +46 -8
  94. package/dist/resourceLog/pin.d.ts.map +1 -1
  95. package/dist/resourceLog/pin.js +32 -7
  96. package/dist/resourceLog/pin.js.map +1 -1
  97. package/dist/resourceLog/seal.d.ts +4 -1
  98. package/dist/resourceLog/seal.d.ts.map +1 -1
  99. package/dist/resourceLog/seal.js +6 -2
  100. package/dist/resourceLog/seal.js.map +1 -1
  101. package/dist/unlock/index.d.ts +40 -0
  102. package/dist/unlock/index.d.ts.map +1 -0
  103. package/dist/unlock/index.js +36 -0
  104. package/dist/unlock/index.js.map +1 -0
  105. package/dist/unlock/ladder.d.ts +100 -0
  106. package/dist/unlock/ladder.d.ts.map +1 -0
  107. package/dist/unlock/ladder.js +144 -0
  108. package/dist/unlock/ladder.js.map +1 -0
  109. package/dist/unlock/selfEnroll.d.ts +83 -0
  110. package/dist/unlock/selfEnroll.d.ts.map +1 -0
  111. package/dist/unlock/selfEnroll.js +126 -0
  112. package/dist/unlock/selfEnroll.js.map +1 -0
  113. package/dist/unlock/standingClient.d.ts +68 -0
  114. package/dist/unlock/standingClient.d.ts.map +1 -0
  115. package/dist/unlock/standingClient.js +81 -0
  116. package/dist/unlock/standingClient.js.map +1 -0
  117. package/dist/unlock/standingWebvh.d.ts +153 -0
  118. package/dist/unlock/standingWebvh.d.ts.map +1 -0
  119. package/dist/unlock/standingWebvh.js +370 -0
  120. package/dist/unlock/standingWebvh.js.map +1 -0
  121. package/dist/unlock/unlockRecord.d.ts +207 -0
  122. package/dist/unlock/unlockRecord.d.ts.map +1 -0
  123. package/dist/unlock/unlockRecord.js +435 -0
  124. package/dist/unlock/unlockRecord.js.map +1 -0
  125. package/dist/webvh/didWebvh.d.ts +166 -7
  126. package/dist/webvh/didWebvh.d.ts.map +1 -1
  127. package/dist/webvh/didWebvh.js +286 -31
  128. package/dist/webvh/didWebvh.js.map +1 -1
  129. package/dist/webvh/index.d.ts +15 -3
  130. package/dist/webvh/index.d.ts.map +1 -1
  131. package/dist/webvh/index.js +14 -3
  132. package/dist/webvh/index.js.map +1 -1
  133. package/dist/webvh/keyAgreement.d.ts +72 -0
  134. package/dist/webvh/keyAgreement.d.ts.map +1 -0
  135. package/dist/webvh/keyAgreement.js +47 -0
  136. package/dist/webvh/keyAgreement.js.map +1 -0
  137. package/dist/webvh/listClients.d.ts +69 -20
  138. package/dist/webvh/listClients.d.ts.map +1 -1
  139. package/dist/webvh/listClients.js +102 -14
  140. package/dist/webvh/listClients.js.map +1 -1
  141. package/dist/webvh/revokeClient.d.ts +21 -11
  142. package/dist/webvh/revokeClient.d.ts.map +1 -1
  143. package/dist/webvh/revokeClient.js +31 -14
  144. package/dist/webvh/revokeClient.js.map +1 -1
  145. package/dist/webvh/verifyLog.d.ts +15 -2
  146. package/dist/webvh/verifyLog.d.ts.map +1 -1
  147. package/dist/webvh/verifyLog.js +22 -3
  148. package/dist/webvh/verifyLog.js.map +1 -1
  149. package/package.json +11 -5
  150. package/dist/recovery/recoveryRecord.d.ts +0 -171
  151. package/dist/recovery/recoveryRecord.d.ts.map +0 -1
  152. package/dist/recovery/recoveryRecord.js +0 -290
  153. package/dist/recovery/recoveryRecord.js.map +0 -1
@@ -1,290 +0,0 @@
1
- /*!
2
- * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
- */
4
- /**
5
- * The recovery keyring record codec: the `{ version, encryption, wrapped,
6
- * binding, proof }` envelope stored as the one resource of a recovery code's
7
- * unlock Space. Its plaintext is the ordinary keyring record's (controller,
8
- * account pointer) PLUS the pre-minted PUT-on-`did.jsonl` delegation -- the
9
- * narrow zcap bridge that lets the code-derived client write its
10
- * self-enrolling log continuation. It carries **no key material of any
11
- * kind**: never a seed, never a user key wrap (wraps live doc-and-roster
12
- * only), so the record stays a pure pointer.
13
- *
14
- * The wrap reuses the keyring record construction (cipher context,
15
- * record-own epoch, and signed frame alike), so a recovery record IS a
16
- * keyring record to every generic consumer -- only the recovery flow demands
17
- * the delegation and the binding.
18
- *
19
- * The record splits into a code-authenticated core and a re-mintable shell.
20
- * The core is the account binding `{ controller, pointer }`, authenticated by
21
- * the `binding` frame member: an HMAC tag under a key derived from the code
22
- * bytes, computed at issuance and verified at recovery BEFORE the pointer is
23
- * trusted. Only the issuer and the code holder ever hold that key -- the
24
- * storage host never does -- so a host-forged record pointing recovery at
25
- * another account fails the tag however it is encrypted or signed. The tag
26
- * rides the frame in the clear (it reveals nothing) so the re-mint path,
27
- * which cannot decrypt the record or recompute the tag, preserves it
28
- * verbatim; the binding values themselves stay inside the plaintext. The
29
- * consequence: a re-mint can never change the pointer, and an account that
30
- * moves hosts must re-issue its codes.
31
- *
32
- * The shell is the delegation and the frame proof, and its signer is mixed.
33
- * At issuance the record is signed by the code-derived unlock key, the one a
34
- * typed code re-derives, so recovery verifies the proof before decrypting.
35
- * The revocation cascade's re-mint path holds only the code's KAK public
36
- * half plus an enrolled client's account key, so it re-PUTs the record
37
- * signed by that client's account verification method instead. This codec is
38
- * agnostic -- it signs with what it is given -- and the reader carries the
39
- * policy: a proof by the expected unlock key verifies up front, and anything
40
- * else comes back marked unverified, for the caller to check against the
41
- * verified did:webvh document of the account the code-authenticated pointer
42
- * names.
43
- */
44
- import { base64urlnopad } from '@scure/base';
45
- import { equalBytes } from '@noble/ciphers/utils.js';
46
- import { hmac } from '@noble/hashes/hmac.js';
47
- import { sha256 } from '@noble/hashes/sha2.js';
48
- import { KEYRING_RECORD_VERSION, mintRecordEncryption, parseRecordCreatedAt, parseRecordFrame, parseRecordPointer, recordCipher, recordCreatedAtStamp, recordProofKeyMultibase, signRecordFrame, verifyRecordProof } from '../keyring/record.js';
49
- /**
50
- * The context label mixed into the binding MAC input, versioning the tag
51
- * construction. Permanent -- changing it orphans every issued code.
52
- */
53
- const RECOVERY_BINDING_CONTEXT = 'freewallet/recovery/binding/v1';
54
- /**
55
- * A recovery record's account binding is absent, malformed, or does not
56
- * verify under the typed code's binding MAC key. Its own class, distinct from
57
- * a proof or decrypt failure: this is the refusal that says the record's
58
- * `{ controller, pointer }` core was not written by a holder of this code --
59
- * a forged record redirecting recovery at another account, or a record from
60
- * before the account moved hosts (either way the code cannot recover here
61
- * and must be re-issued).
62
- */
63
- export class RecoveryBindingError extends Error {
64
- constructor(message) {
65
- super(message);
66
- this.name = 'RecoveryBindingError';
67
- }
68
- }
69
- /**
70
- * The deterministic MAC input over a record's account binding: a JSON array
71
- * of the context label and the binding values, so no delimiter ambiguity can
72
- * make two bindings collide.
73
- */
74
- function bindingMacInput({ controller, pointer }) {
75
- return new TextEncoder().encode(JSON.stringify([
76
- RECOVERY_BINDING_CONTEXT,
77
- controller,
78
- pointer.did ?? '',
79
- pointer.spaceId,
80
- pointer.host
81
- ]));
82
- }
83
- /**
84
- * Computes the account-binding tag: HMAC-SHA-256 over the binding values
85
- * under the code-derived binding MAC key, base64url (no pad). Issuance calls
86
- * it to stamp the record; recovery recomputes it to verify.
87
- *
88
- * @param options {object}
89
- * @param options.bindingMacKey {Uint8Array} the code-derived MAC key
90
- * @param options.controller {string} the account did:key
91
- * @param options.pointer {AccountPointer} the account pointer
92
- * @returns {string}
93
- */
94
- export function computeRecoveryBinding({ bindingMacKey, controller, pointer }) {
95
- return base64urlnopad.encode(hmac(sha256, bindingMacKey, bindingMacInput({ controller, pointer })));
96
- }
97
- /**
98
- * Reads the `binding` frame member off a stored recovery record without
99
- * decrypting anything. The re-mint path uses it to carry the tag forward
100
- * verbatim -- it cannot recompute the tag (no code bytes) and does not need
101
- * to. Refuses a record with no binding: such a record predates the
102
- * code-authenticated core and cannot be re-minted -- its code must be
103
- * re-issued.
104
- *
105
- * @param options {object}
106
- * @param options.record {unknown} the stored record envelope
107
- * @returns {string}
108
- */
109
- export function recoveryRecordBinding({ record }) {
110
- const { binding } = (record ?? {});
111
- if (typeof binding !== 'string' || !binding) {
112
- throw new RecoveryBindingError('The recovery record carries no code-authenticated account binding; ' +
113
- 'the recovery code must be re-issued.');
114
- }
115
- return binding;
116
- }
117
- /**
118
- * Wraps the recovery record: controller, pointer, and the pre-minted
119
- * `did.jsonl` PUT delegation, encrypted under the code's unlock KAK via the
120
- * keyring EDV cipher context, then signed into the same frame the keyring
121
- * record uses -- with the account-binding tag as one more frame member the
122
- * proof covers. Issuance passes the code-derived `bindingMacKey` (the tag is
123
- * computed here) and the code-derived unlock signer; the revocation cascade's
124
- * re-mint path passes the standing record's `binding` verbatim and an
125
- * enrolled client's account signer (see this module's header for the policy
126
- * the reader applies to the two). Exactly one of the two binding inputs must
127
- * be given.
128
- *
129
- * @param options {object}
130
- * @param options.controller {string} the account did:key
131
- * @param options.pointer {AccountPointer} the account pointer
132
- * @param options.delegation {IZcap} the PUT-on-`did.jsonl` delegation to the
133
- * code-derived signing DID
134
- * @param options.keyAgreementKey {IKeyAgreementKey} the code's unlock KAK
135
- * @param options.keyResolver {IKeyResolver}
136
- * @param options.signer {RecordSigner} the signing key: the code's unlock
137
- * key at issuance, an enrolled client's account key on a re-mint
138
- * @param [options.bindingMacKey] {Uint8Array} the code-derived binding MAC
139
- * key -- the issuance path, which computes the tag
140
- * @param [options.binding] {string} the standing record's tag, carried
141
- * forward verbatim -- the re-mint path, which cannot recompute it
142
- * @param [options.createdAt] {string} the bind timestamp to stamp, as an ISO
143
- * string; defaults to now. Supplied by a caller that pins record freshness.
144
- * @returns {Promise<SignedRecoveryRecord>}
145
- */
146
- export async function wrapRecoveryRecord({ controller, pointer, delegation, keyAgreementKey, keyResolver, signer, bindingMacKey, binding, createdAt }) {
147
- if ((bindingMacKey === undefined) === (binding === undefined)) {
148
- throw new Error('Exactly one of bindingMacKey (issuance) or binding (re-mint) is ' +
149
- 'required.');
150
- }
151
- const tag = bindingMacKey !== undefined
152
- ? computeRecoveryBinding({ bindingMacKey, controller, pointer })
153
- : binding;
154
- const encryption = await mintRecordEncryption({ keyAgreementKey });
155
- const cipher = await recordCipher({
156
- keyAgreementKey,
157
- keyResolver,
158
- encryption
159
- });
160
- const data = {
161
- controller,
162
- pointer: {
163
- ...(pointer.did ? { did: pointer.did } : {}),
164
- spaceId: pointer.spaceId,
165
- host: pointer.host
166
- },
167
- delegation,
168
- createdAt: recordCreatedAtStamp({ createdAt })
169
- };
170
- const { envelope } = await cipher.encrypt({
171
- data: data
172
- });
173
- return (await signRecordFrame({
174
- version: KEYRING_RECORD_VERSION,
175
- encryption,
176
- wrapped: envelope,
177
- signer,
178
- members: { binding: tag }
179
- }));
180
- }
181
- /**
182
- * Unwraps and validates a recovery record: the ordinary keyring-record checks
183
- * plus the required pointer, delegation, and account binding. A record
184
- * without a delegation is not a recovery record (an ordinary keyring record
185
- * found under a code's unlock Space would mean a corrupted issuance) and is
186
- * refused.
187
- *
188
- * The account binding is verified before the contents are returned: the
189
- * decrypted `{ controller, pointer }` must carry the tag the code-derived
190
- * MAC key computes over them, or the record is refused as forged
191
- * ({@link RecoveryBindingError}) -- the check that closes the host-forgery
192
- * redirect, since the host never holds the MAC key. Nothing downstream may
193
- * trust the pointer before this returns.
194
- *
195
- * Proof verification is mixed-signer and ordered deliberately. A proof by the
196
- * code's own unlock key is verified BEFORE decryption -- the strong path,
197
- * where the typed code alone establishes what may have signed the record. A
198
- * proof by any other key can only be checked after decryption, because the
199
- * re-minting client is knowable only once the code-authenticated pointer says
200
- * which account this is and that account's log has been verified; the
201
- * contents come back with a pending proof state naming the signer, and the
202
- * caller completes the check with {@link verifyRecordProof} against the
203
- * document's keys. That second phase is what makes an unexpected signer
204
- * refuse: a record whose proof belongs to neither class ends in a
205
- * `RecordProofError` there.
206
- *
207
- * @param options {object}
208
- * @param options.record {unknown} the stored `{ version, encryption,
209
- * wrapped, binding, proof }` envelope
210
- * @param options.keyAgreementKey {IKeyAgreementKey} the code's unlock KAK
211
- * @param options.keyResolver {IKeyResolver}
212
- * @param options.expectedKeyMultibase {string} the code-derived unlock
213
- * signing key's multibase
214
- * @param options.bindingMacKey {Uint8Array} the code-derived binding MAC
215
- * key the record's account binding must verify under
216
- * @returns {Promise<{ contents: RecoveryRecordContents,
217
- * proofState: RecoveryRecordProofState }>}
218
- */
219
- export async function unwrapRecoveryRecord({ record, keyAgreementKey, keyResolver, expectedKeyMultibase, bindingMacKey }) {
220
- const { encryption, wrapped, proof } = parseRecordFrame({
221
- record,
222
- label: 'recovery'
223
- });
224
- const binding = recoveryRecordBinding({ record });
225
- // `parseRecordFrame` shape-checks the proof of a current-version frame, so
226
- // it is present here.
227
- const verificationMethod = proof.verificationMethod;
228
- const keyMultibase = recordProofKeyMultibase({
229
- verificationMethod,
230
- label: 'recovery'
231
- });
232
- let proofState = {
233
- pending: { verificationMethod, keyMultibase }
234
- };
235
- if (keyMultibase === expectedKeyMultibase) {
236
- await verifyRecordProof({
237
- record,
238
- allowedKeyMultibases: expectedKeyMultibase,
239
- label: 'recovery'
240
- });
241
- proofState = 'verified';
242
- }
243
- const cipher = await recordCipher({
244
- keyAgreementKey,
245
- keyResolver,
246
- encryption
247
- });
248
- const plaintext = (await cipher.decrypt({
249
- envelope: wrapped
250
- }));
251
- if (typeof plaintext.controller !== 'string' || !plaintext.controller) {
252
- throw new Error('Recovery record is missing a controller.');
253
- }
254
- const pointer = parseRecordPointer(plaintext.pointer);
255
- if (!pointer) {
256
- throw new Error('Recovery record is missing its account pointer.');
257
- }
258
- if (plaintext.delegation === null ||
259
- typeof plaintext.delegation !== 'object') {
260
- throw new Error('Recovery record is missing its did.jsonl delegation.');
261
- }
262
- const createdAt = parseRecordCreatedAt({
263
- value: plaintext.createdAt,
264
- label: 'Recovery'
265
- });
266
- const expectedTag = hmac(sha256, bindingMacKey, bindingMacInput({ controller: plaintext.controller, pointer }));
267
- let servedTag;
268
- try {
269
- servedTag = base64urlnopad.decode(binding);
270
- }
271
- catch {
272
- servedTag = null;
273
- }
274
- // `equalBytes` is @noble/ciphers' authentication-tag comparison (no early
275
- // exit), so the check leaks nothing through timing.
276
- if (servedTag === null || !equalBytes(servedTag, expectedTag)) {
277
- throw new RecoveryBindingError("The recovery record's account binding does not verify under this " +
278
- 'code; the record is refused as forged.');
279
- }
280
- return {
281
- contents: {
282
- controller: plaintext.controller,
283
- pointer,
284
- delegation: plaintext.delegation,
285
- createdAt
286
- },
287
- proofState
288
- };
289
- }
290
- //# sourceMappingURL=recoveryRecord.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recoveryRecord.js","sourceRoot":"","sources":["../../src/recovery/recoveryRecord.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAM9C,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EAClB,MAAM,sBAAsB,CAAA;AAO7B;;;GAGG;AACH,MAAM,wBAAwB,G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