4. @fleetmesh/circles#
@fleetmesh/circles provides TypeScript implementations of two distinct subsystems:
Circle governance (the browser counterpart to
fleetmesh_core.networkandmeshctl circle): circle controller documents (kind30834), member co-signed capability grants (kinds30832and30833), fleet enrollment tokens, private fleet rosters (kind30835), and brand verification.Social circle client helpers: group DID documents, UCAN and W3C Verifiable Credential objects, per-circle epoch keys, circle-scoped sealed storage, invitation tracking, and member count utilities.
4.1. Installation#
npm install @fleetmesh/circles@next @fleetmesh/textile@next @fleetmesh/leaf@next
Runtime dependencies are @fleetmesh/leaf, @fleetmesh/textile, @noble/curves, and @noble/hashes.
Note
fleetmesh_protocols.circles (Circle Rooms (fleetmesh_protocols.circles)) implements the host-side social circle-rooms store and is unrelated to circle governance.
4.2. Governance#
A FleetMesh circle possesses neither a shared private key nor a central server. Its controller document enumerates member public keys and per-tier quorum thresholds, and is published alongside grants on standard NIP-01 relays. Governance workflows query events at deterministic coordinates, evaluate state transitions locally, and publish resulting signed events. These modules port the Python reference implementation and are validated against its conformance vectors (core/vectors/*.json, mirrored in test/vectors/).
Module |
Description |
|---|---|
|
Kind |
|
Circle founding and epoch rotation, corresponding to |
|
Multi-party grant quorum assembly from identical member copies: |
|
Kinds |
|
Named capability bundles at a single tier (such as |
|
Fleet enrollment tokens: kind |
|
Owner’s private fleet roster (kind |
|
NIP-32 label-based brand verification combining an authority’s kind |
|
Relay transport abstraction: |
|
Schema-derived event kinds, tiers, capability vocabularies, and refusal codes; operator DID parsing; BIP-340 Schnorr signing. |
Every governance operation reports rejections via typed exceptions (GroupRefused, FlowRefused, ChainRefused, TokenRefused, RosterRefused, BrandRefused) carrying a canonical refusal code defined in the schema.
4.3. Social Circles#
Module
Description
circleDidAndUcanCorecomputeCircleGroupDidandbuildCircleDidDocumentfor circle records;mintUcanGrantTokenObjectandmintCircleMemberCredentialObjectfor generating member UCAN and W3C Verifiable Credential objects.circleKeys,vaultKeyPer-circle epoch key management (
circleScope) and device vault key accessors (getVaultKey,setVaultKey).sealedStoreCircle-scoped XChaCha20-Poly1305 encrypted storage (
rememberScopeKey,sealIntoScope,loadSealed).circleInviteStore,circleMemberCountPending invitation persistence and member roster counting and formatting utilities.
hostAdapterconfigureCirclesHostregistration for listing, fetching, and uploading user fibers and posting circle keys. When unconfigured, read operations returnnulland write operations throwHostNotConfiguredError.typesType definitions for circle and member records.