The Deceptive Complexity of P2P Connections and the Solution We Found
- Authors
- Author
- Tarek Elsayed
- Discover how we navigated a maze of p2p network technologies, comparing WebRTC, Libp2p, and Iroh to find the perfect fit for seamless data synchronization.

The Deceptive Complexity of P2P Connections
Have you ever tried to send a file directly to someone’s phone or laptop without uploading it to the cloud first?
If you have, you’ve likely encountered frustrating connection problems, confusing setup steps, or simply given up and used a cloud service instead.
This seemingly simple task — connecting two devices directly over the internet or local network — is actually one of computing’s deceptively complex challenges. NAT routers with integrated firewall functions, changing IP addresses, and closed networks create invisible barriers between your devices.
At ARK Builders, solving this problem was crucial because true data ownership means your files should travel directly between your devices without a mandatory cloud in-between.
After months of evaluating various networking technologies, we found a solution in iroh — a pragmatic approach that prioritizes reliability while maintaining our local-first principles.
Why Does This Matter?
If you’re building peer-to-peer applications, self-hosting your data, or just curious about how modern apps establish direct connections, our journey through WebRTC, libp2p, and other technologies reveals important technical trade-offs that could save you months of development time.
What We’re Building
Here at ARK Builders, we’re creating a suite of applications that make it easy to share data across platforms and users all while keeping your data close to home. Our apps are built around a core focus on local-first approach. If you’re new to the concept of “local-first,” feel free to check out our earlier post, What is “local-first”?.
As we design ARK’s applications, choosing the right networking layer was critical. It’s not just a backend detail — it’s the backbone of how users connect, share, and collaborate. After a lot of research and a few dead ends, we decided on using iroh. But before we tell you why iroh came out on top, let’s rewind a bit and give you the full story.
A Tangle of Options: Our Early Exploration
When we first set out to find the right networking foundation for our apps, we found ourselves knee-deep in a wide range of technologies.
On one hand, there were familiar solutions like WebRTC, simple enough in some cases but not always a perfect fit — especially if we wanted to avoid complicated setup steps.
On the other, we had emerging peer-to-peer frameworks like libp2p, which offered rock-solid reliability but came with a steep learning curve.
We even flirted with the idea of building our own custom layer with UDP/QUIC, though that promised to be a massive undertaking. Building a protocol from scratch wasn’t worth the time and effort, especially when libP2P already offers high customization.
We also considered tools like Nebula and Syncthing, hoping we could refactor some of their networking components and neatly integrate them into our stack. But Syncthing turned out to be a full application rather than a convenient library, and Nebula didn’t provide the packaging flexibility we were looking for.
It quickly became clear that neither would give us the clean, easy-to-integrate pieces we needed.
These comparisons taught us something: no single option was perfect. Everything felt like a trade-off. We narrowed down our choices, but we still didn’t have a clear winner. At this stage, iroh was nowhere on our radar — little did we know that this would soon change.
Refining Our Approach
With our initial exploration behind us, we began to refine our approach and revisit certain ideas more critically.
For one, the thought of building a custom UDP/QUIC-based solution no longer felt practical. The complexities of managing direct peer-to-peer connections and reliable NAT traversal would demand a level of time and maintenance that didn’t align with our goals.
For a deeper understanding of these challenges, the Tailscale blog on how NAT traversal works offers an excellent walkthrough of the techniques involved in getting through NATs. Similarly, the idea of repurposing a tool like Syncthing, which isn’t really designed as a pluggable networking layer, seemed less and less appealing.
This clearer perspective led us to take a fresh, more focused look at both iroh and libp2p. Understanding how they differed in terms of simplicity, reliability, and future readiness felt more important than ever.
Iroh: A Balanced Approach to Connectivity
Iroh started as an IPFS-focused project but has since pivoted to something more flexible and reliable. It aims to make direct peer-to-peer connections whenever possible, and when it can’t, it uses fallback methods.
The team behind iroh has been steadily improving it, focusing on making sure it “just works” rather than stuffing it with endless features and complexity.
Why did we like it? Because iroh:
- Prioritizes Simplicity and Reliability: Instead of overwhelming you with complicated options, it gives you a straightforward path to get things working, even under tough network conditions.
- Adopts Limited Centralization to Make Things Easier: While many frameworks push for totally decentralized designs, iroh strategically incorporates limited centralization. This choice helps ensure connections can still succeed when the environment is less than ideal, while it is still possible to self-host the centralized parts and use iroh for the most private applications.
- Focuses on Seamless Connectivity: In rare cases when direct hole punching doesn’t succeed, iroh employs fallback techniques, leveraging centralized (and potentially self-hosted) network components to maintain a stable connection between peers.
In contrast, libp2p felt like a Swiss Army knife — amazing if you need every possible gadget but maybe a bit too much for our simpler scenario. It’s powerful and feature-rich, but that can mean more complexity and configuration work.
Another exciting tidbit is that the iroh team is working on WebAssembly (wasm) support for iroh-net, which would open doors for running it easily in different environments, including browsers. This flexibility could be really handy for ARK’s future roadmap, which includes browser extensions synced with mobile apps in a fully P2P manner.
Finding the Right Fit with iroh
In the end, iroh offered just the right blend of simplicity, reliability, and scalability for what we need at ARK Builders. It’s neither too heavy-handed nor too bare-bones, which gives us a solid starting point while leaving room to grow.
With upcoming features like WebAssembly support, iroh feels well-positioned for the future, making it easier to bring our vision — fast, secure, and user-friendly file sharing — to a wide range of platforms.
We’re excited to see how iroh helps us shape ARK into the ideal set of tools for anyone looking to share and sync files with confidence. To learn more about what we’re building and our broader mission, visit us at ARK Builders. Stay tuned as we continue refining our apps and working toward a better, more open digital future.