Skip to content

[REQUEST] Optimize vanish (NIP-62) checks using table flag #436

Closed

Description

@vikashsiwach

Description:
Currently, the relay checks for an active NIP-62(kind:62) vanish request by querying the events table.
If the number of events grows ,this will not be a good practice to scale and will need a additional query.
To be more efficient , we can add a flag to users table (e.g. is_vanished) .

Solution:

  • Add a boolean flag (is_vanished) to the users table.
  • Set this flag when a kind:62 event is processed.
  • Use this flag for vanish checks instead of querying events table.

Benefit:

  • Faster lookups (no event table scan)
  • Simpler logic for checking vanish state
  • Better scalability as event volume grows

Additional context
Optimize the performance of NIP-62 in PR #418

Activity

  1. vikashsiwach commented on Apr 10, 2026

    @vikashsiwach
    ContributorAuthor

    Hey @cameri ! Based on your review in PR #418 ,I have created this issue and started work on this

  2. cameri commented on Apr 18, 2026

    @cameri
    Owner

    Thank you @vikashsiwach !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions