chore: rename project quicnprotochat -> quicproquo (binaries: qpq)
Rename the entire workspace:
- Crate packages: quicnprotochat-{core,proto,server,client,gui,p2p,mobile} -> quicproquo-*
- Binary names: quicnprotochat -> qpq, quicnprotochat-server -> qpq-server,
quicnprotochat-gui -> qpq-gui
- Default files: *-state.bin -> qpq-state.bin, *-server.toml -> qpq-server.toml,
*.db -> qpq.db
- Environment variable prefix: QUICNPROTOCHAT_* -> QPQ_*
- App identifier: chat.quicnproto.gui -> chat.quicproquo.gui
- Proto package: quicnprotochat.bench -> quicproquo.bench
- All documentation, Docker, CI, and script references updated
HKDF domain-separation strings and P2P ALPN remain unchanged for
backward compatibility with existing encrypted state and wire protocol.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Cap'n Proto Serialisation and RPC
|
||||
|
||||
quicnprotochat uses [Cap'n Proto](https://capnproto.org/) for both message serialisation and remote procedure calls. The serialisation layer encodes structured messages (Envelopes, Auth tokens, delivery payloads) into a compact binary format. The RPC layer provides the client-server interface for the Authentication Service, Delivery Service, and health checks -- all exposed through a single `NodeService` interface.
|
||||
quicproquo uses [Cap'n Proto](https://capnproto.org/) for both message serialisation and remote procedure calls. The serialisation layer encodes structured messages (Envelopes, Auth tokens, delivery payloads) into a compact binary format. The RPC layer provides the client-server interface for the Authentication Service, Delivery Service, and health checks -- all exposed through a single `NodeService` interface.
|
||||
|
||||
This page covers why Cap'n Proto was chosen, how schemas are compiled, the owned `ParsedEnvelope` type, serialisation helpers, and ALPN integration with QUIC.
|
||||
|
||||
@@ -23,7 +23,7 @@ Cap'n Proto was selected for the following reasons:
|
||||
|
||||
3. **Canonical serialisation**: Cap'n Proto can produce deterministic byte representations of messages. This is critical for MLS, where Commits and KeyPackages must be signed -- the signature must cover exactly the same bytes that the verifier will see.
|
||||
|
||||
4. **Built-in async RPC**: The `capnp-rpc` crate provides a capability-based RPC system with promise pipelining. quicnprotochat uses it for the `NodeService` interface (KeyPackage upload/fetch, message enqueue/fetch, health checks, hybrid key operations). This avoids the need to hand-roll a request/response protocol.
|
||||
4. **Built-in async RPC**: The `capnp-rpc` crate provides a capability-based RPC system with promise pipelining. quicproquo uses it for the `NodeService` interface (KeyPackage upload/fetch, message enqueue/fetch, health checks, hybrid key operations). This avoids the need to hand-roll a request/response protocol.
|
||||
|
||||
5. **Compact wire format**: Cap'n Proto's wire format is more compact than JSON or XML and comparable to Protocol Buffers, with the advantage of no decode step.
|
||||
|
||||
@@ -41,7 +41,7 @@ schemas/
|
||||
|
||||
### build.rs
|
||||
|
||||
The `quicnprotochat-proto` crate compiles these schemas at build time via `build.rs`:
|
||||
The `quicproquo-proto` crate compiles these schemas at build time via `build.rs`:
|
||||
|
||||
```rust
|
||||
capnpc::CompilerCommand::new()
|
||||
@@ -63,7 +63,7 @@ Key details:
|
||||
|
||||
### Generated module inclusion
|
||||
|
||||
The generated code is spliced into the `quicnprotochat-proto` crate via `include!` macros:
|
||||
The generated code is spliced into the `quicproquo-proto` crate via `include!` macros:
|
||||
|
||||
```rust
|
||||
pub mod envelope_capnp {
|
||||
@@ -84,7 +84,7 @@ Consumers import types from these modules. For example, `node_capnp::node_servic
|
||||
|
||||
## The Envelope schema
|
||||
|
||||
The `Envelope` is the top-level wire message for all quicnprotochat traffic. Every frame exchanged between peers is serialised as an Envelope:
|
||||
The `Envelope` is the top-level wire message for all quicproquo traffic. Every frame exchanged between peers is serialised as an Envelope:
|
||||
|
||||
```capnp
|
||||
struct Envelope {
|
||||
@@ -114,7 +114,7 @@ The Delivery Service routes by `(groupId, msgType)` without inspecting `payload`
|
||||
|
||||
Cap'n Proto readers (`envelope_capnp::envelope::Reader`) borrow from the original byte buffer and cannot be sent across async task boundaries (`!Send`). This is a fundamental limitation of zero-copy reads.
|
||||
|
||||
To bridge this gap, `quicnprotochat-proto` defines `ParsedEnvelope`:
|
||||
To bridge this gap, `quicproquo-proto` defines `ParsedEnvelope`:
|
||||
|
||||
```rust
|
||||
pub struct ParsedEnvelope {
|
||||
@@ -256,11 +256,11 @@ MessagePack is untyped -- there is no schema file, and type errors are caught at
|
||||
|
||||
FlatBuffers supports zero-copy reads (like Cap'n Proto) but lacks a built-in RPC framework. The ecosystem and tooling are also less mature for Rust.
|
||||
|
||||
## Design constraints of `quicnprotochat-proto`
|
||||
## Design constraints of `quicproquo-proto`
|
||||
|
||||
The `quicnprotochat-proto` crate enforces three design constraints:
|
||||
The `quicproquo-proto` crate enforces three design constraints:
|
||||
|
||||
1. **No crypto**: Key material never enters this crate. All encryption and signing happens in `quicnprotochat-core`.
|
||||
1. **No crypto**: Key material never enters this crate. All encryption and signing happens in `quicproquo-core`.
|
||||
2. **No I/O**: Callers own the transport. This crate only converts between bytes and types.
|
||||
3. **No async**: Pure synchronous data-layer code. Async is the caller's responsibility.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user