Skip to content

Spec: the network transport (TLS, pairing, discovery) and resources in initialize - #24

Merged
cjus merged 1 commit into
mainfrom
claude/network-transport
Nov 5, 2026
Merged

cjus merged 1 commit into
mainfrom
claude/network-transport

Conversation

@cjus

@cjus cjus commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Specifies what cb2026's network listener does (cjus/chessengine#209), so another client can implement it from the spec.

  • 3.2 The network: TLS over TCP: TLS 1.3, self-signed certificates on both sides pinned by SHA-256 fingerprint, approved-clients only with silent refusal, pairing (one-time code, 5 min, 1 client, 3 tries; the client MUST have the person confirm the fingerprint before sending the code), one client at a time (Busy, null id), disconnect cancels, deadlines (no idle timeout), limits.
  • 3.3 Finding a node: a 320-byte UDP probe to port 4026, a reply never longer than the probe, nothing private, opt-in, where broadcast doesn't reach.
  • initialize result: resources (threads, hashMb), optional, so a client can tell a big node from a small one.
  • §10, §13 and the changes list follow. WebSocket stays reserved.
  • Added to the 1.0 draft as pondering was (optional only); say if you'd rather it be 1.1.
  • Tests: Resources round trip and unknown fields, and a new transport_examples test that checks the spec's transport examples (sizes, fingerprint form, the Busy refusal).

Rust API note: InitializeResult gains a field, so code that builds one with a struct literal needs resources: None.

fmt, clippy, tests, doc and cargo deny pass locally.

🤖 Generated with Claude Code

…sources in initialize

Section 3.2 now specifies CNP over TCP with TLS 1.3: self-signed certificates on both sides,
recognised by SHA-256 fingerprint; a node serves only approved clients and says nothing to
anyone else; pairing with a one-time code after the person has confirmed the node's
fingerprint; one client at a time (Busy with a null id); disconnecting cancels; deadlines and
limits. Section 3.3 specifies discovery: a 320-byte UDP probe on port 4026 and a reply no
longer than the probe, with nothing private in it. Section 10 and the reserved list follow.

initialize's result gains an optional resources object (threads, hashMb), so a client can tell
a node with 64 threads from one with 1. Both additions are optional, like pondering's were to
the 1.0 draft.

The transport examples are checked by a new test, as the cnp examples are.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@cjus
cjus merged commit ba9e0ce into main Nov 5, 2026
1 check passed
@cjus
cjus deleted the claude/network-transport branch November 5, 2026 17:39
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.

1 participant