Skip to content
minip2p
Esc
navigateopen⌘Jpreview
On this page

Introduction

A minimal, caller-driven libp2p stack with QUIC, TCP, and no_std.

Install

cargo add minip2p-rs
npm install @minip2p/react-native

minip2p opens authenticated QUIC and TCP connections from Rust and React Native. On no_std + alloc, TCP runs through a pluggable provider and Endpoint::portable. The Rust Endpoint is synchronous and caller-driven — no async runtime. The React Native SDK owns the native driver and presents typed events, cancellable Promises, and Stream handles to JavaScript.

use minip2p::{Deadline, Endpoint};

fn main() -> Result<(), minip2p::Error> {
    let mut node = Endpoint::builder()
        .agent_version("my-app/0.1.0")
        .bind_quic("127.0.0.1:0")?;

    println!("listen={}", node.listen()?);

    while let Some(event) = node.next_event(Deadline::NEVER)? {
        println!("{event:?}");
    }

    Ok(())
}
import {
  Minip2p,
  generateSecretKey,
} from "@minip2p/react-native";

const endpoint = Minip2p.create({
  secretKey: generateSecretKey(),
});

console.log(endpoint.peerId(), endpoint.listenAddrs());
endpoint.close();

Optional capabilities add custom streams, NAT traversal, pubsub, signed peer discovery, and local-link mDNS.

Get started

learn by doing

Understand

understand this

Do next

do this specific thing

Look up

look this up

Constraints

pre-1.0 APIs may change before the first stable release.
QUIC and TCP The dial address picks the transport. WebSocket and WebTransport are out of scope.
no_std + alloc Protocols, orchestration, and TCP work without an OS; you supply I/O, time, and entropy.
QUIC-only punching DCUtR hole punching needs QUIC; a TCP-only peer reaches NATed peers through a relay.
Rust 1.91+ Workspace MSRV.
Caller-driven Rust Rust applications drive progress; the React Native adapter owns its native driver.
Relay client Bring a Circuit Relay v2 server when a relayed path is required.

Last updated on August 18, 2026

Was this page helpful?