Title: Nostr relay: add size limits (and optional write auth and persistence), in line with strfry and others · Issue #648 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: Nostr relay: add size limits (and optional write auth and persistence), in line with strfry and others · Issue #648 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: Nostr relay: add size limits (and optional write auth and persistence), in line with strfry and others · Issue #648 · JavaScriptSolidServer/JavaScriptSolidServer
Description: The built-in Nostr relay (--nostr) has no size limits of its own. It's barely used beyond one pod so far, so this isn't urgent, but it's worth matching what other relays do before anyone leans on it. What JSS does now (at 2b9555b) src/se...
Open Graph Description: The built-in Nostr relay (--nostr) has no size limits of its own. It's barely used beyond one pod so far, so this isn't urgent, but it's worth matching what other relays do before anyone leans on i...
X Description: The built-in Nostr relay (--nostr) has no size limits of its own. It's barely used beyond one pod so far, so this isn't urgent, but it's worth matching what other relays do before anyon...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/648
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Nostr relay: add size limits (and optional write auth and persistence), in line with strfry and others","articleBody":"The built-in Nostr relay (`--nostr`) has no size limits of its own. It's barely used beyond one pod so far, so this isn't urgent, but it's worth matching what other relays do before anyone leans on it.\n\n## What JSS does now (at 2b9555b)\n\n- `src/server.js:417` registers `@fastify/websocket` with no options, so `ws` uses its default `maxPayload` of **100 MB per message**.\n- `src/nostr/relay.js` checks no event size, keeps up to 1,000 events **in memory only** (`DEFAULT_MAX_EVENTS`, lost on restart), allows **anyone to write**, and rate-limits to 60 events per minute per connection.\n\nSo a client can send very large events, and a handful of them can use a lot of memory.\n\n## What other relays default to\n\n| Relay | Max event | Max websocket message | Other defaults |\n|---|---|---|---|\n| strfry | 64 KB (`maxEventSize`) | 128 KB (`maxWebsocketPayloadSize`) | ≤ 2,000 tags, tag values ≤ 1 KB, `created_at` window (15 min ahead, 3 years back), write-policy plugin, LMDB on disk |\n| nostr-rs-relay | 128 KB | 128 KB | kind allow/block lists, pubkey allowlist, NIP-42, SQLite/Postgres |\n| khatru | — | 500 KB (`MaxMessageSize`) | policies as plug-in functions |\n| nostream | 100 KB content per kind range | 512 KB (`maxPayloadSize`) | per-kind limits, rate limits, Postgres |\n| **JSS** | **none** | **100 MB** | 60 events/min/connection, 1,000 in memory, open writes |\n\n## Suggested defaults\n\n1. **Websocket message cap** of 128 KB for the relay (configurable).\n2. **Event size cap** of 64 KB (configurable), like strfry.\n3. **Tag limits**: at most 2,000 tags, tag values at most 1 KB.\n4. **`created_at` window**, like strfry's.\n5. **Optional write allowlist** (e.g. only the pod owner's key) or NIP-42 auth, off by default.\n6. **Optional persistence** to disk under the pod, for events meant to last.\n\n1–4 close the size issue; 5–6 make the relay usable for real data (for example, publishing mind maps as Nostr events, which are 4–5 KB each).\n\nSources: [strfry.conf](https://github.com/hoytech/strfry/blob/master/strfry.conf), [nostr-rs-relay config.toml](https://github.com/scsibug/nostr-rs-relay/blob/master/config.toml) and [config.rs](https://github.com/scsibug/nostr-rs-relay/blob/master/src/config.rs), [khatru relay.go](https://github.com/fiatjaf/khatru/blob/master/relay.go), [nostream default-settings.yaml](https://github.com/Cameri/nostream/blob/main/resources/default-settings.yaml).\n","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-11-08T10:17:42Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/648"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cc71744f-d408-7935-41b0-92042c98b8c5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AFB2:36E658:698B44:86BE85:6B03A675 |
| html-safe-nonce | e3ac6208ec6fb709f02519db6cd790a5727c8d6add4eb6ff2464bee60cfb267d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkIyOjM2RTY1ODo2OThCNDQ6ODZCRTg1OjZCMDNBNjc1IiwidmlzaXRvcl9pZCI6IjMzOTIzODgxNDExMDg0MDU4NzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 858146adf822c3affded64c15d0b6ed63292f683da7eaf4ce0edf556d5a6d575 |
| hovercard-subject-tag | issue:6269912894 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/648/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cb457d5f6397e45fe2b1d31ad7cad3ec4bef48494fb6111b92a11515c8e0a225/JavaScriptSolidServer/JavaScriptSolidServer/issues/648 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cb457d5f6397e45fe2b1d31ad7cad3ec4bef48494fb6111b92a11515c8e0a225/JavaScriptSolidServer/JavaScriptSolidServer/issues/648 |
| og:image:alt | The built-in Nostr relay (--nostr) has no size limits of its own. It's barely used beyond one pod so far, so this isn't urgent, but it's worth matching what other relays do before anyone leans on i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width