feat(relay): add NIP-38 user status support (kind:30315)#446
Merged
Conversation
Allow the relay to accept, store, replace, and serve kind:30315 (User Status) events per NIP-38. This is a parameterized replaceable event (NIP-33) stored globally with UsersWrite scope, matching the pattern used by profiles (kind:0) and read-state (kind:30078). Changes: - Add KIND_USER_STATUS constant and ALL_KINDS entry - Gate on UsersWrite scope in required_scope_for_kind - Classify as global-only (no channel scoping) - Add to GLOBAL_USER_DATA_KINDS for REST read access - Add 30315 to bounded_kind_label for metrics - Advertise NIP-38 in NIP-11 relay info document - Unit tests for scope, global-only, no-h-tag, REST allowlist - E2E tests for accept, retrieve, NIP-33 replacement, multi-d-tag coexistence, and stale-write protection Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UsersWritescope, matching the pattern used by profiles (kind:0) and read-state (kind:30078)Changes
KIND_USER_STATUSconstant +ALL_KINDSentry insprout-coreUsersWrite), global-only classification, REST read allowlist insprout-relaybounded_kind_label) and NIP-11 advertisement (NIP-38)What's deferred
Test plan
cargo check --workspacecleancargo test --workspaceall passingcargo test --test e2e_user_status -- --ignored)🤖 Generated with Claude Code