WIP: qt: refactor QML frontend onto owned models

bitcoin-core/gui-qml: PR #1142

Provider refusals

write_verifier: Provider declined the request because of a cybersecurity restriction. Experiments remain incomplete; static verification can continue.

1 major finding · 4 minor findings · 7 suggestions

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

Findings

Link

[major] · Backup can rename over a loaded wallet's live database

On POSIX, explicitly approving a backup over an unchanged loaded wallet database can replace its directory entry and lose the destination wallet's keys on reload; this is established by source inspection, not a completed reproduction.

Location: qml/models/backuppolicyio.cpp:149 (head).

Details and suggested fix

From wallet A, select <walletdir>/B/wallet.dat and approve “Replace backup”. The chooser accepts .dat, and ReadTarget checks file type and bytes but not whether the destination is a wallet database. backup::Write backs A up into a sibling staging directory, rechecks B's bytes, then calls RenameOver. On POSIX this replaces B's pathname while B's open SQLite handle still refers to the old inode. After B unloads or the app restarts, its path contains A's database; B's keys require an independent backup to recover. Base instead wrote the destination through SQLite, where B's exclusive lock refused the write. The destination must remain byte-identical through installation; Windows behavior was not assessed. Refuse destinations inside the wallet database directory or matching loaded database file identities, checking during inspection and before installation, and add a two-wallet regression.


Link

[minor] · Closing Address details can discard text entered during the initial read

Text entered while the note editor is Loading can be discarded without a Save/Discard question when Address details closes; the conditional mechanism is source-supported, but its practical frequency was not measured.

Location: qml/models/texteditsessionmodel.cpp:404 (head).

Details and suggested fix

AddressDetails.qml permits editing while TextEditSessionModel::available() is true, including Loading. During that phase, State::edit stores text only in pending_input, leaving the reducer clean. requestClose() forwards directly to the reducer, whose Loading branch closes immediately, and AddressList closes the popup on closed. A refused edit submission can similarly leave visible GUI text absent from the reducer. Make close account for the latest GUI input sequence and defer its decision until any initial input has been reconciled. Cover both a held initial read and a refused edit followed by close.


Link

[minor] · PSBT readiness ignores the submission path's fee caps

An otherwise acceptable, fully signed imported PSBT can receive affirmative readiness despite exceeding submission fee caps, then fail Broadcast or be recorded without relay by wallet Send; the recording behavior predates this PR.

Location: qml/psbtwork.cpp:691 (head).

Details and suggested fix

ReadAdmission passes 0 for testmempoolaccept's maxfeerate, disabling its independent fee cap. An over-cap transaction can therefore return allowed, which Evaluate presents as “The node currently accepts this exact transaction”. Submission uses different constraints: NodeBroadcast passes DEFAULT_MAX_RAW_TX_FEE_RATE as both an absolute cap and a rate cap, while wallet Send records the transaction before broadcasting under m_max_tx_fee and m_max_tx_fee_rate. Thus an excessive fee is a predictable submission obstacle even without a policy change between review and confirmation. Compare the authenticated fee against the selected submission path's caps before reporting readiness or enabling submission.


Link

[minor] · The new Sign-only action rejects already-signed foreign inputs

The new “Sign only” action inherits the existing Send ownership gate and is hidden for mixed-input PSBTs even when foreign inputs are already signed and this wallet can provide every remaining signature.

Location: qml/psbtwork.cpp:683 (head).

Details and suggested fix

PrepareReview includes owned_inputs in both key_can_send and can_commit_complete. currentTransactionCanSignOnly() then requires m_current_transaction_can_send && m_psbt_key_can_send, so any foreign input hides the action and can produce “This wallet does not have the keys to sign this transaction”. Pinned Core's DescriptorScriptPubKeyMan::FillPSBT skips finalized inputs and signs the others individually. Compute Sign-only eligibility from the outstanding unsigned inputs the wallet can sign, independently of commit eligibility. Keep the all-input ownership restriction for Send and retain the fee-proof and transaction-identity checks.


Link

[minor] · Backup confirmation has no height bound for long paths

The final-path confirmation has no height cap or scrolling, so sufficiently long paths can place its actions beyond the window; this is a source-level layout risk, not a rendered reproduction.

Location: qml/components/WalletBackupConfirmation.qml:19 (head).

Details and suggested fix

WalletBackupConfirmation.qml derives implicitHeight from the entire ColumnLayout, centres it vertically, and puts Cancel/Replace below a Text.WrapAnywhere path. Inspection permits paths up to 32768 bytes, but the popup has neither an overlay-height limit nor a scrollable path area. WalletSectionPage disables the chooser's overwrite confirmation, making this the approval surface. Escape still refuses the operation. Cap the popup to the overlay's available height, keep its actions visible, and scroll the path content. Add a long-path case at the minimum window size.


Optional improvements

Link

[suggestion] · Signer verification accepts signatures that do not commit to all outputs

As defense in depth, signer verification lacks an output-commitment restriction: valid SIGHASH_NONE/SIGHASH_SINGLE contributions can pass, although no supported device returning those types was established and this is not a new regression.

Location: qml/psbtsignatures.cpp:108 (head).

Details and suggested fix

VerifyPartialInputs checks encoding, key membership, and cryptographic validity, while VerifiedSignatures and VerifiedExternalTransaction rely on script verification. None requires an output-committing sighash. The pinned ExternalSigner::SignTransaction replaces the PSBT with the signer's response. Matching the reviewed transaction prevents substitution inside the app, but does not strengthen signatures after publication: for example, a transaction with every input signed SIGHASH_NONE permits others to rewrite its outputs. Require wallet-input signer contributions to commit to all outputs before accepting them. Reject NONE, SINGLE, and their ANYONECANPAY variants, while allowing ALL|ANYONECANPAY, and add a signer-mock regression.


Link

[suggestion] · macOS artifact instructions omit preparation of the new helper

The macOS instructions prepare only bitcoin-core-app, although onboarding now executes the sibling bitcoin-core-profile-inspector; an unprepared helper can block profile checks, but no macOS failure was reproduced.

Location: .github/workflows/artifacts.yml:80 (head).

Details and suggested fix

artifacts.yml uploads both executables, while README's chmod +x and codesign -s - command names only bitcoin-core-app. profileinspection::Run locates the helper through applicationDirPath(). For wallet-enabled builds with an existing effective wallet directory, a helper start failure becomes a profile-preview error rather than an empty-wallet result. Document keeping both binaries together and making both executable and signed, or package them with the required permissions and signatures intact.


Link

[suggestion] · Retained secret QString storage is released without cleansing

Retained secrets use ordinary QString storage that is not cleansed on final release; only transient UTF-8 bytes are scrubbed, and QML-side copies remain outside any guarantee.

Location: qml/secretinput.cpp:42 (head).

Details and suggested fix

Input retains m_text, but Input::~Input() is defaulted. materialize() cleanses its temporary QByteArray, leaving the retained UTF-16 allocation untreated. When Input is the final owner, destruction can therefore leave plaintext in freed heap storage. Because QString is implicitly shared, do not overwrite storage still owned by a caller. Cleanse exclusively owned storage when m_text.isDetached() before releasing it on Cleanup, preserving the existing inventory and lifetime accounting, and document the limitation for shared QML-side copies.


Link

[suggestion] · The settings-model introduction presents a superseded edit-budget policy

c2ca86bb introduces whole-state reservations per keystroke and 3c94c0a0 corrects that new code; folding the correction and test into the introduction would make the admission policy easier to review without changing head behavior.

Location: qml/models/settingseditormodel.cpp:47 at 3c94c0a07945 (commit) (commit).

Details and suggested fix

c2ca86bb84db99e23b7f9bf195082d9da4786146 introduces SettingsEditorModel, charging 393216 Domain bytes for every command. 3c94c0a07945314f694747ccf3728322dc2ff5ba changes that same new model to charge each edit's actual payload and adds typingAheadOfTheDomainKeepsEveryKeystroke. Fold the latter commit, including its regression and L-02 explanation, into the model introduction. The area commits are already documented as not building independently, so this preserves the final tree while avoiding a separate review of accounting that the series immediately supersedes.


Link

[suggestion] · The startup rewrite removes error routing that a later commit restores

54cb9d94 removes StartupErrorInWindow, and b6f406d8 restores its routing; folding the repair into the rewrite would preserve review continuity rather than presenting a temporary behavior removal as part of the refactor.

Location: qml/bitcoin.cpp:831 at b6f406d83b9e (commit) (commit).

Details and suggested fix

At direct parent 44bb4357d40140c78370eb73fff0e71582b127f3, the in-window error path exists. The infrastructure rewrite 54cb9d94467be3a11128d52d702f2ed740ad3029 removes it. Later, b6f406d83b9e3c22715cab35bfa8ca039a8f497b restores StartupErrorInWindow, the startup_error_window handoff around preparation, message routing, and cancellation exit handling. Fold that repair into 54cb9d94467be3a11128d52d702f2ed740ad3029, retaining the startup-error scenario references in its message. This is a sequencing suggestion: the final tree already contains the repair, and the separate patch has no intervening bitcoin.cpp change to preserve.


Link

[suggestion] · Fixes #1063 identifies the helper commit rather than fee enforcement

c5b69bca adds authenticated-fee helpers but leaves imported-PSBT submission unchanged; attributing the fix to the later enforcement commit would make the security check easier to locate without changing the final tree.

Location: qml/models/psbtfeeservices.cpp:6 at c5b69bca3c94 (commit) (commit).

Details and suggested fix

c5b69bca3c94c49ee1446fe5cdd9e04349d879d0 adds fee-authentication helpers and tests, but WalletQmlModel still finalizes imported PSBTs and calls commitTransaction without using them. It also includes qml/psbtdocument.h, introduced later with the PSBT extraction. The broadcast enforcement through psbtfee::MatchesReview arrives in 3b93b03c6d1becb12193fcf739d6a9112c017c14. Reword the helper commit as adding authenticated-fee computation, and move Fixes #1063 to the commit that routes review and broadcast through that computation. The series is explicitly non-building between area commits; this concerns accurate attribution, not a new intermediate-build claim.


Link

[suggestion] · The amount-parsing fix introduces paste routing before its component

5e6b888d mixes the decimal-comma fix with CapturedPaste import routing whose component arrives in 25e1d309, forcing reviewers to resolve a later contract while assessing exact amount parsing.

Location: qml/controls/BitcoinAmountInputField.qml:70 at 5e6b888d5039 (commit) (commit).

Details and suggested fix

5e6b888d5039c2db6711bc800bf10c33bbb64c61 adds exact parsing and BitcoinAmount::paste(), but also instantiates CapturedPaste and rewrites payment-URI provenance handling in BitcoinAmountInputField.qml. CapturedPaste.qml is introduced only by the payment-import extraction 25e1d309f28c6b4a3febfeafa016aceec7788b7c. Move the captured-paste wiring and payment-URI provenance hunks into that extraction, keeping exact parsing, input state, and literal paste() behavior in the #1081 fix. This would make each area's contract review local to its implementation; it does not claim independent buildability for the already non-building series.


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

Receive-request status deliberately distinguishes current credit from historical use. Earlier GUI-QML work made the payment badge follow the currently received amount, including replacement away to zero and subsequent renewed payment, while retaining historical sharing and editing restrictions.

This is the historical reason that the changed receipt-reconciliation and request-editor behavior cannot be understood as one permanent 'paid' flag. Current payment observation and whether an address/request has previously been used serve different purposes. This records the earlier intended distinction without establishing the correctness of the new implementation.

Source 1 · Source 2