Repository navigation
This release went through the release dry run, the 60-cycle crash tests
and the fuzz targets, but not the 72-hour soak that CONTRIBUTING.md
asks for: the one run started on a release candidate shared its host
with other workloads and was stopped. Treat long-run memory and latency
behaviour as unverified until a soak on a dedicated host is recorded in
bench/SOAK.md.
Upgrading
-
Blossom (new, off by default) keeps its own store under
[blossom] dir(blob files plus a metadata LMDB environment at
format version 1); the relay's[db]is untouched. Back up both
parts ofdir(guides/blossom.md). -
The on-disk format stays at version 4 (unchanged since 0.2.0): to
upgrade from 0.2.x or 0.3.x, replace the binary and restart. No
export and import is needed. -
The Linux release binaries now need glibc 2.31 or newer (Debian 11,
Ubuntu 20.04, RHEL 9 and newer). The 0.3.0 binaries needed glibc
2.38 and did not start on Debian 12 or Ubuntu 22.04. -
The listener and per-address limit keys moved (native), with no
aliases. A 0.3 configuration that sets[relay] bind,port,
real_ip_headerormax_connections_per_ip, or has a
[relay.rate_limits]table, stops the relay at startup with an
unknown fielderror. Move them by hand; a configuration that sets
none of them needs no change. Before (0.3):[relay] bind = "127.0.0.1" port = 7777 real_ip_header = "X-Forwarded-For" max_connections_per_ip = 128 [relay.rate_limits] events_per_second = 20
After (0.4):
[[relay.listen]] address = "127.0.0.1:7777" real_ip_header = "X-Forwarded-For" [relay.profiles.default] max_connections_per_peer = 128 [relay.profiles.default.rate_limits] events_per_second = 20
Every
[relay.rate_limits]key keeps its name and default under
[relay.profiles.default.rate_limits]. A listener may also be a
Unix-domain socket with its own profile, for a proxy on the same
host or a torrcHiddenServicePort 80 unix:/run/nosfry/onion.sock
(seeguides/tor.md):[[relay.listen]] address = "unix:/run/nosfry/onion.sock" profile = "onion" [relay.profiles.onion] max_connections_per_peer = 10000
nosfry.example.tomllists every key. The Workers edition keeps
[relay] max_connections_per_ipand[relay.rate_limits]. -
[relay] service_url_aliasesis new (both editions). -
The
[relay.auth]table is gone, with no aliases. A config
that sets[relay.auth],restricted_read_kindsor
restrict_read_to_involvedstops the relay at startup with an
unknown fielderror; the Workers edition rejects it the same
way. Move the settings to[relay.access]rules, which cover the
old kinds (now including 21059) plus write gates and the NIP-86
allow list:restricted_read_kinds = Kwith
restrict_read_to_involved = truebecomes
[[relay.access.rules]]withkinds = Kand
read = ["author", "recipient"]— also the new built-in default
forK = [4, 1059, 21059], so a config that never listed the
key needs nothing.restrict_read_to_involved = falsebecomes
read = ["authenticated"].restricted_read_kinds = []becomes[relay.access]with
rules = [].
A config whose
max_websocket_payload_sizeis smaller than
max_event_size + 10is refused at load and at reload — check
this pair if you raisedmax_event_size. -
[relay] max_connectionsis always finite.max_connections = 0
(the old "unlimited" default) now stops the relay at startup, as
does a value abovelimit - 64 - limit/8of the soft open-file
limit: delete the line to get that ceiling as the default (874,936
at the defaultnofiles = 1000000), or set a value sized to the
host's memory. A reload carrying either is refused. -
Under load the relay now refuses work it used to queue: a REQ or
COUNT can be answeredCLOSED rate-limited: relay busyor
rate-limited: too many pending queries, and a NEG-OPEN or NEG-MSG
the sameNEG-ERR. Malformed frames past the REQ rate budget get no
NOTICE. -
nosfry exportnow also writes the persisted NIP-86 management
state and NIP-62 vanish points as versioned
{"nosfry_state":1,…}lines thatnosfry importapplies;
export --events-onlywrites events only, for piping into strfry
or another relay. -
Behaviour an operator may notice: NIP-86 bans and allow lists now
also hide events stored before the entry was added; only the newest
request to vanish per author is kept; AUTH events are accepted within
10 minutes of the relay's time in both directions. -
Breaking behaviour: with AUTH disabled (empty
service_url),
publishes of the access-gated kinds are refused with
restricted:— set[relay.access] rules = []to accept and
serve them openly.
ids,authors,#eand#pfilter values must be 64 lowercase
hex characters (anything else isinvalid:; strfry accepts
uppercase and a0xprefix).nostr_events_total{kind}now counts
events persisted to the store with at most 256 own kind series —
dashboards built on the old verified-publish numbers change.
Security
-
The
cargo denyadvisories and licence exceptions added for Arti's
dependency tree are tracked in #116. -
NIP-86
banpubkey,disallowkindand the allow lists only refused
new publishes: events stored before the entry was added were still
served to everyREQ,COUNTandNEG-OPEN. They are now hidden at
read time, in both editions, and stay hidden after a Workers
hibernation restore. The events stay in the database and reappear
when the entry is removed;baneventstill deletes the event. -
Kind 21059 (NIP-59 ephemeral gift wraps) was broadcast to every
matching subscriber, including unauthenticated ones, because no
rule covered it. The default[relay.access]rule covers it now:
with AUTH on it is delivered only to authenticated involved
readers, and with AUTH off it is refused on write. -
The Workers edition keyed its per-IP connection cap and shared
per-address rate buckets by the exact client address, so an IPv6
client could bypass both by rotating addresses inside its /64. It now
groups IPv6 by /64 and folds IPv4-mapped addresses, as the native
edition does. The NIP-86 IP block list still matches exact addresses. -
The per-reader query queues were unbounded (audit C-14), so a REQ
flood could grow memory without limit. Each reader now admits at
most 4,096 queries and each connection at most twice
max_subs_per_connectionwaiting ones. Beyond that a REQ or COUNT
is answeredCLOSEDwithrate-limited: too many pending queries
(that connection's own limit) orrate-limited: relay busy(the
shared one), and a NEG-OPEN or NEG-MSG with the sameNEG-ERR. -
A stored scan crossing one
created_atshared by many events
buffered every match in that tie group, so a client that
published many events with one timestamp could make each query of it
allocate without bound. The buffer is now bounded by the filter's
remaininglimit. -
A
NEG-OPENscan was charged againstmax_sync_memory_bytesonly
once its session sealed, so concurrent syncs could collect past the
budget. The scan is now charged while it collects and refused with
blocked: sync capacity exhaustedwhen the budget is spent. -
Live matches buffered while a subscription's stored scan runs sat
outside every byte budget (audit C-13). They now reserve their bytes
againstmax_pending_outbound_bytesand count in the process-wide
outbound total; a subscription whose buffer no longer fits is closed
witherror: subscription fell behind, as at the 4,096-event buffer
limit, and the connection stays open. A connection holds at most
twicemax_pending_outbound_bytes: queued frames plus reservations. -
[relay] max_connectionsdefaulted to0, unlimited. It is now
always finite: omitted, it is derived from the soft open-file limit
afternofilesraised it,limit - 64 - limit/8(64 descriptors
for the process itself, one eighth for HTTP requests and handshakes
the cap does not count), e.g. 874,936 at the default
nofiles = 1000000.0and any value above the derived limit are
refused at startup and on reload. The effective cap is logged at
startup. It bounds descriptors, not memory: memory-bound deployments
should still set a lower value. -
Frames that fail to parse were answered with a NOTICE each and
charged to no rate bucket (audit C-01). They now spend the
connection's and address's REQ rate tokens, and past the budget get
no reply, so a junk flood no longer buys one NOTICE per frame. The
unknown-verb NOTICE quotes at most 32 bytes of the verb. -
The HTML landing page now sends
Content-Security-Policy,
X-Content-Type-OptionsandReferrer-Policy
(site::LANDING_HEADERS), in both editions.
Added
-
Blossom media server (native, off by default). With
[blossom] enabled = truethe relay process also serves Blossom
blobs (BUD-01 retrieval with single-range requests, BUD-02 and
BUD-13PUT /uploadandPUT /<sha256>, BUD-06 preflight, BUD-11
kind 24242 tokens in standard or URL-safe base64, BUD-12 list and
delete) on its own[[blossom.listen]]sockets and its own
public_urlhost; the relay refuses to start if either is shared
with the relay. Uploads are limited to the NIP-86 admins and allow
list unlessblossom.upload = "everyone", NIP-86 bans apply, and
per-pubkey quotas (quota_bytes,quota_blobs), a global
max_total_bytes,max_blob_sizeand an optionalmime_types
list bound the store. Blobs are streamed to disk while hashed,
fsynced and renamed into place before their metadata commits and
the client gets201. Every blob response isnosniffwith a
sandboxContent-Security-Policy, and HTML, SVG and other
scriptable types are sent as attachments.nosfry blob list|stat|delete|ban|unban|gc|verifyadministers the store;
/metricsgainsnosfry_blossom_*series. Built in by the default
blossomcargo feature. Seeguides/blossom.md. -
[relay.access]per-kind rules, in both editions, replacing the
old restricted-kinds settings: each[[relay.access.rules]]entry
names explicitkinds(omit it once for a catch-all; no
wildcards), areadset of principals (authenticated,author,
recipient,allowed— the NIP-86 allow list), and awrite
gate (open,authenticated,author). The same rules govern
stored scans, live delivery, COUNT, NEG and publishes; a non-open
write gate marks NIP-11limitation.restricted_writes.
anonymous_kindsexempts single-use-key kinds such as 445 from
the allow-list author check so allow-list relays can carry Marmot
content. -
Embedded Tor onion service (native, opt-in). A
[[relay.listen]]
address ofonion:<nickname>serves the relay as a Tor onion service
embedded in the process through Arti 0.48, behind the newonion
cargo feature — off by default and shipped as-onionrelease
archives and image tags (build from source instead withcargo install nosfry --locked --features onion). Each rendezvous circuit is a connection on the
shared HTTP/WebSocket path, all circuits of a listener share the
listener-wide peer identity (so its profile's
max_connections_per_peerand per-peer buckets bind them together),
and[relay.onion]bounds circuits (max_circuits), streams per
circuit (max_streams_per_circuit) and optionally the
introduction-point rate (intro_rate/intro_burst). Clearnet
listeners serve while the onion listener bootstraps in the
background with capped retries. The first derived onion URL is the
canonicalservice_urlwhen none is set (every onion URL is an
alias otherwise),onion_locationadvertises it to non-onion
clients,nosfry onion addressprints thews://<addr>.onionURLs
without starting the relay, andnosfry_onion_*metrics report
state, circuits, streams and rejections. Write-policy plugins see
onion connections as"sourceType":"Onion". -
Release artifacts for the onion variant: every archive has a
nosfry-<version>-onion-<target>.tar.gztwin and the container image
has<version>-onion,<major>.<minor>-onion,<major>-onionand
oniontags, all built with--features onionand attested like the
default artifacts; the release build asserts the default binary and
SBOM contain no Arti and the onion ones do. -
nosfry syncover Tor (native,onionfeature). A
ws://<addr>.onionpeer URL is dialed through an embedded Arti
client —ws://only, because the circuit already encrypts and
authenticates the service, and never a clearnet DNS lookup. The
client shares[relay.onion] state_dirwith the onion listeners:
one guard set per installation, a warm cache next to a running
relay, and read-only state and cache under Arti's own lock files when
that relay holds them. Bootstrap is bounded at 180 seconds, each
connection by--timeout; a build without the feature refuses the
URL and names it. -
iroh transport (native, opt-in). A
[[relay.listen]]address of
iroh:<nickname>makes the relay reachable over iroh QUIC by anyone
holding its endpoint id, with NAT hole punching and relay fallback, so
a relay at home or behind CGNAT needs no public IP. It sits behind the
newirohcargo feature (iroh 1.4.1) — off by default and absent from
the published binaries and container image (cargo install nosfry --locked --features iroh). Each QUIC stream on ALPNnosfry/http/1
is an ordinary HTTP/1.1 connection, so NIP-11, WebSockets and NIP-86
are unchanged. Per-peer caps and buckets key on the authenticated
remote endpoint id;[relay.iroh]bounds QUIC connections per
listener before the handshake (max_connections) and streams per
connection, picks n0's public relays, your own (relay_mode = "custom",relay_urls) or none, and turns n0's DNS address lookup
on or off. Each listener's relay namews://<endpoint-id>.irohjoins
the relay names (canonical when nothing else names the relay), NIP-11
lists the endpoint ids under"iroh",nosfry iroh addressprints
the dial address offline, andnosfry_iroh_*metrics count direct
and relayed connections.nosfry sync iroh:<endpoint-id>reconciles
with a relay over iroh, andnosfry connect <endpoint-id> --listen 127.0.0.1:<port>is a localhost gateway through which any existing
Nostr client reaches an iroh-only relay. Write-policy plugins see
"sourceType":"Iroh". Seeguides/iroh.md. -
nosfry sync <url> [--filter] [--dir down|up|both] [--since] [--until]reconciles the local database with any NIP-77 relay
(nosfry, strfry) and transfers the difference (native). Memory stays
bounded whatever the set sizes: the range is reconciled in time
windows of at most 100,000 local events and 100,000 differences,
split further when the remote answersblocked:. Frame sizes and
download batches follow the remote's NIP-11 limits,rate-limited:
answers are retried after their hint, and an interrupted run is
resumed by running it again. Downloads pass the same validation as a
clientEVENT, NIP-86 moderation, and the write-policy plugin
("sourceType":"Sync"); protected events and events an
[relay.access]read rule hides from unauthenticated readers are
never uploaded. Exit codes: 0 complete, 3 partial, 1 failed. NIP-42
keys come only from--auth-key-file(mode 600); loopback and
private addresses need--allow-private. Seeguides/sync.md. -
[relay] service_url_aliaseslists furtherws:///wss://names
the relay answers to (for example its onion address); NIP-42 AUTH,
NIP-62 requests to vanish, and NIP-98 management calls accept the
canonicalservice_urland every alias, in both editions. NIP-11
and the landing page keep namingservice_url. -
Unix-domain-socket listeners (
address = "unix:/path"), for a
reverse proxy on the same host or a torrcHiddenServicePort unix:target. Withoutreal_ip_header, all connections of such a
listener are one peer: its profile's per-peer cap andip_*
buckets apply to the whole listener, the write-policy plugin sees
"sourceType":"Unix"with the socket path, andblockipdoes not
apply. A stale socket file is replaced at startup and the file is
removed at shutdown. -
connection closedlog lines carryduration_ms, and the relay
warns at most once a minute per listener when itsreal_ip_header
is missing or unparsable and the peer falls back to the transport. -
Gift wraps (kind 1059) are deleted by their
precipient's
NIP-09 kind 5, with re-publication blocked (NIP-59). -
An AUTH challenge is sent whenever an unauthenticated REQ, COUNT,
or NEG-OPEN filter could match a restricted kind; restricted
events stay hidden until AUTH. -
EOSEnow carries NIP-67 completeness hints, in both editions:
["EOSE", <sub>, ["finish"]]when every stored match was sent so
the client need not paginate,["more"]when a matching stored
event provably remains, and["auth"]when the request could
match restricted kinds — the AUTH challenge precedes that EOSE.
NIP-11 lists 67 unconditionally. -
The NIP-01
rate-limited:retry hint (milliseconds until the
bucket refills) onOKandCLOSED. -
NIP-59 in
supported_nipswhen AUTH is on and 1059 is restricted. -
nosfry exportappends versioned{"nosfry_state":1,…}lines
(NIP-86 bans, allow/disallow lists, kind lists, IP blocks, and
NIP-11 overrides plus NIP-62 vanish points) andnosfry import
applies them; a malformed state line aborts the import.
export --events-onlywrites events only, for piping into other
relays (native). -
nosfry_event_outcomes_total{outcome}counts verified publishes
by outcome (native). -
Release artifacts that can be verified: every archive comes with a
.sha256file (all of them also inSHA256SUMS), a CycloneDX SBOM,
and a GitHub build provenance attestation; the container image carries
its own provenance attestation and SBOM
(gh attestation verify <archive> --repo qntx/nosfry). Before anything
is published, the release workflow runs the full CI gate on the tagged
commit, starts every Linux binary in Debian 11, Debian 12 and Ubuntu
22.04, and smoke-tests the image on both architectures. The crates are
published with the organization's crates.io token. -
Operator guides in
guides/: install,
configuration reference, deployment (a hardened systemd unit and an
nginx site incontrib/), administration, security model,
Tor, the Workers edition, and a test relay for client CI. -
Every WebSocket connection logs inside a
conn{id, peer}span on
targetnosfry::conn(the peer afterreal_ip_header), so each
line of a connection is attributable, e.g. by fail2ban. With
RUST_LOG=info,nosfry::conn=debugthe relay logsconnection open,
connection closed reason="...", andconnection cap reached peer=...; JSON lines carry the span as"span":{"name":"conn", "id":..,"peer":".."}. -
nosfry_reader_busy_total{msg="scan|conn_scan|neg_msg|control"}
counts queries and control messages shed because the readers were
saturated, and thenosfry_reader_jobsgauge shows the queries
admitted to the readers and not yet finished. -
contrib/marmot/nosfry.toml, a ready-to-run native profile for a
Marmot group/inbox relay (2 MiB events and frames, rate limits
sized to the measured White Noise bursts,anonymous_kinds = [445]), withguides/marmot.mdcovering deployment on both
editions, the privacy posture and a members-only variant; the
conformance suite gained a fourth pass that runs itsmarmot_*
cases against the shipped profile on both editions. -
contrib/test-relay/nosfry-test-relay.shstarts a seeded local or
CI test relay on a temp dir, waits for NIP-11 readiness, and cleans
up deterministically on signal (guide:guides/test-relay.md).
Changed
-
heed0.22.1 → 0.23.1, the LMDB binding for the native store. The
vendored C library (lmdb-master-sys0.2.6) is unchanged, and the
on-disk format stays at version 4: replace the binary and restart,
no export/import needed. The bump is verified format-compatible in
both directions (a store written by 0.22 exports identically under
0.23 and vice versa). -
rusqliteis held at 0.40.2 (libsqlite3-sys 0.38.2) across the whole
workspace lockfile so Arti 0.48 resolves (#116). The default native
binary and the Workers bundle link no SQLite, so neither changes;
SQLite is linked by nosfry-sql's optionalrusqlitefeature (tests
and downstream users) and by--features onionbuilds (Arti's
directory cache). -
Listener configuration moved (native).
[[relay.listen]]
entries (address,profile,real_ip_header) replace[relay] bind,port, andreal_ip_header; each names a
[relay.profiles.<name>](defaultdefault) holding
max_connections_per_peer(was[relay] max_connections_per_ip)
andrate_limits(was[relay.rate_limits]). There are no
aliases for the old keys: move them by hand, as in
nosfry.example.toml. Listeners are restart-only; profiles reload,
and a reload removing a profile in use is refused. -
restricted_read_kindsdefaults to 4, 1059, 21059 (was 4, 1059;
strfry master has 4, 1059). -
With AUTH disabled (empty
service_url), writes of restricted
kinds are refused withrestricted:instead of acknowledged and
never served; setrestricted_read_kinds = []to accept and
serve them openly. -
ids,authors,#e, and#pfilter values must be 64
lowercase hex characters; anything else is refused with
invalid:(strfry accepts uppercase and a0xprefix). -
NIP-11
limitation.max_message_lengthis now
min(max_websocket_payload_size, max_event_size + 10). -
A config whose
max_websocket_payload_sizeis smaller than
max_event_size + 10is refused at load and at reload. -
nostr_events_total{kind}counts events persisted to the store
(strfry master semantics, #225) instead of every verified
publish, and at most 256 kinds get their own series — later kinds
count underkind="other". Dashboards built on strfry 1.1.3's
ingress semantics will see lower numbers (native). -
AUTH events are checked against a dedicated symmetric ±600 s
window (created_atwithin ~10 minutes of the relay's time, per
NIP-42) instead of the ephemeral-age rules that limited them to
60 s in the past. -
Only the newest kind-62 request to vanish per author is stored
(NIP-62 bookkeeping); an older or equal-dated incoming request is
answeredduplicate: have a newer versioninstead of accumulating. -
Idle WebSocket connections now hold a few words instead of a
channel buffer block: the per-connection outbound queue is a
mutex-guarded deque with a waker (~2.4 KiB less per connection),
and the socket write buffer no longer pre-reserves 2 KiB. -
Writer transactions take every queued publish (bounded by the
65,536-request / 64 MiB writer inbox) instead of at most 1,024
events, amortizing commit cost on large databases. -
COUNT's tag-cover check binary-searches the sorted earlier values
instead of scanning them against every packed tag. -
The container image's Rust and distroless base images are pinned by
digest.
Fixed
- Events written by another process while the relay runs (
nosfry import,nosfry sync) were invisible to newREQ,COUNTand
NEG-OPENqueries until the relay stored an event of its own. Each
query now starts from the store's latest commit; such events are
still not broadcast to subscriptions that are already open (native). - The native relay refused a WebSocket frame of exactly
max_websocket_payload_sizebytes (yawc's limit is exclusive);
the limit is now inclusive on both editions. importno longer buffers a whole input line before themax_line
check: it reads at mostmax_line + 1bytes, rejects a longer line
once, and consumes the rest without allocating it.- The write-policy plugin's modification-time check no longer blocks a
runtime worker thread with synchronous file I/O.
Verifying the artifacts
Every archive has a .sha256 file (all of them are also in SHA256SUMS),
a build provenance attestation, and a CycloneDX SBOM (.cdx.json) attested
to the archive it describes. The container image carries its own provenance
attestation and SBOM. The same applies to the nosfry-<version>-onion-<target>
archives and the ghcr.io/qntx/nosfry:<version>-onion image tags, which ship
the Arti-linked variant.
sha256sum -c nosfry-<version>-<target>.tar.gz.sha256
gh attestation verify nosfry-<version>-<target>.tar.gz --repo qntx/nosfry
gh attestation verify oci://ghcr.io/qntx/nosfry:<version> --repo qntx/nosfryThe Linux binaries need glibc 2.31 or newer (Debian 11, Ubuntu 20.04, RHEL 9
and newer); each one was started on Debian 11, Debian 12 and Ubuntu 22.04
before this release was published.