Inspiration: Silence is Dangerous

The inspiration for NoFi came from a chilling realization: in a modern disaster, our smartphones, the most powerful communication tools in history, become useless bricks the moment the cell towers fail.

We saw images from hurricanes and conflict zones where people were trapped in rubble or isolated in basements, unable to call for help despite having a supercomputer in their pocket. We realized that connectivity shouldn't be a subscription service provided by a telecom giant; it should be a fundamental property of the device itself.

We asked ourselves:

"If we delete the internet, how can we still talk?"

The answer was right in front of us. Every phone has a speaker and a microphone. Sound is the oldest network in the world. We decided to modernize it.

What We Built

NoFi is a decentralized mesh network that transmits data through sound waves. It turns air into a data cable.

Key Features:

  • Acoustic Modem: We engineered a custom Frequency Shift Keying (FSK) protocol that encodes text into audio tones. It operates in two modes:
    • Audible Mode (2kHz): High reliability, long range (~5m).
    • Stealth Mode (16kHz+): Near-ultrasonic, invisible communication for hostile environments.
  • Mesh Networking: The system isn't just point-to-point. Every device acts as a relay node. If Phone A sends a message to Phone B, Phone B automatically re-broadcasts it to reach Phone C, creating a self-healing daisy chain of connectivity.
  • Offline AI: We embedded a quantized version of OpenAI's Whisper model directly into the system. This allows for real-time, offline voice-to-text transcription, crucial for injured users who cannot type.

How We Built It

We built NoFi using a modern web stack, but with a heavy reliance on low-level browser APIs that most developers ignore.

  • Frontend: React + TypeScript + Tailwind CSS for a tactical, high-contrast UI.
  • Audio Engine: We bypassed standard audio libraries and wrote a custom Web Audio API engine. We used OscillatorNode for generating precise FSK tones and AnalyserNode with a Fast Fourier Transform (FFT) size of 2048 to decode incoming frequencies in real-time.
  • The Protocol: We designed a custom packet structure: $$\text{Packet} = [\text{Start Marker}] + [\text{Message ID}] + [\text{Payload}] + [\text{Checksum}]$$ We used mathematical frequency mapping to convert ASCII characters into Hz: $$f_{char} = f_{base} + (\text{ASCII} \times f_{step})$$ This allowed us to "sing" data across the room.
  • Offline AI: We used Transformers.js and ONNX Runtime to load the Whisper model client-side. We had to fight aggressive browser security policies (CORS, SharedArrayBuffer) to get multi-threaded WASM running without a backend.

Challenges We Faced

The biggest challenge was Physics. Sound is messy.

1. The "Nyquist" Hardware Limit

  • The Hurdle: We initially attempted to transmit data at 24kHz to ensure total silence. However, we hit the Nyquist Limit. Since most consumer microphones sample at 44.1kHz, they physically cannot record frequencies above ~ 22 kHz. Our signals were being filtered out by the hardware before our code could even process them.
  • The Fix: We compressed our protocol into the narrow "Ultrasonic Window" between 19kHz and 21kHz. By tightening the frequency step to just 40Hz per character, we successfully squeezed the entire ASCII alphabet into a band that is audible to machines but silent to humans.

2. The "Speed of Sound" Collision

  • The Hurdle: Unlike radio waves, sound travels slowly (343 m/s). In a room with multiple devices, the physical travel time caused packet collisions; multiple devices would hear a distress signal and try to relay it simultaneously, resulting in destructive interference that garbled the message.
  • The Fix: We implemented a Collision Avoidance Algorithm. Before relaying, every node generates a cryptographic random "back-off" timer (1–3 seconds). This simple "jitter" ensures that devices politely take turns re-broadcasting, preventing audio overlap.

3. The React "Stale Closure" Trap

  • The Hurdle: Our audio processing loop runs at 60fps, completely outside of the React render cycle. Because of this, the audio engine kept losing access to the latest application state (like the current message queue), leading to a bug where the receiver heard a message but failed to trigger the relay.
  • The Fix: We architected a Mutable Ref System that acts as a high-speed bridge. Instead of reading state directly, the audio engine reads from useRef containers, allowing the real-time signal processor to communicate with the slower React UI without desynchronizing.

What We Learned

We learned that the browser is capable of far more than just displaying websites. It can be a signal processor, an AI inference engine, and a mesh networking node.

Most importantly, we learned that resilience is an engineering choice. By removing dependencies on servers and clouds, we built something that is harder to break than the internet itself.

NoFi isn't just a hackathon project; it's a proof of concept for a localized, unkillable internet.

+ 9 more
Share this project:

Updates