Skip to content

Add RecordReferrers service: reverse lookup of RelationRecords per namespace #37

Closed

Description

@Jenziner

Summary

RWP defines forward references only (CaseRecord links, AssertionRecord subject/object).
A party holding a Record has no defined way to discover which RelationRecords refer to it.
This issue proposes a DID Document service of type RecordReferrers that returns all
RelationRecords referring to a given Record within the Record's namespace.

Motivation

  • Verifiers must be able to find RelationRecords about a Record, e.g. assertions that
    change its status (revocation, suspension, key compromise), without out-of-band knowledge.
  • The same mechanism lets a custodian answer "in which Cases / Assertions is this Record used?"
  • Service discovery already follows the DID Document (see 21.2.5: endpoints MUST NOT be inferred).

Proposal

1. DID Document service entry (4.3)

"service": [{
  "id": "did:rwp:<namespace>:<record-id>#referrers",
  "type": "RecordReferrers",
  "serviceEndpoint": "[https://example.org/api/v1/referrers](https://example.org/api/v1/referrers)"
}]

4.3 currently states that all fields other than recordEndpoint, updated and
currentVersion MUST NOT be changed. This needs an amendment so that service
entries may be added or updated.

2. Scope and completeness (normative)

A custodian offering this capability MUST return, for a target Record in its namespace,
every finalised version of every RelationRecord in the same namespace that contains a
reference to the target DID. The result is complete for that namespace. Completeness
is a conformance requirement; the response carries no separate scope field.
References from other namespaces are out of scope (see follow-up issue).

3. What counts as a referrer

  • Any RelationRecord type (CaseRecord, AssertionRecord, future RelationRecord types).
  • A reference is any link recordDid (CaseRecord) or subject.id / object.id
    (AssertionRecord) equal to the target DID, regardless of whether a versionHash is present.
  • Draft versions are not listed.

4. Response

{
  "target": "did:rwp:<namespace>:<record-id>",
  "referrers": [
    {
      "recordDid": "did:rwp:<namespace>:<referrer-id>",
      "versionHash": "sha256:<hex>",
      "recordType": "did:rwp:<namespace>:<schema-id>",
      "targetVersionHash": "sha256:<hex>"
    }
  ],
  "next": null
}

targetVersionHash is present only if the reference was version-specific.
Query parameters: recordType (SchemaRecord DID, repeatable), limit, cursor.

5. Trust

Entries are pointers, not evidence. A consumer MUST resolve and validate each referrer
according to 7.5 and 20.2 before relying on it.

6. Access

No special rule. Referencing Records are opaque; access to their content follows the
normal access mechanics. Listing a referrer does not grant access to it.

7. Errors

Aligned with 4.4: 200 known, 403 per access policy of the target, 404 unknown, 410 deleted.

8. Conformance

Add capability "Provide referrers" to 2.5. A custodian claiming it MUST satisfy
requirement 2 for all Records in its namespace.

Out of scope

  • References from other namespaces (separate, deferred issue).
  • SystemRecords that reference Records (MergeRecord contributedTo, DeletionRecord
    targetDid, ConformanceRecord supersedes).
  • Remodelling recordEndpoint as a service entry.

Open questions

  1. Draft versions excluded: confirm.
  2. Must a referrer appear in the response immediately after finalisation, or is eventual
    consistency allowed? The text above requires immediate (everything finalised before
    the request was received).
  3. Should the response also list the referrer's state? Currently only finalised versions
    appear, so it would always be finalized.

Related

  • DID Document history (versionId chain)
  • Status assertions (revocation via AssertionRecord with effectiveAt)
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