Skip to content

feat: encrypted identity export/import for cross-platform key transfer #12

@lmanchu

Description

@lmanchu

Problem

Users switching between platforms (iOS → Android, iOS → Windows) need a way to transfer their Nostr identity (nsec) without relying on platform-specific sync (iCloud).

Proposal

Add an encrypted .sigil export file format:

  1. Export: User taps "Export Identity" in profile, sets a password. App generates a JSON file with scrypt-encrypted nsec + contacts + relay list.
  2. Import: On new device, user opens .sigil file, enters password, identity restored.

Implementation Notes

  • guard.rs already has scrypt + SHA-256 key encryption (sigil encrypt-key) — reuse for export
  • File format: { "version": 1, "encrypted_nsec": "...", "contacts": [...], "relays": [...], "salt": "...", "nonce": "..." }
  • iOS: share sheet export, document picker import
  • CLI: sigil export-identity / sigil import-identity
  • Android/Windows: same file format when those clients exist

Current Key Transfer Options

  • ✅ Device Linking (QR scan between two devices)
  • ✅ Manual nsec copy-paste (CLI)
  • ✅ iCloud sync (iOS/Mac only, opt-in)
  • This issue: encrypted file export (cross-platform)

Priority

Low — current options cover most cases. This becomes important when Android/Windows clients ship.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions