5 minor findings · 10 suggestions
Earlier concerns neither republished nor resolved: 1 major finding · 2 minor findings · 5 suggestions. See the Run archive for their assessments.
Findings
[minor] · Silent-payments selection can return only non-contributing inputs
An SP send can fail even with eligible coins available because ordinary selection can satisfy the monetary target using only non-contributing inputs.
Location: src/wallet/spend.cpp:1451 (head).
Details and suggested fix
For example, a P2WSH preset that covers the target takes the SelectCoins manual return even with add_inputs=true and an eligible coin available. P2WSH is allowed in an SP transaction but contributes no key, so CreateSilentPaymentsOutputs then returns “No silent payment eligible inputs were found.” Automatic selection can make the same mistake by accepting a fundable P2WSH-only output type before trying mixed types. CreateTransaction returns this failure without retrying. Require at least one contributing input in the selected set, counting eligible presets and respecting add_inputs=false, and add regression cases for automatic supplementation. The send fails closed; manually selecting an eligible input works around it, and wallets using only default descriptors are unaffected.
[minor] · Txid-changing SP variants lose the recipient metadata needed for bumping
After a mined scriptSig variant is disconnected, an input-adding bump can retain undiscoverable SP outputs because the variant lacks SP metadata; no production occurrence was identified.
Location: src/wallet/wallet.cpp:2163 (head).
Details and suggested fix
SP sends support P2PKH inputs, so owner re-signing or a miner-included scriptSig malleation can create a different-txid variant with the same inputs and outputs. SyncMalleatedTxMetadata copies neither m_rbf_needs_sp_outputs nor m_sprecipients to that variant. Once its confirming block is disconnected, bumpfee skips both the missing-recipient refusal and SP reconstruction, treating the payment scripts as fixed P2TR destinations. Adding inputs can then change the BIP352 shared secret without changing those scripts, so normal recipient scanning misses the replacement. The variant also lacks the downgrade tag and bypasses the SP-specific psbtbumpfee refusal. Copy both fields during variant synchronization and persist the variant's separate sprecipients record. Extend the clone fixture with an SP recipient and a bump that adds an input.
[minor] · SP send ignores the requested input reservation
Concurrent SP send calls can select the same coins even with lock_unspents=true, because funding no longer reserves them until commit.
Location: src/wallet/rpc/spend.cpp:747 (head).
Details and suggested fix
FundTransaction masks out lockUnspents for SP transactions, but committing later does not close the interval between funding and commit. send releases cs_wallet after funding and signs in FinishTransaction, allowing another call to select the same inputs during that interval. Both calls can report complete=true and a txid even when the second transaction cannot enter the mempool, since CommitTransaction only logs submission failure; a sufficiently expensive second transaction may instead replace the first. The unreserved default already had this race, but callers explicitly requesting reservation lose that protection here. Preserve the reservations through commit and release newly acquired locks on pre-commit failure, including incomplete signing.
[minor] · bumpfee can reuse an OP_RETURN as its change script
Selecting an OP_RETURN with original_change_index can now burn replacement change; no current caller supplying that input was identified.
Location: src/wallet/feebumper.cpp:328 (head).
Details and suggested fix
ExtractDestination returns CNoDestination{script} for the selected OP_RETURN, but the feebumper still assigns it to destChange. Previously that variant meant “generate fresh wallet change.” The engaged optional now makes CreateTransactionInternal use the preserved script instead. Other outputs remain fixed recipients, so surplus from added inputs can become positive-value OP_RETURN change, which dust handling does not reject. bumpfee can sign and broadcast that unspendable output; psbtbumpfee constructs the same replacement script. Treat CNoDestination as an absent custom change destination again, while retaining PubKeyDestination and SP support, and add an OP_RETURN regression case.
[minor] · Restored wallets lack the metadata that makes SP fee bumping safe
A pre-send backup can rediscover a pending SP transaction without its metadata, allowing an input-adding bumpfee to retain scripts the recipient's normal scan cannot find.
Location: src/wallet/feebumper.cpp:263 (head).
Details and suggested fix
A restored wallet, or another wallet holding the same descriptors, learns the outgoing transaction through ordinary discovery with update_wtx=nullptr. Its SP flag remains false and its recipient vector empty. With no replacement outputs supplied, both reconstruction gates are skipped and the SP outputs become fixed P2TR destinations. A bump that needs another confirmed input, such as for a changeless payment, can change the shared secret while preserving those scripts. Requiring creation-time commit does not cover this workflow. Define the recovery contract: conservatively refuse input-adding bumps of from-me transactions with non-wallet P2TR outputs and no SP record unless outputs are supplied, accepting the restriction on recovered ordinary taproot payments, or explicitly document the limitation in RPC help and release notes. Add a pre-send-backup restoration test for the chosen behavior.
Optional improvements
[suggestion] · The downgrade tag has side effects beyond fee-bump refusal
Assuming older releases retain the base's replacement handling, the downgrade tag also excludes pending SP change from safe selection and reports a nonexistent replacement txid.
Location: src/wallet/transaction.h:297 (head).
Details and suggested fix
AvailableCoins marks depth-zero outputs unsafe when replaced_by_txid is present, so the placeholder also prevents safe automatic spending of the send's unconfirmed change, including a default CPFP attempt. include_unsafe provides a workaround where supported, and confirmation removes this selection restriction. The replacement metadata exposed by gettransaction and listtransactions also names the placeholder rather than a real transaction. Document these effects alongside the intended refusal to fee bump after a downgrade.
[suggestion] · RPC help omits the silent-payments contract
The RPC help does not explain valid SP results without a scriptPubKey, or the SP-specific restrictions on wallet sending and fee bumping.
Location: src/rpc/output_script.cpp:81 (head).
Details and suggested fix
For an SP address, validateaddress returns only isvalid, address, isscript=false, and iswitness=false, with no SP marker. Although scriptPubKey is optional in the schema, its help does not explain this valid-address omission or that raw-transaction construction still rejects the address. The wallet help likewise advertises PSBT and preview options without explaining that SP transactions reject psbt=true and add_to_wallet=false, require unlocked local private keys, and cannot use psbtbumpfee. The current code also ignores lock_unspents for SP sends and rejects SP change addresses in fundrawtransaction and walletcreatefundedpsbt. Document these exceptions in the affected argument and result help, and add a release note covering SP sending, the stored recipient metadata, and downgrade handling.
[suggestion] · Unsupported SP options are rejected after funding work
Unsupported SP requests can reach funding before rejection, wasting derivation and, for successfully funded send requests with automatic change, consuming an address index.
Location: src/wallet/rpc/spend.cpp:1372 (head).
Details and suggested fix
send checks psbt=true and add_to_wallet=false only after selection and SP output derivation have succeeded. By then CreateTransactionInternal has called KeepDestination(), so rejecting the request does not return its generated change index. For an SP change_address, fundrawtransaction and walletcreatefundedpsbt also enable SP before refusing it. Watch-only or external-signer wallets therefore hit the private-key error first, locked wallets hit the unlock error, and wallets with no eligible inputs can fail derivation instead of reporting the unsupported option. Determine SP use from the parsed recipients and change destination, and reject unsupported combinations before enabling SP or funding.
[suggestion] · SP fee-bump refusal guards lack negative coverage
The SP fee-bump tests do not exercise missing or mismatched recipient records, leaving both fail-closed guards unprotected.
Location: src/wallet/feebumper.cpp:263 (head).
Details and suggested fix
The reload tests retain the recipient record and expect success, while silent_payments_flag_roundtrip checks only serialization. Neither creates a flagged transaction with an empty recipient vector or valid recipient data that reproduces different scripts. These states matter because the marker and recipients are separate database records, and unreadable recipients cause only a noncritical load error. Add reload cases that delete the sprecipients record and replace it with wrong but valid data. Use a changeless payment, a spare confirmed coin, and a fee increase requiring another input. Assert the specific refusal and an unchanged mempool in each case.
[suggestion] · The multi-recipient SP test does not bind amounts to recipients
The 3 BTC/4 BTC multi-recipient case checks discovery counts only, so its assertions do not detect exchanging the recipients' amounts.
Location: test/functional/wallet_silentpayments_sending.py:152 (head).
Details and suggested fix
assert_sp_outputs checks only len(found), although production pairs each derived script with an amount by index. Each recipient would still find one output if the two payment amounts were exchanged. Map each scanned output key back to its vout and check its value: 3 BTC and 4 BTC for the sendmany and send cases, and the expected sweep shares for sendall, which receives no specified amounts here. Reuse that check for the new SP iterations in wallet_sendall.py; its existing and/or precedence allows a matching amount alone to satisfy assert_tx_has_output, and an SP address cannot equal the derived output address.
[suggestion] · The Python BIP352 scanner misses the transaction-wide future-witness exclusion
The test oracle can report an SP payment in a transaction that the C++ receiver skips because an input spends a native witness version above 1.
Location: test/functional/test_framework/bip352.py:51 (head).
Details and suggested fix
scan() filters out inputs whose public keys cannot be extracted and derives from the remaining keys. A native v2 input is therefore treated as merely non-contributing, while GetSilentPaymentsPrevoutsSummary rejects the entire transaction. This can let an otherwise matching output pass the oracle despite the BIP352 exclusion. Before summing keys, return no matches if any native prevout has a witness version above 1, preserving version-1 P2A handling. Add a unit case with an eligible input, a v2 input, and an otherwise matching output.
[suggestion] · sendall's skipped-SP-coins refusal has no regression test
The P2WSH-only failure test does not exercise the guard that prevents an SP sendall from silently leaving incompatible coins behind.
Location: src/wallet/rpc/spend.cpp:1626 (head).
Details and suggested fix
P2WSH coins are allowed as non-contributing SP inputs, so sendall_sp_fails_on_no_eligible_inputs reaches the later “No silent payment eligible inputs were found” error without setting skipped_silent_payments_ineligible. Removing the skipped flag or this refusal would not change those assertions. Add a wallet containing an eligible P2WPKH coin and a spendable tr(<xonly pub>,pk(<priv>)) coin whose internal private key is unavailable. Assert the skipped-coins error and unchanged spends, then sweep only the eligible coin with inputs and verify the payment using scan_tx.
[suggestion] · The oversized sendall fixture doubles its input pool unnecessarily
The failed regular sweep leaves 1,600 UTXOs available, so funding again makes the SP check derive over about 3,200 inputs without adding size-limit coverage.
Location: test/functional/wallet_sendall.py:599 (head).
Details and suggested fix
The size rejection happens before signing or commit, so the first iteration does not consume its funded coins. Move keypoolrefill, the 1,600-output funding transaction, and mining before the target loop. Both rejections can then use the same pool, which already exceeds the weight limit for either single-output destination type, avoiding another funding transaction and the larger SP derivation.
[suggestion] · The ancestor-fee assertions repeat without using the SP target
The SP iteration repeats two regular-address previews and their funding work; only cleanup uses the selected SP target, after the parents confirm.
Location: test/functional/wallet_sendall.py:474 (head).
Details and suggested fix
Both sendall calls under test pay self.def_wallet.getnewaddress() with add_to_wallet=False, so changing remainder_target adds no SP ancestor-fee assertion. Use @for_each_target(allow_sp=False) for this preview test to avoid repeating its parent sends, previews, and mining. Dedicated SP ancestor-aware coverage would need an SP recipient and committed sends, since SP previews are refused.
[suggestion] · Qt fee-bump tests do not exercise the new SP workflow
Current Qt tests only bump ordinary PKHash sends, leaving the SP-specific unlock ordering, PSBT suppression, and recipient forwarding uncovered.
Location: src/qt/walletmodel.cpp:456 (head).
Details and suggested fix
SP bump construction derives outputs before the existing signing-time unlock, so removing the new early unlock would make a locked-wallet bump fail without affecting the current Qt cases. Losing sp_recipients across the interface would likewise escape those cases. Extend MiniGUI with an SP transaction created through the wallet API, then bump it from a locked encrypted wallet with PSBT controls enabled. Check that unlocking precedes bump construction and confirmation, the unsigned option is absent, cancellation relocks the wallet, and a committed replacement retains its SP recipients.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [minor]: A Silent Payments change address can fail a send with no change
- [minor]: Fee bump can misclassify a fixed Taproot output as silent payment
- [major]: Fee bump can misclassify a duplicate-script output as silent payment
- [suggestion]: The rawtr SP key-lookup branch has no test (earlier report)
- [suggestion]: Input-type fixtures change type after the first RPC (earlier report)
- [suggestion]: Retained same-scan-key outputs lack lifecycle coverage (earlier report)
- [suggestion]: SP recipient cleanup precedes durable replacement marking (earlier report)
- [suggestion]: An SP recipient without the coin-control flag reaches an abort (earlier report)