From 60db237749a1189d57b8783cd318c60d6df0cbcc Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 15 Jun 2026 23:15:44 -0700 Subject: Sync wallet state across devices via encrypted Nostr events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Persist wallet state (addresses, utxos, history, indices, fees) as a NIP-44 encrypted, parameterized-replaceable event (kind 30078) addressed to self on relay.coinos.io. The Nostr identity is derived from the same seed (NIP-06), so no extra secret. On load we pull the latest state from Nostr — a device with no local cache gets full state without re-scanning, and another device's updates propagate — using savedAt to keep the newest copy. localStorage stays as the instant/offline cache; state is published (debounced) on every change. (Relay note: added kind 30078 to the strfry write-policy allowlist on prod.) Co-Authored-By: Claude Opus 4.8 (1M context) --- package.json | 1 + 1 file changed, 1 insertion(+) (limited to 'package.json') diff --git a/package.json b/package.json index 9e38e24..eef5b5d 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@scure/bip32": "^1.7.0", "@scure/bip39": "^1.6.0", "@scure/btc-signer": "^1.8.1", + "nostr-tools": "^2.23.5", "qrcode-generator": "^2.0.4" }, "devDependencies": { -- cgit v1.2.3