🌪️ Inspiration

In the aftermath of natural disasters such as earthquakes, tsunamis, and floods, the collapse of communication infrastructure often leaves first responders struggling to coordinate effectively across impacted zones. The recent devastating earthquake in Myanmar on March 28, 2025, underscores this challenge. The 7.7-magnitude quake struck near Mandalay, resulting in over 1,000 fatalities and thousands of injuries. The destruction of communication networks further complicated rescue and relief efforts, highlighting the urgent need for resilient communication systems during such emergencies. ​

In response to this pressing issue, we developed SafeChain—a prototype for a decentralized communication system designed to function independently of traditional internet infrastructure. By leveraging peer-to-peer communication, decentralized storage, and blockchain logging, SafeChain enables emergency teams to maintain connectivity even when conventional networks are compromised. This ensures that critical information can be shared securely and efficiently among first responders, facilitating better coordination and more effective disaster response.​

Our goal with SafeChain is to move beyond typical applications of blockchain technology and create a solution that can genuinely assist individuals in life-threatening situations. By providing a robust communication network that remains operational during disasters, SafeChain enhances the effectiveness of emergency response efforts. The Myanmar earthquake serves as a poignant reminder of the critical importance of maintaining communication during such events, and we believe that implementing systems like SafeChain can ultimately save lives and reduce the impact of catastrophic occurrences.


How we built it

This hackathon PoC (Proof of Concept) demonstrates a fully decentralized messaging platform using:

  • Communication Layer: For now, we use WebSockets between devices to simulate peer-to-peer messaging. In the final version, this would be replaced by physical radio modules (e.g., LoRa), allowing offline, long-range hardware communication and satellite modules for extracting location without connection to the internet.
  • Frontend: Built in React.js with Leaflet.js, featuring a live map that shows other "nodes" (devices) and allows message exchange.
  • Backend: A Node.js + Express server handles WebSocket communication, message handling, and syncing logic.
  • Local Storage: All messages and metadata are stored in a local PostgreSQL instance per device.
  • Decentralized Storage: Messages are periodically uploaded to IPFS via Pinata, making them persistent and accessible from anywhere once connectivity is restored.
  • Blockchain Logging: We log IPFS hashes and key metadata (like mesh join or message sync) to a smart contract on the Polygon Amoy Testnet for auditability and tamper-proofing.
  • MetaMask: Handles wallet authentication and transaction signing on-chain. websockets for p2p communication SDR (software defined radio) compatible solutions.

Challenges we ran into

  • Simulating real-world offline communication in a virtualized hackathon setting without actual hardware was tough.
  • Message syncing timing between local PostgreSQL and IPFS + blockchain required coordination to avoid conflicts.
  • troubleshooting node communication using different machines
  • initially tried working with IOTA but we faced issues and had to switch to polygon. -communication between the nodes in the Mesh.
  • Designing the system to be modular and hardware-ready, so that swapping WebSocket with radio module logic in future builds is seamless.
  • Ensuring the app can function entirely offline, but gracefully reconnect and sync to IPFS/Polygon when possible.

Accomplishments that we're proud of

  • Built a complete frontend-backend system with real-time communication across devices.
  • Successfully stored messages history in IPFS and recorded their hashes on-chain via Polygon.
  • Created a visual, location-aware interface using Leaflet to represent distributed nodes.
  • Designed a communication protocol via sockets that can be extended to hardware-based radio modules for true disaster-readiness.
  • used IPCM to handle version control in the smart contract to handle IPFS storage. During the initialization of our backend and database systems, we miscalculated a few critical steps and strayed off course. Unfortunately, we only realized the issue once much of the foundation had already been built. This forced us to go back and revise key functions and reconfigure our database schemas—triggering a cascade of changes across the entire codebase. It was a tough but necessary pivot that taught us the importance of early alignment between data structures and backend logic.

-To address our biggest challenge—accurate map integration—we had to act fast. After identifying that our initial setup was failing to properly display user geolocations on the mesh network, we quickly pivoted to the Google Maps API to leverage its reliable geolocation services. It was a tough call mid-build, but once implemented, the improvement was immediate and honestly, a moment of disbelief for all of us. However, due to time constraints and existing dependencies, we continued rendering the map using Leaflet. Moving forward, our first post-hackathon priority is to fully migrate to Google Maps to ensure a smoother and more accurate user experience.


What we learned

  • How to design offline-first, decentralized architectures using IPFS, blockchain, and local storage.
  • WebSocket-based mesh simulation and how to prepare it for hardware transition (e.g., to LoRa).
  • How to coordinate data across three different layers: local DB, decentralized storage, and blockchain.
  • learnt socket-based communication in a P2P network.
  • The importance of failover, syncing logic, and UI design in disaster recovery systems
  • Use of IPCM (Inter-Planetart Content Mapping) for version-controlling chat logs over IPFS.

What's next for SAFECHAIN

  • 📻 Integrate LoRa or custom radio modules to create actual hardware-based communication between nodes.
  • 🔐 Add end-to-end encryption for secure peer messaging.
  • 📱 Build a standalone PWA/mobile app with optional USB/serial radio module support.

Built With

Share this project:

Updates