Skip to content

Rightbracket/peeroxide

peeroxide

CI MSRV

Rust implementation of the Hyperswarm P2P networking stack, wire-compatible with the existing Node.js network.

This project is a faithful port targeting full interoperability with the existing Hyperswarm network. Node.js peers can discover and connect to Rust peers and vice versa.

Architecture

peeroxide          — topic-based peer discovery + connection management (Hyperswarm)
└── peeroxide-dht  — Kademlia DHT, Noise handshakes, hole-punching, relay (HyperDHT)
    └── libudx     — reliable UDP transport with BBR congestion control (libudx)

Quick Start

use peeroxide::{spawn, discovery_key, JoinOpts, SwarmConfig};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = SwarmConfig::with_public_bootstrap();
    let (_task, handle, mut conn_rx) = spawn(config).await?;

    let topic = discovery_key(b"my-application");
    handle.join(topic, JoinOpts::default()).await?;

    while let Some(conn) = conn_rx.recv().await {
        println!("connected to {}", hex::encode(conn.remote_public_key()));
    }
    Ok(())
}

Crates

  • peeroxide Crates.io
    High-level swarm management and topic-based discovery.
  • peeroxide-dht Crates.io
    HyperDHT implementation including Kademlia, hole-punching, and Noise handshakes.
  • libudx Crates.io
    Pure Rust implementation of the UDX protocol with BBR congestion control.

Interoperability

All layers are validated via golden byte fixtures and live cross-language interop tests against Node.js reference implementations. The stack uses pure Rust crypto (RustCrypto) and excludes C dependencies. It targets the Rust 2024 edition and uses the tokio async runtime.

Reference Implementations

This work implements the protocols defined in the following reference projects:

Status

Version 1.0.0 — initial public release. The full protocol stack is implemented and validated, including live network interoperability with the Node.js reference implementation.

License

Dual-licensed under MIT OR Apache-2.0. See THIRD_PARTY_NOTICES for upstream license details.

About

Rust implementation of the Hyperswarm P2P networking stack — wire-compatible with the existing Node.js network. Includes Kademlia DHT, Noise handshakes, UDP hole-punching, and BBR congestion control. Pure Rust, no C dependencies.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors