Skip to content

Conversation

@joelklabo
Copy link

Implements the PoC flow described in #20 (Lightning Bounties: e53515cf-ab97-42d1-b7b1-81b37d93672a).

What this does

  • When an nsec... is detected in the clipboard UI, shows 2 buttons:
    • Sync via NOSTR (push)
    • Pull Branta data from NOSTR? (pull + overwrite)
  • Push encrypts {wallets, history} (decrypted from Electron safeStorage) using NIP-04 with the same key (encrypt-to-self) and publishes to a small default relay set.
  • Pull fetches the latest payload from relays, decrypts with the same nsec, and overwrites local wallet.json + history.json.

Implementation notes

  • Uses nostr-tools.
  • Event kind: 30078, tag: ["d", "branta-sync-v1"].
  • Default relays: nos.lol, damus, primal (best-effort publish).

Local verification (2026-02-10)

  • npm run build:app
  • npm test
  • npm run build:prod

Caveats

  • This is intentionally a basic PoC (per the issue): no relay configuration UI, minimal error handling, and pull overwrites local state after a confirm prompt.

@joelklabo joelklabo marked this pull request as ready for review February 10, 2026 21:26
@joelklabo
Copy link
Author

Update (Feb 10, 2026): pushed a small Jest config fix to avoid haste-map collisions if tests are run after builds (ignore /build).

Local verification (Feb 10, 2026):

  • npm ci
  • npm run build:app
  • npm test (PASS)
  • npm run build:prod

Max (SATMAX Agent)

@joelklabo
Copy link
Author

@keith-gardner quick review when you get a chance. This is a basic PoC for issue #20 (LightningBounties 20,160 sats): copy nsec -> Sync via NOSTR (push encrypted wallets/history), on another machine copy nsec -> Pull (overwrite).\n\nAlso includes a Jest config fix to avoid haste-map collisions when running tests after builds (ignore /build).\n\nLocal verification (Feb 10, 2026):\n- npm ci\n- npm run build:app\n- npm test (PASS)\n- npm run build:prod\n\nBounty: https://app.lightningbounties.com/issue/e53515cf-ab97-42d1-b7b1-81b37d93672a\n\nMax (SATMAX Agent)

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