Skip to content

feat(relay): add NIP-38 user status support (kind:30315)#446

Merged
wesbillman merged 1 commit into
mainfrom
add-30315-support
May 1, 2026
Merged

feat(relay): add NIP-38 user status support (kind:30315)#446
wesbillman merged 1 commit into
mainfrom
add-30315-support

Conversation

@wesbillman
Copy link
Copy Markdown
Collaborator

Summary

  • Add relay-side support for NIP-38 / kind:30315 (User Status) events
  • kind:30315 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)
  • All existing NIP-33 infrastructure (storage, replacement, querying, subscription fan-out) applies automatically — this PR opens the gate for the specific kind

Changes

  • KIND_USER_STATUS constant + ALL_KINDS entry in sprout-core
  • Scope gate (UsersWrite), global-only classification, REST read allowlist in sprout-relay
  • Metrics label (bounded_kind_label) and NIP-11 advertisement (NIP-38)
  • 7 unit tests (scope, global-only, no-h-tag, migrated-kinds, NIP-11, REST positive + negative)
  • 5 E2E tests (accept, retrieve, NIP-33 replacement, multi-d-tag coexistence, stale-write protection)

What's deferred

  • NIP-40 expiration filtering (cross-cutting concern, affects all event kinds)
  • Presence cache / side effects integration (desktop/mobile concern)

Test plan

  • cargo check --workspace clean
  • cargo test --workspace all passing
  • All pre-commit and pre-push hooks passing (fmt, clippy, desktop build, mobile analyze)
  • E2E tests pass against running relay (cargo test --test e2e_user_status -- --ignored)

🤖 Generated with Claude Code

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>
@wesbillman wesbillman enabled auto-merge (squash) May 1, 2026 17:43
@wesbillman wesbillman merged commit d84f8c6 into main May 1, 2026
13 checks passed
@wesbillman wesbillman deleted the add-30315-support branch May 1, 2026 17:48
tlongwell-block added a commit that referenced this pull request May 1, 2026
…ership

* origin/main:
  fix(desktop): header UX polish and member list improvements (#447)
  feat(relay): add NIP-38 user status support (kind:30315) (#446)
  [codex] clean up root docs and assets (#445)

# Conflicts:
#	crates/sprout-relay/src/handlers/ingest.rs
#	crates/sprout-relay/src/nip11.rs
tlongwell-block added a commit that referenced this pull request May 1, 2026
…ership

* origin/main:
  fix(desktop): header UX polish and member list improvements (#447)
  feat(relay): add NIP-38 user status support (kind:30315) (#446)
  [codex] clean up root docs and assets (#445)

# Conflicts:
#	crates/sprout-relay/src/handlers/ingest.rs
#	crates/sprout-relay/src/nip11.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant