@did-btcr2/method 0.62.0 → 0.63.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.
@@ -1,5 +1,5 @@
1
1
  import { getNetwork } from '@did-btcr2/bitcoin';
2
- import { canonicalHash, canonicalHashBytes, canonicalize, DateUtils, encode as encodeHash, decode as decodeHash, INTERNAL_ERROR, INVALID_DID, INVALID_DID_UPDATE, INVALID_OPTIONS, JSONPatch, JSONUtils, LATE_PUBLISHING_ERROR, ResolveError } from '@did-btcr2/common';
2
+ import { canonicalHash, canonicalHashBytes, canonicalize, DateUtils, encode as encodeHash, decode as decodeHash, INTERNAL_ERROR, INVALID_DID, INVALID_DID_UPDATE, INVALID_OPTIONS, JSONPatch, JSONUtils, LATE_PUBLISHING_ERROR, NOT_FOUND, ResolveError } from '@did-btcr2/common';
3
3
  import { BTCR2_UPDATE_CONTEXT, isBtcr2UpdateContext } from './btcr2-update.js';
4
4
  import { BIP340Cryptosuite, BIP340DataIntegrityProof, SchnorrMultikey } from '@did-btcr2/cryptosuite';
5
5
  import { CompressedSecp256k1PublicKey } from '@did-btcr2/keypair';
@@ -63,18 +63,62 @@ function validateMinConf(value) {
63
63
  return DEFAULT_MIN_CONF;
64
64
  if (typeof value === 'number' && Number.isInteger(value) && value >= 1)
65
65
  return value;
66
- const shown = typeof value === 'string' ? JSON.stringify(value) : String(value);
67
- throw new ResolveError(`Invalid resolution option minConf: expected a positive integer (minimum 1), got ${shown}.`, INVALID_OPTIONS, { minConf: value });
66
+ throw new ResolveError(`Invalid resolution option minConf: expected a positive integer (minimum 1), got ${shown(value)}.`, INVALID_OPTIONS, { minConf: value });
68
67
  }
68
+ /** Render an option value for an error message: a string in quotes, any other value as is. */
69
+ function shown(value) {
70
+ return typeof value === 'string' ? JSON.stringify(value) : String(value);
71
+ }
72
+ /** An ASCII string of an integer: an optional minus sign, then digits. */
73
+ const ASCII_INTEGER = /^-?[0-9]+$/;
74
+ /**
75
+ * Parse `ResolutionOptions.versionId`. The specification says that the value MUST
76
+ * parse as an integer, and DID Resolution v1 types the option as a string. The
77
+ * accepted form is an ASCII string of an integer inside the safe integer range.
78
+ * @returns {number | undefined} The integer, or `undefined` when the option is absent.
79
+ * @throws {ResolveError} `INVALID_OPTIONS` for every other value.
80
+ */
81
+ function validateVersionId(value) {
82
+ if (value === undefined)
83
+ return undefined;
84
+ if (typeof value === 'string' && ASCII_INTEGER.test(value) && Number.isSafeInteger(Number(value))) {
85
+ return Number(value);
86
+ }
87
+ throw new ResolveError(`Invalid resolution option versionId: expected an ASCII string of an integer, got ${shown(value)}.`, INVALID_OPTIONS, { versionId: value });
88
+ }
89
+ /** An XML Datetime in UTC with the `Z` designator and no fraction, for example `2026-07-01T00:00:00Z`. */
90
+ const UTC_XSD_DATETIME = /^-?\d{4,}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/;
69
91
  /**
70
- * Different possible Resolver states representing phases in the resolution process.
92
+ * Parse `ResolutionOptions.versionTime`. DID Resolution v1 requires an XML Datetime
93
+ * normalized to UTC without sub-second precision. The specification raises
94
+ * `INVALID_OPTIONS` for a value that does not parse.
95
+ * @returns {number | undefined} The instant in milliseconds since the Unix epoch, or `undefined` when the option is absent.
96
+ * @throws {ResolveError} `INVALID_OPTIONS` for every other value.
97
+ */
98
+ function validateVersionTime(value) {
99
+ if (value === undefined)
100
+ return undefined;
101
+ if (typeof value === 'string' && UTC_XSD_DATETIME.test(value) && DateUtils.isValidXsdDateTime(value)) {
102
+ const ms = Date.parse(value);
103
+ if (Number.isFinite(ms))
104
+ return ms;
105
+ }
106
+ throw new ResolveError('Invalid resolution option versionTime: expected an XML Datetime in UTC without a fraction '
107
+ + `(for example "2026-07-01T00:00:00Z"), got ${shown(value)}.`, INVALID_OPTIONS, { versionTime: value });
108
+ }
109
+ /**
110
+ * The phases of the resolution process. Each pass of the specification loop is
111
+ * BeaconDiscovery (the scan of the beacon addresses the resolver did not scan yet),
112
+ * BeaconProcess (the tuples of the signals the caller provided), and ProcessUpdate
113
+ * (one tuple). GenesisDocument runs once, for an EXTERNAL identifier whose genesis
114
+ * document is not in the sidecar.
71
115
  */
72
116
  var ResolverPhase;
73
117
  (function (ResolverPhase) {
74
118
  ResolverPhase["GenesisDocument"] = "GenesisDocument";
75
119
  ResolverPhase["BeaconDiscovery"] = "BeaconDiscovery";
76
120
  ResolverPhase["BeaconProcess"] = "BeaconProcess";
77
- ResolverPhase["ApplyUpdates"] = "ApplyUpdates";
121
+ ResolverPhase["ProcessUpdate"] = "ProcessUpdate";
78
122
  ResolverPhase["Complete"] = "Complete";
79
123
  })(ResolverPhase || (ResolverPhase = {}));
80
124
  /**
@@ -102,7 +146,9 @@ var ResolverPhase;
102
146
  export class Resolver {
103
147
  // --- Immutable inputs ---
104
148
  #didComponents;
149
+ /** The parsed `ResolutionOptions.versionId`, or `undefined` when the option is absent. */
105
150
  #versionId;
151
+ /** The parsed `ResolutionOptions.versionTime` in milliseconds since the Unix epoch, or `undefined`. */
106
152
  #versionTime;
107
153
  /**
108
154
  * The specific phase the Resolver is current in.
@@ -113,22 +159,28 @@ export class Resolver {
113
159
  #providedGenesisDocument = null;
114
160
  #beaconServicesSignals = new Map();
115
161
  #processedServices = new Set();
162
+ /** The beacon addresses the resolver requested signals for: `scanned_beacons` of the specification. */
116
163
  #requestCache = new Set();
164
+ /**
165
+ * The tuples of the specification's `updates` list: a signed update and the metadata of
166
+ * the block that announced it. BeaconProcess appends; ProcessUpdate sorts the list and
167
+ * removes one tuple per step. A tuple that one pass does not reach waits for the next.
168
+ */
117
169
  #unsortedUpdates = [];
118
170
  #resolvedResponse = null;
119
171
  /**
120
- * Monotonic DID-document version counter and the update-hash history that backs
121
- * duplicate confirmation, both carried across the entire resolution. The spec's
122
- * read algorithm keeps a single version counter and a single update-hash history
123
- * for the whole signal-processing loop, re-deriving beacons from the contemporary
124
- * document on each pass. This sans-I/O resolver splits that one loop into discovery
125
- * rounds, so the two must persist across rounds rather than restart each pass.
126
- * Restarting them would reject a legitimate linear history whose later updates are
127
- * announced on beacons that earlier updates added: round two would forget it had
128
- * already reached version two, see version three, and raise a late-publishing error.
172
+ * The state of the specification loop, carried across every pass: the version counter
173
+ * (`current_version_id`), the update-hash history that backs duplicate confirmation
174
+ * (`update_hash_history`), the confirmations of the block that contains the most
175
+ * recently applied unique update (`block_confirmations`), and the header time of that
176
+ * block as `updated`. A pass that finds a new beacon address returns to discovery, so
177
+ * the state must not restart: a restart would reject a linear history whose later
178
+ * updates are announced on beacons that earlier updates added.
129
179
  */
130
180
  #currentVersionId = 1;
131
181
  #updateHashHistory = [];
182
+ #blockConfirmations = 0;
183
+ #updated;
132
184
  /**
133
185
  * Opt-in upper bound on multi-round beacon-discovery passes. `Infinity` (the
134
186
  * default) leaves discovery unbounded; termination is already guaranteed by
@@ -153,14 +205,20 @@ export class Resolver {
153
205
  this.#didComponents = didComponents;
154
206
  this.#sidecarData = sidecarData;
155
207
  this.#currentDocument = currentDocument;
156
- this.#versionId = options?.versionId;
157
- this.#versionTime = options?.versionTime;
208
+ // The resolution options fail here, before any data need is emitted, so the
209
+ // caller does no I/O for a request it cannot serve. DID Resolution v1 defines
210
+ // versionId and versionTime as mutually exclusive; the specification raises
211
+ // INVALID_OPTIONS for a request with both, and for a value that does not parse.
212
+ if (options?.versionId !== undefined && options?.versionTime !== undefined) {
213
+ throw new ResolveError('Invalid resolution options: versionId and versionTime are mutually exclusive. Pass one of them.', INVALID_OPTIONS, { versionId: options.versionId, versionTime: options.versionTime });
214
+ }
215
+ this.#versionId = validateVersionId(options?.versionId);
216
+ this.#versionTime = validateVersionTime(options?.versionTime);
158
217
  // Discovery is unbounded by default; a positive maxDiscoveryRounds opts into a
159
218
  // finite resource guard. A non-positive or omitted value means no limit.
160
219
  const rounds = options?.maxDiscoveryRounds;
161
220
  this.#maxDiscoveryRounds = typeof rounds === 'number' && rounds > 0 ? rounds : Infinity;
162
- // The signal confirmation threshold. An invalid value fails here, before any
163
- // data need is emitted, so the caller does no I/O for a request it cannot serve.
221
+ // The signal confirmation threshold.
164
222
  this.#minConf = validateMinConf(options?.minConf);
165
223
  // If a genesis document was provided (from sidecar), pre-seed it for validation
166
224
  if (options?.genesisDocument) {
@@ -254,124 +312,7 @@ export class Resolver {
254
312
  return { updateMap, casMap, smtMap };
255
313
  }
256
314
  /**
257
- * Implements subsection {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#process-updates | 7.2.f Process updates Array}.
258
- * @param {DidDocument} currentDocument The current DID Document to apply the updates to.
259
- * @param {Array<[SignedBTCR2Update, BlockMetadata]>} unsortedUpdates The unsorted array of BTCR2 Signed Updates and their associated Block Metadata.
260
- * @param {string} [versionTime] The optional version time to limit updates to.
261
- * @param {string} [versionId] The optional version id to limit updates to.
262
- * @param {{ currentVersionId: number; updateHashHistory: HashBytes[] }} [resolutionState]
263
- * Version counter and update-hash history carried from earlier discovery rounds.
264
- * Standalone callers omit it and start fresh at version 1 with an empty history.
265
- * @returns {DidResolutionResponse} The updated DID Document, number of confirmations, and version id.
266
- *
267
- * Confirmation depth is not checked here. The BeaconProcess phase excludes a
268
- * signal below `ResolutionOptions.minConf` before its update reaches this method,
269
- * so every tuple here comes from a block at or above the threshold.
270
- */
271
- static updates(currentDocument, unsortedUpdates, versionTime, versionId, resolutionState = { currentVersionId: 1, updateHashHistory: [] }) {
272
- // Continue the version counter and update-hash history from earlier discovery
273
- // rounds so the whole resolution is one monotonic sequence, matching the spec's
274
- // single signal-processing loop. updateHashHistory is shared by reference, so the
275
- // appends made below are visible to the next round.
276
- let currentVersionId = resolutionState.currentVersionId;
277
- const updateHashHistory = resolutionState.updateHashHistory;
278
- // 1. Sort updates by targetVersionId (ascending), using blockheight as tie-breaker
279
- const updates = unsortedUpdates.sort(([upd0, blk0], [upd1, blk1]) => upd0.targetVersionId - upd1.targetVersionId || blk0.height - blk1.height);
280
- // Create a default response object. `updated` is absent until an update applies.
281
- const response = {
282
- didDocument: currentDocument,
283
- metadata: {
284
- versionId: `${currentVersionId}`,
285
- confirmations: 0,
286
- deactivated: currentDocument.deactivated || false
287
- }
288
- };
289
- // Iterate over each (update block) pair
290
- for (const [update, block] of updates) {
291
- // Get the hash of the current document as raw bytes
292
- const currentDocumentHash = canonicalHashBytes(response.didDocument);
293
- // Safely convert block.time to timestamp
294
- const blocktime = DateUtils.blocktimeToTimestamp(block.time);
295
- // Set the updated field to the blocktime of the current update
296
- response.metadata.updated = DateUtils.toISOStringNonFractional(blocktime);
297
- // Set confirmations to the block confirmations
298
- response.metadata.confirmations = block.confirmations;
299
- // Check update.targetVersionId against currentVersionId.
300
- // If update.targetVersionId <= currentVersionId, this update re-announces a version
301
- // that has already been applied. Confirm it is a true duplicate, then skip it: a
302
- // duplicate does not advance the version counter (the increment and the
303
- // metadata.versionId it sets run only on the apply path below), and confirmation
304
- // compares against the update-hash history without appending to it, because the
305
- // history already holds the applied update at updateHashHistory[targetVersionId - 2].
306
- // Holding the increment off the duplicate path is the deliberate did:btcr2 deviation
307
- // recorded in ADR 067: the read algorithm's "Increment current_version_id" belongs
308
- // to the apply branch, not to every tuple. Duplicates are confirmed whatever their
309
- // blocktime, before the versionTime check below, so a re-announcement mined after
310
- // versionTime can neither truncate the in-window history nor dodge late-publishing
311
- // detection (ADR 068).
312
- if (update.targetVersionId <= currentVersionId) {
313
- this.confirmDuplicate(update, updateHashHistory);
314
- continue;
315
- }
316
- // if resolutionOptions.versionTime is defined and the blocktime is more recent, return
317
- // currentDocument. Evaluated only for tuples that would change state (apply or late
318
- // publishing). The spec places this check before the duplicate branch, where the sort
319
- // by targetVersionId lets a duplicate of an early version mined after versionTime end
320
- // resolution before genuine in-window updates are processed; checking it here is the
321
- // deliberate deviation recorded in ADR 068.
322
- if (versionTime) {
323
- // Safely convert versionTime to timestamp
324
- if (blocktime > DateUtils.dateStringToTimestamp(versionTime)) {
325
- return response;
326
- }
327
- }
328
- // If update.targetVersionId == currentVersionId + 1, apply the update
329
- if (update.targetVersionId === currentVersionId + 1) {
330
- // Check if update.sourceHash !== currentDocumentHash (byte comparison)
331
- const sourceHashBytes = decodeHash(update.sourceHash, 'base64urlnopad');
332
- if (!equalBytes(sourceHashBytes, currentDocumentHash)) {
333
- throw new ResolveError(`Hash mismatch: update.sourceHash !== currentDocumentHash`, INVALID_DID_UPDATE, {
334
- sourceHash: update.sourceHash,
335
- currentDocumentHash: encodeHash(currentDocumentHash, 'hex')
336
- });
337
- }
338
- // Apply the update to the currentDocument and set it in the response
339
- response.didDocument = this.applyUpdate(response.didDocument, update);
340
- // Create unsigned_update by removing the proof property from update.
341
- const unsignedUpdate = JSONUtils.deleteKeys(update, ['proof']);
342
- // Push the canonicalized unsigned update hash bytes to the updateHashHistory
343
- updateHashHistory.push(canonicalHashBytes(unsignedUpdate));
344
- }
345
- // Otherwise update.targetVersionId > currentVersionId + 1: a version was skipped,
346
- // so throw LATE_PUBLISHING error. The duplicate case already continued above.
347
- else {
348
- throw new ResolveError(`Version Id Mismatch: targetVersionId cannot be > currentVersionId + 1`, LATE_PUBLISHING_ERROR, {
349
- targetVersionId: update.targetVersionId,
350
- currentVersionId: currentVersionId + 1
351
- });
352
- }
353
- // Increment currentVersionId
354
- currentVersionId++;
355
- // Set response.versionId to be the new currentVersionId
356
- response.metadata.versionId = `${currentVersionId}`;
357
- // If resolutionOptions.versionId is defined and <= currentVersionId, return currentDocument
358
- const versionIdNumber = Number(versionId);
359
- if (!isNaN(versionIdNumber) && versionIdNumber <= currentVersionId) {
360
- return response;
361
- }
362
- // Check if the current document is deactivated before further processing
363
- if (response.didDocument.deactivated) {
364
- // Set the response deactivated flag to true
365
- response.metadata.deactivated = response.didDocument.deactivated;
366
- // If deactivated, stop processing further updates and return the response
367
- return response;
368
- }
369
- }
370
- // Return response data
371
- return response;
372
- }
373
- /**
374
- * Implements subsection {@link https://dcdpr.github.io/did-btcr2/#confirm-duplicate-update | 7.2.f.1 Confirm Duplicate Update}.
315
+ * Implements subsection {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#confirm-duplicate-update | Confirm Duplicate Update}.
375
316
  * This step confirms that an update with a lower-than-expected targetVersionId is a true duplicate.
376
317
  * @param {SignedBTCR2Update} update The BTCR2 Signed Update to confirm as a duplicate.
377
318
  * @param {HashBytes[]} updateHashHistory The accumulated hash history for comparison.
@@ -410,14 +351,24 @@ export class Resolver {
410
351
  }
411
352
  }
412
353
  /**
413
- * Implements subsection {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#apply-update | 7.2.f.3 Apply Update}
354
+ * Implements subsection {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#apply-update | Apply update}
414
355
  * and its step {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#check-update-proof | Check update.proof}.
415
356
  * @param {DidDocument} currentDocument The current DID Document to apply the update to.
416
357
  * @param {SignedBTCR2Update} update The BTCR2 Signed Update to apply.
417
358
  * @returns {DidDocument} The updated DID Document after applying the update.
418
- * @throws {ResolveError} If the update is invalid or cannot be applied.
359
+ * @throws {ResolveError} `INVALID_DID_UPDATE` if the update is invalid or cannot be applied.
419
360
  */
420
361
  static applyUpdate(currentDocument, update) {
362
+ // Spec "Apply update": the hash of the current document must be the decoded
363
+ // update.sourceHash (byte comparison).
364
+ const currentDocumentHash = canonicalHashBytes(currentDocument);
365
+ const sourceHashBytes = decodeHash(update.sourceHash, 'base64urlnopad');
366
+ if (!equalBytes(sourceHashBytes, currentDocumentHash)) {
367
+ throw new ResolveError(`Hash mismatch: update.sourceHash !== currentDocumentHash`, INVALID_DID_UPDATE, {
368
+ sourceHash: update.sourceHash,
369
+ currentDocumentHash: encodeHash(currentDocumentHash, 'hex')
370
+ });
371
+ }
421
372
  // Spec "Check update.proof": the update @context must be the array that the BTCR2
422
373
  // Unsigned Update data structure pins, and the proof @context must equal it, member
423
374
  // for member and in order. The array is inside the hashed and signed bytes, so an
@@ -489,14 +440,14 @@ export class Resolver {
489
440
  const updatedDocument = JSONPatch.apply(currentDocument, update.patch);
490
441
  // Verify that updatedDocument is conformant to DID Core v1.1.
491
442
  DidDocument.validate(updatedDocument);
492
- // Canonicalize and hash the updatedDocument to get the currentDocumentHash (raw bytes).
493
- const currentDocumentHash = canonicalHashBytes(updatedDocument);
494
- // Prepare the update targetHash for comparison with currentDocumentHash.
443
+ // Canonicalize and hash the updatedDocument (raw bytes).
444
+ const updatedDocumentHash = canonicalHashBytes(updatedDocument);
445
+ // Prepare the update targetHash for comparison with updatedDocumentHash.
495
446
  const updateTargetHash = decodeHash(update.targetHash);
496
- // Make sure the update.targetHash equals currentDocumentHash.
497
- if (!equalBytes(updateTargetHash, currentDocumentHash)) {
447
+ // Make sure the update.targetHash equals updatedDocumentHash.
448
+ if (!equalBytes(updateTargetHash, updatedDocumentHash)) {
498
449
  // If they do not match, throw INVALID_DID_UPDATE error.
499
- throw new ResolveError(`Invalid update: update.targetHash !== currentDocumentHash`, INVALID_DID_UPDATE, { updateTargetHash, currentDocumentHash });
450
+ throw new ResolveError(`Invalid update: update.targetHash !== updatedDocumentHash`, INVALID_DID_UPDATE, { updateTargetHash, updatedDocumentHash });
500
451
  }
501
452
  // Return final updatedDocument.
502
453
  return updatedDocument;
@@ -585,66 +536,118 @@ export class Resolver {
585
536
  if (allNeeds.length > 0) {
586
537
  return { status: 'action-required', needs: allNeeds };
587
538
  }
588
- this.#phase = ResolverPhase.ApplyUpdates;
539
+ this.#phase = ResolverPhase.ProcessUpdate;
589
540
  continue;
590
541
  }
591
- // Phase: ApplyUpdates
592
- // Apply collected updates, then check for new beacon services (multi-round).
593
- case ResolverPhase.ApplyUpdates: {
594
- if (this.#unsortedUpdates.length > 0) {
595
- // Apply this round's updates, continuing the resolution-wide version
596
- // counter and update-hash history rather than restarting them. Without
597
- // this carry, a linear history split across discovery rounds would be
598
- // rejected at round two as late publishing.
599
- this.#resolvedResponse = Resolver.updates(this.#currentDocument, this.#unsortedUpdates, this.#versionTime, this.#versionId, { currentVersionId: this.#currentVersionId, updateHashHistory: this.#updateHashHistory });
600
- // updates() reports the version it reached via metadata.versionId; carry
601
- // it forward so the next round continues the monotonic sequence.
602
- this.#currentVersionId = Number(this.#resolvedResponse.metadata.versionId);
603
- this.#currentDocument = this.#resolvedResponse.didDocument;
604
- this.#unsortedUpdates = [];
605
- // Check for new beacon services added by updates (multi-round discovery)
606
- const beaconServices = BeaconUtils.getBeaconServices(this.#currentDocument);
607
- const hasNewServices = beaconServices.some(service => {
608
- const address = BeaconUtils.parseBitcoinAddress(service.serviceEndpoint);
609
- return !this.#requestCache.has(address);
542
+ // Phase: ProcessUpdate
543
+ // Spec "Process Next Update": one tuple per step. The phase repeats until
544
+ // the document resolves, or until an applied update adds a beacon address
545
+ // that the resolver did not scan (then the pass returns to BeaconDiscovery).
546
+ case ResolverPhase.ProcessUpdate: {
547
+ const document = this.#currentDocument;
548
+ // Step 1: the requested version is reached. The test runs before Apply,
549
+ // so version 1 is reachable.
550
+ if (this.#versionId !== undefined && this.#currentVersionId === this.#versionId) {
551
+ this.#phase = ResolverPhase.Complete;
552
+ continue;
553
+ }
554
+ // Step 2: no tuple is left, or the document is deactivated. A requested
555
+ // version that the history does not reach is NOT_FOUND.
556
+ if (this.#unsortedUpdates.length === 0 || document.deactivated) {
557
+ if (this.#versionId !== undefined) {
558
+ throw new ResolveError(`Version ${this.#versionId} of the DID does not exist: the history `
559
+ + (document.deactivated
560
+ ? `ends with the deactivation at version ${this.#currentVersionId}.`
561
+ : `ends at version ${this.#currentVersionId}.`), NOT_FOUND, { versionId: this.#versionId, currentVersionId: this.#currentVersionId });
562
+ }
563
+ this.#phase = ResolverPhase.Complete;
564
+ continue;
565
+ }
566
+ // Step 3: sort the tuples by targetVersionId (ascending), then by block
567
+ // height, and remove the first one. The sort runs on every step because
568
+ // a scan between two steps can add a tuple with a lower version.
569
+ this.#unsortedUpdates.sort(([upd0, blk0], [upd1, blk1]) => upd0.targetVersionId - upd1.targetVersionId || blk0.height - blk1.height);
570
+ const [update, block] = this.#unsortedUpdates.shift();
571
+ // Check targetVersionId, first arm: update.targetVersionId <= currentVersionId
572
+ // re-announces an applied version. Confirm that it is a true duplicate, then
573
+ // skip it. A duplicate does not advance the version counter, does not append
574
+ // to the history (the slot already holds the applied update, ADR 067), and
575
+ // does not stamp the metadata: confirmations refers to the block of the most
576
+ // recently applied unique update. The branch runs before the versionTime
577
+ // test (ADR 068): a re-announcement mined after versionTime can neither end
578
+ // the resolution early nor dodge late-publishing detection.
579
+ if (update.targetVersionId <= this.#currentVersionId) {
580
+ Resolver.confirmDuplicate(update, this.#updateHashHistory);
581
+ continue;
582
+ }
583
+ // Step 4: the versionTime stop. The block mediantime of the tuple is after
584
+ // versionTime: resolve the current document. The boundary is inclusive, so a
585
+ // tuple whose mediantime equals versionTime applies. The stopped tuple stamps
586
+ // nothing: the metadata reports the last applied update.
587
+ if (this.#versionTime !== undefined && block.mediantime * 1000 > this.#versionTime) {
588
+ this.#phase = ResolverPhase.Complete;
589
+ continue;
590
+ }
591
+ // Check targetVersionId, third arm: a version was skipped, so raise LATE_PUBLISHING.
592
+ if (update.targetVersionId !== this.#currentVersionId + 1) {
593
+ throw new ResolveError(`Version Id Mismatch: targetVersionId cannot be > currentVersionId + 1`, LATE_PUBLISHING_ERROR, {
594
+ targetVersionId: update.targetVersionId,
595
+ currentVersionId: this.#currentVersionId + 1
610
596
  });
611
- if (hasNewServices) {
612
- // Discovery is unbounded by default: termination is guaranteed by
613
- // address de-duplication (#requestCache), so a well-formed DID
614
- // resolves in however many rounds its history requires. An opt-in
615
- // maxDiscoveryRounds lets a caller bound the work as a resource
616
- // guard. Exceeding it is a limit the caller imposed, not a malformed
617
- // document, so it surfaces as INTERNAL_ERROR, not INVALID_DID_DOCUMENT.
618
- if (++this.#discoveryRounds > this.#maxDiscoveryRounds) {
619
- throw new ResolveError(`Exceeded the configured maximum of ${this.#maxDiscoveryRounds} beacon-discovery `
620
- + 'rounds. Raise or remove ResolutionOptions.maxDiscoveryRounds to resolve this DID.', INTERNAL_ERROR, { maxDiscoveryRounds: this.#maxDiscoveryRounds, discoveryRounds: this.#discoveryRounds });
621
- }
622
- // Loop back to discover signals for new beacon services
623
- this.#phase = ResolverPhase.BeaconDiscovery;
624
- continue;
597
+ }
598
+ // Second arm: update.targetVersionId == currentVersionId + 1. Apply the update,
599
+ // append the unsigned update hash to the history, increment the version.
600
+ this.#currentDocument = Resolver.applyUpdate(document, update);
601
+ const unsignedUpdate = JSONUtils.deleteKeys(update, ['proof']);
602
+ this.#updateHashHistory.push(canonicalHashBytes(unsignedUpdate));
603
+ this.#currentVersionId++;
604
+ // Step 5: block_confirmations, and the header time as `updated`. On the apply
605
+ // path only: the stop above and the duplicate branch stamp nothing.
606
+ this.#blockConfirmations = block.confirmations;
607
+ this.#updated = DateUtils.toISOStringNonFractional(DateUtils.blocktimeToTimestamp(block.time));
608
+ // The applied update can add a beacon service. "Find Beacon Signals" runs at
609
+ // the top of every pass for the addresses that are not scanned yet, so the
610
+ // pass returns to BeaconDiscovery before the next tuple. Discovery is
611
+ // unbounded by default: termination is guaranteed by address
612
+ // de-duplication (#requestCache). An opt-in maxDiscoveryRounds lets a caller
613
+ // bound the work as a resource guard. Exceeding it is a limit the caller
614
+ // imposed, not a malformed document, so it surfaces as INTERNAL_ERROR.
615
+ if (this.#hasUnscannedBeacons()) {
616
+ if (++this.#discoveryRounds > this.#maxDiscoveryRounds) {
617
+ throw new ResolveError(`Exceeded the configured maximum of ${this.#maxDiscoveryRounds} beacon-discovery `
618
+ + 'rounds. Raise or remove ResolutionOptions.maxDiscoveryRounds to resolve this DID.', INTERNAL_ERROR, { maxDiscoveryRounds: this.#maxDiscoveryRounds, discoveryRounds: this.#discoveryRounds });
625
619
  }
620
+ this.#phase = ResolverPhase.BeaconDiscovery;
626
621
  }
627
- this.#phase = ResolverPhase.Complete;
628
622
  continue;
629
623
  }
630
624
  // Phase: Complete
625
+ // The document metadata of the specification: versionId is current_version_id,
626
+ // confirmations is block_confirmations (0 when no update applied), deactivated
627
+ // is the flag of the document. `updated` is present after the first apply.
631
628
  case ResolverPhase.Complete: {
632
- return {
633
- status: 'resolved',
634
- // No update applied: confirmations is 0 per the specification.
635
- result: this.#resolvedResponse ?? {
636
- didDocument: this.#currentDocument,
637
- metadata: {
638
- versionId: this.#versionId ?? '1',
639
- confirmations: 0,
640
- deactivated: this.#currentDocument.deactivated || false
641
- }
629
+ this.#resolvedResponse ??= {
630
+ didDocument: this.#currentDocument,
631
+ metadata: {
632
+ versionId: `${this.#currentVersionId}`,
633
+ confirmations: this.#blockConfirmations,
634
+ ...(this.#updated !== undefined ? { updated: this.#updated } : {}),
635
+ deactivated: this.#currentDocument.deactivated || false
642
636
  }
643
637
  };
638
+ return { status: 'resolved', result: this.#resolvedResponse };
644
639
  }
645
640
  }
646
641
  }
647
642
  }
643
+ /**
644
+ * True if the current document carries a beacon service whose address the resolver
645
+ * did not request signals for. "Find Beacon Signals" scans such an address on the
646
+ * next pass.
647
+ */
648
+ #hasUnscannedBeacons() {
649
+ return BeaconUtils.getBeaconServices(this.#currentDocument).some(service => !this.#requestCache.has(BeaconUtils.parseBitcoinAddress(service.serviceEndpoint)));
650
+ }
648
651
  /**
649
652
  * Return the signals of one beacon service that resolution may process: the
650
653
  * signals with at least `#minConf` confirmations. The specification removes a
@@ -653,10 +656,11 @@ export class Resolver {
653
656
  * integer confirmation count is excluded too: that is a mempool transaction
654
657
  * from a driver that did not skip it.
655
658
  *
656
- * An eligible signal must carry a finite block height and block time. A
657
- * signal that passes the count but lacks them is malformed. It fails fast
658
- * here with a typed error, in the style of the {@link provide} guards, and
659
- * not later with an invalid date inside {@link updates}.
659
+ * An eligible signal must carry a finite block height, block time, and block
660
+ * median time past. A signal that passes the count but lacks them is
661
+ * malformed. It fails fast here with a typed error, in the style of the
662
+ * {@link provide} guards, and not later with an invalid date or a false
663
+ * `versionTime` comparison in the ProcessUpdate phase.
660
664
  * @param {Array<BeaconSignal>} signals The signals the caller provided for one service.
661
665
  * @returns {Array<BeaconSignal>} The signals at or above the threshold, in the given order.
662
666
  * @throws {ResolveError} `INVALID_DID_UPDATE` for an eligible signal with no valid block metadata.
@@ -669,9 +673,15 @@ export class Resolver {
669
673
  if (!Number.isInteger(confirmations) || confirmations < this.#minConf) {
670
674
  continue;
671
675
  }
672
- if (!Number.isFinite(block?.height) || !Number.isFinite(block?.time)) {
676
+ if (!Number.isFinite(block?.height) || !Number.isFinite(block?.time) || !Number.isFinite(block?.mediantime)) {
673
677
  throw new ResolveError(`Beacon signal ${signal.signalBytes} has ${confirmations} confirmations `
674
- + 'but no valid block height or block time.', INVALID_DID_UPDATE, { signalBytes: signal.signalBytes, confirmations, height: block?.height, time: block?.time });
678
+ + 'but no valid block height, block time, or block mediantime.', INVALID_DID_UPDATE, {
679
+ signalBytes: signal.signalBytes,
680
+ confirmations,
681
+ height: block?.height,
682
+ time: block?.time,
683
+ mediantime: block?.mediantime
684
+ });
675
685
  }
676
686
  eligible.push(signal);
677
687
  }
@@ -1 +1 @@
1
- {"version":3,"file":"resolver.js","sourceRoot":"","sources":["../../../src/core/resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,MAAM,IAAI,UAAU,EACpB,MAAM,IAAI,UAAU,EACpB,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,SAAS,EACT,SAAS,EACT,qBAAqB,EACrB,YAAY,EACb,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,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