Rust IPFS Logo Rust IPFS

The performance and efficiency of Rust, and the decentralized power of IPFS.

Together at last.

Get Started

UnixFS Support


Easily encode your content and add, get, and cat to your heart's content

Global Swarming


Connect to the global IPFS network and discover content via bootstrap peers

Canonical HTTP APIs


If your application already uses the IPFS HTTP APIs, you can easily switch to Rust IPFS

Getting Started

First, add ipfs and tokio to your Cargo.toml file:

ipfs = { git = "https://github.com/rs-ipfs/rust-ipfs" }
tokio = { version = "1", features = ["full"] }
tokio-stream = "0.1"

Then, in your src/main.rs:

use ipfs::{Ipfs, IpfsOptions, IpfsPath, TestTypes, UninitializedIpfs};
use std::process::exit;
use tokio::io::AsyncWriteExt;
use tokio_stream::StreamExt;

async fn main() {
    // Initialize an in-memory repo and start a daemon.
    let opts = IpfsOptions::inmemory_with_generated_keys();
    let (ipfs, fut): (Ipfs<TestTypes>, _) = UninitializedIpfs::new(opts).start().await.unwrap();

    // Spawn the background task

    // Restore the default bootstrappers to enable content discovery

    // Get the IPFS README
    let path = "/ipfs/QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/readme"

    let stream = ipfs.cat_unixfs(path, None).await.unwrap_or_else(|e| {
        eprintln!("Error: {}", e);


    let mut stdout = tokio::io::stdout();

    loop {
        match stream.next().await {
            Some(Ok(bytes)) => {
            Some(Err(e)) => {
                eprintln!("Error: {}", e);
            None => break,

Further Reading

These are some extra resources to get you started with specific use-cases of Rust IPFS:

This project is supported by

Equilibrium Protocol Labs Web3 Foundation

Rust IPFS is supported by Equilibrium, Protocol Labs, the Web3 Foundation, and YOU. If you find this work useful, please consider becoming a financial contributor on OpenCollective.