@did-btcr2/method (MINOR: for a request with versionId or versionTime, the resolver processes every update, and an error in a later update fails the request); @did-btcr2/api (MINOR: the browser bundle holds the method package, and resolveDid and tryResolveDid refuse a historical request that they accepted before); @did-btcr2/cli (PATCH: dependency uptake)Specification pull request 391 (“Keep a conflicting update fatal for historical resolution”, merged 2026-10-09) closes specification issue 386. It changes “Process Next Update” of “Resolve”.
Before the change, step 1 and step 5 resolved current_document as didDocument. Step 1 tested versionId. Step 5 tested versionTime against the block mediantime of the tuple. The resolver did not process the rest of the updates.
After the change, step 1 and step 5 copy the state to a new variable, requested_state. The specification defines it: “the state at the version that resolutionOptions.versionId or resolutionOptions.versionTime requests, a copy of current_document, current_version_id, block_confirmations and block_mediantime, the values didDocumentMetadata is built from. The resolver keeps these copies while it processes the rest of the updates (starts empty).”
Each of the two steps copies only if requested_state is empty. Step 2 runs if no tuple is left or if the document is deactivated. If requested_state is not empty, step 2 sets the four values from it and resolves current_document. Otherwise step 2 raises NOT_FOUND if versionId is set, as before.
The pull request also removes a condition from the rule for unused sidecar data. The rule “Sidecar Data that the resolver did not use has no effect on the result” now applies also to a request with versionId or versionTime.
ADR 111 implemented the old steps 1 and 5: the resolver ended the resolution at the requested version. Thus the resolver did not check a later update with the steps of “Process Next Update”. An error that these steps find, for example LATE_PUBLISHING or INVALID_DID_UPDATE from “Apply update”, did not fail a historical request. Example: a history has a valid version 2, a valid version 3, and a later beacon signal with a second, different version 3.
| Request | Specification | This library before |
|---|---|---|
| no option | LATE_PUBLISHING |
LATE_PUBLISHING |
versionId: "2" |
LATE_PUBLISHING |
version 2 |
versionTime after version 2 and before version 3 |
LATE_PUBLISHING |
version 2 |
ADR 068 recorded a part of this case as a residual risk. The window of a versionTime request is the history up to versionTime. A second, different update for a version in the window failed a versionTime request. A gap or two different updates of one version after the window did not. A versionId request did not check a second, different update of the requested version, or an update of a later version.
The resolver holds requested_state in the private field #requestedState, with four values: the document, the version, confirmations, and updated. At step 1 and at step 5, the resolver keeps the current values in requested_state if requested_state is empty. Then it continues. At step 2, if requested_state is not empty, the resolver sets the four values from it and completes. Otherwise, the NOT_FOUND rule of ADR 111 applies.
requested_state holds a reference to the document, not a copy. For each update, the resolver makes a new current document, because JSONPatch.apply patches a clone. Thus the document in requested_state does not change. If a future JSONPatch.apply patches in place, the resolver must copy the document at step 1 and step 5.
The resolver processes each update after the requested version with the checks of a request for the current version. Thus one history gives one answer about its integrity: a historical request fails if a request for the current version fails. The errors include LATE_PUBLISHING, INVALID_DID_UPDATE, MISSING_UPDATE_DATA, and the INTERNAL_ERROR of the maxDiscoveryRounds limit.
Two tests run before the step 5 test, and neither keeps the requested state:
targetVersionId is more than current_version_id” gives the same result. Footnote 4 of “Process Next Update” gives the reason: the block of a duplicate can be after versionTime, and the next version can be before it.confirmations and updated come from requested_state. Thus they report the block of the update that yields the requested version, not the block of a later update. deactivated comes from the document in requested_state, so a later deactivation does not change it.
structuredClone). Rejected. JSONPatch.apply makes a new object already, so the copy adds no safety. The JSDoc of #saveRequestedState() names the condition.NeedBeaconSignals for such a beacon. For each signal at such a beacon, it emits NeedCASAnnouncement, NeedSMTProof, or NeedSignedUpdate if the sidecar data does not have the data.MISSING_UPDATE_DATA if sidecar.smtProofs does not have the proof of a beacon signal at an SMT beacon. A signal that announces no update for the DID also needs its proof. Before, this was already true for an SMT beacon that the document had at or before the requested version. It is new for an SMT beacon that an update after the requested version adds.maxDiscoveryRounds counts the discovery rounds of the full history. Example: version 2 adds beacon B, version 3 on beacon B adds beacon C, and version 4 is on beacon C. Before, versionId: "2" with maxDiscoveryRounds: 1 returned version 2. Now it fails with INTERNAL_ERROR.versionId: "0" and a negative versionId still fail with NOT_FOUND: no version is below 1. A new test checks this behavior.Superseded.
updated is absent until the resolver applies an update”. For a request with versionId or versionTime, updated is absent if the requested version is 1, also after the resolver applies later updates.versionId test runs at the top of each step, and an unsatisfiable versionId raises NOT_FOUND”: the sentence “When the current version equals the parsed versionId, the resolver resolves the current document.” The resolver now keeps the requested state and continues. The NOT_FOUND rule stays.confirmations and updated stamp on the apply path only”: the sentence “A tuple that stops the resolution at versionTime does not stamp.” No tuple stops the resolution now. The resolver applies and stamps the tuple after step 5, and step 2 restores the values of requested_state. The other stamp rules stay.confirmations after a versionTime stop reports the last applied update; before, it reported the stopped tuple.” confirmations now reports the block of the update that yields the requested version.versionTime test) stays.
versionId queries.packages/method/src/core/resolver.ts: the interface RequestedState, the field #requestedState, the method #saveRequestedState(), steps 1, 2, and 5 of the ProcessUpdate phase, and the JSDoc of DidResolutionResponse.packages/method/src/core/interfaces.ts: the JSDoc of versionId, versionTime, maxDiscoveryRounds, and minConf.packages/method/tests/resolver.spec.ts: the tests “a historical request processes the full history (ADR 145)”, the test versionId "0" and "-1" fail with NOT_FOUND: no version is below 1, and the changed titles in “update-processing limits (versionId / versionTime / deactivated)” and in “resolution options and the update loop of the specification (ADR 111)”.packages/method/README.md, packages/api/README.md, and packages/cli/docs/resolve.md: the text of versionId, versionTime, maxDiscoveryRounds, and the metadata.packages/api/docs/test-vectors.md, packages/api/lib/readme-scenarios.ts, and the four 23-k1-duplicate-signal.json recipes: the text of the recorded metadata and of the duplicate case. The README of the vector corpus changes at the next vector pass.versionTime test.