跳到正文
DEV Community· Michael Muriithi·· 3 小時前AI 評分39

以 Rust 建構去中心化網狀網絡:GhostWire

Building a Decentralized Mesh Network in Rust: GhostWire

AI 導讀

GhostWire 是以 Rust 和 libp2p 建構的開放協議及參考實作,為網絡連線不穩或基礎設施不可信的情境提供具韌性的點對點通訊。它支援加密 P2P 訊息、ML-KEM 後量子金鑰封裝、AI 輔助路由及 REST API,已有 200+ 項測試通過。

正文

Michael Muriithi

Building a Decentralized Mesh Network in Rust: GhostWire

GhostWire is an open protocol and reference implementation for resilient peer-to-peer communication. It is built in Rust with libp2p, XChaCha20-Poly1305, X25519/ML-KEM hybrid post-quantum key exchange, delay-tolerant networking, and AI-assisted routing.

Why GhostWire exists

Most communication systems assume a working internet, centralized servers, and stable identities. GhostWire assumes the opposite: intermittent connectivity, untrusted infrastructure, and real physical threats. It is built for disaster responders, rural communities, privacy advocates, and developers who need communication that still works when the normal stack fails.

What works today

  • Encrypted P2P messaging over libp2p
  • Forward secrecy with a symmetric ratchet
  • Peer discovery with mDNS, DHT, and bootstrap peers
  • Delay-tolerant store-carry-forward routing
  • Post-quantum key encapsulation (ML-KEM)
  • Terminal UI and Axum-based REST API
  • 200+ passing tests

Protocol stack

Application: messaging, knowledge ark, ghost channels
API: REST, WebSocket, CLI, TUI
Services: block store, mailbox, social, Sphinx
AI routing: LightGBM -> Gemma 4 -> GNN -> PRoPHET
Crypto: XChaCha20-Poly1305, X25519, ML-KEM-768
Transports: TCP, WebRTC, BLE, LoRa, obfs4, Reticulum
Mesh: libp2p GossipSub, Kademlia DHT, DTN

Quick start

git clone https://codeberg.org/PHANTOMOJO/GhostWire-secure-mesh-communication.git
cd GhostWire-secure-mesh-communication/ghostwire
cargo run --release

The node starts on http://127.0.0.1:8080. Mesh networking activates with --mesh-port.

Build on it

GhostWire is a protocol, not just an app. Use it as a Rust crate, REST API, or implement the spec in another language.

Read the spec: docs/spec/
GitHub/Codeberg: https://codeberg.org/PHANTOMOJO/GhostWire-secure-mesh-communication
Website: https://www.ghostwire.cc/

Contribute

We welcome code, tests, docs, security review, and field testing. Good first issues and help-wanted labels are being prepared now. If you work on mesh networking, privacy, DTN, or Rust crypto, your review would help.

來源:DEV Community · dev.to