Repository navigation
Description
Problem
in its early development stages, SRI's noise_sv2 made the KISS decision of making server static key ephemeral... every session leverages RNG to create a new static key, and a new throw-away certificate is signed
moreover, the application layer of SRI is currently structured in a way where authority keypairs are written into config.toml and deployed on the server (which is not a good idea for production)
all of that is still true on SRI today
this oversimplification was practical for early development, but now it might be nudging implementers in a direction where their custody expectations around authority keys might be shaped by what SRI does today, not by what the protocol was designed for
while ephemerally generating static keys for every handshake is not violating the spec as-is, I don't think it is good practice for production systems
static keys do deserve "cheap" rotation, but making them ephemeral pushes authority key to a "hot" position where it doesn't belong
looking at it from a pure protocol design perspective:
- ephemeral keys are meant to be rotated on every session
- static keys are meant to be hot, and periodically rotated (with new signed certificates)
- authority keys are meant to be kept off the internet-facing server (offline, HSM, or an internal signing service), and only ever touched when new certificates need to be signed... rotation is expensive by design
Spec PR sv2-spec#234 (at a0a32bd) documents the intended key management in a new §4.8. §4.8.1: "The authority private key SHOULD therefore be kept off internet-facing servers [...] An internet-facing server holds only its static key and a certificate over it, issued where the authority private key is kept and loaded by the server. [...] Outside development and testing, a server SHOULD NOT sign certificates at handshake time, nor generate a new static key for every connection, since such a key cannot be certified in advance." §4.8.3: "Certificates SHOULD have short validity periods and be renewed automatically, each renewal certifying a new static key rather than extending the old one." SRI cannot follow either today.
Impact
Any host that accepts Noise connections (Pool, JDS, JDC's downstream listener) holds the authority private key in memory and on disk. A compromise of one internet-facing server leaks the key that lets an attacker impersonate the operator to every client, for as long as any client still trusts that key, and there is no revocation (spec §4.8.1, §4.8.2).
Certificate validity is whatever the server chooses at handshake time, so nothing bounds the lifetime of a leaked static key except cert_validity_sec on the same compromised host. Operators cannot issue short-lived certificates from a separate signing machine, nor renew them without restarting the server.
Because the only way to run a server is with the authority secret in its config, the shared test secret shipped in config examples is reused in deployments (sv2-apps#784), and the secret-at-rest problems in sv2-apps#446 and sv2-apps#834 apply to every server host instead of one signing machine.
Expected outcome
- a new
Responderconstructor taking a static keypair plus a pre-signed certificate, withstep_1sending that certificate verbatim instead of signing a new one - all the risks associated with the old
Responderconstructor very well documented
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady For Review 🔍
- StatusShow more project fieldsReady For Review 🔍
Activity
Christopherdominic commentedon Oct 28, 2026
@plebhash I'd like to work on this. Since #2426 reworks the certificate verification path in
initiator.rsandsignature_message.rs, should I wait for it to land and build on top of it (so both breaking changes can share onenoise_sv2major bump), or would you prefer to keep this one yourself? Happy to split it as well, e.g. the pre-issued-certificateResponderfirst, then the multi-keyInitiator.[-]`noise_sv2`: let a server present a pre-issued certificate, and a client trust several authority keys[/-][+]`noise_sv2`: let a server present a pre-issued certificate[/+]plebhash commentedon Oct 30, 2026
@Christopherdominic thanks for your interest but this is a sensitive issue, and we need it to be solved by experienced contributors.
plebhash commentedon Oct 30, 2026
note: multikey proposal from stratum-mining/sv2-spec#234 is now unlikely to move forward, so I'm reducing the scope here so that we only fix the
Responderconstructor to allow for cold authority keyplebhash commentedon Nov 3, 2026
here's some potential approaches for how we can shape UX on the
sv2-appscompanion:environment variables
server
config.toml:environment, e.g. a systemd
EnvironmentFile=or a docker--env-file:a running process cannot see changes to its own environment, so here rotation is a restart:
# written by the same job that signed the new certificate $ cp key_2.env /etc/sv2/static_key.env $ systemctl restart sv2-poolactive_static_key.toml+ symlinksserver
config.toml:server
active_static_key.toml, same fields as the environment variables:in order to enable atomic updates for rotation,
active_static_key.tomlis a symlink on disk.new files are written for rotation, and symlink is updated.
for example, imagine I'm rotating static keys every 24h:
$ ls -l static_keys/ total 12 lrwxrwxrwx 1 plebhash plebhash 10 Oct 8 23:55 active_static_key.toml -> key_2.toml -rw-rw-r-- 1 plebhash plebhash 320 Oct 6 23:55 key_0.toml -rw-rw-r-- 1 plebhash plebhash 320 Oct 7 23:55 key_1.toml -rw-rw-r-- 1 plebhash plebhash 320 Oct 8 23:55 key_2.tomlideally
key_0.tomlandkey_1.tomlcould be deleted, but I left them in the example for clarity.every time the server needs to perform a new handshake,
stratum-apps::network_helpersreadsactive_static_key.tomland instantiates a newnoise_sv2::Responderfrom itsstatic_private_key+certificate.tradeoffs
EnvironmentFile=, docker/k8s secrets), not in the app's own directory, and no file watching or re-reading per handshake is needed.so env variables fit orchestrated deployments where a rolling restart per rotation is routine anyway, while the symlink fits a single long-running process.
feat(stratum-apps)!: add a Noise Certificate to key_utils
feat(stratum-apps)!: add ResponderCredentials for Noise servers
feat!: let Pool, JDS and JDC present a pre-issued certificate
29 remaining items
docs: ship a throwaway certificate in the example configs
feat(noise_sv2): let a Responder present a pre-issued certificate
docs(noise_sv2): state the risks of signing certificates per handshake
feat(stratum-apps): add a Noise Certificate to key_utils
feat(stratum-apps)!: add ResponderCredentials for Noise servers
feat!: let Pool, JDS and JDC present a pre-issued certificate
feat(stratum-apps): add the sv2-certificate tool
docs: ship a throwaway certificate in the example configs
feat(noise_sv2): let a Responder present a pre-issued certificate
docs(noise_sv2): state the risks of signing certificates per handshake
feat(stratum-apps): add a Noise Certificate to key_utils
feat(stratum-apps)!: add ResponderCredentials for Noise servers
feat!: let Pool, JDS and JDC present a pre-issued certificate
feat(stratum-apps): add the sv2-certificate tool
docs: ship a throwaway certificate in the example configs