Skip to content

feat(community-list): add CommunityList, immutable signed lists of curated communities - #309

Open
Rinse12 wants to merge 6 commits into
masterfrom
docs/community-list-spec
Open

Rinse12 wants to merge 6 commits into
masterfrom
docs/community-list-spec

Conversation

@Rinse12

@Rinse12 Rinse12 commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Implements CommunityList (formerly "multisub") end to end, docs and code in one PR.

Closes #21. Closes #342.

Design (revised from the original issue #21 IPNS design, see the revision comment there)

A CommunityList is an immutable, signed IPFS file addressed by CID, like a comment. Mutable IPNS lists were rejected as a rug-pull risk: apps ship list addresses as defaults, and a single IPNS update could redirect every installed client to arbitrary communities with nobody in the loop. With CIDs, each revision is a new CID re-reviewed at adoption time; clients never auto-follow. Spec: docs/protocol/community-lists.md.

What's in the PR

  • Spec: docs/protocol/community-lists.md rewritten for the immutable design, including the author field (Add author to the CommunityList spec #342): same wire schema as publication.author, runtime identity derived from signature.publicKey, lazy author.nameResolved, and never any author.community (lists are never published to a community, so there is no challenge flow and no community-assigned author state).
  • Implementation (src/community-list/): one CommunityList class.
    • pkc.createCommunityList({signer, ...props}) + publish() (sign + IPFS add, returns the cid) / stop() (abort). Any key can sign, including the curator's personal author key; one key can sign any number of lists.
    • pkc.createCommunityList({cid}) + update() / stop(): fetch + verify with retries, emit update, then keep driving author.nameResolved until the verdict is definitive (resolves to signer = true; different key or no resolver for the TLD = false; transient failures retry), emit update again, then stop itself. One-shot pkc.getCommunityList({cid}) doesn't wait for the verdict (it warms the pkc-wide cache).
    • Signing/verification in src/signer/signatures.ts (signCommunityList, verifyCommunityList): loose load schemas preserving extra signed props, reserved-field guards (cid/shortCid on the record, address/shortAddress on entries, the publication author reserved list on author), unsigned-signable-field check (Verification picks by signedPropertyNames without checking the record against it, so a record can skip crosspost recursion #249 class), duplicate entry publicKey rejection, 2 MB cap on publish and on load (download-limit guarded before parsing).
  • RPC: publishCommunityList / fetchCommunityList. Signing stays client-side; the raw signed string crosses the wire so the server adds the exact signed bytes, and the client checks the returned cid against the bytes it signed (and on fetch, checks the returned bytes against the cid) so the server is never trusted with record validity.
  • README: Multisub/MultisubEdit/PKCDefaults schema fossils replaced with the CommunityList schema and API sections.
  • Tests (test/node-and-browser/community-list/): lifecycle, validation and verification suites plus dedicated author.nameResolved coverage (true/false/definitive-false/transient, cache warmup, wire purity), passing under remote-kubo-rpc, local-kubo-rpc, remote-libp2pjs and remote-ipfs-gateway. The remote-pkc-rpc config requires a test server built from this branch (the new RPC methods).

Not in scope (per spec non-goals)

Mutability/IPNS, edit(), third-party edits, revision-chain field, pagination, PKCDefaults. Discovery of newer revisions is out of protocol (future IPNS author profiles and communities).

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: e50f2a9f-da05-46c5-9cf6-81657909d30c

📥 Commits

Reviewing files that changed from the base of the PR and between e30dc7d and 92e81f5.

📒 Files selected for processing (22)
  • README.md
  • docs/protocol/README.md
  • docs/protocol/community-lists.md
  • src/clients/rpc-client/pkc-rpc-client.ts
  • src/clients/rpc-client/rpc-schema-util.ts
  • src/clients/rpc-client/schema.ts
  • src/clients/rpc-client/types.ts
  • src/community-list/community-list.ts
  • src/community-list/schema.ts
  • src/community-list/types.ts
  • src/errors.ts
  • src/index.ts
  • src/pkc/pkc-client-manager.ts
  • src/pkc/pkc.ts
  • src/rpc/src/index.ts
  • src/schema/schema-util.ts
  • src/signer/signatures.ts
  • test/node-and-browser/clients/rpc-call-error-deserialization.test.ts
  • test/node-and-browser/community-list/author-name-resolved.communitylist.test.ts
  • test/node-and-browser/community-list/communitylist-test-util.ts
  • test/node-and-browser/community-list/communitylist.test.ts
  • test/node-and-browser/community-list/signatures.communitylist.test.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 3cbad88c-7467-4f70-8741-3fed84dceb80

📥 Commits

Reviewing files that changed from the base of the PR and between dcf3f74 and e30dc7d.

📒 Files selected for processing (2)
  • docs/protocol/README.md
  • docs/protocol/community-lists.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Added the CommunityList protocol specification. The specification covers signed records, IPNS publication, owner and delegated publishing, validation, persistence, APIs, and client classes. Added the specification to the protocol documentation index.

Changes

CommunityList protocol

Layer / File(s) Summary
CommunityList protocol contract and documentation
docs/protocol/community-lists.md, docs/protocol/README.md
Added the CommunityList protocol design and linked it from the protocol index. The design defines the wire format, identity model, publishing APIs, validation rules, RPC workflow, persistence, class structure, and non-goals.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: 🟡 Moderate · up to e30dc

This documentation adds a signed, delegated publication contract but does not require verifying that the returned CID resolves to the exact bytes being signed, and it leaves retry, concurrency, and partial-failure behavior underspecified. Once implemented, these gaps could permit stale or mismatched content or inconsistent hosted state, so the specification should be clarified before merge.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding the documented CommunityList feature for immutable signed lists of curated communities.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/community-list-spec

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Rinse12 Rinse12 changed the title docs(protocol): add CommunityList spec (curated community lists, formerly multisub) feat(community-list): add CommunityList, immutable signed lists of curated communities Sep 6, 2026
…ed community lists

Implements the revised spec (issues #21, #342): CommunityList is an immutable, signed IPFS
file addressed by CID. Adds the CommunityList class (publish/update/stop with definitive
author.nameResolved settlement and self-stop), schemas with loose loading and reserved-field
guards, sign/verify functions, pkc.createCommunityList/getCommunityList, RPC publish/fetch
methods that keep signing client-side and byte-exact, a 2mb cap on both sides, README
schema/API rewrite replacing the Multisub fossils, and node-and-browser tests across kubo,
libp2p-js, gateway and RPC transports including author.nameResolved coverage.
…not instanceof

An error rejected by an RPC call crosses the wire as a plain object carrying the server-side
PKCError's code, never as a PKCError instance, so the instanceof-based non-retriable check
treated a deterministic ERR_OVER_DOWNLOAD_LIMIT as transient and update() retried forever
(remote-pkc-rpc oversize test timed out). Same fix for the ERR_NO_RESOLVER_FOR_NAME verdict
in author.nameResolved settlement. All 28 tests pass under remote-pkc-rpc and remote-kubo-rpc.
…tifications

The client always had _deserializeRpcError, but only subscription "error" notifications went
through it: the monkey-patched _webSocketClient.call decorated the raw JSON-RPC error object
with rpcArgs/rpcServerUrl and rethrew it as a plain object, so instanceof PKCError checks on
any request/response method's rejection always failed. Reconstruct the error in the call catch
too; locally-created errors (pTimeout ERR_RPC_CALL_TIMED_OUT, transport errors) pass through.
Repro test added first (red against the unmodified client) in
test/node-and-browser/clients/rpc-call-error-deserialization.test.ts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add author to the CommunityList spec implement multisubs

1 participant