RFC-0001 · KSP Developer Platform v1.0

Experimental Secure Application Protocol.

A purpose-built, binary-encoded, application-layer protocol and complete developer platform designed for secure, low-latency, multiplexed communication over TCP. Built in safe Rust.

KSP Browser — Developer Preview - Early 2027
KSP CLI development — In development · Expected release: Mid October 2026
scroll
System Topology

HTTPS → Gateway → KSP Architecture

Because native browsers cannot open raw TCP/9876 sockets with custom framing, KSP employs an edge Gateway Reverse Proxy that terminates standard HTTPS/WebSockets and translates them into high-speed, multiplexed KSP v1.0 binary frames.

Zero-Copy Relay Active
Client Layer

Web Browser / Mobile Client

Speaks standard HTTPS/WebSockets (TLS 1.3 over TCP 443). Connects seamlessly without requiring custom operating system kernel drivers or modified browser builds.

Protocol: HTTPS / WSSPort: 443/tcp
Bridge Layer

KSP Edge Gateway Proxy

Written in Rust (`tokio` + `hyper`). Terminates TLS 1.3 from public clients, authenticates bearer/API tokens, and translates HTTP payloads directly into KSP v1.0 binary frames.

Conversion: TLS ↔ KSP AEADLatency overhead: < 0.4ms
Core Backend Layer

KSP Rust Core Daemon

Receives pure KSP binary frames over TCP (`9876/tcp`). Handles up to 256 multiplexed bidirectional streams per connection with sliding-window replay bitmaps and AES-256-GCM AEAD.

Protocol: KSP v1.0Port: 9876/tcp
Public Wire SecurityTLS 1.3 (Browser to Gateway)
Internal Wire SecurityKSP X25519 + AES-256-GCM
Reverse Proxy EngineRust `tokio` + `hyper` asynchronous
Bit-Level Lifecycle

Packet → Serialize → Encrypt → Wire → Decrypt Pipeline

Every KSP frame undergoes strict deterministic serialization and cryptographic transformation before touching the network interface. Zero JSON parsing or text serialization overhead.

Plaintext01

Application Payload

Raw application struct or stream buffer (`StreamData` frame or control command).

Stage: Sender OutputStep 2
Binary Framing02

Serialize & Fragment

Encode into binary. If payload > 16,384 bytes, slice across `StreamData` frames (`FRAGMENTED` bit set).

Stage: Sender OutputStep 3
Nonce Construction03

Header & Nonce XOR

Construct 48B fixed header (`Magic 0x4B535031`, Sequence #). Compute `write_iv XOR seq_num` nonce.

Stage: Sender OutputStep 4
Authenticated Encryption04

AEAD Encrypt

Run `AES-256-GCM` or `ChaCha20-Poly1305` over header (`AAD`) + payload. Append 16-byte authentication tag.

Stage: Sender OutputStep 5
TCP/987605

Network Wire Delivery

Transmit binary stream over reliable `9876/tcp` socket (or reverse-proxied over edge TLS Gateway).

Stage: Receiver InputStep 6
O(1) Verification06

Replay Bitmap Verify

Receiver checks 1024-bit sliding window (`highest_seq`). Drops packet immediately if duplicate or too old.

Stage: Receiver InputAssemble

Protocol Landscape

Where KSP sits in the evolution of networking protocols. KSP is an experimental research protocol, not an Internet standard.

2015

HTTP/2

RFC 7540

  • Binary framing
  • Header compression
  • Multiplexing
2018

TLS 1.3

RFC 8446

  • 1-RTT handshake
  • Forward secrecy
  • AEAD only
2022

HTTP/3 / QUIC

RFC 9114

  • UDP transport
  • 0-RTT resume
  • Built-in TLS
2026← Now

KSP

RFC-0001 (Draft)

  • Application-layer
  • Custom binary framing
  • Experimental / Research

⚠ KSP is an experimental protocol for learning and research. It is NOT an Internet standard and NOT a replacement for TLS or HTTPS.

Design Philosophy

Why another protocol?

KSP is not here to replace TLS or HTTPS. It exists because understanding protocol design requires building one.

Learning

Explore how secure application-layer protocols are designed from first principles — handshakes, framing, key derivation, and replay protection.

Experimentation

Test handshake designs, cipher suite selection, and framing strategies in isolation — without the constraints of production systems.

Binary Framing

Understand why binary wire formats outperform text protocols in overhead, parse complexity, and ambiguity elimination.

Protocol Engineering

Study AEAD encryption, forward secrecy, nonce construction, and stream multiplexing through a fully documented, readable implementation.

Research

A clean, RFC-documented protocol for academic and systems research. Every design decision is explained and justified.

Cryptographic Clarity

X25519, HKDF, and AES-256-GCM combined in a clear, auditable pipeline. No magic. No hidden state. Every step documented.

Capabilities

What KSP includes

A complete protocol implementation with tooling, benchmarks, and documentation.

Core

Binary Protocol

48-byte fixed header. Big-endian encoded. Zero text parsing overhead. Every bit is accounted for in the RFC.

Security

Replay Protection

1024-bit sliding window algorithm with per-direction sequence counters. Detects and rejects replayed frames silently.

Security

Authenticated Handshake

X25519 ephemeral key exchange + Ed25519 certificate binding. Downgrade attack prevented via full transcript verification.

Transport

Stream Multiplexing

256 concurrent logical streams over a single TCP connection. Client-initiated odd IDs, server-initiated even. Inspired by HTTP/2.

Crypto

AEAD Encryption

AES-256-GCM or ChaCha20-Poly1305. Header authenticated as AAD. HKDF-derived session keys. Forward secrecy per session.

Tooling

Wireshark Integration

Custom Lua dissector for Wireshark. Inspect real KSP traffic: headers, flags, sequence numbers, stream IDs.

Infra

Docker Ready

Containerized KSP server and client. Run a full KSP stack in seconds. Included in the GitHub repository.

Perf

Criterion Benchmarks

Statistical benchmarks with Criterion.rs. Latency, throughput, serialization, and handshake performance measured and documented.

Docs

RFC Specification

Full RFC-0001 specification covering every aspect of the protocol. Written to RFC standards with MUST/SHALL/SHOULD language.

Ecosystem Roadmap

From Protocol Spec to Complete Developer Platform

We aren't just delivering a specification. We are systematically building out the 5-stage client and gateway infrastructure required for ubiquitous adoption.

View Full Ecosystem Tracker
Stage 01

Gateway Proxy

Edge TLS reverse proxy terminating HTTPS/WSS into KSP binary frames.

In Development · Q4 2026
Stage 02

Browser Bridge

WebRTC/WASM browser runtime allowing web apps to speak KSP.

Developer Preview · Early 2027
Stage 03

Core SDKs

Idiomatic async libraries for Rust (`tokio`), Python, Go, and TypeScript.

Roadmap · Mid 2027
Stage 04

Browser Extension

DevTools inspection extension for viewing KSP stream frames live.

Roadmap · Q3 2027
Stage 05

Native Client Daemon

OS-level system daemon for transparent local KSP socket forwarding.

Roadmap · Q4 2027

KSP Playground

Build packets. Run a handshake. Inject replays. Watch the state machine. Everything simulated live in your browser — no installation required.

Packet BuilderHandshake SimulatorReplay InjectorDev ConsoleState MachineHex Inspector
Open Playground