IP addresses break, dial keys instead. A library that adds QUIC + NAT Traversal to your apps. https://iroh.computer
  • Rust 99.6%
  • Shell 0.3%
Find a file
2026-07-06 16:51:32 -04:00
.cargo fix: handle wine properly (#3902) 2026-04-07 18:38:38 +02:00
.config feat: update noq and net-tools to latest (#4088) 2026-04-08 15:34:34 +02:00
.github chore: remove extensive breaking changes instructions (#4380) 2026-06-29 12:59:37 +02:00
.img docs: update root, iroh, iroh-metrics readmes (#1258) 2023-07-17 21:48:09 +00:00
docker refactor(iroh)!: rework net_report (#3314) 2025-06-24 13:31:24 +00:00
iroh chore: Release 2026-07-06 16:51:32 -04:00
iroh-base chore: Release 2026-07-06 16:51:32 -04:00
iroh-dns chore: Release 2026-07-06 16:51:32 -04:00
iroh-dns-server chore: Release 2026-07-06 16:51:32 -04:00
iroh-relay chore: Release 2026-07-06 16:51:32 -04:00
.dockerignore feat: docker images for iroh (#2404) 2024-07-08 11:17:31 +00:00
.gitattributes fix(ci): release builds (#2219) 2024-04-29 10:08:12 +00:00
.gitignore tests: add patchbay tests (#3986) 2026-04-02 10:21:54 +02:00
.typos.toml chore: introduce crate-ci/typos (#2430) 2024-06-30 20:33:56 +00:00
Cargo.lock chore: Release 2026-07-06 16:51:32 -04:00
Cargo.toml feat!: update to 1.0 dependencies (#4343) 2026-06-15 14:38:11 +02:00
CHANGELOG.md chore: Release 2026-07-06 16:51:32 -04:00
CHANGELOG_old.md chore: Fix typos (#1964) 2024-01-23 14:36:54 +00:00
cliff.toml chore(*): add release configuration for generating the changelog 2026-07-06 16:32:28 -04:00
code_of_conduct.md chore: Fix typos (#1964) 2024-01-23 14:36:54 +00:00
CONTRIBUTING.md docs: fix typos discovered by codespell (#2534) 2024-07-25 09:34:46 +00:00
deny.toml feat(relay): allow updating the per-client rate limit live (#4381) 2026-07-03 11:26:44 +02:00
example.config.toml refactor!: rename Node to Endpoint in all cases (#3542) 2025-10-15 13:31:01 +00:00
LICENSE-APACHE chore: update copyright dates (#3543) 2025-10-15 15:14:32 +00:00
LICENSE-MIT chore: update copyright dates (#3543) 2025-10-15 15:14:32 +00:00
Makefile.toml chore: update check-external-types (#4323) 2026-06-11 11:18:44 +02:00
README.md docs: update license links to HTTPS (#4365) 2026-06-23 09:31:47 +02:00
release.toml chore: switch to git-cliff for changelog generation 2023-11-08 11:46:12 +01:00
TRANSPORTS.md feat: Implement custom transports (#3845) 2026-03-05 11:11:51 +00:00

iroh

less net work for networks

Documentation Crates.io downloads Chat Youtube License: MIT License: Apache 2.0 CI


What is iroh?

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.

Hole-punching

The fastest route is a direct connection, so if necessary, iroh tries to hole-punch. Should this fail, it can fall back to an open ecosystem of public relay servers. To ensure these connections are as fast as possible, we continuously measure iroh.

Built on QUIC

Iroh uses noq to establish QUIC connections between endpoints. This way you get authenticated encryption, concurrent streams with stream priorities, a datagram transport and avoid head-of-line-blocking out of the box.

Compose Protocols

Use pre-existing protocols built on iroh instead of writing your own:

  • iroh-blobs for BLAKE3-based content-addressed blob transfer scaling from kilobytes to terabytes
  • iroh-gossip for establishing publish-subscribe overlay networks that scale, requiring only resources that your average phone can handle
  • iroh-docs for an eventually-consistent key-value store of iroh-blobs blobs

Getting Started

Rust Library

It's easiest to use iroh from rust. Install it using cargo add iroh, then on the connecting side:

const ALPN: &[u8] = b"iroh-example/echo/0";

let endpoint = Endpoint::bind().await?;

// Open a connection to the accepting endpoint
let conn = endpoint.connect(addr, ALPN).await?;

// Open a bidirectional QUIC stream
let (mut send, mut recv) = conn.open_bi().await?;

// Send some data to be echoed
send.write_all(b"Hello, world!").await?;
send.finish()?;

// Receive the echo
let response = recv.read_to_end(1000).await?;
assert_eq!(&response, b"Hello, world!");

// As the side receiving the last application data - say goodbye
conn.close(0u32.into(), b"bye!");

// Close the endpoint and all its connections
endpoint.close().await;

And on the accepting side:

let endpoint = Endpoint::bind().await?;

let router = Router::builder(endpoint)
    .accept(ALPN.to_vec(), Arc::new(Echo))
    .spawn()
    .await?;

// The protocol definition:
#[derive(Debug, Clone)]
struct Echo;

impl ProtocolHandler for Echo {
    async fn accept(&self, connection: Connection) -> Result<()> {
        let (mut send, mut recv) = connection.accept_bi().await?;

        // Echo any bytes received back directly.
        let bytes_sent = tokio::io::copy(&mut recv, &mut send).await?;

        send.finish()?;
        connection.closed().await;

        Ok(())
    }
}

The full example code with more comments can be found at echo.rs.

Or use one of the pre-existing protocols, e.g. iroh-blobs or iroh-gossip.

Other Languages

If you want to use iroh from other languages, make sure to check out iroh-ffi, the repository for FFI bindings.

Repository Structure

This repository contains a workspace of crates:

  • iroh: The core library for hole-punching & communicating with relays.
  • iroh-relay: The relay client and server implementation. This is the code we run in production for the public relays (and you can, too!).
  • iroh-base: Common types like EndpointId or RelayUrl.
  • iroh-dns-server: DNS server implementation powering the DNS/Pkarr address lookup for EndpointIds, running at dns.iroh.link.

License

Copyright 2025 N0, INC.

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.