Skip to content

DID Document history: immutable, signed, hash-chained versions with versionId/versionTime resolution #42

Closed

Description

@Jenziner

Summary

The DID Document of a Record is currently mutable state: only recordEndpoint, updated
and currentVersion may change, and the resolver returns only the current state (4.3, 4.4).
A verifier cannot determine which keys were authorised at a past time, and the resolver
cannot be held to its own history. This issue makes every change of a DID Document a new,
immutable, signed and hash-chained version that resolvers MUST retain and resolve by
versionId and versionTime.

Motivation

  • Signature validity at a past time ("was this key authorised when the Version was
    signed?") cannot be established today.
  • 4.3 forbids any change to verificationMethod and controller, so key rotation and
    transfer of control are not possible.
  • versionId (4.3) is a hash of the document fields but is not linked to a predecessor,
    and the document carries no proof. History would only be as trustworthy as the resolver.
  • 4.3 places verificationMethod in the Record's own DID Document, while 19.4 requires the
    signing key in the DID Document of the record owner. These disagree.

Proposal

1. Immutable versions

Every change creates a new DID Document version. id and created MUST NOT change; all
other fields MAY change. A DID Document version is immutable once published.
updated is the time of the version and defines versionTime resolution.

2. Update at every finalisation

currentVersion MUST be updated, and thus a new DID Document version created, whenever a
Record Version is finalised, when the storage location changes, and on payload deletion.
The chain therefore also records which Record Version was current at which time.

3. Hash chain

Add previousVersionId (null for the first version). The versionId calculation (4.3)
covers: id, recordEndpoint, service, created, updated, currentVersion,
previousVersionId, controller, verificationMethod (where present), canonicalised with
RFC 8785 and hashed with SHA-256. proof is excluded from the hash.

4. Signed versions

Each version carries a proof:

"proof": {
  "verificationMethod": "did:rwp:<ns>:<agent-id>#key-1",
  "signature": "z..."
}

The signature is calculated over the canonical versionId as in 19.4 (Ed25519 or P-256,
multibase). The signing key MUST be a verification method of the controller named in the
predecessor version. For the first version, the controller named in that version itself.
For self-controlled documents (typically AgentRecords), the key comes from the
predecessor version. The first version of a self-controlled document is signed with a key
it contains; trust in it is established outside the chain (namespace registration and
governance, see 21).

5. Signing keys live in the Agent's DID Document

Signing keys are published in the DID Document of the Agent (AgentRecord), not in the
Records' own DID Documents. verificationMethod is REQUIRED in the DID Document of an
AgentRecord (at least one) and is not used in other Records' DID Documents.
19.4 is aligned: the key used to sign a Version is a verification method of the owner
Agent. Old keys remain in older versions, never removed from history. A key absent from the
current version MUST NOT be used for signatures after that version's updated.
Retroactive invalidation is expressed by status assertions, not by editing history.

6. Resolver requirements (4.4)

A resolver MUST:

  • support the resolution parameters versionId and versionTime; they are mutually
    exclusive (both given: 400);
  • for versionTime, return the version with the greatest updated ≤ the given time;
    if none exists (time before created) or versionId is unknown: 404;
  • return versionId and, if present, nextVersionId in the document metadata;
  • retain every version for as long as the DID is resolvable. Payload-only deletion does not
    remove the history. Only a full deletion ends it (410).

7. History verification

A verifier checking a version MUST: recompute versionId; check that previousVersionId
matches the predecessor; verify proof per rule 4; check that updated is not earlier than
the predecessor's updated.

Spec impact

4.3 (fields, invariants, versionId), 4.4 (resolver), 19.4 (key location), 2.4/2.5
(resolver capability), 8.3 (410), CHANGELOG.

Out of scope

  • Evaluation of key state at a given time in validation (asOfTime, deferred issue 5b).
  • Retroactive invalidation (status assertions issue).
  • Pre-rotation / recovery after compromise of the current key; witnesses and watchers.
  • Exporting the complete chain for offline verification.
  • External timestamps for updated (anchoring, 23); updated is producer-declared.

Open questions

  1. Is verificationMethod removed from non-Agent DID Documents (rule 5)? Check against 4.3
    and the Reference Implementation notes.
  2. A compromised current key can sign a rotation to attacker keys. The chain cannot prevent
    this. Accept for now and treat recovery as governance (namespace registrar)?
  3. 4.4 states 410 for payload deletion, 8.3 for full deletion. Align to: 410 only for full
    deletion (to be confirmed).
  4. Should chain verification be expressible as a validation type)?

Related

RecordReferrers (adds service), Status assertions, Validation Result.

Activity

  1. added a commit that references this issue on Oct 30, 2026
    823a6e0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions