1 major finding · 4 suggestions
Findings
[major] · External-signer wallets ignore keypath_only when signing and finalizing
With sign=true and finalize=true, an external-signer wallet can return a finalized script-path spend despite keypath_only=true if the successful signer response retains sufficient unfinalized script-path signatures.
Location: src/wallet/rpc/spend.cpp:1708 (head).
Details and suggested fix
The unchanged ExternalSignerScriptPubKeyMan::FillPSBT override delegates to the policy-aware descriptor implementation only when sign=false. Otherwise it sends the supplied PSBT to the device without a key-path-only instruction, accepts the response, and calls FinalizePSBT with unrestricted defaults. An input containing the leaf script, control block and sufficient valid script-path signatures, but no key-path signature or final witness, passes the final-fields-only PSBTInputSigned guard. Local finalization can therefore produce a script-path witness, after which wallet verification allows the RPC to return complete=true and transaction hex. This requires external-signer support, -signer, matching fingerprint metadata and the successful response described above; it does not require a new device signature. A capable device can also add script-path signatures because it receives no restriction. Reject keypath_only=true for external-signer signing until both the device boundary and local finalization enforce the policy, and add a mock-signer case preserving complete unfinalized script-path signatures. The supplied-PSBT trigger primarily affects walletprocesspsbt; send and sendall start with fresh PSBTs.
Optional improvements
[suggestion] · send/sendall checks miss ignored keypath_only forwarding
The new send and sendall assertions use a watch-only wallet, so they would still pass if FinishTransaction stopped forwarding keypath_only.
Location: test/functional/wallet_taproot.py:270 (head).
Details and suggested fix
psbt_online has private keys disabled and imports only public descriptors. Since FinishTransaction starts with a fresh PSBT, both calls remain incomplete and produce no taproot_script_path_sigs even without the restriction. Dropping taproot_keypath_only from both fill calls would instead add input taproot_scripts for tree descriptors, which this helper never checks. Add an assertion that those scripts are absent from both returned PSBTs; the earlier equivalent check covers the separate walletcreatefundedpsbt path. For signing and finalization coverage, add a private-key wallet with only a spendable script path, such as tr(H,pk(key)), using psbt=true and add_to_wallet=false. Restricted processing should remain incomplete without a final witness, while unrestricted processing should complete.
[suggestion] · Help and release note overstate PSBT-wide script-data suppression
Recognized script-bearing Taproot outputs can still receive taproot_tree with keypath_only=true, so the help and release note overstate PSBT-wide script-data suppression.
Location: src/wallet/rpc/spend.cpp:1778 (head).
Details and suggested fix
The restriction applies to input leaf-script population and input signing/finalization, but both wallet and descriptor processing still enrich recognized outputs through UpdatePSBTOutput. That function uses default signing options, and PSBTOutput::FromSignatureData copies the provider's full Taproot tree when available. A change output can therefore still reveal its fallback policy to recipients of the PSBT. Keep this existing output metadata for hardware-wallet change identification, but qualify the help text, release note and PSBTFillOptions comment to describe the input restriction and explicitly retain output trees. Derivation and MuSig participant metadata also remain, so this option should not read as general PSBT metadata filtering.
[suggestion] · Unrestricted retries mask expected key-path signing failures
A missing key-path signature always triggers unrestricted retry, which can hide a keypath_only signing regression even when the tested wallet holds the internal private key.
Location: test/functional/wallet_taproot.py:244 (head).
Details and suggested fix
Under keypath_only, signature absence sets retry=True without checking whether the key path should be signable. The retry builds another PSBT at fee rate 200 and signs with keypath_only=False, so finalization and mempool acceptance validate that replacement rather than the restricted attempt. For example, psbt_offline holds the internal private key in tr($1/*,{pk($2/*),pk($2/*)}) with [True, False], and key_only_wallet imports every supplied xprv. A regression specific to restricted key-path signing could therefore pass through the retry. Derive expected key-path signability from each descriptor and wallet's private keys, require taproot_key_path_sig when available, and allow retry only for known unsignable key paths.
[suggestion] · Explicit null keypath_only values fail in options-object RPCs
send, sendall and walletcreatefundedpsbt reject keypath_only=null instead of using the default, unlike walletprocesspsbt and descriptorprocesspsbt.
Location: src/wallet/rpc/spend.cpp:1857 (head).
Details and suggested fix
The options-object type checks allow null, but both new parsing sites use exists("keypath_only") before calling get_bool(). An explicit null therefore reaches the boolean getter and errors, whereas the two top-level RPC arguments use the default-aware self.Arg<bool> getter. Choose DEFAULT_SIGN_TAPROOT_KEYPATH_ONLY when options["keypath_only"].isNull() in both FinishTransaction and walletcreatefundedpsbt. This follows the documented missing/null convention. Several sibling options share the existing membership pattern, so this is a consistency improvement for the new option.