# What License Does iroh Use? MIT and Apache-2.0 Dual Licensing Explained

> Discover the MIT and Apache-2.0 dual licenses used by the iroh project. Understand the implications of this open-source licensing choice.

- Repository: [number zero/iroh](https://github.com/n0-computer/iroh)
- Tags: licensing-overview
- Published: 2026-07-12

---

**The iroh project is dual-licensed under the MIT License and Apache License 2.0, with the full legal texts residing in the `LICENSE-MIT` and `LICENSE-APACHE` files at the repository root.**

When evaluating open-source networking libraries for production use, understanding the licensing terms is critical. The **iroh license** follows a dual-licensing model that provides flexibility for both commercial and open-source applications. This repository, maintained by n0-computer, implements this approach to maximize compatibility with other projects while protecting contributor rights.

## Dual Licensing Model

### MIT License and Apache-2.0

The primary iroh license combination allows you to choose between two permissive open-source licenses. According to the n0-computer/iroh source code, you may use the software under either the **MIT License** or the **Apache License 2.0**, whichever better suits your project's requirements.

This dual-licensing approach is reflected in the [`Cargo.toml`](https://github.com/n0-computer/iroh/blob/main/Cargo.toml) files throughout the workspace:

```toml
[package]
name = "my_iroh_component"
version = "0.1.0"
license = "MIT OR Apache-2.0"

```

## License Files in the Repository

The repository contains the complete license texts at the top level:

- **`LICENSE-MIT`** – Contains the full MIT license text applicable to the project
- **`LICENSE-APACHE`** – Contains the full Apache License 2.0 text

These files govern the overall project licensing for the majority of the codebase.

## Sub-Crate Licensing Exceptions

While the root dual-licensing applies broadly, specific sub-crates maintain their own licensing terms. The analysis of the n0-computer/iroh repository reveals that certain components use the **BSD-3-Clause** license:

- **`iroh/LICENSE-BSD3`** – BSD-3-Clause license for the main `iroh` crate
- **`iroh-relay/LICENSE-BSD3`** – BSD-3-Clause license for the `iroh-relay` crate

These exceptions are clearly delineated in their respective directories, ensuring transparency for developers integrating specific components.

## Programmatically Accessing License Information

If your application needs to display or verify license information at runtime, you can read the license files directly from the filesystem. This Rust example demonstrates how to access both license texts:

```rust
use std::fs;

fn main() -> std::io::Result<()> {
    let mit = fs::read_to_string("LICENSE-MIT")?;
    let apache = fs::read_to_string("LICENSE-APACHE")?;
    println!("MIT License:\n{}\n", mit);
    println!("Apache License 2.0:\n{}", apache);
    Ok(())
}

```

This approach ensures compliance while providing transparency to end users about the legal terms governing the software.

## Summary

- The **iroh license** is dual-licensed under MIT and Apache-2.0 at the repository root
- Primary license files are **`LICENSE-MIT`** and **`LICENSE-APACHE`** in the root directory
- The **`iroh`** and **`iroh-relay`** crates use BSD-3-Clause licenses as specified in their respective `LICENSE-BSD3` files
- Both licenses are permissive and allow commercial use, modification, and distribution
- Reference the license in [`Cargo.toml`](https://github.com/n0-computer/iroh/blob/main/Cargo.toml) using the SPDX expression `"MIT OR Apache-2.0"`

## Frequently Asked Questions

### Can I use iroh in commercial projects?

Yes. Both the MIT License and Apache License 2.0 explicitly permit commercial use, modification, and distribution. The dual-licensing model allows you to choose whichever license terms better align with your organization's legal requirements and existing license portfolio.

### Why does iroh use dual licensing?

The dual-licensing strategy maximizes compatibility with other open-source projects. Some organizations prefer the MIT License for its simplicity, while others require the Apache License 2.0 for its explicit patent grant and trademark provisions. By offering both, the n0-computer/iroh project accommodates diverse ecosystem needs without restricting usage scenarios.

### What is the BSD-3-Clause license in some sub-crates?

The **`iroh`** and **`iroh-relay`** crates include additional BSD-3-Clause licensing terms in their respective `LICENSE-BSD3` files. This licensing variation applies specifically to these components and provides a permissive alternative that includes a non-endorsement clause, ensuring that the original authors' names cannot be used to promote derivative works without permission.

### Do I need to include the license text in my application?

Yes. Both the MIT License and Apache License 2.0 require that you include the original license text and copyright notice when distributing the software. If you distribute binaries or derivative works, you must preserve the `LICENSE-MIT` and `LICENSE-APACHE` files from the repository root, or provide the full text through your application's about screen or documentation.