Open protocol

nsa

Peer-to-peer data infrastructure

Reach your own machines by name. Discover peers through the BitTorrent DHT, connect directly with libp2p, and exchange data using any protocol. No accounts, and no intermediary in the data path: the only piece you run is a blind switchboard that introduces two machines and never sees their traffic.

BitTorrent DHT (BEP 44) · libp2p Circuit Relay v2 · DCUtR hole punching · Noise encryption

01 / The problem

Every connection routes through someone else's infrastructure.

Email routes through Google or Microsoft. Messaging apps depend on company backends. Even "decentralized" systems rely on specific relay networks controlled by a small group. The result: single points of failure, forced trust in operators, and vendor lock-in.

02 / How it works

Three layers, all proven technology.

nsa composes battle-tested open protocols into a coherent infrastructure layer. Nothing here is new networking science: the innovation is in the composition.

Layer 01 · Discovery

Finding peers

BitTorrent DHT · BEP 44 mutable items

Each peer publishes a signed entry to the BitTorrent DHT, the largest decentralized lookup system in existence, with over a million active nodes. Your public key is your address. Anyone who knows it can find your current connection metadata. Entries are ephemeral and refreshed periodically.

Layer 02 · Connectivity

Establishing connections

libp2p Circuit Relay v2 · DCUtR · AutoNAT

You run a switchboard on a machine both ends can reach. It introduces them with a brief handshake (a few KB, under 2 minutes), then both peers simultaneously punch through their NATs to establish a direct connection. Research across 4.4M attempts shows ~70% success rate. The switchboard is blind: it never carries their data, only the introduction.

Layer 03 · Transport

Exchanging data

Multiplexed streams · Noise / TLS 1.3 · protocol agnostic

Once connected, peers communicate over end-to-end encrypted, multiplexed streams. Multiple protocols run concurrently over one connection: chat, file transfer and streaming in parallel. Existing applications run their protocols directly over these streams. nsa provides the pipe; what flows through it is up to you.

03 / Design principles

Decisions, not defaults.

No infrastructure you don't own

Nothing stores your data or sits in the data path. The DHT is distributed across millions of independent nodes, and the switchboard that introduces two machines is yours, stateless, and never carries their traffic.

Self-sovereign identity

Your identity is an ed25519 key pair generated locally. No registration, no accounts, no authority that can revoke your access.

Protocol agnostic

The infrastructure handles discovery and connectivity. Once connected, peers multiplex different protocols over the same connection. Existing apps run directly on it.

You run the switchboard

One machine both ends can reach introduces them to each other, and you own it. It is blind by design: it never carries their traffic, so trusting it costs you nothing but reachability.

No store-and-forward

The network does not persist data. If a peer is offline, they're unreachable. Like a phone call, not an answering machine. Users who want persistence run their own always-on node.

Zero lock-in

Keys are portable. DHT entries are self-published. Switching providers means updating one DHT entry. Your peers don't even notice.

04 / Landscape

How it compares.

Several projects explore parts of this design space. nsa differentiates through the combination of zero central infrastructure, protocol agnosticism, and composability.

SystemDiscoveryTransportData layer
BriarTor hidden servicesTor / Bluetooth / WiFiMessaging only (Bramble)
Waku / Statuslibp2p DHTlibp2p GossipSub + relaysMessaging (Waku topics)
NostrRelay URLs (manual)WebSockets to relaysSocial events (JSON)
nsaBitTorrent DHT (BEP 44)libp2p direct + Circuit v2Protocol agnostic
05 / Build on it

What can run on nsa.

Because the infrastructure is protocol-agnostic, it serves as a foundation layer for any application that needs direct peer-to-peer connectivity.

// messaging

Encrypted messaging

Text, voice, video between peers with no server in the middle.

// transfer

File transfer

Direct peer-to-peer file sharing. No size limits, no storage costs.

// iot

IoT communication

Sensors and devices reachable by public key without exposing ports.

// collab

Collaborative tools

Real-time document editing, whiteboarding, code collaboration.

// api

Decentralized APIs

Services discoverable and callable by public key rather than DNS.

// network

Private networks

Ad-hoc encrypted networks between known peers. No VPN infra required. CTL runs yours.

06 / Technology foundation

Standing on giants.

nsa is not building new networking primitives. It composes proven, production-grade components into a coherent infrastructure layer.

ComponentTechnologyTrack record
DiscoveryBitTorrent DHT (BEP 44)1M+ active nodes, 20+ years
Connectivitylibp2p Circuit Relay v2 + DCUtRPowers IPFS, Ethereum, Filecoin
Transportlibp2p multiplexed streamsBattle-tested across major networks
EncryptionNoise / TLS 1.3Industry-standard authenticated encryption
NAT traversalAutoNAT + DCUtR hole-punching~70% success across 85K+ networks
07 / Changelog

What's new.

Every published release is listed here. nsa version --check tells you when you're behind.

Release notes are unavailable right now.
08 / Install

Install nsa.

One static binary: no runtime, no dependencies, no accounts. Fetch it from the terminal, drop it on your PATH, and you're ready to reach your machines by name.

latest release —
# macOS, Apple Silicon
curl -fsSL https://releases.nsa.tech/nsa-darwin-arm64-latest -o nsa && chmod +x nsa && sudo mv nsa /usr/local/bin/

# macOS, Intel
curl -fsSL https://releases.nsa.tech/nsa-darwin-amd64-latest -o nsa && chmod +x nsa && sudo mv nsa /usr/local/bin/

# Linux, x86-64
curl -fsSL https://releases.nsa.tech/nsa-linux-amd64-latest -o nsa && chmod +x nsa && sudo mv nsa /usr/local/bin/

# Linux, ARM64
curl -fsSL https://releases.nsa.tech/nsa-linux-arm64-latest -o nsa && chmod +x nsa && sudo mv nsa /usr/local/bin/

# Windows, x86-64 (PowerShell)
curl.exe -fsSL https://releases.nsa.tech/nsa-windows-amd64-latest.exe -o nsa.exe
Quickstart

From zero to a direct connection.

You run a switchboard on a machine both ends can reach. It introduces them to each other and never carries their data. Then every machine comes online, and they talk directly.

# 1. On a machine both ends can reach, run the switchboard.
#    It prints its address; you pass that to the first `nsa up` below.
nsa switchboard

# 2. On your laptop, create a network (prints a 12-word secret)
#    and come online, giving it the switchboard address.
nsa new laptop
nsa up /ip4/203.0.113.10/tcp/4001/p2p/12D3KooW...

# 3. On your desktop, join with that secret, then come online
#    the same way. Later `nsa up` calls reuse what it remembers.
nsa join desktop
nsa up /ip4/203.0.113.10/tcp/4001/p2p/12D3KooW...

# 4. From the laptop, reach the desktop by name.
nsa ssh you@desktop
nsa vnc desktop

# Not sure this network allows peer-to-peer? Check first.
nsa doctor

Both machines run nsa up: the one that dials as much as the one being reached. Commands like ssh and vnc talk to that running node, so without it they stop with the node isn't running: start nsa up first.