Python 3.12+ • FastAPI • Redis 7 + Lua • Ed25519 UDP • mTLS Passthrough

Zero-Knowledge Peer Discovery & Encrypted Fallback Relay.

Peers authenticate with EC P-256 signatures over replay-proof Redis nonces and introduce themselves with single-use 8-character Crockford codes. When firewalls block direct hole-punching, an opaque 64 KiB relay bridges end-to-end mutual TLS 1.3 ciphertext without ever inspecting filenames, sizes, or keys.

3-Node Switchboard Preview Auto-cycling
Ephemeral Control Plane blindvault-control + Redis 7 WS /ws/control • UDP :3478 • TTL RAM
Direct mTLS 1.3 P2P Tunnel
Peer A Initiator
EC P-256 • a19f..8e04
Peer B Responder
EC P-256 • 7c42..3d19
Data Path Direct UDP/TCP Hole-Punch
Frame / Packet Guard Ed25519 Signed BVST (:3478)
Server Visibility Signal Hints Only • 0 Keys
How Connections Establish

Four Ephemeral Steps From Discovery to Encrypted Stream

Every handshake, invite code, NAT reflection probe, and fallback tunnel is stateless on disk and bound by automatic Redis TTLs.

Replay-Proof Handshake SECP256R1 Strictly Enforced

Prove Identity Without Sending Private Keys

The peer submits its PEM/DER public key in HELLO. Only secp256r1 keys pass curve validation to derive the lowercase SHA-256 fingerprint, then the server stores a 32-byte nonce in Redis consumed once via GETDEL.

Client → Server HELLO EC P-256 SPKI Key
Server → Client 32B CHALLENGE nonce:{fp} (30s TTL)
Client → Server ECDSA AUTH Atomic Redis GETDEL
Server → Client AUTH_OK 60s TTL • 20s PING
Max control frame: 8 KiB Heartbeat: 20s PING/PONG Rate limit: 10 handshakes/min/IP
WS /ws/control — Auth Sequence
Cryptographic & Operational Invariants

Privacy & Rate-Limiting Guarantees

No databases, no file inspection, no weak elliptic curves—enforced in code, Redis Lua scripts, and hermetic CI tests.

Zero Persistent Storage

All runtime state lives strictly in Redis RAM with 30s–300s TTLs and disk persistence disabled (--appendonly no --save "").

nonce: 30s presence: 60s invite: 300s

Automatic IP Scrubbing

ip_scrubbing_processor automatically rewrites IPv4 and IPv6 addresses across structured structlog JSON events.

client_ip → [REDACTED_IP]

Curve Confusion Guard

parse_ec_p256_public_key verifies the curve is strictly SECP256R1—immediately rejecting RSA, secp256k1, and secp384r1.

P-256 ✓ RSA / k1 / P-384 ✕

Atomic Redis Lua Token Buckets

TOKEN_BUCKET_LUA enforces burst-proof sliding refill budgets in a single atomic Redis evaluation with zero race conditions.

Auth 10/m Invite 10/m Claim 10/m Relay 5/m

Horizontal Multi-Replica Scaling

Load-balanced instances route control envelopes on bv:peer:{fingerprint} and bridge binary relay chunks over bv:relay:* Pub/Sub.

bv:peer:* ⇄ bv:relay:a2b / b2a

41/41 Hermetic Tests

Deterministic coverage via fakeredis[lua], strict mypy src/, and ruff check . spanning crypto, auth, pairing, Ed25519 UDP, and 10 MiB relay streams.

pytest 41/41 mypy --strict ruff ✓
Wire Specification Explorer

Interactive Wire Protocol & UDP Packet Explorer

Filter WebSocket control messages or inspect exact UDP BVST byte offsets matching schemas.py and udp_reflector.py.

Measured Async Concurrency

High-Throughput Control & Opaque Relay Speed

All figures come directly from benchmarks/bench_control.py executed on an 8-core CPU workload with zero bytes corrupted.

312 handshakes/s
ECDSA Challenge Auth Peak
500 concurrent handshakes (25 workers) • 73.8 ms p50 • 108.8 ms p95
500 peers
Concurrent Authenticated Sessions
100% WebSocket success • 135.2 ms fan-out ping p50 • 150.1 ms p95
9.60 MiB/s
64 KiB Encrypted Relay Stream
~80.5 Mbps on 100 MiB transfer • 100% SHA-256 integrity
Production & Local Setup

Deploy With Docker Compose or Run Locally

Includes an ephemeral RAM-only Redis 7 container, FastAPI control/relay ports (:8000 TCP), and UDP endpoint reflection (:3478 UDP).

# 1. Clone and boot Redis 7 (RAM-only: --appendonly no --save "") + blindvault-control
git clone https://github.com/OmarAhmedTHE25th/blindvault-control.git
cd blindvault-control
docker compose up --build

# 2. Verify liveness, readiness, and Ed25519 UDP public key discovery
curl -s http://localhost:8000/health | jq
curl -s http://localhost:8000/ready | jq
curl -s http://localhost:8000/api/v1/info | jq

# Exposed Services:
# - Control & Relay WebSockets: ws://localhost:8000/ws/control & /ws/relay/{session_id}
# - Signed UDP Reflector:       udp://localhost:3478 (Magic: BVST / 0x42565354)