You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(nip43): enforce membership, validate requests, and invalidate admission cache
Address review findings against the NIP-43 spec:
- Enforce admission for all writes when nip43.enabled, even without
payments enabled — membership was previously toothless on non-payment
relays since isUserAdmitted short-circuited when payments were off.
- Invalidate the per-pubkey admission cache on join and leave so
membership changes take effect immediately instead of after the cache
TTL (up to 60s of rejections after joining, up to 300s of continued
access after leaving).
- Validate created_at freshness on join/leave requests (spec MUST,
same 10-minute tolerance as the NIP-42 auth handler).
- Require the NIP-70 "-" tag on leave requests (spec MUST).
- Use the auth-required: prefix for unauthenticated join/leave so
NIP-42 clients know to AUTH and retry.
- Revoke admission with a targeted UPDATE instead of a generic upsert
that clobbered is_vanished on the existing row.
- Emit OK results through createEventCommandResult so join/leave are
counted in the accepted/rejected event metrics like other strategies.
- Only advertise NIP-43 in the NIP-11 document when the feature is
enabled (clients MUST key off supported_nips), and report
restricted_writes accordingly.
- Document the nip43 settings block in default-settings.yaml.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .changeset/nip43-join-leave.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,4 +2,4 @@
2
2
"nostream": minor
3
3
---
4
4
5
-
Add NIP-43 join/leave request event strategies (kinds 28934/28936) with NIP-42 auth enforcement, invite code claiming, and admission management. Advertise NIP-43 in NIP-11 document.
5
+
Add NIP-43 join/leave request event strategies (kinds 28934/28936) with NIP-42 auth enforcement, created_at freshness validation, invite code claiming, and admission management. When `nip43.enabled` is set, publishing is restricted to admitted members even without payments enabled, and NIP-43 is advertised in the NIP-11 document (hidden when disabled). Join/leave update the admission cache so membership changes take effect immediately.
0 commit comments