FleetMesh fleetmesh
Mesh Guide 8 Chapters
L2 Network Fabric L2 Network Fabric

Network Fabric, Discovery & Bridges.

Layer 1 gave every node an unforgeable cryptographic identity. Layer 2 solves the next hard question: how do two strangers find each other, punch through firewalls and home routers, survive internet outages, let ordinary browser tabs join safely, and speak across Nostr, ATProto, and the Fediverse?

2.0 · Layer 2 Big Picture

One unbroken identity across an eight-rung transport ladder

Real-world networks are messy. Two nodes in the same office can speak direct LAN packets; two home servers behind carrier-grade NAT need UDP hole-punching; a traveler on airport Wi-Fi may only have outbound HTTPS port 443; and a smartphone browser tab cannot open raw UDP sockets at all.

Instead of betting on a single fragile socket, FleetMesh decouples who you are (did:nostr) from which wire carries your packets. Nodes negotiate the highest shared rung on an 8-rung priority ladder—from FIPS Noise XK (rank 5) and the iroh rung (rank 10) down through WSS (rank 40) and Nostr gift-wrap relays (rank 100)—while bilateral grants, signatures, and 1 KB Bao proofs stay completely unbroken across every fallback.

Interactive Lab 2.0 · 8-Rung Transport Ladder Simulator
Toggle network conditions to see which rung wins
L2 L2
Companion Explainer 2.0
Layer 2: Network Fabric & The 8-Rung Ladder
Nostr Relays Nostr Relays

2.1 · Decentralized Discovery

Nostr Relay Discovery & Control Plane

The Concept

How do you find a peer without a central directory? Nostr (Notes and Other Stuff Transmitted by Relays) treats relays as simple, interchangeable bulletin boards. Every event is signed by its author’s secp256k1 key, so a relay can never forge or alter a record—and if one relay bans you or goes offline, you simply publish the same signed card to any other relay.

FleetMesh Implementation

  • Signed Node Descriptors (kind 11801): Every node publishes its X25519 agreement key, supported transport ranks, and canonical schema/DIGEST.
  • Universal Fallback (Rank 100): When every direct socket is blocked, senders drop a NIP-59 gift wrap onto the recipient’s kind 10050 inbox relays.
  • 24 Standard NIPs: FleetMesh composes cleanly on established Nostr primitives rather than inventing a closed discovery silo.
Interactive Lab 2.1 · Signed Node Descriptor Inspector (kind 11801)
Switch node class to inspect its Nostr peer card
Nostr Nostr
Companion Explainer 2.1
Nostr Relay Discovery & Universal Fallback
FIPS Mesh Overlay FIPS Mesh Overlay

2.2 · Identity-Native Routing

FIPS Mesh Overlay

Important Acronym Check: In Layer 2, FIPS stands for the Free Internetworking Peering System—an encrypted peer-to-peer mesh overlay network. It is completely separate from NIST FIPS 140-3 (the federal cryptographic module validation standard covered in Chapter 7 and fips-140.html).

The Concept

Traditional VPNs route traffic through a central concentrator and assign arbitrary IPs from a database. FIPS derives each node’s self-certifying fd00::/8 IPv6 mesh address mathematically from its secp256k1 public key and wraps every hop in Noise IK/XK encryption—so packets route across multiple hops directly by cryptographic identity with zero DNS or VPN hub.

FleetMesh Implementation

  • Top Transport Priority (Rank 5, Opt-in): Automatically preferred whenever both peers advertise fleetmesh-fips in their descriptor.
  • Unprivileged fips-native Mode: The Rust fleetmesh-fips sidecar passes 16-bit FSP service sockets over Unix SCM_RIGHTS file descriptors with zero root privileges.
  • Optional Kernel TUN (fips0): Supports standard IPv6 overlay routing when operators want OS-level mesh sockets. See fips-peering.html.
Interactive Lab 2.2 · Self-Certifying npub → fd00::/8 Address Deriver
Type any peer label to derive its deterministic FIPS mesh address
FIPS FIPS
Companion Explainer 2.2
FIPS Mesh Overlay (Identity-Native Noise Routing)
Iroh Rung Iroh Rung

2.3 · Opt-in Point-to-Point Rung

Iroh Rung & Optional Sidecar

The Concept

Home Wi-Fi routers and mobile carriers use NAT (Network Address Translation) that drops unsolicited inbound connections. The iroh rung addresses peers by their Ed25519 NodeId so nodes can exchange framed streams directly, and pairs with an optional external iroh sidecar when relay-assisted UDP hole-punching across NAT is needed.

FleetMesh Implementation

  • Opt-in Rung (Rank 10): Sits directly below FIPS on the 8-rung ladder in fleetmesh_node/transport/iroh_rung.
  • Wire Unencrypted by Design (Not QUIC / Not TLS 1.3): The built-in iroh_rung wire itself is neither encrypted nor authenticated—there is no TLS 1.3 handshake or QUIC packet protection. Confidentiality and authenticity come from the inner DIDComm v2 JWE envelope.
  • Optional External Sidecar for Hole-Punching: Direct UDP hole-punching and relay upgrade happen only when an operator runs an optional external iroh sidecar alongside meshnode.
Interactive Lab 2.3 · Iroh Rung & Optional Sidecar Stepper
Step through how peers dial the iroh rung and pair with an optional sidecar
Iroh Rung Iroh Rung
Companion Explainer 2.3
Iroh Rung & Optional External NAT Sidecar
libp2p GossipSub libp2p GossipSub

2.4 · Epidemic Broadcast

libp2p & GossipSub Mesh

The Concept

If 10,000 nodes each connected to every other node, the network would collapse under connection overhead. GossipSub v1.1 solves broadcast scale by giving each node a small active topic mesh (D ≈ 6 eager neighbors) plus lightweight IHAVE/IWANT metadata gossip to wider peers—reaching the entire network in logarithmic hops while scoring and pruning spammers locally.

FleetMesh Implementation

  • Sidecar Integration (Rank 20, Experimental): Wired through fleetmesh_p2p to scale pub/sub fanout without full-mesh socket explosion.
  • Topic & Envelope Mapping: Bridges FleetMesh’s kind 30804 topic announcements and gossip/1.0 envelopes directly onto GossipSub v1.1.
  • NAT Traversal & Identity Continuity: Uses Circuit Relay v2 and DCUtR upgrades while keeping Layer 1 DIDs and Layer 4 bilateral grants unchanged.
Interactive Lab 2.4 · GossipSub Epidemic Fanout Estimator
Adjust network size & mesh degree D to compare hops vs. full-mesh cost
libp2p libp2p
Companion Explainer 2.4
libp2p, GossipSub v1.1 & DCUtR
LAN mDNS LAN mDNS

2.5 · Zero-WAN Local Mesh

LAN mDNS & Offline Local Discovery

The Concept

In centralized cloud apps, cutting the neighborhood fiber cable stops two laptops sitting on the same table from talking. Multicast DNS (mDNS, RFC 6762) lets devices on the same Wi-Fi router or Ethernet switch announce themselves locally with zero DNS server or internet uplink.

FleetMesh Implementation

  • Opt-in Zero-WAN Discovery: Disabled by default (LanConfig.enabled = False in config/compartments.py); when explicitly enabled by the operator, nodes listen for local mDNS beacons so LAN clusters stay operational during internet outages.
  • Zero Blind LAN Trust: mDNS supplies only a candidate address—peers still run full did:nostr signature verification, DIDComm encryption, and bilateral grant metering.
  • Automatic Delta Reconcile: The moment any node regains WAN uplink, NIP-77 Negentropy merges offline-created events cleanly back into the wider mesh.
Interactive Lab 2.5 · WAN Outage → Offline LAN → Reconnect Lifecycle
Walk through how a local cluster survives a total internet outage
mDNS mDNS
Companion Explainer 2.5
LAN mDNS & Zero-WAN Local Mesh Resilience
Browser Leaves Browser Leaves

2.6 · Zero-Install Web Nodes

Browser Leaves & Dual-Anchor Mediation

The Concept

Asking newcomers to install a daemon or forward router ports kills adoption. Yet browser tabs cannot bind raw UDP sockets, and WebRTC ICE leaks home IP addresses. A mediated Leaf keeps all signing keys, encryption, and verification inside the browser tab while using lightweight relay mediators strictly as blind ciphertext postboxes.

FleetMesh Implementation

  • Dual-Anchor Anti-Eclipse (Rank 40): @fleetmesh/leaf rides one TLS 1.3 WebSocket per mediator across at least two independent Anchors via coordinate-mediation/2.0.
  • Offline-First Queueing: Unsent drafts and state persist in browser IndexedDB when a phone or laptop loses signal.
  • In-Tab Verification: Every incoming event and 1 KB Bao chunk is verified inside WebCrypto—catching any lying or censoring Anchor immediately.
Interactive Lab 2.6 · Dual-Anchor Anti-Eclipse Resilience Tester
Simulate mediator failure or censorship against a browser Leaf
Leaf Leaf
Companion Explainer 2.6
Browser Leaves & Dual-Anchor Anti-Eclipse Mediation
ATProto ATProto

2.7 · Cross-Protocol Transducer

AT Protocol (Bluesky) Interop

The Concept

AT Protocol (powering Bluesky) gives every user a portable signed repository stored as a Merkle Search Tree (MST), addressed by did:plc or did:web, with structured Lexicon schemas and timestamped IDs (TIDs) streamed over a public firehose.

FleetMesh Implementation

  • XRPC Adapter (Experimental): Implements com.atproto.{repo,server,sync} endpoints to ingest and serve ATProto commits.
  • Deterministic Textile Transducer: Maps Lexicon records inside @fleetmesh/protocols into Layer 3 Textile Strands and Bao Fibers.
  • Local-First Ownership: Communities bridge smoothly with Bluesky without giving up sovereign peer-to-peer storage or verification.
Interactive Lab 2.7 · ATProto Lexicon ↔ Textile Strand Transducer
Inspect how an ATProto commit translates deterministically into FleetMesh
ATProto ATProto
Companion Explainer 2.7
AT Protocol Interop & Textile Transducer
Federation Bridges Federation Bridges

2.8 · Federation & Log Bridges

ActivityPub, SSB, p2panda & Rhio Bridges

The Concept

Decentralized communities shouldn’t be trapped in incompatible silos. Federated servers speak ActivityPub (Mastodon, PeerTube, Pixelfed); offline-first P2P communities use p2panda CBOR operation logs and Secure Scuttlebutt (SSB) gossip feeds; and high-throughput clusters pair Rhio with NATS JetStream.

FleetMesh Implementation

  • Cluster & Log Adapters (Opt-in): Rhio (rank 12) streams length-committed Bao HTTP 206 chunks; p2panda (rank 15) syncs Bamboo CBOR logs; SSB (rank 25) bridges SHS + Box Stream feeds.
  • Fediverse Bridge (Experimental): Translates ActivityPub actors and notes using WebFinger (RFC 7033) and HTTP Signatures (RFC 9421).
  • Unified Storage Target: Every bridge converges into the exact same Layer 3 Textile & 1 KB Bao storage primitives.
Interactive Lab 2.8 · Multi-Protocol Bridge Adapter Inspector
Inspect wire mechanics & maturity of each Layer 2 bridge
Bridges Bridges
Companion Explainer 2.8
ActivityPub, SSB, p2panda & Rhio Federation Bridges