6 minor findings · 8 suggestions
Earlier concerns neither republished nor resolved: 1 major finding · 3 minor findings · 9 suggestions. See the Run archive for their assessments.
Findings
[minor] · Different-txid SP variants lose their fee-bump metadata
A scriptSig-malleated SP transaction is stored under its new txid without SP metadata, so an input-adding bump after a reorg can preserve outputs that normal BIP352 scanning no longer finds.
Location: src/wallet/wallet.cpp:2163 (head).
Details and suggested fix
CommitTransaction sets m_rbf_needs_sp_outputs and m_sprecipients on the committed transaction, but SyncMalleatedTxMetadata copies neither field to recognized different-txid variants. A P2PKH-funded SP send can produce such a variant through re-signing, as in wallet_txn_clone.py, or through a scriptSig mutation included by a miner. After that variant is mined and its block is disconnected, bumpfee skips both the missing-recipient refusal and SP recomputation. If the bump adds an eligible input, the BIP352 derivation changes while the output scripts remain fixed, so the recipient's normal scan misses the replacement payment. The variant also lacks the downgrade placeholder and passes the SP-specific psbtbumpfee refusal. Synchronize both fields across recognized variants and persist each variant's separate sprecipients record; WriteTxMetadata alone does not write it. Extend the clone test with an SP recipient and an input-adding bump. No production occurrence was found; the sequence requires a mined different-txid variant followed by a reorg.
[minor] · Pre-send backups lack the metadata needed for safe SP fee bumps
After a pre-send backup restore, bumpfee can add inputs without recomputing the rediscovered SP transaction's outputs, leaving the replacement undiscoverable by normal BIP352 scanning.
Location: src/wallet/feebumper.cpp:263 (head).
Details and suggested fix
The SP flag and recipient list exist only in the wallet database used to create the payment. A wallet restored from a pre-send backup, or another wallet with the same descriptors, relearns the outgoing transaction through AddToWalletIfInvolvingMe without that metadata. The missing-data guard does not fire, and the fee bumper treats its outputs as fixed P2TR destinations. A changeless SP sendall with a spare confirmed eligible coin provides an input-adding bump that changes the derivation and defeats normal recipient scanning. bumpfee neither warns about this nor describes it in its help. Decide the recovery contract explicitly: either refuse input-adding bumps of unflagged transactions with non-wallet P2TR outputs unless outputs are supplied, accepting the restriction on ordinary recovered taproot payments, or document the limitation in RPC help and release notes. Add a pre-send-backup restore test in either case. No production occurrence was found.
[minor] · bumpfee reuses CNoDestination outputs as change
Pointing original_change_index at an OP_RETURN now sends replacement change into that unspendable output, whereas the base code generated fresh wallet change.
Location: src/wallet/feebumper.cpp:328 (head).
Details and suggested fix
ExtractDestination preserves OP_RETURN, bare-multisig and nonstandard scripts inside CNoDestination. The feebumper now wraps that value in an engaged PaymentDestination, which CreateTransactionInternal accepts as custom change. Previously, CNoDestination selected a fresh wallet change address. When original_change_index targets an OP_RETURN and the replacement has surplus, that surplus, including change from added inputs, can go into the OP_RETURN. Its zero dust threshold does not prevent this, and an otherwise standard replacement can be signed and broadcast. The engaged optional also bypasses the former CNoDestination sanity check when no recipients remain. Leave destChange unset for CNoDestination, while retaining PubKeyDestination and SP destinations, and add an OP_RETURN change-index regression test. No current caller selecting such an output was identified, so production impact is unconfirmed.
[minor] · An SP anchor can push covering presets past max_tx_weight
An SP send whose ineligible preset inputs already cover the target can gain an automatic anchor that exceeds the caller's max_tx_weight or the TRUC size limit.
Location: src/wallet/spend.cpp:1009 (head).
Details and suggested fix
With ineligible preset inputs and add_inputs=true, the SP fallback adds an eligible anchor after checking only that coin's own weight. Because the presets already cover the target, the retried SelectCoins returns through its MANUAL shortcut without checking their combined weight. The final construction check compares against MAX_STANDARD_TX_WEIGHT, not the smaller requested limit. Consequently, send can commit a transaction above max_tx_weight; with version=3, a sufficiently oversized result is rejected by TRUC mempool policy while send still returns its txid. Check the combined input weight against the remaining transaction budget before accepting an anchor result, then try another anchor or return the weight error. No current caller combining these options was identified, so production impact is unconfirmed.
[minor] · SP send ignores the requested input reservation
Concurrent SP send calls can select the same coins between funding and commit even when the caller explicitly sets lock_unspents=true.
Location: src/wallet/rpc/spend.cpp:747 (head).
Details and suggested fix
The RPC funding helper forces lockUnspents off for SP transactions, but send releases cs_wallet after funding and signs and commits later in FinishTransaction. Another RPC thread can fund a transaction from the same coins during that interval. Two overlapping calls can therefore return conflicting fully signed transactions, each with complete=true and a txid. CommitTransaction only logs a mempool submission failure; a second transaction meeting replacement requirements may instead replace the first. Default sends already had this race, but suppressing the locks regresses callers that explicitly requested reservation. Keep the requested locks through commit and release newly acquired locks if completion fails.
[minor] · SP anchor selection splits avoid-partial-spends groups
Presetting a single eligible anchor outside GroupOutputs can spend one coin of a reused address while leaving its siblings behind despite avoid-partial-spends.
Location: src/wallet/spend.cpp:1020 (head).
Details and suggested fix
When the first selection has no BIP352-eligible input, the fallback removes one eligible coin from available_coins and presets it. GroupOutputs then sees only the remaining coins, or is bypassed entirely if the presets cover the target. For example, if an ineligible 5 BTC coin initially funds a 4 BTC payment while two eligible 1 BTC coins share an address, the fallback can add one sibling and leave the other unspent. The APS retry uses this same path, and an avoid_reuse wallet subsequently treats the leftover sibling as a used-address coin. With APS enabled, choose anchors from filtered output groups and preset the whole group, preserving OUTPUT_GROUP_MAX_ENTRIES. No specific production wallet with this layout was identified, so production frequency is unconfirmed.
Optional improvements
[suggestion] · SP RPC behavior and sending restrictions are undocumented
The help does not explain valid SP addresses without scriptPubKey or the SP-specific restrictions on signing, PSBTs, change addresses and fee bumping.
Location: src/rpc/output_script.cpp:81 (head).
Details and suggested fix
validateaddress now accepts SP addresses and returns isscript=false and iswitness=false, without a fixed scriptPubKey or an SP indicator. Although scriptPubKey is marked optional, the help does not explain this valid-address case. The send and sendall help also describes psbt and add_to_wallet without their SP exclusions or the requirement for unlocked local private keys. Qualify the affected help and add a release note covering SP destinations in sendtoaddress, sendmany, send, sendall and bumpfee outputs; the psbtbumpfee refusal; unsupported SP change addresses in fundrawtransaction and walletcreatefundedpsbt; and the new recipient record and downgrade placeholder. This is a user-visible feature and API change covered by the release-note guidance in doc/developer-notes.md.
[suggestion] · Unsupported SP options reach private-key checks and funding
An unsupported SP change_address can produce unlock or private-key errors, or run full funding, before fundrawtransaction or walletcreatefundedpsbt reports that it is unsupported.
Location: src/wallet/rpc/spend.cpp:899 (head).
Details and suggested fix
The shared RPC FundTransaction accepts the SP change address, calls MaybeEnableSilentPayments, and funds the transaction before either caller rejects it. Watch-only and external-signer wallets therefore receive a private-key error, locked wallets receive an unlock error, and a sufficiently funded unlocked wallet performs coin selection and SP derivation unnecessarily. send similarly checks psbt=true and add_to_wallet=false only after funding, which can also consume an automatic change index through KeepDestination. Reject unsupported combinations after parsing recipients and the change address but before enabling SP or funding. A per-caller capability flag in the shared helper would preserve send's supported SP change behavior.
[suggestion] · The test scanner does not skip future-witness transactions
The Python oracle can report an SP payment in a transaction that BIP352 and the C++ receiver skip entirely.
Location: test/functional/test_framework/bip352.py:51 (head).
Details and suggested fix
scan() ignores a native future-witness input's key and continues deriving outputs from other eligible inputs. GetSilentPaymentsPrevoutsSummary instead rejects the whole transaction when any native prevout is a witness program with version greater than one. The scanner alone therefore would not detect a sender regression that admitted such an input. Before summing keys, return no matches for native witness versions above one, while retaining P2A's version-one behavior and other unrecognized scripts. Add a unit case containing an eligible input, a v2 input and an otherwise matching output.
[suggestion] · SP fee-bump refusal paths lack negative tests
The intact-record reload tests do not detect removal of the missing-recipient or output-mismatch refusal in CreateRateBumpTransaction.
Location: src/wallet/feebumper.cpp:263 (head).
Details and suggested fix
The reload test preserves sprecipients and expects a successful bump, so it does not exercise either fail-closed check. Both exceptional states are representable on disk: the SP marker is stored separately from the recipient record, and an unreadable record only causes a noncritical load error. Add two no-outputs bump cases that retain the marker: unload the wallet and delete the record in one case, and replace it with valid but wrong recipients in the other, then reload. Reuse the sendall/maxconf fixture with a spare confirmed coin so an unsafe bump would add an input. Assert the corresponding bumpfee error and an unchanged mempool.
[suggestion] · SP recipient tests do not associate discovered outputs with amounts
Swapping the amounts paid to two SP recipients would preserve their discovered-output counts and pass the current multi-recipient assertions.
Location: test/functional/wallet_silentpayments_sending.py:512 (head).
Details and suggested fix
test_multiple_sp_recipients requests 3 BTC and 4 BTC for different scan keys, but assert_sp_outputs only checks that each recipient finds one output. A mismatch between the indexed derived scripts and recipient amounts would leave those counts unchanged. Map each discovered key back to its vout and assert the value, including the mixed-output case and a fee bump that adds an input. For sendall, assert the computed remainder split instead of fixed amounts, because do_send passes only addresses to that RPC.
[suggestion] · sendall's SP-incompatible-coin refusal lacks coverage
The P2WSH-only test reaches the no-eligible-input error, not the guard preventing an SP sweep from silently leaving incompatible coins behind.
Location: src/wallet/rpc/spend.cpp:1626 (head).
Details and suggested fix
Without explicit inputs, SP sendall refuses the sweep when AvailableCoins skips an SP-incompatible coin. The current P2WSH-only fixture does not set that flag: P2WSH coins are permitted inputs but do not contribute to the shared secret. Fund both an eligible P2WPKH coin and a tr(<xonly pub>,pk(<private key>)) coin whose output-key private material is unavailable. Assert the skipped-coins error and that nothing was spent. Then select only the P2WPKH coin through inputs and verify the payment with scan_tx. This would exercise the sweep-specific guard rather than only individual input eligibility.
[suggestion] · GUI SP fee-bump interactions lack Qt coverage
The Qt fee-bump fixture does not exercise SP-specific unlock ordering, recipient forwarding, unsigned-option suppression or cancellation relocking.
Location: src/qt/walletmodel.cpp:456 (head).
Details and suggested fix
WalletModel::bumpFee now unlocks before constructing an SP replacement, forwards sp_recipients through creation and commit, and suppresses the PSBT option. The existing fee-bump fixture uses ordinary PKHash sends in an unencrypted wallet, so it cannot detect removal of the early unlock or loss of the recipient list across the interface. Extend MiniGUI with an SP transaction created through the wallet API, then bump it from a locked encrypted wallet with PSBT controls enabled. Assert that unlocking precedes confirmation, no unsigned option is offered, cancellation restores the lock, and a committed replacement retains its recipients.
[suggestion] · The oversized sendall test accumulates a second input pool
The first rejection leaves 1600 coins unspent, so the SP iteration adds another pool and processes about 3200 inputs without testing a different size boundary.
Location: test/functional/wallet_sendall.py:599 (head).
Details and suggested fix
sendall_fails_with_transaction_too_large refills the keypool, funds 1600 outputs and mines inside the target loop. The expected size error occurs before signing or commit, leaving those coins unspent. The SP iteration then funds another 1600 outputs and derives SP outputs using the combined pool before rejecting it. Move the funding and mining before the loop and assert both rejections against the same 1600-coin set, which is already too large for either target.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [minor]: Fallback skips eligible anchors with non-positive effective value
- [suggestion]: Anchor retries can bypass least-waste selection
- [suggestion]: Measure repeated anchor-selection retries
- [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]: Placeholder replacement metadata affects wallet behavior after downgrade (earlier report)
- [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]: Ancestor-funding test repeats without exercising SP funding (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)