OverviewFilesCommitsIssuesDocsReleasesPeers

atproto-did-peer commits / 572a1a0

atproto-did-peer: README
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
572a1a09dfdc3c87635604addac39718d36545e3
by plankatron <fleeky@gmail.com> · 2026-07-15T15:07:20.000Z

Changed files (1) +37 -0

README.md +37 -0
……@@ -0,0 +1,37 @@
1# atproto-did-peer
2
3**Keyless P2P reader** for a self-custody atproto peer's repo + firehose. Given a DID (and its verify key),
4it announces + replicates the peer's Hypercores over Hyperswarm and derives a read view — holding **no key**
5and never re-minting a signature (the peer's own signed commits travel in its firehose).
6
7Extracted from [atproto-bridge](../atproto-bridge)'s `PeerFront`/`PeerRouter` so the read path is a shared
8module. Consumed by [favela-web](../favela-web) (its appview reads community members' repos) and the bridge.
9
10## API
11
12```js
13import { DidPeer, DidPeerRouter } from 'atproto-did-peer'
14
15// single DID
16const peer = new DidPeer(corestore, { did, verifyKey })
17await peer.ready()
18for (const r of await peer.listRecords('app.bsky.feed.post')) { … } // snapshot read
19for await (const { bytes } of peer.subscribeRepos(from)) { … } // live firehose tail
20const ops = await DidPeer.commitOps(frameBody) // decode a #commit's ops
21
22// MANY DIDs over ONE announce channel (the multi-DID fix — a per-peer attach collides on the
23// single ANNOUNCE_PROTOCOL channel; the router owns replication + dispatch by DID)
24const router = new DidPeerRouter(corestore)
25swarm.on('connection', (c) => router.onconnection(c))
26const peer = router.add(did, { verifyKey })
27```
28
29## Why keyless
30
31The firehose is already torrent-like (hypercore: multi-source parallel download, per-block
32Merkle + signature piece-hashes, sparse, non-author seeding, live-append). A reader verifies each signed
33commit against the DID's key; it never needs the signing key to READ. This is the substrate favela's
34per-peer appview and the keyless membrane both build on.
35
36See also: [atproto-store](../atproto-store) (repo storage + firehose codec),
37[hyper-proto-peer](../hyper-proto-peer) (the self-custody peer that holds the key).