/ws, see Subscriptions.
Why two endpoints
Conflating public read-only subscriptions and identity-bound subscriptions on a single endpoint is the canonical auth-confusion bug pattern. The split:/ws— public, no auth, read-only topics (newBlock,newTx,consensus)./ws-private— validator-profile-only, bearer-token authenticated, identity-bound topics.
--rpc-profile public always returns 404 for /ws-private, regardless of token. Identity-bound subscriptions never leave the validator surface.
Auth model
Current: bearer token
/ws-private accepts the Authorization: Bearer <token> header and matches <token> against the SIGIL_WS_PRIVATE_TOKEN env var using a constant-time comparison. If the env var is unset, the endpoint returns 503 (fail-closed) so a forgotten secret cannot accidentally expose identity-bound subscriptions.
Future: mTLS or DID-signed handshake
The bearer-token check is a transitional posture. Future releases swap it for either:- mTLS: the client presents a certificate signed by the operator’s intermediate CA. ingress-nginx terminates and validates the cert; the node sees the resulting
x-ssl-client-dnheader. - OAS DID-signed challenge: the server emits a random nonce on connect; the client signs it with the OAS DID’s Ed25519 key; the server verifies against the published public key.
Operator setup
Generate a token
Provision via Kubernetes Secret
Smoke-test the endpoint
Rotating the token
Constant-time compare
The token check uses an explicit constant-time byte comparison innode/sigil-node/src/ws.rs::ct_eq. A naïve == on &[u8] short-circuits on the first mismatch and leaks the matching prefix length via timing. The current implementation iterates the full length and accumulates XOR results.
Topics
| Topic | Today | Future |
|---|---|---|
newBlock | yes (mirrors /ws) | yes |
newTx | yes (mirrors /ws) | yes |
consensus (redacted) | yes | yes |
account.<did> | not yet | yes |
contract.<address> | not yet | yes |
consensus.detailed | not yet | yes |
See also
- Subscriptions — public WebSocket schemas.
- Authentication — JWT for premium tiers.