A High-performance, local-first decentralized
database built on Rust and Iroh
Iroh is the networking layer behind GuardianDB. A peer-to-peer library written in Rust that connects two devices directly, wherever they happen to be.
Iroh's Magicsock handles NAT traversal, hole punching and roaming (Wi-Fi ⇄ 5G without dropping), all with no global DHT.
One encrypted UDP connection multiplexes blobs (data), docs (state) and gossip (signals) per peer, with no external daemons.
Every peer is an Ed25519 public key (the EndpointId, 32 bytes). Every connection is end-to-end encrypted.
Peers exchange only the diff between them, syncing millions of records in milliseconds instead of entire lists.
iroh-gossip's epidemic broadcast trees spread ephemeral messages with low latency and redundancy.
Ed25519-signed tokens grant fine-grained permissions. Access control with no central authority whatsoever.
“I didn’t have the resources to run infrastructure capable of serving thousands of people at the same time. The costs would have been prohibitive. With GuardianDB, I was able to build that foundation affordably, shaping the technology to my needs and using modern tools to create exactly what I needed.
But this is only the beginning.
GuardianDB is not just a database. It is the first step of a powerful decentralized ecosystem. An ecosystem that, with the collaboration of the community, can grow, evolve and become immense in the future.”

Key-Value and Document run over Iroh-Docs (Last-Write-Wins). The Event Log keeps a causal DAG for strict ordering and auditing.

An append-only, immutable log. A causal DAG from the ipfs-log lineage with strict ordering and auditability. Binary Postcard entries and 32-byte BLAKE3 links in place of CIDs.

A high-performance distributed map with Last-Write-Wins semantics over Iroh-Docs. Ideal for user profiles, settings and application state.

JSON documents with async filter queries and batch operations, over Iroh-Docs and synced by Willow. The local-first foundation for collaborative apps.
No daemon, no server. IrohClient::development() starts a local node. Writes replicate to peers automatically and reads answer from the local replica instantly.
use guardian_db::guardian::GuardianDB;
use guardian_db::p2p::network::client::IrohClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Spin up a local Iroh node — no server, no daemon.
let client = IrohClient::development().await?;
let db = GuardianDB::new(client, None).await?;
// Open a store — writes replicate to peers automatically.
let kv = db.key_value("settings", None).await?;
kv.put("theme", b"dark".to_vec()).await?;
// Local read — instant, works offline.
if let Some(v) = kv.get("theme").await? {
println!("theme = {}", String::from_utf8_lossy(&v));
}
Ok(())
}Into distributed systems, Iroh, Rust or decentralized databases? Code, docs, ideas or bug reports? There’s a place for you here. Come build with us.