6. Circle Rooms (fleetmesh_protocols.circles)#
fleetmesh_protocols.circles provides an embeddable social circle-rooms store for web hosts, managing circles, posts, watch-party frontier state, invitations, privacy rungs, and persistence. It is supported in the alpha release as an opt-in library and is not invoked by meshnode.
This package is distinct from FleetMesh circle governance, which is implemented in fleetmesh_core.network.group and fleetmesh_core.network.grant (administered via meshctl circle) and in TypeScript via @fleetmesh/circles.
6.1. Security and Validation Rules#
The store enforces the following invariants:
Invite codes: Generated invite codes for private circles consist of the
MESH-prefix followed by 96 bits of cryptographic randomness. Caller-supplied invite codes MUST be at least 12 characters long, as code-based join lookups search across all circles and rely on the invite code as the sole authorization secret.No group keys: Circle records do not store a
group_pubkeyfield.No outbound delivery: Invitation records set
dm_sent: false, because this store performs no message transmission.Slug format: Circle slugs MUST contain only lowercase ASCII letters (
a-z), digits (0-9), and hyphens (-).
6.2. Store#
Standalone Circle Rooms, Watch-Party Frontier & Privacy Rung Store (node.protocols.circles.store).
Circles are equal-peer collectives: no owner or admin, so their members are who may change them. Every write is authorized by the request principal, never by an identity the request names:
creating a circle makes the caller its first member; joining a public circle adds the caller, a private one needs its invite code or an invite addressed to the caller; leaving removes them;
posts, curation, the watch party, invites, profile, DID, UCAN, credential and treasury changes are members-only, and act on circles that exist (never invent one).
Reads: private circles are listed to their members only; a public circle’s internals (invite code, UCAN grants, credentials, treasury, invites) are its members’ alone. Membership flags are computed for each viewer, not stored.
- fleetmesh_protocols.circles.store.visible_circle(c_obj, principal)[source]#
The circle as this viewer may see it, with their membership flags; None for a private circle they are not in.
- fleetmesh_protocols.circles.store.visible_invites(eng, principal)[source]#
Invites the viewer sent or received, or that belong to a circle they are in.
- fleetmesh_protocols.circles.store.circle_access(eng, cid, principal)[source]#
The circle and whether principal is one of its members, or None when there is no such circle.
- fleetmesh_protocols.circles.store.apply_circle_media_privacy(eng, c_obj, media_id, body, actor_did='')[source]#
Whether media_id may be shared into the circle by actor_did, checked against the item’s own root.
6.3. Persistence#
Circles persistence (node.protocols.circles.persistence): a node’s circles and invites in its SQLite database, restored at start (load_circles) and written after each change (persist_circle), so a node no longer loses its circles on restart. Presence (typing, watch-party telemetry) is never written.
6.4. Blinded Tombstones and the Privacy-Ladder Ledger#
Experimental
This feature is implemented and tested, but is not supported in this alpha release and is subject to modification or removal. See Experimental Features.
This submodule is not imported automatically and requires explicit import by the caller. Blinded locks require a caller-supplied blind_secret of at least 16 characters, with no default value and no environment-variable fallback. Caller-supplied commitments are accepted without independent verification, and PrivacyLadderLedger operates strictly in memory.
Blinded pre-emptive tombstones and the privacy-ladder ledger (experimental).
Experimental: not supported in the alpha, and may change or go away. Moved out of core’s fleetmesh_core.textile.privacy_ladder (audit 2026-11-18 textile #15, decided 2026-11-19), which keeps the rungs (PRIVACY_RUNG_RANK) and normalize_did / normalize_bytes32. Nothing in the node or the supported libraries calls this; the client side is @fleetmesh/textile’s blindedTombstones.ts.
The blinding secret is the caller’s: a blinded lock needs a blind_secret of at least MIN_SECRET_LENGTH characters (or a blinding_factor_hex the caller derived), and nothing is read from the environment. Until alpha.2 it fell back to FLEETMESH_BLIND_SECRET, FLEETMESH_NODE_SK, the public URL or domain, then fleetmesh.org, from which anyone could compute the factor and lift the lock.
- Known gaps, for whoever takes it up:
a caller-supplied blinded_origin_commitment or ephemeral_pubkey is taken as is, so whoever knows a content root can put a lock on it first and block its public ingest
the ledger is in memory only
- class fleetmesh_protocols.circles.blinding.PrivacyLadderLedger[source]#
Bases:
objectServer-side ledger enforcing the 6-rung privacy ratchet and blinded pre-emptive locks.
- find_tombstone_for_tree_root(tree_root)[source]#
- Parameters:
tree_root (str)
- Return type:
MutableMapping[str, Any] | None
- fleetmesh_protocols.circles.blinding.compute_blinded_origin_commitment(blinding_factor_hex, origin_did, tree_root)[source]#
- fleetmesh_protocols.circles.blinding.derive_ephemeral_tombstone_key(blinding_factor_hex, lock_tag_hex)[source]#
- fleetmesh_protocols.circles.blinding.derive_origin_blinding_factor(origin_did, tree_root, secret)[source]#
The blinding factor for a DID’s content root. Raises ValueError unless secret has at least MIN_SECRET_LENGTH characters once stripped: there is no default.