# Nosflare - Full Documentation > Generated from https://nosflare.com. This file concatenates every Markdown > document on the site for LLM and AI-agent consumption. Source of truth for > the relay implementation itself: https://github.com/Spl0itable/nosflare Last generated: 2026-08-28 --- # Nosflare - Next-Gen Nostr Relay **Nosflare is a serverless [Nostr](https://github.com/nostr-protocol/nips) relay purpose-built for [Cloudflare Workers](https://workers.cloudflare.com/), [Cloudflare D1](https://developers.cloudflare.com/d1/) (SQLite at the edge), and [Durable Objects](https://developers.cloudflare.com/durable-objects/).** It runs with no servers to manage, scales instantly, replicates globally, and typically costs 75-90% less than traditional relay hosting. - **Website:** https://nosflare.com - **Live relay:** `wss://relay.nosflare.com` - **One-click deploy:** https://deploy.nosflare.com (one-time 21,420 sats) - **Source code:** https://github.com/Spl0itable/nosflare (MIT licensed) - **Maintained by:** [21 Million LLC](https://nostrservices.com) - **Contact (Nostr):** `npub16jdfqgazrkapk0yrqm9rdxlnys7ck39c7zmdzxtxqlmmpxg04r0sd733sv` ## What is Nosflare? Nostr is a decentralized social protocol in which clients publish signed events to relays, and relays store and rebroadcast those events. A relay is the piece of infrastructure that makes the network work. Traditionally, running a relay means renting a VPS, installing a relay implementation, managing a database, monitoring uptime, and paying for capacity you mostly do not use. Nosflare replaces all of that with Cloudflare's serverless platform: Workers for compute, D1 for storage, and Durable Objects for long-lived WebSocket connections. There is no server to patch, no capacity to provision, and no fixed monthly bill. ## Key facts | Property | Value | | --- | --- | | Relay type | Serverless Nostr relay | | Platform | Cloudflare Workers | | Database | Cloudflare D1 (SQLite at the edge) | | Storage limit | 10 GB per D1 database | | WebSockets | Durable Objects with Hibernation API | | Durable Objects mesh | 9 regions, multi-regional broadcast | | Read replication | D1 Session API global read replicas | | Edge locations | 300+ Cloudflare locations | | Typical global latency | Under 50 ms | | Uptime target | 99.9% | | Supported NIPs | 19 (see [NIPs](https://nosflare.com/docs/supported-nips.md)) | | Payments | Bitcoin Lightning via Nostr zaps (NIP-57) | | Deploy time | Under 1 minute | | One-click deploy price | 21,420 sats (one-time) | | License | MIT | ## Features at a glance 1. **One-click deploy** - No coding required. A relay of your own in under 60 seconds, on your own Cloudflare account. 2. **Global edge network** - 300+ Cloudflare edge locations, automatic scaling, no capacity planning. 3. **Real-time WebSockets** - Durable Objects hold persistent connections; a multi-regional mesh broadcasts new events without a single-location bottleneck. 4. **Pay-to-relay** - Charge for write access in sats, paid over Lightning through Nostr zaps, with automatic payment verification. 5. **Advanced anti-spam** - Content hashing, NIP-05 verification, rate limiting, word/phrase blocking, and pubkey/kind/tag allowlists and blocklists. 6. **SQLite storage at the edge** - D1 with global read replicas: local read performance, global consistency, 10 GB per database. Details: [Features](https://nosflare.com/docs/features.md) ## Documentation (Markdown, agent-friendly) - [Overview](https://nosflare.com/docs/overview.md) - what Nosflare is and how it is architected - [Features](https://nosflare.com/docs/features.md) - full feature list with configuration keys - [Deployment](https://nosflare.com/docs/deployment.md) - one-click and manual deployment guides - [Supported NIPs](https://nosflare.com/docs/supported-nips.md) - the 19 NIPs Nosflare implements - [Pay-to-relay](https://nosflare.com/docs/pay-to-relay.md) - Lightning monetization - [Anti-spam](https://nosflare.com/docs/anti-spam.md) - spam filtering mechanisms - [Pricing](https://nosflare.com/docs/pricing.md) - cost model and comparison - [FAQ](https://nosflare.com/docs/faq.md) - frequently asked questions Machine-readable index: [llms.txt](https://nosflare.com/llms.txt) - full corpus: [llms-full.txt](https://nosflare.com/llms-full.txt) ## Get started - **Non-technical:** go to https://deploy.nosflare.com and pay the one-time 21,420 sat setup fee. Your relay is deployed to your own Cloudflare account, and you can keep updating it afterwards at no extra cost. - **Technical:** fork https://github.com/Spl0itable/nosflare, edit `src/config.ts`, run `npm run build`, and deploy the bundled `worker.js` to a Cloudflare Worker bound to a D1 database. See [Deployment](https://nosflare.com/docs/deployment.md). - **Just want to use a relay:** add `wss://relay.nosflare.com` to your Nostr client's relay list. --- # Nosflare Overview Nosflare is a serverless [Nostr](https://github.com/nostr-protocol/nips) relay implementation that runs entirely on Cloudflare's edge platform. It is open source under the MIT license at https://github.com/Spl0itable/nosflare. A live, paid instance runs at `wss://relay.nosflare.com`. ## The problem it solves A Nostr relay accepts signed events from clients, stores them, and rebroadcasts them to subscribers. Running one traditionally means: - renting and maintaining a VPS, - operating a database (usually PostgreSQL or SQLite on a single box), - keeping a WebSocket process alive under load, - paying a fixed monthly bill sized for peak traffic, and - accepting single-region latency for a global audience. Nosflare removes all five. It is deployed as a Cloudflare Worker, so there is no server, no process supervision, and no fixed monthly capacity charge. ## Architecture ### Compute: Cloudflare Workers The relay logic runs as a Cloudflare Worker, executed at whichever of Cloudflare's 300+ edge locations is closest to the connecting client. Workers scale to zero when idle and scale out instantly under load, so the relay does not need capacity planning. ### Storage: Cloudflare D1 with global read replicas Events are stored in [Cloudflare D1](https://developers.cloudflare.com/d1/), which is SQLite at the edge. Nosflare uses D1's [Session API](https://developers.cloudflare.com/d1/worker-api/d1-database/#withsession), which enables Cloudflare's global read replication: read-only copies of the database are placed in regions closer to clients. This lowers read latency and scales read throughput by adding replicas rather than by vertically scaling a single database. D1 provides up to 10 GB of storage per database. Nosflare includes fallback support for the case where read replication is disabled. ### WebSockets: multi-regional Durable Objects mesh Long-lived client WebSocket connections are held by [Durable Objects](https://developers.cloudflare.com/durable-objects/). Rather than routing every connection through a single Durable Object instance - which would create one global bottleneck - Nosflare runs a **mesh across 9 locations**. New events are broadcast across the mesh, so every connected client receives real-time updates from a nearby region. Nosflare also uses the [WebSocket Hibernation API](https://developers.cloudflare.com/durable-objects/best-practices/websockets/#websocket-hibernation-api). Hibernation means billable Duration (GB-s) charges are not incurred during periods of inactivity while clients remain connected, which is the dominant cost of a naive Durable-Objects relay. ### Landing page When a browser (rather than a Nostr client) requests the relay URL over HTTP, Nosflare serves a static HTML landing page. That page displays relay metadata and, when pay-to-relay is enabled, handles payment for relay access. Operators can customize it with their own branding. ## What Nosflare supports - **19 NIPs** - see [Supported NIPs](https://nosflare.com/docs/supported-nips.md). - **Pay-to-relay** - Lightning payments over Nostr zaps; see [Pay-to-relay](https://nosflare.com/docs/pay-to-relay.md). - **NIP-05 addresses** - serve `username@your-domain.com` verified Nostr addresses from your own relay. - **Access control** - allowlist or blocklist pubkeys, event kinds, and tags. - **Rate limiting** - throttle events per pubkey, with kinds excludable from the limit. - **Content filtering** - block specific words and phrases; see [Anti-spam](https://nosflare.com/docs/anti-spam.md). ## Companion: the "Send It" blaster The repository also contains `send-it.js`, the code behind `wss://sendit.nosflare.com`, a relay that "blasts" a note to as many online relays as possible using [NIP-66](https://github.com/nostr-protocol/nips/blob/master/66.md) relay discovery. ## Roadmap The current release focuses on the [basic protocol flow](https://github.com/nostr-protocol/nips/blob/master/01.md) so that events store and retrieve quickly. Planned additions include: - [NIP-50](https://github.com/nostr-protocol/nips/blob/master/50.md) - full-text search - [NIP-65](https://github.com/nostr-protocol/nips/blob/master/65.md) - relay list metadata / replaceable events ## Project details - **License:** MIT - **Repository:** https://github.com/Spl0itable/nosflare - **Releases and changelog:** https://github.com/Spl0itable/nosflare/releases - **Maintainer:** [21 Million LLC](https://nostrservices.com) - **Contact:** GitHub Discussions, or Nostr `npub16jdfqgazrkapk0yrqm9rdxlnys7ck39c7zmdzxtxqlmmpxg04r0sd733sv` --- # Nosflare Features Configuration for a self-hosted deployment lives in `src/config.ts` in the [source repository](https://github.com/Spl0itable/nosflare). Setting names below refer to that file. ## One-click deploy No coding required. [Nosflare Deploy](https://deploy.nosflare.com) provisions a fully customized relay onto **your own Cloudflare account** in under 60 seconds for a one-time fee of 21,420 sats. You keep control of the account and the data, and you can make unlimited updates to the relay afterwards at no extra cost. ## Global edge network The relay runs on Cloudflare Workers across 300+ edge locations. Requests are served from the location closest to the client, scaling is automatic, and there is no origin server to size or keep alive. Typical global latency is under 50 ms. ## Real-time WebSockets Persistent client connections are held by Durable Objects rather than by a long-running server process. Nosflare runs a **multi-regional Durable Objects mesh across 9 locations**, so event broadcast is not funneled through one region. The WebSocket Hibernation API keeps idle-but-connected clients from accruing Duration (GB-s) charges. ## SQLite storage at the edge Cloudflare D1 provides SQLite storage with up to **10 GB per database**. Nosflare uses D1's Session API for global read replication: read replicas are placed in regions near clients, lowering read latency and scaling read throughput. Fallback support is included if read replication is turned off. ## Pay-to-relay Charge for relay access in sats, paid over the Bitcoin Lightning Network through Nostr zaps. Payment verification is automatic: with the feature enabled, every event submitted to the relay has its author's pubkey checked for paid access. Relevant settings: `PAY_TO_RELAY_ENABLED` (on by default), `relayNpub`, `RELAY_ACCESS_PRICE_SATS`. See [Pay-to-relay](https://nosflare.com/docs/pay-to-relay.md). ## Advanced anti-spam Multi-layer protection, all optional and independently configurable: - **NIP-05 validation** (`checkValidNip05`) - require a valid NIP-05 Nostr address to publish, with `allowedNip05Domains` / `blockedNip05Domains` for domain-level control. - **Content hashing** (`enableAntiSpam`) - hash event content to reject duplicates, per-pubkey by default or globally with `enableGlobalDuplicateCheck`. `antiSpamKinds` controls which kinds are checked. - **Rate limiting** - throttle the number of events from a single pubkey; `excludedRateLimitKinds` exempts chosen kinds. - **Word and phrase blocking** (`blockedContent`) - reject events containing specific strings. See [Anti-spam](https://nosflare.com/docs/anti-spam.md). ## Access control: allowlists and blocklists Nosflare can filter by pubkey, event kind, and tag: - `allowedPubkeys` / `blockedPubkeys` - `allowedEventKinds` / `blockedEventKinds` - `allowedTags` / `blockedTags` The semantics are symmetrical: **if items are in a blocklist, only those items are blocked and everything else is allowed; if items are in an allowlist, only those items are allowed and everything else is blocked.** ## NIP-05 verified addresses Serve `username@your-domain.com` Nostr addresses from your own relay by adding usernames and their hex pubkeys to the `nip05Users` section of `src/config.ts`. ## Customizable relay metadata and landing page `relayInfo` sets the relay's NIP-11 metadata - name, description, icon, contact, limitations. Nosflare also ships a static HTML landing page shown to browsers visiting the relay URL, which doubles as the payment page when pay-to-relay is enabled. Both are fully customizable. ## Cost efficiency Nosflare typically costs **75-90% less** than traditional relay hosting, because Workers, D1, and hibernating Durable Objects bill for use rather than for provisioned capacity. See [Pricing](https://nosflare.com/docs/pricing.md). --- # Deploying Nosflare There are two paths: a one-click no-code deployment, or a manual deployment you build and ship yourself. ## Option 1: One-click deploy (no code) For people who do not code or do not want to operate a server. 1. Go to https://deploy.nosflare.com 2. Pay the one-time setup fee of **21,420 sats**. 3. Your relay is deployed to **your own Cloudflare account** in under a minute. You can make as many updates to your relay as you like afterwards at no extra cost. ## Option 2: Manual deployment ### Prerequisites - A [Cloudflare account](https://www.cloudflare.com/plans/). The Workers paid plan is recommended; a free tier is available. D1 and Durable Objects must be enabled. - [Node.js](https://nodejs.org/) and npm. - Optional: the [Wrangler CLI](https://developers.cloudflare.com/workers/cli-wrangler/install-update). ### Dependencies ```bash npm install @noble/curves npm install -g esbuild typescript wrangler npm install --save-dev @cloudflare/workers-types @types/node ``` Nosflare uses [@noble/curves](https://github.com/paulmillr/noble-curves) for cryptography, [esbuild](https://github.com/evanw/esbuild) for bundling, and TypeScript. ### Configure Fork https://github.com/Spl0itable/nosflare (forking is recommended so you can deploy from your own git repository), then open `src/config.ts` and edit: - `relayInfo` - relay name, description, icon, contact, limitations. - Pay-to-relay settings - `PAY_TO_RELAY_ENABLED` (enabled by default; set to `false` to turn off), `relayNpub`, `RELAY_ACCESS_PRICE_SATS`. - `nip05Users` - usernames and hex pubkeys for NIP-05 verified addresses. - `allowedPubkeys` / `blockedPubkeys`, `allowedEventKinds` / `blockedEventKinds`, `allowedTags` / `blockedTags` - access control. - `blockedContent` - blocked words and phrases. - `excludedRateLimitKinds` - kinds exempt from rate limiting. - `allowedNip05Domains` / `blockedNip05Domains` - NIP-05 domain filtering. Reference lists: [event kinds](https://github.com/nostr-protocol/nips#event-kinds) and [standardized tags](https://github.com/nostr-protocol/nips?tab=readme-ov-file#standardized-tags). ### Build ```bash npm run build ``` This bundles the worker using your edited `src/config.ts` and overwrites `worker.js`. ### Deploy via the Cloudflare dashboard 1. Log in to the Cloudflare dashboard. 2. Go to **Storage & Databases > D1 SQL Database** and click **Create Database**. Choose a name and region. 3. Open the new database's **Settings** tab and click **Enable read replication**. Nosflare has been extensively tested with read replication; fallback support exists if it is disabled. 4. Edit `wrangler.toml` with your D1 database name and id (the UUID shown on the D1 dashboard). Other worker settings, including its name, live in this file too. 5. Go to **Compute (Workers)** and create a new Worker. You can import directly from a git repository or start from the "Hello World" template. This is the primary relay worker that Nostr clients connect to. 6. If you are **not** using a connected git repository, open the Worker's **Bindings** tab and bind the `RELAY_DATABASE` variable to the D1 database from step 2. With a connected git repository this binding happens automatically. 7. Ship the code: paste the contents of `worker.js` into the online editor, or let the connected git repository build `worker.js` into the Worker automatically. With a connected repository, every later push updates the Worker. 8. Save and deploy. Then visit the relay URL in a browser over HTTP to load the landing page - **this first HTTP request triggers database initialization** and creates the necessary tables. 9. Add a custom domain under the Worker's **Settings > Domains & Routes**. This becomes your relay URL. Deployment with the Wrangler CLI follows broadly the same steps. ### Recommended Cloudflare settings - Set the Worker's **CPU time limit** to `30000`. - Create a Page Rule with a **"cache everything"** rule and a long Cloudflare edge TTL for a high cache rate. - Enable **rate limiting** to protect the relay from abuse. ## After deployment Add your relay URL (`wss://your-domain.com`) to your Nostr client's relay list. If pay-to-relay is enabled, visitors pay through the landing page before their events are accepted. --- # Supported NIPs Nosflare implements **19** [Nostr Improvement Proposals](https://github.com/nostr-protocol/nips). The authoritative list is the `supported_nips` array in `src/config.ts`, which is also served as NIP-11 relay metadata. **Supported:** 1, 2, 4, 5, 9, 11, 12, 13, 15, 16, 17, 20, 22, 25, 28, 33, 40, 42, 57 | NIP | Title | What it gives the relay | | --- | --- | --- | | [01](https://github.com/nostr-protocol/nips/blob/master/01.md) | Basic protocol flow | Core event publishing, subscriptions, and filters | | [02](https://github.com/nostr-protocol/nips/blob/master/02.md) | Follow list | Contact lists | | [04](https://github.com/nostr-protocol/nips/blob/master/04.md) | Encrypted direct messages | Legacy DMs | | [05](https://github.com/nostr-protocol/nips/blob/master/05.md) | DNS-based identifiers | `username@domain.com` verified Nostr addresses | | [09](https://github.com/nostr-protocol/nips/blob/master/09.md) | Event deletion | Deletion requests | | [11](https://github.com/nostr-protocol/nips/blob/master/11.md) | Relay information document | Relay metadata, limitations, icon, contact | | [12](https://github.com/nostr-protocol/nips/blob/master/12.md) | Generic tag queries | Filtering by arbitrary single-letter tags | | [13](https://github.com/nostr-protocol/nips/blob/master/13.md) | Proof of work | PoW-stamped events | | [15](https://github.com/nostr-protocol/nips/blob/master/15.md) | End of stored events notice | `EOSE` messages | | [16](https://github.com/nostr-protocol/nips/blob/master/16.md) | Event treatment | Replaceable and ephemeral events | | [17](https://github.com/nostr-protocol/nips/blob/master/17.md) | Private direct messages | Modern private DMs | | [20](https://github.com/nostr-protocol/nips/blob/master/20.md) | Command results | `OK` responses on publish | | [22](https://github.com/nostr-protocol/nips/blob/master/22.md) | Comment | Threaded comments | | [25](https://github.com/nostr-protocol/nips/blob/master/25.md) | Reactions | Likes and reactions | | [28](https://github.com/nostr-protocol/nips/blob/master/28.md) | Public chat | Public chat channels | | [33](https://github.com/nostr-protocol/nips/blob/master/33.md) | Parameterized replaceable events | Addressable events | | [40](https://github.com/nostr-protocol/nips/blob/master/40.md) | Expiration timestamp | Self-expiring events | | [42](https://github.com/nostr-protocol/nips/blob/master/42.md) | Authentication of clients | `AUTH` challenge/response | | [57](https://github.com/nostr-protocol/nips/blob/master/57.md) | Lightning zaps | Zap receipts; underpins pay-to-relay | ## Planned | NIP | Title | Purpose | | --- | --- | --- | | [50](https://github.com/nostr-protocol/nips/blob/master/50.md) | Search capability | Full-text search over stored events | | [65](https://github.com/nostr-protocol/nips/blob/master/65.md) | Relay list metadata | Replaceable relay-list events | ## Related The companion "Send It" blaster relay at `wss://sendit.nosflare.com` uses [NIP-66](https://github.com/nostr-protocol/nips/blob/master/66.md) relay discovery to rebroadcast a note to as many online relays as possible. --- # Pay-to-Relay Nosflare has built-in support for **pay-to-relay**: the operator accepts Bitcoin Lightning payments, denominated in sats, through Nostr zaps in exchange for write access to the relay. ## How it works 1. The operator sets a price in sats and the npub that receives payment. 2. A visitor loading the relay URL in a browser sees the Nosflare landing page, which handles payment. 3. Payment is made over the Lightning Network as a Nostr zap ([NIP-57](https://github.com/nostr-protocol/nips/blob/master/57.md)). 4. Once enabled, **every event submitted to the relay has its author's pubkey checked for paid access**. Verification is automatic; there is no manual allowlisting step. ## Why operators use it - **Cost recovery** - a paid relay funds its own Cloudflare usage. - **Spam resistance** - requiring payment makes disposable-pubkey spam expensive, which complements the [anti-spam](https://nosflare.com/docs/anti-spam.md) filters. - **Sustainability** - relays are public infrastructure; payment aligns capacity with the people who use it. ## Configuration In `src/config.ts`: | Setting | Purpose | Default | | --- | --- | --- | | `PAY_TO_RELAY_ENABLED` | Turns pay-to-relay on or off | `true` (enabled) | | `relayNpub` | The npub that receives payments | Set to your own npub | | `RELAY_ACCESS_PRICE_SATS` | Price of access, in sats | Operator's choice | To run a free relay, set `PAY_TO_RELAY_ENABLED` to `false`. ## The landing page The static HTML page Nosflare serves to browsers is the payment surface. It also shows relay metadata. Operators customize it with their own logo and branding. ## Related - [Features](https://nosflare.com/docs/features.md) - [Deployment](https://nosflare.com/docs/deployment.md) - [Pricing](https://nosflare.com/docs/pricing.md) --- # Anti-Spam and Content Filtering Nosflare ships several independent spam defenses. All are optional and configured in `src/config.ts`. ## NIP-05 validation Disabled by default. Set `checkValidNip05` to `true` to require a valid [NIP-05](https://github.com/nostr-protocol/nips/blob/master/05.md) Nostr address before an event is accepted. Validation is handled inside the `processEvent` function in `src/relay-worker.ts`, under the "NIP-05 validation" block. Domain-level control is available through `allowedNip05Domains` and `blockedNip05Domains`, so a relay can accept only members of specific communities, or exclude domains known for abuse. ## Content hashing (duplicate detection) Disabled by default. Set `enableAntiSpam` to `true` to hash each submitted event and reject duplicates. - **Per-pubkey (default).** The hash combines the author's pubkey with the event content. A given pubkey can publish a given note exactly once; repeated identical notes from the same author are rejected. - **Global.** Set `enableGlobalDuplicateCheck` to `true` to hash content alone. Once anyone publishes a piece of content, no one else can publish the identical content. This is aimed at spam waves that use disposable pubkeys but identical note bodies - the "ReplyGuy"-style attack. `antiSpamKinds` controls which event kinds are subject to duplicate checking. A range of kinds is included by default and any can be removed to skip them. ## Rate limiting Nosflare throttles the number of events accepted from a single pubkey. `excludedRateLimitKinds` exempts specific event kinds from the limit - useful for kinds that are legitimately high-volume. At the platform level, Cloudflare rate limiting rules are also recommended in front of the Worker. ## Blocked words and phrases `blockedContent` holds specific words or phrases; events containing them are rejected. ## Allowlists and blocklists Filtering by pubkey, event kind, and tag: - `allowedPubkeys` / `blockedPubkeys` - `allowedEventKinds` / `blockedEventKinds` - `allowedTags` / `blockedTags` The rule is symmetrical: **if entries are in a blocklist, only those entries are blocked and everything else is allowed; if entries are in an allowlist, only those entries are allowed and everything else is blocked.** Reference lists: [event kinds](https://github.com/nostr-protocol/nips#event-kinds) and [standardized tags](https://github.com/nostr-protocol/nips?tab=readme-ov-file#standardized-tags). ## Payment as a spam filter Enabling [pay-to-relay](https://nosflare.com/docs/pay-to-relay.md) puts a cost on write access, which is on its own a strong deterrent against disposable-pubkey spam. --- # Pricing and Cost Model ## One-click deploy **21,420 sats, one time.** [Nosflare Deploy](https://deploy.nosflare.com) sets up a fully customized relay on your own Cloudflare account. There is no subscription and no per-update charge - you can keep changing your relay's configuration afterwards at no extra cost. ## Self-hosting Nosflare is MIT-licensed and free to deploy yourself from https://github.com/Spl0itable/nosflare. Your only cost is Cloudflare usage. ## Running cost Nosflare typically costs **75-90% less than traditional relay hosting**, while delivering better performance, global scale, and zero maintenance. The reason is structural: you pay for what the relay actually does rather than for a server sized for peak load. Cost components, all usage-billed by Cloudflare: | Component | What it bills for | Cloudflare pricing | | --- | --- | --- | | Workers | Requests and CPU time | [Workers pricing](https://developers.cloudflare.com/workers/platform/pricing/) | | Durable Objects | Requests and active Duration (GB-s) | [Durable Objects pricing](https://developers.cloudflare.com/durable-objects/platform/pricing/) | | D1 | Rows read/written and storage (10 GB limit) | [D1 pricing](https://developers.cloudflare.com/d1/platform/pricing/) | The Workers **paid plan is recommended**, though a free tier is available. ### Why it is cheaper - **No idle cost.** Workers scale to zero. A VPS bills the same at 3am as at peak. - **WebSocket hibernation.** Durable Objects using the Hibernation API do not accrue Duration charges while connected clients are idle - normally the dominant cost of a Durable-Objects relay. - **No ops overhead.** No patching, monitoring, or on-call time, which is the real cost of self-hosted infrastructure. - **Caching.** A "cache everything" page rule with a long edge TTL keeps a high share of traffic off the Worker entirely. ## Earning it back With [pay-to-relay](https://nosflare.com/docs/pay-to-relay.md), a relay can charge for write access in sats over Lightning, letting operators offset or exceed their Cloudflare bill. --- # Frequently Asked Questions ## What is Nosflare? Nosflare is a serverless [Nostr](https://github.com/nostr-protocol/nips) relay built for Cloudflare Workers, Cloudflare D1 (SQLite at the edge), and Durable Objects. It lets anyone run a Nostr relay without a server, scaling automatically across 300+ Cloudflare edge locations. It is open source under the MIT license. ## Do I need to know how to code to run a relay? No. [Nosflare Deploy](https://deploy.nosflare.com) is a one-click, no-code deployment for a one-time fee of 21,420 sats. It provisions a fully customized relay onto your own Cloudflare account in under a minute, and you can keep updating it afterwards at no extra cost. Developers can instead fork the repository and deploy manually. ## How long does deployment take? Under one minute with one-click deploy. A manual deployment - configure `src/config.ts`, run `npm run build`, create a D1 database, create the Worker, bind the database, and add a custom domain - typically takes 15-30 minutes the first time. ## What does it cost to run? The one-click deploy is a one-time 21,420 sats. After that you pay only Cloudflare usage for Workers, Durable Objects, and D1. Nosflare typically costs 75-90% less than traditional relay hosting because it bills for use rather than for provisioned capacity. See [Pricing](https://nosflare.com/docs/pricing.md). ## Can I charge people to use my relay? Yes. Pay-to-relay is built in and enabled by default. You set a price in sats and an npub to receive payments; access is paid over the Bitcoin Lightning Network through Nostr zaps, and payment verification is automatic. See [Pay-to-relay](https://nosflare.com/docs/pay-to-relay.md). ## Which NIPs does Nosflare support? 19 NIPs: 1, 2, 4, 5, 9, 11, 12, 13, 15, 16, 17, 20, 22, 25, 28, 33, 40, 42, and 57. NIP-50 (search) and NIP-65 (relay lists) are on the roadmap. See [Supported NIPs](https://nosflare.com/docs/supported-nips.md). ## How much data can the relay store? A Cloudflare D1 database provides up to 10 GB of storage. D1 read replication is used to place read-only copies of the database near clients, which lowers read latency and scales read throughput. ## How does it handle real-time event delivery? Client WebSocket connections are held by Durable Objects using the WebSocket Hibernation API, arranged as a multi-regional mesh across 9 locations. New events are broadcast across the mesh, so real-time delivery is not bottlenecked on a single Durable Object location, and idle-but-connected clients do not accrue Duration charges. ## How does Nosflare stop spam? Several independent layers: optional NIP-05 address validation with domain allow/blocklists, content hashing to reject duplicate events (per-pubkey or globally), rate limiting per pubkey, blocked words and phrases, and allowlists or blocklists for pubkeys, event kinds, and tags. Enabling pay-to-relay also puts a hard cost on write access. See [Anti-spam](https://nosflare.com/docs/anti-spam.md). ## Can I try a Nosflare relay without deploying one? Yes. Add `wss://relay.nosflare.com` to your Nostr client's relay list. It is a live, paid instance of this relay implementation. ## Is Nosflare open source? Yes, MIT licensed, at https://github.com/Spl0itable/nosflare. Issues, feature requests, and pull requests are welcome. ## Who maintains Nosflare? Nosflare is maintained by [21 Million LLC](https://nostrservices.com). You can reach the maintainer through GitHub Discussions or on Nostr at `npub16jdfqgazrkapk0yrqm9rdxlnys7ck39c7zmdzxtxqlmmpxg04r0sd733sv`. ## What is the "Send It" blaster? `wss://sendit.nosflare.com` is a companion relay, included in the repository as `send-it.js`, that rebroadcasts a note to as many online relays as possible using NIP-66 relay discovery. ---