enigma-node-registry
Registry daemon for Enigma nodes with envelope-based registration, TLS, rate limiting, proof-of-work (optional), and presence TTL/GC. All responses are structured JSON and inputs are strictly validated.
Quickstart (HTTP, local dev)
Use storage.kind = "memory" for local runs without sled. Endpoints listen on address from the config (default 0.0.0.0:8443).
Quickstart (TLS, production)
Provide PEM-encoded cert/key paths under [tls]. Enable mtls feature and set client_ca_pem_path to require client certificates. Persistence uses sled when the persistence feature is enabled and storage.kind = "sled".
Config example
= "0.0.0.0:8443"
= "tls"
= true
[]
= true
= 5
= 10
= 300
[]
= 1
= 3
= 10
[]
= "000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f"
= [{ = "0001020304050607", = "101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f", = true }]
[]
= "/etc/enigma/registry.cert"
= "/etc/enigma/registry.key"
# client_ca_pem_path = "/etc/enigma/ca.pem" # enable when mtls feature is on
[]
= "sled"
= "./registry_db"
[]
= 300
= 60
[]
= false
= 18
= 120
Endpoint summary
POST /register—{ handle, envelope }encrypted to the server envelope key. Returns{ ok }or409on conflict.POST /resolve—{ handle, requester_ephemeral_pubkey_hex }and returns{ handle, envelope }encrypted to the requester using the active envelope key. Enforced rate limit and optional PoW.GET /check_user/{handle}—{ exists }with anti-enumeration rate limits and optional PoW.POST /announce— presence heartbeat for a device.POST /sync— merges provided identities whenallow_sync = true.GET/POST /nodes— list or add nodes (deduped, capped).GET /envelope_pubkeyandGET /envelope_pubkeys— advertise current and historical envelope keys.GET /pow/challenge— available whenpowfeature is compiled and enabled in config.
Errors follow { "error": { "code": "...", "message": "...", "details": { ... } } }.
Security notes
- TLS via rustls is recommended in production; HTTP is for local development only.
- Rate limits and optional PoW protect
/resolveand/check_userfrom scraping. - Identities are only returned inside encrypted envelopes keyed by X25519 and a peppered blind index.
- Presence entries are purged on a GC interval using the configured TTL.
Testing