Skip to content

[Nostr] Add profile management and identity switching #4

@shadowbipnode

Description

@shadowbipnode

[Nostr] Add profile management and identity switching

Goal

Replace the current single-profile Nostr architecture with a proper identity management system.

Current situation

Zap Browser currently supports only one hardcoded Nostr identity:

  • nostr_profile WHERE id=1
  • no logout
  • no profile removal
  • no profile switching
  • no identity isolation

This creates UX and security limitations for a browser intended to be Nostr-native.

Why this matters

Real users often operate multiple Nostr identities:

  • personal profile
  • anonymous profile
  • work/dev profile
  • Bitcoin-only profile

Without profile management:

  • users cannot rotate identities safely
  • corrupted profiles are difficult to recover
  • onboarding becomes fragile
  • testing different identities is cumbersome
  • future permission systems become harder to implement cleanly

Tasks

Database layer

  • Replace nostr_profile single-entry assumptions.
  • Support multiple stored profiles.
  • Add active profile state.
  • Add migration path from legacy id=1 schema.

Identity management

  • Add profile import/remove/logout.
  • Add profile switching.
  • Add active profile persistence across restarts.
  • Ensure NIP-07 uses the currently active identity.

UI/UX

  • Add profile management screen.
  • Add “Disconnect profile” button.
  • Add “Switch identity” flow.
  • Show active identity in browser UI.

Security

  • Ensure encrypted private keys remain isolated per profile.
  • Prevent accidental cross-profile signing.
  • Clear cached permissions on profile switch.

Acceptance criteria

  • Users can manage multiple Nostr identities.
  • Active identity can be switched without restart.
  • NIP-07 correctly reflects the selected profile.
  • Profiles can be safely removed.
  • Existing users are migrated automatically.

Priority

High.

This is a foundational feature for a sovereign/Nostr-native browser.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions