Skip to content

id: AT Protocol read compatibility — DID resolution + repo/record ingestion (consider) #13787

Backlog

Description

@dezren39

Consideration

Drew (2026-11-23): "we should probably at least support it for compatibility layer — allow reading bsky in id natively, consider."

Scope: a read-only AT Protocol ingestion path for pkgs/id — resolve atproto identities, fetch their public repositories, verify them cryptographically, and surface the records inside id with provenance. No write support, no account creation, no Spaces/permissioned data, no AppView ambitions. Full research note: ~/workspace/p2panda-investigation/research/bluesky-atproto.md (Part B); filed from the auth+transport investigation #13779, for the id epic #2056.

What it decomposes into

  1. Handle → DID: DNS TXT (_atproto.<handle>) or /.well-known/atproto-did, verified bidirectionally against the DID document.
  2. DID resolution: did:plc via plc.directory (strong form: fetch and verify the audit-log operation chain — each op signed by the prior op's rotation keys, so the directory is trusted only for availability/fork choice); did:web via /.well-known/did.json (trust = DNS+TLS). From the document: the #atproto repo signing key and the #atproto_pds endpoint.
  3. Light record reads: com.atproto.repo.describeRepo / listRecords / getRecord against the account's PDS, unauthenticated. Trusts the PDS for completeness — acceptable for display, not for verification claims.
  4. Verifiable repo ingest: com.atproto.sync.getRepo → CAR v1 (signed commit + MST nodes + records). Verification: DAG-CBOR/CID discipline, MST reconstruction (SHA-256 key-depth, fanout 4, prefix-compressed nodes) with root equality against the commit's data CID, commit signature check (SHA-256 over the unsigned commit; secp256k1 or P-256 key from the DID document), rev monotonicity. This is the slice that makes "reads bsky natively" mean something more than "calls Bluesky's AppView".
  5. Optional live follow (later): relay com.atproto.sync.subscribeRepos; #commit diffs verify cheaply via op-inversion against prevData (per-repo state = rev + root CID). Full-network firehose is AppView-scale — a filtered/per-account shape is the realistic form.

Where it would sit

Precedent: pkgs/id/crates/id-import-notion — importer-shaped work already lives in its own crate. Proposal: a new read-only importer crate (working name id-import-atproto): resolve → fetch → verify → emit foreign records with provenance (DID, collection, rkey, CID, commit rev) into id's existing store/events shapes. Explicitly not id-core (no core model change for a foreign protocol) and not id-sync (id's own log-sync/meta protocol — a different thing that happens to share a word).

Rust library state: atrium (MIT, actively released; atrium-identity, atrium-repo MST, codegen'd XRPC types — the default candidate, though its centre of gravity is client sessions); jacquard (MPL-2.0, jacquard-repo MST/CAR, zero-copy, but single-maintainer-shaped and pre-1.0 with frequent breaking releases); atproto-crates (MIT, separable primitives incl. CAR reading and identity, 0.14.x). Rolling our own MST/CAR verifier is bounded, spec-complete fallback work, not the plan.

Costs, stated plainly

  • MST/CAR/commit verification is real work — and is also the entire value over proxying an AppView.
  • Unknown lexicons must ingest as opaque verbatim records; interpreting app.bsky.* is a separate opt-in layer.
  • Deletion/takedown handling is a policy choice: repos are tombstone-free and mirrors are expected to honour deletions; verbatim retention must be a deliberate decision, not a default.
  • Scale scoping: per-account ingest is tractable; "the network" is an indexing programme. This issue is about accounts.

Open questions

  1. PLC trust posture: (a) trust plc.directory HTTPS, (b) verify the audit-log chain per DID, (c) consume a PLC replica. Recommendation: (b).
  2. Record modelling: verbatim DAG-CBOR with provenance index (recommended first slice) vs mapping into id's object model.
  3. Which accounts/collections are in scope for a first slice — a named seed set, or any DID on demand?
  4. Live follow: in scope at all, and if so filtered (per-account polling / Jetstream-shaped) vs relay subscription?
  5. Blobs: reference-only, or fetch-and-store?
  6. Does the importer emit into id-events/id-store directly, or land in a staging shape the atlas source-registry work (atlas: provenance registry (chunk occurrences), content-addressed extracts, multi-DB vector resolution #3125 line) consumes?

Links

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-23T21:43:42Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": null,
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": null,
    "auth_subject": "archer",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Activity

  1. developing-today commented on Nov 23, 2026

    @developing-today
    Contributor
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