- Python 61.7%
- HTML 29%
- JavaScript 8.7%
- Makefile 0.6%
Generalize the AUTH-gated, recipient-only delivery rule from NIP-04 to also cover NIP-17 kind 1059 gift wraps. When the relay is configured to require AUTH for kind 1059, only the AUTH'd recipient named in the event's `p` tag receives it; otherwise gift wraps broadcast like any regular event. - relay/event.py: add `is_seal`, `is_gift_wrap`, `is_private_message` helpers (kinds 13, 1059) - relay/client_connection.py: rename `_is_direct_message_for_other` -> `_is_private_event_for_other`; key off `is_private_message` so the same gating applies to kinds 4 and 1059 - relay/relay.py: advertise NIPs 17, 44, 59 in NIP-11 supported_nips - README: document NIP-17/44/59 transport-level support - tests/test_nip17.py: unit tests for kind classification, AUTH-gated 1059 delivery (recipient vs non-recipient vs unauthenticated), and regression coverage for kind 4 gating NIP-44 (encryption) and NIP-59 (wrap/seal) are client-side concerns; the relay treats payloads as opaque ciphertext and stores kind 1059 like any regular event. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .github/workflows | ||
| relay | ||
| static | ||
| templates/nostrrelay | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| .prettierrc | ||
| __init__.py | ||
| client_manager.py | ||
| config.json | ||
| crud.py | ||
| description.md | ||
| helpers.py | ||
| LICENSE | ||
| Makefile | ||
| manifest.json | ||
| migrations.py | ||
| models.py | ||
| package-lock.json | ||
| package.json | ||
| pyproject.toml | ||
| README.md | ||
| tasks.py | ||
| toc.md | ||
| uv.lock | ||
| views.py | ||
| views_api.py | ||
Nostr Relay
One click and spin up your own Nostr relay. Share with the world, or use privately.
Configure:
- Free Plan: with limitted storage (limit can be changed)
- Paid Plan:
pay to joinandpay for storage - Storage Limit (can buy more)
- Rate Limit
- Filter Limit
- Allow/Block accounts
- Optional Auth for
EventsandFilters
Supported NIPs
- NIP-01: Basic protocol flow
- Regular Events
- Replaceable Events (kinds 10000-19999)
- Ephemeral Events (kinds 20000-29999)
- Addressable Events (kinds 30000-39999)
- NIP-02: Contact List and Petnames
kind: 3: delete past contact lists as soon as the relay receives a new one
- NIP-04: Encrypted Direct Message
- if
AUTHenabled: send only to the intended target
- if
- NIP-09: Event Deletion
- 'e' tags: Delete regular events by event ID
- 'a' tags: Delete addressable events by address (kind:pubkey:d-identifier)
- NIP-11: Relay Information Document
-
Note
: the endpoint is NOT on the root level of the domain. It also includes a path (eg https://lnbits.link/nostrrelay/)
-
- NIP-12: Generic Tag Queries
- todo
- NIP-15: End of Stored Events Notice
- NIP-16: Event Treatment
- Regular Events
- Replaceable Events
- Ephemeral Events
- NIP-17: Private Direct Messages
kind: 1059gift wraps stored and broadcast like regular events- if
AUTHenabled forkind: 1059: deliver only to the recipient named in theptag (same gating as NIP-04) - encryption (NIP-44) and wrapping (NIP-59) are client-side concerns; the relay handles transport only
- NIP-20: Command Results
- todo: use correct prefixes
- NIP-22: Event created_at Limits
- NIP-26: Delegated Event Signing
- not planned
- NIP-28 Public Chat
kind: 41: handled similar tokind 0metadata events
- NIP-33: Addressable Events (moved to NIP-01)
- ✅ Implemented as part of NIP-01 addressable events
- NIP-40: Expiration Timestamp
- todo
- NIP-42: Authentication of clients to relays
- todo: use correct prefix
- NIP-44: Encrypted Payloads (Versioned)
- relay treats payloads as opaque; encryption is client-side
- NIP-50: Search Capability
- todo
- NIP-59: Gift Wrap
kind: 13(seal) andkind: 1059(gift wrap) accepted; unwrapping is client-side
Create Relay
Creating a new relay is straightforward. Just click New Relay then enter the Relay Info.
Note
The relay can be activated/deactivated.
Configure Relay
Find your Relay in the list and click the expand button (+) to configure it.
Relay Info
This tab contains data according to NIP-11 (Relay Information Document).
Note
: the
domainis added automatically and shoud be corrected manually if needed. This value is used forNIP-42(Authentication of clients to relays)
Payment
By default the relay is free to access, but it can be configured to ask for payments.
It is encourage to also activate the Require Auth option for paid relays.
Note
: check the info button (
I) tooltip for a description of each field.
Click on the Relay ID (or visit https://{your_domain}/nostrrelay/${relay_id}) for the Relay public page.
Here the entry and storage fees can be paid.
Config
Configure NIP-22 (Event created_at Limits), NIP-42 (Authentication of clients to relays) and other Relay parameters.
Some configurations are not standard (NIPs) but they help control what clients are allowed to do, thus blocking (some) attack vectors.
Note
: check the info button (
I) tooltip for a description of each field.
Accounts
Allows the Relay operator to Block or Allow certain accounts.
If an account is allowed then it is not required to pay to join.
When an account is blocked it does not matter if it paid to join or if it is allowed.
Development
Create Symbolic Link:
ln -s /Users/my-user/git-repos/nostr-relay-extension/ /Users/my-user/git-repos/lnbits/lnbits/extensions/nostrrelay





