QSCS Trust Layer

Keypair-anchored identity over an end-to-end encrypted transport.

Trust in QSCS does not rely on secrets that can be copied, cookies that can be stolen, or bearer tokens that can be replayed. Every client and every node holds a cryptographic keypair. Every authenticated request is signed. Every byte on the wire, including the identifiers themselves, travels inside an encrypted channel.

This page describes how that actually works, in the same terms as the running code.


1. Identities Are Keypairs, Not Secrets

When a browser first loads the QSCS substrate, it generates two things locally, inside the WebAssembly module:

The UUID is an identifier, not a credential. It is sent to the daemon in plain form in the X-QSCS-Client-Uuid header, the daemon reads it, and the daemon stores it. There is no hashing step, and nothing about the UUID needs to be secret. Security does not come from hiding the UUID. It comes from the fact that only the genuine client holds the matching Ed25519 private key, and every meaningful request must be signed with it.

So the correct mental model is simple: your identity is a public key. Proving your identity means signing with the private half that only you hold.

Client (WASM) UUIDv4 identifier Ed25519 public key private key (never leaves client) UUID + pubkey stays local Daemon bind (uuid, origin) to pubkey stored in spook.identities.db The UUID is public. The private key is what proves identity.

2. Why Identifiers Are Not Readable on the Wire

The UUID is not a secret, but that does not mean an eavesdropper can read it. They cannot, because QSCS carries all traffic inside an encrypted channel. There are two legs, and both are encrypted end to end.

Browser to edge

The connection between the browser and the QSCS edge is standard TLS (HTTPS), terminated at the reverse proxy in front of the daemon. The UUID, the public key, credentials at login, and every signed request arrive already encrypted.

Node to node

Traffic between QSCS nodes does not use TLS. It uses a purpose-built encrypted transport on port 4443:

The practical result: a network observer sees only ciphertext and framing. The UUID, the identity bindings, and the state deltas are never visible. And even in the impossible case that an identifier leaked, it is useless on its own, because it is not a credential. Without the Ed25519 private key, it signs nothing.

Browser substrate QSCS Edge node QSCS Peer node TLS X25519 + AES-256-GCM Eavesdropper on the wire sees only ciphertext and frame lengths Unreadable because the channel is encrypted, not because the UUID is hashed. A leaked identifier is still useless without the private key.

3. Authentication Is Proof of Key Possession

QSCS never checks a shared secret on the wire. It checks a signature. Every authenticated request carries four headers:

The signature covers a canonical message built from the request itself:

METHOD \n HOST \n URI \n BODY \n TIMESTAMP \n NONCE

Because the body and target are inside the signed message, a valid signature proves the request was produced by the holder of the private key and was not altered in transit.

Login

A login is a POST /auth/login carrying the username, password, client UUID, and public key, and it is signed like any other request. The daemon does three things, in order:

  1. Verifies the signature against the supplied public key. This proves the caller actually holds the private key.
  2. Verifies the credentials by asking the control plane to authenticate the username and password. The daemon never stores or judges the password itself.
  3. Binds the identity, writing a record of (uuid, origin) to the username and public key into its local identity store, then replicating that binding to the cluster.

From that point on, every request for a protected resource is verified against the stored public key for that (uuid, origin). There is no session cookie and no bearer token. There is nothing to steal and replay, because possession of the private key is required on every request.

Client signed POST /auth/login Daemon 1. verify Ed25519 signature 2. verify credentials 3. bind (uuid, origin) to pubkey Control Plane checks user + password No cookies, no bearer tokens. Every protected request is signature-verified.

4. Replay and Freshness

A signature alone would let an attacker capture a valid request and send it again. QSCS closes that with two bindings on every signed request:

A captured request is therefore only valid for a very short window, and only once. Logging out clears the client's nonce history and its binding, so a reconnect must authenticate again.

accepted within 60s, nonce unseen too old reject too new reject now - 60s now + 60s A replayed request is both stale and a duplicate nonce, so it is refused twice over.

5. Node and Cluster Trust

Client identity is only half of the model. Nodes must also trust each other and the control plane.

License-anchored node identity

Each node has its own stable node UUID and a license. At startup the daemon validates its license, node UUID plus license token, with the control plane. If validation fails, if the license is expired, or if the node has been revoked, the daemon refuses to start. A copied node UUID is worthless without the matching license token, and the control plane can revoke a node centrally.

Encrypted, gated peer connections

Node-to-node connections are protected in layers:

Consistent, scoped replication

Identity bindings and logouts are replicated across the cluster as deltas scoped to (uuid, origin). Authenticating on one node makes you known cluster-wide, and logging out revokes that binding everywhere. Because bindings carry the origin they belong to, an identity for one origin can never be used to speak for another.

address gate unknown peers dropped X25519 handshake AES-256-GCM session domain handshake same cluster only state Each stage must pass before the next begins. State flows only between verified cluster members. Node identity is anchored to a control-plane license that can be revoked.

6. The Per-Origin Identity Gate

An origin can be marked as identity-protected in the node configuration. For those origins the daemon enforces a gate on every request:

This means a protected endpoint cannot be reached by simply replaying a page load or guessing a URL. The request must be signed, fresh, and bound to an identity the daemon already trusts for that origin.


7. What This Means for an Attacker

The trust model is easier to judge by what it denies:

Snoop the wire Sees only ciphertext, both legs encrypted Steal a client UUID Useless without the Ed25519 private key Replay a captured request Rejected by the timestamp window and nonce ring Copy a node UUID Useless without the license, revocable centrally Every path back to access requires a private key the attacker does not hold.

Identity in QSCS is a public key you prove ownership of, carried over a channel nobody else can read, checked fresh on every request, and anchored to a control plane that can revoke trust at any time. That is the whole model, and it is exactly what the code does.