Celerity 0.1.1: pure Rust ZMTP 3.1 with a sans-IO core, Tokio transport, and CURVE-RS
โ Rust ๐ 2026-04-20 ๐ค surdeus ๐๏ธ 3Hi all,
Iโve been working on celerity, a pure Rust implementation of ZMTP 3.1 for guys who want ZeroMQ-style messaging semantics without really depending on libzmq.
The main design choice is that the protocol engine is sans-IO. CelerityPeer owns greeting, handshake, framing, multipart assembly, and security state, while the optional Tokio layer handles TCP and Unix domain sockets. That split kept the wire protocol testable in isolation and kept transport issues separate from protocol state.
Current scope:
-
ZMTP 3.1 greeting, handshake, framing, and multipart messages
-
PUB/SUBandREQ/REP -
Tokio transport wrappers for TCP and Unix sockets
-
CURVE-RSfor authenticated/encrypted non-local links -
a small
cel-catCLI for local smoke testing
A few implementation details:
-
Security is scope-aware: loopback TCP and IPC default to
NULLfor local workflows, while non-local links fail closed unlessCURVEis configured or insecureNULLis explicitly enabled. -
The
CURVE-RSpath uses X25519 key agreement, HKDF-SHA256 for derivation, and ChaCha20-Poly1305 for traffic protection. -
High-water mark configuration supports either backpressure or
DropNewestbehavior. -
Handshake metadata is case-insensitive on lookup while preserving original bytes on the wire.
The API currently has two layers:
-
low-level:
CelerityPeeras a protocol state machine -
higher-level:
celerity::iowith Tokio adapters and helpers likePubSocket,SubSocket,ReqSocket, andRepSocket
Iโve been validating it with cargo test --all-features; the current test matrix covers handshake edge cases, CURVE flows, IPC authorization checks, queue policy behavior, and end-to-end Tokio socket roundtrips.
Iโd be interested in feedback on:
- the sans-IO API shape
- the local vs non-local security defaults
- missing ZMTP patterns or interoperability cases worth prioritizing next
I'm open to any other suggestions
1 post - 1 participant
๐ท๏ธ Rust_feed