The p2p node can now add and drop regions while running (SetRegions):
topics, validators, subscriptions and per-region peer discovery start and
stop with them, and a newly followed region catches up by sync.
PUT /api/v1/regions (owner token) applies a change and the node saves it in
regions.json, which wins over --region from then on. The owner's browser
gets a "Regions" page: search a place by name (GeoNames cities, offline,
CC BY 4.0), follow its cell plus any cell within about 40 km.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
- Bootstrap: built-in /dnsaddr/allmende.stinnesbeck.com (TXT records at
_dnsaddr.<name>), resolved at every redial with the last good answer kept;
--bootstrap takes /p2p/ or /dnsaddr/ entries, --no-default-bootstrap drops
the built-in one. Stopping never waits for a stuck resolver.
- Remembered peers in peers.json (saved every 5 min and on shutdown, redialled
at the next start)
- Private Kademlia DHT (/allmende prefix), advertised and looked up per region
with quick first attempts and a backoff; --no-dht turns it off
- NAT traversal: port mapping, hole punching, AutoRelay through bootstrap nodes
- --public: DHT server and relay for a bootstrap node; prints the TXT records
- Docker, NixOS module (public, defaultBootstrap, QUIC/UDP) and docs updated
- e2e: bootstrap node scenario, seed cache restart, and polling that really polls
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The node now checks for new messages every 10 s in the background (before,
only when the web UI asked), and Inbox.Collect reports newly filed visible
messages through OnArrivals. The CLI logs one line per conversation with the
listing title and a link to it, never the buyer's text. Hidden messages are not
announced, a backlog is capped at 5 lines, and a lock stops a background check
and a UI request from filing the same message twice.
The e2e checks that node A announces the message before its API is called.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Web: "My listings" (listings, requests of a listing, conversation) in
three panes on wide screens and one at a time on phones, and a sheet or
dialog to release the exact address. Sign-in uses a link printed by
`node run` (token in the URL fragment, kept in sessionStorage only).
API: GET /api/v1/mine (own listings with request counts and whether an
address is saved); inbox rows gain last_dir, needs_reply, preview,
effort and grant_until, and can be filtered by listing.
Docs: PROTOCOL.md and README describe the owner UI and login.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Wire format (internal/message): sealed boxes to the listing's device key
(X25519 + HKDF + ChaCha20-Poly1305), padded, proof-of-work stamped, with
signed owner replies and address grants. Relay validation, bounded queues,
gossip on per-region message topics and sync (store, p2p).
Owner side (internal/inbox, API): inbox with hidden link messages and a
per-day new-thread limit, replies, grants, and a private per-listing
address. Public POST/GET /api/v1/messages for buyers.
Browser: noble-based sealing and reply verification checked against a Go
fixture, contact form, conversation view, message list, de/en strings.
Docs: PROTOCOL.md messaging section matches the implementation.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Every node now serves a search and listing-detail UI at GET /. It is
vanilla TypeScript, bundled unminified into web/dist (committed) and
embedded with go:embed, so `go build` is enough to run a node.
The browser verifies each listing itself (certificate, binding, validity,
signature, proof-of-work) with pure-JS ed25519, so a gateway can withhold
listings but not forge them. Unverifiable results are hidden and their
content is never shown. Listing text is only inserted via textContent and
the UI is served with a strict CSP.
Canonical JSON is reimplemented in TypeScript and tested against a golden
fixture signed by the Go code. /api/v1/status now reports difficulty.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- cmd/node: init (recovery phrase onboarding), run, recover
- api: public reads of canonical signed records, token-protected writes
- identity: RevokeAll voids every device certified before a cutoff, so
recovery works with only the phrase; store purges by certificate age
- p2p: redial bootstrap peers, sync on every new connection (in-flight
guard only), validate bootstrap addresses up front
- docs: API, recovery semantics, peer-ID change on recovery
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- identity: 12-word recovery phrase, device certificates, revocations,
device key storage; the identity key is never stored on a node
- listing: signed by a device with an embedded certificate, domain-separated
signatures, ErrTimeWindow for clock-related failures, region helpers
- store: revocations purge a device's listings; keyset-paged Since for sync
- p2p: gossipsub topic per geohash region plus a global revocation topic,
validators run before relaying, /allmende/1/sync catch-up protocol,
bootstrap peers and mDNS
- docs: key model, replication and conflict rules
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Put verifies listings and keeps only the newest version per
(author, id); equal seq resolves to the smaller hash so replicas converge
- Tombstones are stored so old versions cannot be resurrected
- Search by geohash prefix, kind, category, price, area, rooms
- Expire removes listings and tombstones past their lifetime
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- internal/jcs: RFC 8785 canonical JSON (integers only)
- internal/identity: ed25519 keypair, 0600 key file, no overwrite
- internal/listing: signed listing record with PoW, validation,
tombstones and supersede rules
- docs/PROTOCOL.md: architecture and decisions so far
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>