From b73bb9ee51b9be33bc1859fd56d3e11905c3d456 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 1 Aug 2026 19:02:25 -0700 Subject: Background NWC: the worker now answers — and pays — from the pouch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The no-tap half of background wallet-connect. The push payload carries the (encrypted, client-signed) request event; a bundled service-worker responder (src/sw-nwc.js -> nwc-respond.js) finds the matching pouch in IndexedDB, decrypts with the connection's service key, and answers get_info/get_balance/list_transactions from pouch state. pay_invoice pays through the swap bridge with an ArkManager running over the pouch's chain-6 key window (one HTLC lock, one HTTP swap), enforcing per-payment and daily budgets from the pouch's own spend log, checking the notifier's /answered endpoint so it never double-pays or shouts over an open device, and persisting the swap before handing it off so the app can refund a crashed flight. Anything it can't handle falls back to the wake-the-user notification. The notifier grows /publish (verified 23195s only, rate-limited) as the worker's reply pipe and /answered for race avoidance. The app gains pouch funding (mailbox-less arkoor self-send whose recipient bytes we keep), emptying, spend/budget reconciliation on open, and refund recovery with the pouch's own keys. Co-Authored-By: Claude Fable 5 --- src/i18n.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/i18n.js') diff --git a/src/i18n.js b/src/i18n.js index 1fa7d74..327bf01 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -439,11 +439,18 @@ const STR = { nwcDesc: 'Let another app pay from this wallet over nostr — it never sees your keys, only spends within the limits you set, and you can cut it off at any time. Payments go out over Ark.', nwcTabWarning: 'Only works while Hal is open in a tab — it is not an always-on service.', nwcAdd: 'Add a connection', - nwcBackground: 'Alert me when closed', + nwcBackground: 'Answer while closed', nwcOn: 'On', nwcOff: 'Off', - nwcBackgroundOn: 'You will be notified of payment requests', - nwcBackgroundOff: 'Background alerts turned off', + nwcBackgroundOn: 'Requests will be answered in the background', + nwcBackgroundOff: 'Background answering turned off', + nwcPouch: 'Pouch (spendable while closed)', + nwcPouchDesc: 'Coins in the pouch can be spent by the background responder without opening Hal. Keep it small — top it up as it drains.', + nwcPouchFund: 'Add to pouch', + nwcPouchEmpty: 'Empty pouch', + nwcPouchFunded: 'Moved {sats} sats into the pouch', + nwcPouchEmptied: 'Moved {sats} sats back to the wallet', + nwcPouchAmount: 'Amount (sats)', nwcAppName: 'App name (e.g. Damus)', nwcMaxPayment: 'Max per payment (sats)', nwcDailyBudget: 'Daily budget (sats)', -- cgit v1.2.3