Inspiration
Autonomous robots generate highly sensitive data: precise locations, routes, sensor readings, and operational decisions. Conventional monitoring systems often prove that a mission was completed by collecting all of that telemetry in one place. Publishing the same information on a blockchain would make the privacy problem even worse.
Midnight Swarm was inspired by a different question: Can a robot prove that it completed an assigned task without revealing where it traveled or what it observed?
We built Midnight Swarm to demonstrate that zero-knowledge technology can provide accountability without turning private robot telemetry into public infrastructure.
What it does
Midnight Swarm coordinates two simulated drones completing private checkpoints in sequence.
The first drone publishes its position locally through ROS 2. After it remains inside its assigned checkpoint for three consecutive observations, it submits a private claim to a Compact smart contract on Midnight.
For private coordinates ((x,y)), the proof establishes that:
$$ x_{\min} \leq x \leq x_{\max} \quad\text{and}\quad y_{\min} \leq y \leq y_{\max} $$
The coordinates, checkpoint boundaries, trajectory, and drone credentials remain private. The public learns only that the checkpoint rule was satisfied.
After the first proof is finalized, a ROS mission coordinator reads the public contract state through the Midnight indexer and authorizes the second drone to begin. The dashboard advances from (0%) to (50%) after the first drone is verified and reaches (100%) after the second finishes—all without receiving either drone’s raw location data.
How we built it
We built Midnight Swarm around ROS 2, the widely adopted, industry-standard middleware framework for robotics. ROS is used to connect perception, localization, planning, control, and monitoring components in real robotic systems. Building on its standard publish-and-subscribe architecture makes Midnight Swarm straightforward to integrate into existing projects.
A robot only needs to publish its position using the standard ROS message type:
geometry_msgs/PoseStamped
Our reusable midnight_checkpoint ROS package subscribes to that existing pose stream, detects stable checkpoint arrival, and forwards private evidence for proof generation. Robotics teams do not need to rewrite their navigation stack or add Midnight wallet and contract logic directly to the robot. They can remap the package’s input topic to their existing localization output, configure the checkpoint policy, and leave the rest of their system unchanged.
This modular design means the deterministic simulator in our demo can be replaced with a real drone, autonomous vehicle, inspection robot, SLAM system, or AI navigation stack without redesigning the verification pipeline.
The complete stack uses:
ROS 2 and Python for pose ingestion, checkpoint monitoring, inter-drone coordination, retries, and sanitized result publication.
Compact for proving checkpoint inclusion and credential authorization without exposing private inputs.
Midnight.js and Node.js for wallet management, contract deployment, proof submission, and transaction finalization.
Midnight’s node, indexer, and proof server for blockchain and zero-knowledge infrastructure.
React, TypeScript, and Vite for a read-only, indexer-backed mission dashboard.
Docker Compose for a reproducible local development environment.
Each drone has an independent contract, checkpoint, credential, and proof state. Drone 2 does not start because of a timer or browser event. It starts only when the ROS coordinator observes finalized on-chain proof that Drone 1 completed its mission.
Challenges we ran into
The hardest challenge was maintaining a strict privacy boundary across ROS, the bridge, the proof circuit, the indexer, and the dashboard. Coordinates and checkpoint bounds needed to remain inside the trusted robotics and proving environment, while public interfaces received only sanitized verification results.
Coordinating asynchronous systems was another major challenge. A robot can reach a checkpoint immediately, but proof generation, transaction submission, block production, and indexer synchronization occur at different times. Drone 2 therefore had to wait for finalized, indexer-backed state rather than treating proof submission as mission completion.
We also needed to bridge two very different ecosystems. ROS communicates through topics and messages, while Midnight uses contracts, transactions, proofs, and indexed ledger state. We designed a small adapter layer so existing ROS components remain unaware of blockchain-specific concepts.
Finally, we made the system resilient to startup order and temporary service failures. The ROS forwarder retries bridge requests, duplicate submissions return cached public results, and the coordinator emits a durable start signal exactly once.
Accomplishments that we're proud of
We are especially proud that Midnight Swarm demonstrates a real closed-loop interaction between robotics and a privacy-preserving blockchain:
- A robot produces private physical-state evidence.
- A Compact circuit verifies the mission rule.
- Midnight finalizes the public result.
- ROS consumes that finalized result.
- The result authorizes another autonomous agent to act.
The system does not merely display a blockchain transaction after a simulation. Finalized contract state directly controls the next stage of the robotic mission.
We are also proud that the integration uses familiar ROS conventions instead of requiring a custom robotics framework. Existing projects can retain their sensors, localization, navigation, and control nodes while adding Midnight verification as a modular ROS component.
Our dashboard contains no wallet, proof witness, checkpoint bounds, or pose feed. Its intentionally limited view demonstrates how operators can receive trustworthy mission progress without gaining access to sensitive telemetry.
What we learned
We learned that privacy is most effective when treated as an architectural boundary rather than a user-interface feature. Removing coordinates from the dashboard is not enough; sensitive values must also be excluded from logs, manifests, API responses, errors, and shared storage.
We also learned that ROS provides a natural integration boundary for privacy-preserving verification. Standard message types and topic remapping allow the proof system to observe only the specific output it needs while remaining separate from the robot’s broader software stack.
Another important lesson was that proof submission and proof finality are different events. Autonomous coordination should rely on authoritative finalized state, especially when one robot’s actions depend on another robot’s verified completion.
The resulting architecture works with both conventional and AI-powered robotics:
private sensors → perception/navigation → ROS PoseStamped ↓ checkpoint monitor ↓ zero-knowledge proof ↓ public verified outcome
What's next for Midnight Swarm
The next step is moving from simulation to physical robots. Because Midnight Swarm consumes a standard ROS 2 pose message, connecting it to real hardware primarily involves remapping the pose topic to an existing localization or navigation output.
We plan to support more standard ROS interfaces and distribute the checkpoint component as an easily installable ROS package. This would allow robotics teams to add privacy-preserving mission verification without restructuring their existing projects.
Future improvements include:
- Integration with real drones, autonomous vehicles, and inspection robots
- Support for additional ROS localization and navigation message types
- Hardware-backed robot identities and credential rotation
- Authenticated and encrypted robot-to-bridge communication
- Replay protection and timestamped mission claims
- Multi-checkpoint routes and richer mission policies
- Fault handling, reassignment, and larger coordinated fleets
- Browser-wallet support and production Midnight deployment
- Private proofs derived from AI perception or planning outputs
Ultimately, we see Midnight Swarm as a reusable verification layer for autonomous systems that must be trusted without being constantly watched.
Log in or sign up for Devpost to join the conversation.