---
title: "Pay-to-Relay: Monetize a Nostr Relay with Lightning Zaps"
description: "How Nosflare's pay-to-relay works: Bitcoin Lightning payments through Nostr zaps, operator-set pricing in sats, and automatic payment verification."
canonical: "https://nosflare.com/docs/pay-to-relay.md"
---

# 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)
