Files
fips/docs/design
Johnathan Corgan 717be3d960 Restrict bloom filter propagation to tree edges, update design docs
Gate peer_inbound_filters() to only collect from tree peers (parent
and children), so outgoing filter computation merges only tree-sourced
information. All peers still receive FilterAnnounce messages and store
filters locally for routing queries — the restriction is only on what
gets merged into outgoing filters.

This prevents bloom filter saturation where mesh shortcuts cause every
node's filter to converge toward the full network. With tree-only
merge, filters contain subtree (from children) + complement (from
parent) + single-hop mesh views.

Implementation:
- Add is_tree_peer() helper to determine tree parent/child relationship
- Gate peer_inbound_filters() to tree peers only (single control point)
- Trigger bloom filter exchange on tree relationship changes
- Add est_entries, set_bits, fill ratio, and tree_peer fields to
  FilterAnnounce send/receive debug logs
- Add test_bloom_filter_split_horizon test verifying directional
  asymmetry: upward filters contain only the child's subtree, downward
  filters contain only the complement
- Add print_filter_cardinality diagnostic helper for test inspection

Design docs:
- fips-bloom-filters.md: Add directional asymmetry and mesh peer filter
  subsections, update per-peer filter model, saturation mitigation,
  implementation status table
- fips-mesh-operation.md: Update filter propagation description, add
  directional asymmetry, tree relationship change trigger
- fips-intro.md: Rewrite bloom propagation paragraph for tree-only merge
2026-02-23 14:00:00 +00:00
..

FIPS Design Documents

Protocol design specifications for the Federated Interoperable Peering System — a self-organizing encrypted mesh network built on Nostr identities.

Reading Order

Start with the introduction, then follow the protocol stack from bottom to top. After the stack, the mesh operation document explains how all the pieces work together. Supporting references provide deeper dives into specific topics.

Protocol Stack

Document Description
fips-intro.md Protocol introduction: goals, architecture, layer model
fips-transport-layer.md Transport layer: datagram delivery over arbitrary media
fips-mesh-layer.md FIPS Mesh Protocol (FMP): peer authentication, link encryption, forwarding
fips-session-layer.md FIPS Session Protocol (FSP): end-to-end encryption, sessions
fips-ipv6-adapter.md IPv6 adaptation: TUN interface, DNS, MTU enforcement

Mesh Behavior

Document Description
fips-mesh-operation.md How the mesh operates: routing, discovery, error recovery
fips-wire-formats.md Wire format reference for all message types

Supporting References

Document Description
fips-spanning-tree.md Spanning tree algorithms: root election, parent selection, coordinates
fips-bloom-filters.md Bloom filter math: FPR analysis, size classes, split-horizon

Implementation

Document Description
fips-software-architecture.md Stable architectural decisions guiding the codebase
fips-state-machines.md Phase-based state machine pattern (Rust enum-of-structs)
fips-configuration.md YAML configuration reference

Supplemental

Document Description
spanning-tree-dynamics.md Spanning tree walkthroughs: convergence scenarios, worked examples

Document Relationships

                        fips-intro.md
                             │
              ┌──────────────┼──────────────┐
              ▼              ▼              ▼
   fips-transport-layer  fips-mesh-     fips-software-
              │          operation       architecture
              ▼              │              │
   fips-mesh-layer ◄────────┤              ▼
              │              │       fips-state-machines
              ▼              │
   fips-session-layer        ├──► fips-spanning-tree
              │              │         │
              ▼              └──► fips-bloom-filters
   fips-ipv6-adapter
                        fips-wire-formats
                        (referenced by all layer docs)

              fips-configuration
              (standalone reference)

              spanning-tree-dynamics
              (pedagogical companion to fips-spanning-tree)