The development of modern P2P applications, especially those focused on mobile devices, such as our upcoming “Messenger” project, requires strategic architectural decisions. In GuardianDB, we made the choice to completely remove libp2p’s legacy modules and adopt the Iroh API exclusively from this point forward.
libp2p comes at a high cost: large binaries, excessive battery consumption, and difficulties maintaining connections during network changes (roaming between 4G and Wi-Fi). In addition, we maintained an expensive compatibility layer, constantly converting PeerIDs to NodeIDs while attempting to translate and bridge incompatible concepts.
With Iroh 1.0 approaching, GuardianDB will operate on a purely QUIC-based foundation. This means that network identity will no longer rely on libp2p’s complex multihash, but instead become a native 32-byte Ed25519 public key (Iroh’s NodeID). This simplification will ripple through all database modules.
The old direct_channel and one_on_one_channel modules, previously based on libp2p’s GossipSub, will be refactored to establish a direct and secure connection using Iroh’s Magicsock technology, which performs NAT traversal far more efficiently and transparently. The latency to establish the first byte of communication drops drastically, creating the real-time feel required for an instant chat.
The pubsub and raw modules are being migrated to iroh-gossip. Unlike traditional network flooding, Iroh’s gossip protocol uses an optimized tree-based broadcast approach.
The end result of this transition will be a lighter and more focused GuardianDB. By removing the libp2p dependency, we declutter the codebase and allow the database (based on Sled) to focus on its primary role: secure persistence and indexing. Iroh takes on the role of a fast and resilient central nervous system, transforming the future GuardianEngine into a truly mobile-first solution, where networking complexity disappears in favor of performance.
