From 5b6ba5094b77d75db4b5777699a1507129d77e0d Mon Sep 17 00:00:00 2001 From: DanS Date: Sun, 9 Aug 2026 00:59:29 -0500 Subject: [PATCH] docs(lite): clarify SDXL viewing-key HRP differs from the full node MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Audit of the lite import path found no false-rejection defect (no client-side gate; the two-command fallback in importKey makes the U/5/K/L prefix guess non-binding; lite send reuses the now-P2SH-fixed send_tab helpers). But the "zxview" viewing-key comment — which was WRONG in the full node (fixed earlier) — is genuinely CORRECT here: SDXL's import takes an extended full viewing key (zxviews…, hrp_sapling_viewing_key), whereas the full node's z_importviewingkey takes an incoming viewing key (zivks…). The two are not interchangeable. Add a note so nobody "harmonizes" the two gates and reintroduces the full-node bug. Comment-only; no behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/wallet/lite_wallet_controller.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wallet/lite_wallet_controller.cpp b/src/wallet/lite_wallet_controller.cpp index 6596f4e..d1bc0e4 100644 --- a/src/wallet/lite_wallet_controller.cpp +++ b/src/wallet/lite_wallet_controller.cpp @@ -887,6 +887,11 @@ LiteImportResult LiteWalletController::importKey(std::string spendingOrViewingKe } // Transparent WIFs begin with U/5/K/L (TImportCommand); shielded keys begin with // "secret-..." / viewing keys "zxview...", so this prefix check usually won't collide. + // NB: the lite/SDXL backend's viewing key is an *extended full* viewing key ("zxviews…", + // hrp_sapling_viewing_key), which is genuinely correct here — do NOT "harmonize" this with the + // full node, whose z_importviewingkey takes an *incoming* viewing key ("zivks…") instead. The + // two variants accept different viewing-key forms; a VK is not portable between them. Regardless, + // the two-command fallback below means a mis-guessed prefix never rejects an otherwise-valid key. const char first = spendingOrViewingKey[0]; const bool transparentFirst = (first == 'U' || first == '5' || first == 'K' || first == 'L');