Skip to content

Tracking: cross-platform sync of Interface / Wallet / Zap preferences via NIP-78 #579

Description

@dmnyc

Deferred phase

This issue tracks the work originally scoped in #556 / #564 / #569 (and iOS counterpart barrydeen/wisp-ios#173) to sync user preferences across devices using NIP-78 (kind 30078 app-specific data with NIP-44 encryption).

The slim-PR series #570#576 landed the client-side UI and per-account scoping pieces of that work, but deliberately deferred the actual cross-device sync infrastructure so each PR could ship and be reviewed in isolation.

In scope when this is picked up

  • NIP-78 publisher / subscriber — kind 30078 events keyed by a stable d tag (e.g. wisp-app-settings:v1, wisp-zap-presets:v1, wisp-wallet-meta:v1)
  • NIP-44 encryption of the JSON body (preferences contain account-level state that should not be public)
  • Schema versioningv1 baseline matching iOS; bump on breaking changes
  • Conflict resolution — last-write-wins by created_at, with a manual "Restore from relays" affordance (the UI hook already exists from feat(settings): NIP-78 cross-device sync of Interface preferences #564's earlier iteration but is currently inert)
  • Opt-in toggle — Settings → Interface should expose an explicit Sync toggle off by default
  • Cross-platform schema parity — Android + iOS must read/write identical JSON; coordinate any schema change across both repos

Out of scope (already landed)

Superseded PRs (closed when this issue was filed)

Suggested future-phase plan

  1. Schema definition PR (both repos in lockstep) — define the kind-30078 JSON envelope, d tag namespacing, version field, encryption envelope. No actual sync wiring yet, just types + serialization.
  2. Android publisher PR — write on every relevant SharedPreferences change, debounced
  3. iOS publisher PR — equivalent
  4. Subscriber + Restore UX (both repos) — on launch, fetch latest 30078 events for the user's pubkey, decrypt, surface a confirmation before overwriting local state (avoid surprise loss of local edits)
  5. Settings toggle + "Restore from relays" button wiring on both platforms

Related

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