From b2a50376df1059d5d3190128a568dc83a0ce4f4d Mon Sep 17 00:00:00 2001 From: Laan Tungir Date: Thu, 25 Jun 2026 13:48:34 -0400 Subject: [PATCH] Ensure nutzap privkey is always included in kind 17375 republish - Added ensureDirectNutzapP2pk() call in publishDirectProofs before building wallet payload - This auto-generates a privkey if one wasn't hydrated from the old 17375 event - Bumped WORKER_REVISION to nip60-privkey-ensure-1 --- www/js/init-ndk.mjs | 2 +- www/js/version.json | 6 +++--- www/ndk-worker.js | 9 +++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/www/js/init-ndk.mjs b/www/js/init-ndk.mjs index bc2dfa8..9f75569 100644 --- a/www/js/init-ndk.mjs +++ b/www/js/init-ndk.mjs @@ -184,7 +184,7 @@ export async function initNDKPage(options = {}) { // All pages in www/ directory, so worker path is always the same. // Include explicit worker revision token so updated SharedWorker code is guaranteed to restart. - const WORKER_REVISION = 'nip60-republish-1'; + const WORKER_REVISION = 'nip60-privkey-ensure-1'; const workerPath = `./ndk-worker.js?v=${encodeURIComponent(VERSION)}&wr=${encodeURIComponent(WORKER_REVISION)}`; // Initialize NDK SharedWorker (shared across all tabs/pages) diff --git a/www/js/version.json b/www/js/version.json index 3eec6a4..1a9a093 100644 --- a/www/js/version.json +++ b/www/js/version.json @@ -1,5 +1,5 @@ { - "VERSION": "v0.7.21", - "VERSION_NUMBER": "0.7.21", - "BUILD_DATE": "2026-06-25T17:39:32.779Z" + "VERSION": "v0.7.22", + "VERSION_NUMBER": "0.7.22", + "BUILD_DATE": "2026-06-25T17:48:34.112Z" } diff --git a/www/ndk-worker.js b/www/ndk-worker.js index 8c6eb49..991c5db 100644 --- a/www/ndk-worker.js +++ b/www/ndk-worker.js @@ -2843,6 +2843,15 @@ async function publishDirectProofs(debugContext = null) { } log('delete old 7375 done'); + // Ensure a nutzap privkey exists before building the wallet payload. + // If the user's old 17375 didn't have one (or hydration failed), + // this auto-generates one so it's always included in the republish. + try { + ensureDirectNutzapP2pk(); + } catch (err) { + log('ensureDirectNutzapP2pk failed during publish', { error: err?.message || String(err) }); + } + // NIP-60 standard: public "mint" tags are visible on the event; // the privkey lives in the encrypted content as a "privkey" tag. // The "pubkey" tag does NOT belong on kind 17375 (it belongs on