WIP: feat: Support sending silent payments

bitcoin-core/gui-qml: PR #1141

3 minor findings · 4 suggestions

Earlier concerns neither republished nor resolved: 1 minor finding · 1 suggestion. See the Run archive for their assessments.

Findings

Link

[minor] · Optional sp instructions make usable fallback payment links fail

An invalid optional sp now rejects the URI, while a valid one discards the on-chain fallback, preventing watch-only and external-signer wallets from paying links accepted at base.

Location: qml/models/bitcoinuri.cpp:63 (head).

Details and suggested fix

BitcoinUri::Parse handles sp and req-sp identically: an invalid Silent Payments address is fatal, and a valid one overwrites result.address. SendCreate.applyParsedPaymentRequest then applies only that address, so prepareTransactionInternal rejects the payment when privateKeysDisabled() or hasExternalSigner() is true. At base, both links retained their valid path address because unknown optional parameters were ignored. Preserve the path as a fallback and retain whether Silent Payments is required. Use the fallback when optional sp instructions are invalid or unsupported by the wallet, while keeping unusable req-sp instructions fatal.


Link

[minor] · Fee bumping removes the original transaction's Silent Payments address history

Transaction details and search use CWalletTx::m_sprecipients, which Core clears and deletes from the wallet database when the transaction is replaced.

Location: qml/models/transactionactivitymodel.cpp:356 (head).

Details and suggested fix

SilentPaymentAddresses reads only wallet_tx->m_sprecipients. A normal fee bump calls CWallet::MarkReplaced, which clears those recipients, erases their database record, and emits CT_UPDATED for the original transaction. The next readSnapshot overwrites the cached address list with an empty list, removing the details row and the address from that transaction's search text; reloading does not restore it. This also leaves the address missing if the original transaction later confirms instead of its replacement. Retain durable history metadata separately from the RBF working records and expose it through interfaces::Wallet.


Link

[minor] · Silent Payments request labels and messages are absent from review

Silent Payments links with a label or message reach confirmation without that request context, although the recipient retains it and the address and amount remain visible.

Location: qml/pages/wallet/SendCreate.qml:533 (head).

Details and suggested fix

applyPaymentRequest stores the URI label and message in m_request_label and m_message, but paymentRequestNote returns an empty string for Silent Payments. captureReviewedRecipients copies only recipient->label(), and the review delegate uses that note as its title alongside the address, amount, and generic request badge. Ordinary URIs containing a message carry this context through the note, but Silent Payments links do not. Include the request label and message in separate review-only snapshot fields so the user can check the payee and purpose without saving them as private notes.


Optional improvements

Link

[suggestion] · Silent Payments fee-bump state transitions lack regression coverage

The updated tests leave rbf_needs_sp_outputs false and never return recipients, so they do not exercise prepare-time unlocking, pre-signing, or recipient forwarding.

Location: test/test_bumptransactionmodel.cpp:119 (head).

Details and suggested fix

MakeBumpableWallet does not configure get_wallet_tx_fn, and every creation callback leaves the Silent Payments recipient vector empty. Add a locked-wallet fixture returning rbf_needs_sp_outputs=true and recipients. Verify that preparation requests a password, permits retry after an incorrect password, signs exactly once, relocks, and commits nothing before confirmation. Confirmation should forward exactly the returned recipients without signing again. Also cover failure on missing recipients and rejection of a stale prepareFeeBumpWithPassphrase submission after reset(). These assertions would exercise the new behavior rather than only adapting the existing mock signatures.


Link

[suggestion] · interfaces::Wallet is bypassed for Silent Payments commit and history

The new send and history paths require raw CWallet access instead of the mockable wallet interface, making recipient forwarding and history behavior harder to unit-test.

Location: qml/models/walletqmlmodel.cpp:2730 (head).

Details and suggested fix

The pinned interfaces.cpp forwards sp_recipients through the bump methods, but commitTransaction still accepts only the transaction and messages, and interfaces::WalletTx exposes no recipients. Consequently, sendTransactionInternal calls CWallet::CommitTransaction directly, while SilentPaymentAddresses reads CWalletTx::m_sprecipients under cs_wallet. Extend the upstream interface to carry commit recipients and expose them in transaction snapshots so tests can supply and assert this data without a real backend. ReviewMockWallet can already provide a raw CWallet, so the current path is testable, but only through that heavier integration setup. Until the interface is available, isolate the direct accesses in an integration helper.


Link

[suggestion] · The Core-bump commit leaves the password-wallet fixture incompatible

Source inspection shows the password-wallet helper would fail after 7d010269 until b0e2c9f4 repairs its deprecated RPC call; the final tree already contains the fix.

Location: test/functional/qml_test_password_wallet.py:254 at 7d01026990aa (parent of b0e2c9f40bbd) (commit).

Details and suggested fix

7d01026990aa0d6b69f16b8acef7dfce37209e1c bumps Core while leaving configure_fallback_wallet calling encryptwallet. Its node launcher and generated configuration do not enable -deprecatedrpc=encryptwallet, so the new Core gate throws RPC_METHOD_DEPRECATED; base Core had no such gate. b0e2c9f40bbd45b9e95541a16949c7b2939c4556, whose direct parent is that feature commit, replaces the call with a createwallet passphrase and repairs the fixture. Fold that fix into the dependency-bump commit and mention the deprecation there, preserving a usable intermediate test revision without changing the final code.


Link

[suggestion] · The fee-rate overflow fix is buried in the Silent Payments feature commit

The feature commit mixes an independently backportable custom-fee parsing fix with Silent Payments adaptations and mechanical include reordering, making the separate behavior change harder to review.

Location: qml/models/walletqmlmodel.cpp:204 at 7d01026990aa (commit) (commit).

Details and suggested fix

7d01026990aa0d6b69f16b8acef7dfce37209e1c adds an overflow guard to ParseCustomFeeRatePerKvB before multiplying the whole part by FEE_RATE_BASIS_VBYTES. This changes ordinary custom-fee parsing independently of Silent Payments. Move that guard into a small preceding fix commit, ideally with a regression test, so it can be validated and backported separately. Keep purely mechanical include moves in a separate commit or omit them, leaving necessary Silent Payments header additions with the feature. The prepare-time unlock and its dependent SpeedUpOverlay.qml changes should remain together.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.

Background

Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.

Documented decisions

Silent Payments require retaining the original recipient destinations because fee replacement may change the inputs, requiring the payment outputs to be derived again. The upstream proposal explicitly introduces persisted recipient data for RBF and prevents older wallet software from replacing these transactions.

The inspected pinned fee-bumper change reconstructs original Silent Payments scripts from the original inputs and stored recipients before rebuilding destinations. It rejects missing recipient data when the transaction is marked as requiring it, and rejects recomputed outputs that do not match. The application's fee-bump workflow therefore depends on recipient identity and derivation data, not merely preservation of the old Taproot scripts and amounts.

Source 1

The upstream design deliberately blocks transaction-creation workflows that would leave a Silent Payments transaction unsafe to fee bump later, including PSBT creation and sending without adding the transaction to the wallet.

The pinned RPC diff gives the associated safety rationale: outputs depend on input private keys, and an exported transaction can be signed elsewhere or have its inputs changed, leaving outputs the recipient cannot find. Thus the GUI's save/export and direct commit paths cross a substantive safety boundary, rather than only a serialization/API change. The precise pinned commit and persistence implementation remains a coverage gap.

Source 1

Ralph's inferences

Transaction construction now distinguishes a payment destination from an already-known output script. At the base, the spend interface has no Silent Payments construction helpers; at the head, it provides size-equivalent dummy outputs, input checks, actual output derivation, and recipient extraction. A dummy output supports sizing or dust checks, not final payment execution.

The GUI owns a separate no-change send-all constructor. Its inspected head implementation uses dummy outputs for estimation, but derives actual Silent Payments scripts from the selected input set for a real transaction. This preserves the distinction between an editing-time estimate and an executable payment, while retaining the existing fee, size, dust, and signing checks.

Ordinary spendability is no longer sufficient input eligibility for a Silent Payments transaction. Shared-secret-contributing inputs require accessible private keys, and construction must include at least one contributing input. Inputs that do not contribute to derivation are not necessarily prohibited.

The pinned input-check and derivation diffs distinguish contributing script types from other spendable inputs, reject unknown witness versions and certain external inputs, and fail when no contributing keys are available. The GUI's send-all path enumerates ordinary available coins with Silent Payments filtering disabled, then checks each input during real preparation. Consequently, its maximum-amount estimate is not itself evidence that this input set can produce an executable Silent Payment.

Recipient derivation order is part of the metadata contract, distinct from physical transaction-output position. The head helper specifies Silent Payments recipients in derivation order: recipients first, followed by a Silent Payments change destination when change exists.

The GUI's send-all constructor supplies an index-to-destination map and installs the derived scripts at those indices. Its metadata and review mapping must preserve the corresponding recipient identities and derivation sequence. The inspected evidence does not establish that the normal Core constructor preserves the exact physical output ordering assumed by the GUI's new snapshot logic.

Private-key access is needed during Silent Payments construction, before ordinary transaction signing. Therefore an unsigned construction request is not necessarily a locked-wallet-safe operation, even though a script-size estimate can avoid private-key derivation.

The head spend interface explicitly ties eligible-input checks to private-key availability. The GUI's copied send-all constructor separates estimate-only construction from actual derivation and separately invokes signing afterward. This explains why preparation and replacement preparation can need unlocking before the user reaches final send confirmation; access to keys and authorization to broadcast are separate workflow stages.