the networking stack for user agency

Iroh is a library for building on direct connections between devices, putting more control in the hands of your users.

DIRECTDIRECTRELAYDIRECT

Connect any two devices on the planet

Iroh gives you an API for dialing by public key. You say “connect to that phone”, iroh will find & maintain the fastest connection for you, regardless of where it is.

“In stark contrast to other p2p & dweb technologies we've played with - which are exciting due to their implications for the future - Iroh brought instant gains in our present."

- The Weird Team

Compose your own tailor-made protocol stack

An ecosystem of ready-made, composable protocols are built on top of iroh.
Mix & match to get the feature set you need.

Blobs

Resumable, verifiable data transfer

Gossip

Broadcast messages to groups of nodes by topic.

DMs

Simple node-to-node message passing

Documents

Realtime, multiwriter, key-value sync

Willow

multiwriter, key-value sync with fine-grained access control

Automerge

CRDT-powered collaborative documents

Browse all protocols

Build your own protocol

Don't see a protocol you need? Build your own! Iroh gives you a reliable foundation for building distributed systems that reach the edge. The rest is up to you.

Custom Protocol Docs

Continuously Measured

All commits to iroh's main branch run through a growing set of simulations & tests

Iroh Perf Site

Real World Use

Iroh is running in production on hundreds of thousands of devices, on all major platforms.

Delta Chat

Delta Chat

Iroh powers multi-device backup & live connections for in-chat WebXDC apps

Build in your language

Iroh supports a growing set of languages, embedding nodes directly in your project without any need to call out to an external API

start building

doc get

use anyhow::Result;
use futures::stream::TryStreamExt;

#[tokio::main]
async fn main() -> Result<()> {
    // build the node
    let node = iroh::node::Node::memory().spawn().await?;

    // create 2 documents
    let _doc_0 = node.docs.create().await?;
    let _doc_1 = node.docs.create().await?;

    // list newly created docs
    println!("List all docs:");
    let mut docs = node.docs.list().await?;
    while let Some((doc_id, _capability)) = docs.try_next().await? {
        println!("{doc_id}");
    }

    Ok(())
}

From the Blog