WIP: feat: Support sending silent payments

bitcoin-core/gui-qml: PR #1141

2 minor findings · 7 suggestions

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

Findings

Link

[minor] · Optional sp discards a usable ordinary-address fallback

Hybrid payment links that previously supported ordinary-address payment now fail for watch-only and external-signer wallets, or are rejected outright when optional sp instructions are invalid.

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

Details and suggested fix

Base BitcoinUri::Parse kept the validated path address and ignored optional sp. The new scan handles sp and req-sp identically: an invalid value rejects the URI, while a valid value overwrites result.address. applyParsedPaymentRequest imports only that address, and preparation then refuses SP for wallets without local private keys. Consequently, bitcoin:<valid address>?sp=<valid SP address> loses its ordinary-payment workflow, and an invalid optional value rejects an otherwise usable link. Retain the path address and whether SP was required, then offer an explicit ordinary-address fallback when optional SP cannot be used. An explicit choice avoids silently accepting the address-reuse privacy tradeoff; unusable req-sp must still fail.


Link

[minor] · Speed up erases the original transaction's SP history identity

After Speed up, the original transaction loses its silent-payment address in details and address searches, including after reload or if it later confirms; the replacement retains its own recipient metadata.

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

Details and suggested fix

SilentPaymentAddresses reads only CWalletTx::m_sprecipients, but the pinned Core treats these as RBF working records. Its fee-bump commit calls MarkReplaced, which clears the original's recipients, erases their database record, and emits CT_UPDATED. The GUI then overwrites its cached addresses with an empty list and removes them from details and search terms. Reloading cannot recover the erased data. This also affects an original that subsequently confirms, which rebuildRows correctly treats as active. Use durable history recipient metadata exposed through the wallet interface rather than records whose lifetime ends at replacement, or explicitly narrow the history feature's contract.


Optional improvements

Link

[suggestion] · New SP authorization, review matching, and URI branches lack regression coverage

The adapted tests still exercise ordinary payments, leaving SP preparation authorization, recipient forwarding, positional review matching, and sp/req-sp parsing unchecked.

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

Details and suggested fix

MakeBumpableWallet never installs get_wallet_tx_fn, so every bump test gets rbf_needs_sp_outputs=false; the commit lambdas also ignore the recipient vector. Add a locked encrypted-wallet case with the SP marker and nonempty recipients. Assert that preparation requests the password, signs once, relocks, and reaches NeedsConfirmation without committing. Confirmation should forward the same transaction and recipients without another unlock or signature. Cover missing recipients and stale or mismatched passphrase submissions as well. The other new branches need sp/req-sp URI cases, including empty paths, invalid values and duplicates, plus SP review snapshots with change at each output position.


Link

[suggestion] · Fixed-amount SP drafts cannot preview fees before preparation

Locked encrypted wallets require preparation to compare fixed-amount SP fees; a placeholder preview could avoid that step, but would not validate SP input eligibility.

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

Details and suggested fix

The explanatory footer makes the deferral clear, but users must still enter their password and prepare a transaction just to see or compare fees. Consider a preview-only recipient copy replacing SP destinations with PaymentDestination{dest.GetTxDestination()}. The pinned API returns a placeholder WitnessV1Taproot specifically for output type and size, and Use maximum already previews dummy outputs. Do not pass SP destinations unchanged into ordinary unsigned construction: without SP derivation, Core reaches Assert(dest.GetScript()). Keep this estimate explicitly approximate, since substituting ordinary placeholders skips SP input-eligibility filtering and may select coins that actual preparation rejects.


Link

[suggestion] · SP payment-request context disappears before review

SP URI imports with a message lose that context at review, unlike ordinary imports that copy the message and optional label into the note.

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

Details and suggested fix

paymentRequestNote returns an empty string for SP imports, and allValid rejects a nonempty SP note. Although the send form displays the URI label and message, captureReviewedRecipients retains only recipient->label() and the payment-request flag. Review consequently shows the address, amount and generic request badge without the request's stated payee or purpose. Carry the URI label and message in separate review-only fields, clearly distinguished from a private note and from verified recipient identity.


Link

[suggestion] · SP commit and history bypass the mockable wallet interface

These paths require a real CWallet fixture instead of allowing interface mocks to supply SP history recipients or observe committed recipient metadata.

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

Details and suggested fix

sendTransactionInternal calls raw CWallet::CommitTransaction because the interface does not accept SP recipients, while SilentPaymentAddresses locks cs_wallet and reads m_sprecipients directly. Pure MockWallet tests therefore cannot exercise those behaviors through configurable interface responses. ReviewMockWallet can attach a real backend, so integration testing remains possible, but it does not provide the same control over metadata responses and commit assertions. Extend interfaces::Wallet::commitTransaction to accept SP recipients and expose history recipients through WalletTx in the dependency PR.


Link

[suggestion] · The Core-bump commit omits its required encryptwallet test adaptation

Source inspection predicts deprecated-RPC failures in the affected functional-test paths at 7d01026; the subsequent fixture commit fixes head but leaves the bump revision without its required adaptation.

Location: test/functional/qml_test_send_receive.py:623 at 0fced52dc152 (commit) (commit).

Details and suggested fix

7d01026990aa0d6b69f16b8acef7dfce37209e1c bumps Core while leaving encryptwallet calls in qml_test_send_receive.py and qml_test_password_wallet.py. The pinned Core rejects that RPC unless -deprecatedrpc=encryptwallet is enabled, which the ordinary harness configuration and startup do not do. 0fced52dc1523029f44542161028e41ebe40e6f5 subsequently replaces those calls with passphrase-enabled createwallet and walletlock where needed. Fold that fixture adaptation into the Core-bump commit and explain the deprecation dependency in its message. This preserves final behavior while making the dependency transition independently testable.


Link

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

Separating the existing custom-fee parser's overflow fix would let it be reviewed and backported without the silent-payment feature or Core dependency bump.

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

Details and suggested fix

7d01026990aa0d6b69f16b8acef7dfce37209e1c adds the bound check before whole_part * FEE_RATE_BASIS_VBYTES in ParseCustomFeeRatePerKvB. This prevents signed overflow for sufficiently large custom rates and has no SP or new Core API dependency, but the feature commit message does not mention it. Extract the guard into a small preparatory commit, ideally with a large-rate regression test, so this correctness fix can be validated and backported independently.


Link

[suggestion] · The SP fee-bump authorization transition is mixed with URI and history work

The feature commit changes when passwords and signatures are requested alongside other GUI features, making the two-stage fee-bump authorization workflow harder to validate independently.

Location: qml/models/bumptransactionmodel.cpp:139 at 7d01026990aa (commit) (commit).

Details and suggested fix

In 7d01026990aa0d6b69f16b8acef7dfce37209e1c, SP replacement preparation requests the password and signs before fee confirmation; confirmation then skips unlocking and signing when m_bump_signed is set. SpeedUpOverlay adds the matching prepare-with-passphrase route. Separate the series into Core bump plus mechanical adaptations, SP sending, and the fee-bump authorization transition. Keep the new interface signatures and recipient forwarding in the mechanical adaptation, and keep BumpTransactionModel and SpeedUpOverlay authorization changes together. This gives the password, relock, signing and later-confirmation sequence a focused review boundary.


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

Avoiding ordinary address reuse is a central privacy constraint, including when designing compatibility fallbacks. In the BIP352 discussion, Josie Baker objected that publishing a static ordinary address alongside silent-payment instructions could encourage address reuse rather than eliminate it.

The changed BitcoinUri parser accepts an ordinary-address path together with sp instructions and selects the silent-payment address. This history explains why fallback behavior involves a privacy tradeoff, not just parsing convenience. It does not establish that every ordinary-address fallback is prohibited.

Source 1

Silent-payment sending was designed as input-dependent output construction, not simply decoding a new address into a fixed script. The original Core sending proposal explicitly included retrieving input private keys, creating silent-payment outputs during transaction construction, and making coin selection silent-payment aware.

At the pinned head, PaymentDestination distinguishes fixed scripts from silent-payment destinations, and input validation requires eligible private keys. This explains the GUI's local-key restriction and password request during preparation, before a final transaction is available for review. The underlying constraint is key access; the precise GUI workflow remains an application choice.

Source 1

Original silent-payment destinations must be retained for safe fee replacement because adding inputs can require deriving different payment outputs. The upstream sending proposal explicitly makes recipient persistence part of RBF support and prevents older software from replacing these transactions.

The pinned base fee bumper reconstructs recipients from existing output scripts. The head instead uses retained silent-payment destinations, recomputes their scripts, and rejects missing or mismatched recipient data. This explains why BumpTransactionModel now carries recipient metadata and may require unlocking before presenting the replacement fee.

Source 1

The upstream implementation deliberately restricts operations that would create a silent-payment transaction without preserving safe future fee bumping, explicitly including PSBT creation and sending without adding the transaction to the wallet.

This provides historical context for disabling silent-payment PSBT export and forwarding recipient metadata when committing the GUI transaction. These restrictions reflect the implementation's metadata and replacement-safety boundary, rather than a general claim that silent payments can never support PSBT or external signing.

Source 1 · Source 2

BIP321's query-parameter approach was proposed to allow gradual deployment of new payment methods without requiring every sender to understand every new address format. Allowing an empty address path provides an upgrade endpoint when a recipient no longer wants a legacy on-chain address.

The base GUI parser requires a conventional address in the URI path. The changed parser recognizes sp and req-sp instructions and permits an empty path when silent-payment instructions are present. This history explains both the new representation and the importance of distinguishing optional alternatives from required instructions.

Source 1

Sending and receiving support were intentionally made independently deployable. One stated adoption argument was that wider sending support makes silent-payment receiving practical sooner; the parent implementation subsequently described independent sending and receiving components.

The affected application behavior is sending through the existing wallet flow. Historical deployment goals explain why this can be useful without implying that the GUI also implements silent-payment address generation, scanning, or receiving.

Source 1 · Source 2

Ralph's inferences

Deferring the fixed-amount silent-payment fee display until preparation separates an unauthenticated draft preview from construction that needs eligible private keys. This is an application tradeoff, not evidence that approximate silent-payment fee estimation is inherently impossible.

TryPreviewFee explicitly declines ordinary fixed-amount silent-payment previews, while preparation unlocks the wallet and records the constructed transaction's fee rate. PaymentDestination also exposes a placeholder Taproot output type and size before final derivation.

Original silent-payment addresses serve as wallet-side recipient identity, distinct from the transaction's derived Taproot output addresses. History display therefore depends on retained metadata and cannot generally treat each output address as the original payment instruction.

TransactionActivityModel reads stored recipient destinations and substitutes a single silent-payment address only under restrictive single-action conditions. The same retained destinations are used by Core to reconstruct replacement outputs.

The temporary restriction on private notes is an application persistence limitation, not an inherent silent-payment privacy requirement.

The GUI persists outgoing notes through an address-book path that decodes conventional CTxDestination values and explicitly leaves silent-payment labels for future support. This explains the affected note workflow without conflating private notes with BIP352's separate receiver-label mechanism.