← Back to Academy
Decentralized Systems · Architecture

Building Mesh IoT Networks (MIoTN)

⏱ ~5 hours 🛠️ Architecture Advanced

Why Mesh Architecture for IoT?

The standard star topology — all devices connect to one central cloud — has fundamental weaknesses for serious IoT deployments: a single point of failure, data sovereignty issues, cloud vendor lock-in, high latency for local decisions, and escalating costs at scale.

A Mesh IoT Network (MIoTN) distributes the intelligence across multiple FidesInnova Nodes that communicate peer-to-peer. Each site or zone has its own local node that processes data independently — the cloud is optional, not required.

Key insight: In a FidesInnova MIoTN, every peer-to-peer interaction is governed by ZKP-backed Service Contracts. A node receiving data from another node does not need to trust that node — it verifies the ZKP proof. This makes the mesh adversarially resilient: a compromised node cannot inject false data.

The 3-Tier Mesh Topology

1

Tier 1: Edge Devices (zk-Devices)

Leaf nodes — IoT sensors and actuators with the FidesInnova ZKP SDK in firmware. Each generates proofs locally and communicates via MQTTS to its local gateway. Devices never communicate directly with other sites.

2

Tier 2: Site Gateways (FidesInnova Nodes)

One or more FidesInnova Nodes per physical site — a building, factory floor, field installation, or vehicle. Each gateway runs a local MQTT broker, executes site-level Service Contracts, and federates selected topic namespaces with peer nodes.

3

Tier 3: Coordination Layer (Blockchain + Optional Cloud)

Proofs from all sites are anchored to the FidesInnova blockchain. A coordination node (which may also be a site gateway) aggregates cross-site data. The blockchain layer is the only shared infrastructure — no central application server exists.

MQTT Federation Between Nodes

MQTT federation (also called MQTT bridging) connects two brokers so that messages published on one are forwarded to the other. In FidesInnova MIoTN, each site node forwards only the specific topic namespaces relevant to cross-site Service Contracts — not all traffic.

# FidesInnova Node federation configuration (node-a → node-b)
federation:
  peers:
    - id: node-b
      host: node-b.site2.example.com
      port: 8883
      tls: true
      forward_topics:
        - node-a/+/sensor/power // energy data shared
        - node-a/+/proof // proofs always shared
      receive_topics:
        - node-b/+/sensor/power
        - node-b/+/proof

Only forward_topics traverse the federation link. All other device data stays local. This is the data sovereignty control point — you decide exactly what crosses site boundaries.

Distributed Service Contracts

A Service Contract running on a coordination node can receive verified data from multiple site nodes via federation and compute cross-site aggregates:

// Coordination node: aggregate energy across 3 factory sites
const SITES = ['node-a', 'node-b', 'node-c'];

async function onSchedule() {
  // Collect hourly energy totals from each site (already ZKP-verified)
  const siteData = await Promise.all(
    SITES.map(site => node.queryVerifiedData(site, 'energy', '1h'))
  );
  const total = siteData.reduce((sum, s) => sum + s.kwh, 0);

  // Prove the total — inputs are already verified; output is proven
  const proof = await node.generateAggregateProof(siteData, total);
  await node.submitToBlockchain(proof);
  market.publishData({ totalKwh: total, proofId: proof.id });
}

Offline Resilience

A critical feature of MIoTN is continued operation during internet outages. FidesInnova Nodes cache all device readings and generated proofs locally. When connectivity is restored:

  • Cached proofs are submitted to the blockchain in order of generation timestamp
  • Federation links reconnect and forward buffered messages
  • The blockchain timestamps all submitted proofs with their original generation time — not submission time — preserving temporal accuracy

For installations with intermittent connectivity (remote sensors, mobile deployments), configure the Node's offline_buffer_hours setting to determine how long to cache before rolling over. Proofs are never discarded — they are always submitted eventually.

ZKP Trust Across Node Boundaries

When Node B receives data forwarded from Node A via federation, how does it know the data is authentic? The answer is that every message in a FidesInnova MIoTN carries a ZKP proof generated by the originating device. Node B verifies the proof against the public verification key — no trust in Node A required.

Node B will only forward or process data whose proof is valid. A compromised Node A that injects false readings cannot generate valid proofs for them — the ZKP system makes this computationally infeasible. The mesh is trustless by cryptographic design.

Deployment Walkthrough: 3-Site Factory Network

  1. Site survey — identify sensor locations, gateway placement, and inter-site connectivity (VPN, dedicated fiber, or internet with TLS federation)
  2. Node deployment — install FidesInnova Node on a local server or ruggedized edge computer at each site (minimum: 2-core CPU, 4GB RAM, 50GB SSD)
  3. Device registration — register each sensor in its site's Node dashboard; obtain device tokens and configure MQTTS connections
  4. Federation configuration — define federation topic namespaces between nodes; test with the Node's MQTT inspector
  5. Service Contract deployment — deploy site-level contracts on each local node; deploy coordination contract on the aggregation node
  6. Blockchain configuration — configure each node to submit proofs to the FidesInnova blockchain; set offline buffer size
  7. Monitoring — set up dashboards in the Node web UI; configure LWT-based device health alerts

Real-World Deployment Patterns

🏭 Multi-Plant Manufacturing

Each production line has a local node. Site-level contracts handle anomaly detection. A plant-level coordination node aggregates OEE metrics. No raw production data leaves the factory.

🌾 Large-Scale Agriculture

Field edge nodes collect soil, weather, and irrigation data. A farm management node coordinates irrigation decisions based on verified zone averages. Operates fully offline during rural connectivity outages.

🚢 Shipping & Logistics

Vessels carry FidesInnova Nodes that operate fully offline at sea. When in port, proofs batch-sync to the blockchain. Supply chain provenance is proven end-to-end despite weeks of offline operation.

🏙️ Smart City District

Each neighbourhood block has an edge node for environmental sensors. District nodes aggregate verified air quality and noise for city planning. Residents can verify their own neighbourhood data independently.

What You Will Learn

  • Design a 3-tier mesh IoT topology for your deployment
  • Configure MQTT federation between FidesInnova Nodes
  • Write distributed Service Contracts that span multiple nodes
  • Implement offline-resilient edge processing with local blockchain caching
  • Handle node failures and network partitions gracefully
  • Deploy a complete MIoTN on a real multi-site scenario
🤖
AI Learning Assistant

Ask any question about this course topic

Ask AI ↗