Commit graph

21 commits

Author SHA1 Message Date
4811fcf352 feat(nip17): support gift-wrapped private direct messages
Some checks failed
ci.yml / feat(nip17): support gift-wrapped private direct messages (pull_request) Failing after 0s
ci.yml / feat(nip17): support gift-wrapped private direct messages (push) Failing after 0s
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>
2026-05-03 13:59:14 +02:00
Patrick Mulligan
8547864254 docs: Update README with complete NIP-09 deletion support
Updated NIP-09 section to document full implementation including:
  - 'e' tags for deleting regular events by event ID
  - 'a' tags for deleting addressable events by address format (kind:pubkey:d-identifier)

  This reflects the implementation added in commits 3ba3318 and 538fe42 which brought the relay into full NIP-09 compliance.
2025-11-17 00:01:21 +01:00
PatMulligan
22df5868de
FEAT: Implement NIP-01 Addressable Events Support (#33)
* Implement NIP-16 parameterized replaceable events

Add support for parameterized replaceable events (kinds 30000-39999) to
properly
handle Nostr marketplace product and stall updates according to NIP-16
specification.

Changes:
- Add is_parameterized_replaceable_event property to NostrEvent
- Implement automatic deletion of previous versions when new
parameterized replaceable event is received
- Add 'd' tag filtering support to NostrFilter for parameterized
replacement logic
- Update SQL query generation to handle 'd' tag joins

Fixes issue where product updates would create duplicate entries instead
of
replacing previous versions, ensuring only the latest version remains
visible.

* Refactor event handling for addressable events

Renamed the property is_parameterized_replaceable_event to is_addressable_event in NostrEvent to align with NIP-01 specifications (previously NIP-16). Updated the client_connection.py to utilize the new property for extracting 'd' tag values for addressable replacement, ensuring proper event handling in the relay system.

* Refactor tag filtering logic in NostrFilter

Updated the tag filtering mechanism to ensure that the filter only fails if the specified tags ('e' and 'p') are not found. This change improves clarity and maintains functionality by allowing for more precise control over event filtering.

* update readme

* Fix addressable event deletion and SQL schema issues

- Fix Pydantic field alias usage for d tag filtering (use #d instead of
d)
- Remove nostrrelay schema prefixes from SQL table references
- Implement subquery approach for DELETE operations with JOINs
- Resolve SQLite DELETE syntax incompatibility with JOIN statements
- Ensure NIP-33 compliance: only delete events with matching d tag
values
2025-09-10 16:40:40 +03:00
Vlad Stan
ffb0177003 chore: code format 2023-02-21 16:20:19 +02:00
Vlad Stan
2d4e836676
doc: summary 2023-02-17 15:13:37 +02:00
Vlad Stan
8c24109dd3
doc: fix headers 2023-02-17 12:21:02 +02:00
Vlad Stan
eaf0979254
doc: small fixes 2023-02-17 12:19:45 +02:00
Vlad Stan
012d861d16
doc: small fixes 2023-02-17 12:17:47 +02:00
Vlad Stan
bae7d284b3
doc: add accounts 2023-02-17 12:13:39 +02:00
Vlad Stan
d38b3c73ff
doc: add Config 2023-02-17 12:06:07 +02:00
Vlad Stan
de25a7a12d
doc: basic config tab 2023-02-17 11:54:05 +02:00
Vlad Stan
fd18ebe015
doc: payment basics 2023-02-17 11:40:09 +02:00
Vlad Stan
1dc6ddf9c5
doc: create relay 2023-02-17 11:08:32 +02:00
Vlad Stan
afde9ae37c
doc: mark NIP16 done 2023-02-17 09:55:57 +02:00
Vlad Stan
b5f7aa0c78
doc: updated NIP 04 2023-02-16 18:09:48 +02:00
Vlad Stan
a120394304
doc: more nips 2023-02-16 16:56:04 +02:00
Vlad Stan
6130de3987
doc: nip 15 & 16 2023-02-16 16:36:02 +02:00
Vlad Stan
1a300d4528
doc: nore NIP updates 2023-02-16 16:30:30 +02:00
Vlad Stan
1099fe7e87
doc: supported nips 1 2023-02-16 14:50:40 +02:00
Vlad Stan
dfda2367a2 feat: add payment for stoeage 2023-02-13 17:49:10 +02:00
Vlad Stan
4b82905f78 feat: extracted 2023-01-30 14:40:55 +02:00