4 minor findings · 3 suggestions
Earlier concerns neither republished nor resolved: 1 major finding · 3 minor findings · 2 suggestions. See the Run archive for their assessments.
Findings
[minor] · Silent-payments fallback can bypass avoid-partial-spends grouping
When the fallback adds an eligible coin, other coins with the same address may remain unspent even when avoid-partial-spends is enabled.
Location: src/wallet/spend.cpp:1020 (head).
Details and suggested fix
The fallback runs when the initial selection has no BIP352-eligible input. It removes one eligible coin from available_coins and adds it to the presets. If the presets cover the target, SelectCoins returns the manual preset result before automatic selection or GroupOutputs runs, so the anchor's other UTXOs with the same scriptPubKey are not added. If the presets do not cover the target, those UTXOs remain in the pool, but selection is not required to include them.
m_avoid_partial_spends can be enabled by -avoidpartialspends, by avoid_reuse wallets, or by the default APS retry in CreateTransaction. In these cases, the transaction can spend only part of an address's coins. On avoid_reuse wallets, the leftover coins are also marked used and excluded by default. This behavior is confined to the fallback path; for example, it can occur in wallets mixing P2WSH coins with a few eligible coins.
When m_avoid_partial_spends is set, choose the anchor from eligible OutputGroups, or preset all available coins with the anchor's scriptPubKey up to OUTPUT_GROUP_MAX_ENTRIES. Add a test with several eligible coins at one address. No concrete wallet UTXO set that reaches this fallback was identified, so its production frequency is unknown.
[minor] · bumpfee can direct change to an address-less script
Although the destChange refactor is described as behavior-preserving, an original_change_index pointing to an OP_RETURN output now directs the remainder there instead of using fresh wallet change.
Location: src/wallet/feebumper.cpp:328 (head).
Details and suggested fix
In the base version, CreateTransactionInternal treated a CNoDestination destChange as no custom change and reserved a fresh change address. The new code wraps every ExtractDestination result in a PaymentDestination, including the CNoDestination returned for OP_RETURN, bare multisig, and nonstandard scripts, and assigns it to destChange. CreateTransactionInternal then uses that script as the change prototype.
If bumpfee is called with original_change_index pointing to an OP_RETURN output, the remainder, including any surplus from added inputs, is paid into that output. Because the unspendable script's dust threshold is zero, the transaction can be signed and broadcast. The base version instead dropped that output and used fresh wallet change, although the RPC help says the remainder goes to the original change output's script.
An owned bare-multisig output detected as change also receives the change under the new behavior. The check requiring at least one recipient no longer fires when every output is such a script. Restore the base behavior by setting destChange only for valid destinations or PubKeyDestination, or reject an original_change_index whose script has no address. Triggering the OP_RETURN case requires the caller to point original_change_index at that output; no such usage was identified.
[minor] · Malleated silent-payments variants lose recipient metadata
A scriptSig-malleated variant can be stored without silent-payments metadata, allowing a post-reorg fee bump that may make its payment undiscoverable by BIP352 scanning.
Location: src/wallet/transaction.h:213 (head).
Details and suggested fix
SyncMalleatedTxMetadata copies replacement IDs, comments, and messages between malleated wallet-transaction variants, but not m_rbf_needs_sp_outputs or m_sprecipients. WriteFullTx writes the recipients record only when the vector is non-empty.
For example, a miner could include a consensus-valid scriptSig change to a silent-payments transaction with a P2PKH input, producing a new txid. The wallet can learn that variant without either field set. If the block is later disconnected and the user bumps the variant, the missing-recipient guard does not fire. The existing silent-payments output remains a fixed P2TR script, and any added input makes it undiscoverable by BIP352 scanning. The variant is also saved without the tag, so an older release could bump it.
Copy the flag and recipients when syncing metadata, and write the recipients record for each variant. This requires a miner-included malleation, a reorg, and a user-initiated bump. No occurrence was identified, so its production frequency is unknown.
[minor] · Fallback anchor can exceed the requested transaction weight limit
With ineligible preset inputs, send can exceed the caller's max_tx_weight or the TRUC limit because the fallback does not check combined input weight.
Location: src/wallet/spend.cpp:1009 (head).
Details and suggested fix
This can occur when preset inputs already cover the target but none is BIP352-eligible. The fallback adds one eligible wallet coin to the presets, but the anchor filter checks only that coin against max_inputs_weight. The second SelectCoins call returns the manual preset result early, bypassing the combined-weight check used after automatic selection. The final size check in CreateTransactionInternal compares only against MAX_STANDARD_TX_WEIGHT.
Thus send with ineligible inputs, add_inputs=true, and a max_tx_weight close to the presets' weight can produce a transaction above the requested limit, despite the RPC help saying construction fails when the limit cannot be met. With version=3, the limit is TRUC_MAX_WEIGHT, so the resulting transaction would be rejected by mempool policy.
Before accepting an anchor result, check the combined input weight as the merge path does, then try another anchor or return a weight error. No caller combining these options was identified, so the production frequency is unknown.
Optional improvements
[suggestion] · Fee-bump behavior for relearned silent-payments transactions is unclear
After restoring a backup from before a silent-payments send, bumpfee may add inputs while keeping the old output, making the payment undiscoverable by the recipient's scan.
Location: src/wallet/feebumper.cpp:263 (head).
Details and suggested fix
bumpfee treats a transaction as a silent-payments transaction only when m_rbf_needs_sp_outputs or m_sprecipients is set. Those fields are set only in CommitTransaction.
A wallet restored from a backup made before an unconfirmed silent-payments send, or another wallet loaded with the same descriptors, can relearn the transaction through AddToWalletIfInvolvingMe without either field. bumpfee then treats the silent-payments output as an ordinary P2TR recipient. It may add inputs when existing change cannot cover the higher fee, as happens for changeless or sendall transactions. The recipient's scan of the replacement then no longer finds the output.
The comment on EnsureSilentPaymentsTxIsAddedToWallet acknowledges this relearned-transaction case, but the new restrictions cover only creation paths. One option is to document the backup caveat in the bumpfee help and release notes. Another is to refuse, or require explicit opt-in before, adding inputs when bumping a transaction that pays unowned P2TR outputs and has no creation record. That second option would also affect ordinary taproot payments. Decide which behavior is intended to determine whether this recovery case needs code or documentation.
[suggestion] · Silent-payments RPC behavior and address validation are undocumented
New RPC behavior and restrictions lack a release note, and validateaddress help does not explain silent-payments addresses or their omitted scriptPubKey.
Location: src/rpc/output_script.cpp:81 (head).
Details and suggested fix
This change lets sendtoaddress, sendmany, send, sendall, and bumpfee accept silent-payments addresses as outputs. It also refuses psbt=true and add_to_wallet=false for silent-payments transactions, makes psbtbumpfee refuse them, and rejects silent-payments change_address values in fundrawtransaction and walletcreatefundedpsbt. It adds a sprecipients wallet record. validateaddress now returns isvalid=true for silent-payments addresses without a scriptPubKey and with iswitness=false.
No doc/release-notes-35302.md is included. The RPC help still describes address arguments as a “bitcoin address,” and the validateaddress result help does not cover the silent-payments case. A client that expects scriptPubKey whenever isvalid=true will fail for these addresses.
Add a release note as requested by doc/developer-notes.md, and update the validateaddress help to explain that scriptPubKey is omitted for silent-payments addresses.
[suggestion] · Placeholder replacement metadata affects wallet behavior after downgrade
After a downgrade, unconfirmed change from a silent-payments transaction may be treated as unsafe, and RPCs may report a nonexistent replacement txid until the transaction confirms.
Location: src/wallet/transaction.h:304 (head).
Details and suggested fix
Older releases read the SILENT_PAYMENTS_TX_TAG placeholder as m_replaced_by_txid. The change description mentions that this blocks bumpfee, but the placeholder also affects unconfirmed wallet outputs: base AvailableCoins marks outputs of transactions with m_replaced_by_txid as unsafe. After a downgrade, the wallet therefore skips unconfirmed change unless include_unsafe is set, for example when trying to CPFP a stuck transaction. gettransaction and listtransactions also report replaced_by_txid as a txid that does not exist.
These effects last only until the transaction confirms. Mention them in the release note. If CPFP after a downgrade matters, consider whether a different marker is needed. This assumes older releases handle replacement metadata as the base code does; their sources were not available to confirm that behavior.
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