Repository navigation
Description
Summary
PR #128 preserves wallet-local PQC usage when signP2MRDataHash() returns an error after consuming signature capacity. A separate failure path remains when signing returns a result but qbit-qt's mandatory local VerifyP2MRDataSignatureProof() check rejects the generated proof.
That branch emits no portable proof and displays only the verification error, even though the signing attempt can carry a nonempty PQCUsageReport for counters already durably consumed.
Current behavior
In src/qt/signverifymessagedialog.cpp, the ordinary !result branch appends FormatPQCUsageStatus(*attempt.pqc_usage) to the error status. After a successful result, qbit-qt constructs and locally verifies the proof. If that verification fails, lines 677–682 set only:
Generated proof failed local verification: <error>
and return.
The proof output remains empty, which is correct, but the available usage report is discarded. PQC signing reserves and observes the stateful counter before returning a signature, so an invariant, provider, or cryptographic failure detected by local verification can leave capacity consumed without showing the affected key, count, remaining budget, state, or warning.
Steps to reproduce
- Use a synthetic
interfaces::Walletthat returns a successfulP2MRDataSignatureAttemptcontaining:- a deliberately corrupted or mismatched
P2MRDataSignatureResult; and - a nonempty
PQCUsageReportrepresenting a consumed counter.
- a deliberately corrupted or mismatched
- Submit a P2MR data-signing request through
SignVerifyMessageDialog. - Allow
VerifyP2MRDataSignatureProof()to reject the generated proof. - Observe that the proof output is empty and the status is red, but the status contains no PQC usage details.
Expected behavior
Every failure occurring after PQC capacity may have been consumed should preserve the local usage report, regardless of whether failure is returned by the wallet signer or detected by qbit-qt's post-sign verification.
Acceptance criteria
- On local generated-proof verification failure, append the available formatted PQC usage report to the error status.
- State clearly that the attempt failed after consuming PQC signature capacity when the report is nonempty.
- Keep the proof output empty and the status styled as an error.
- Do not add wallet-local usage, retry-key, or counter metadata to portable proof JSON.
- Add a deterministic Qt regression using a successful synthetic signing result with an invalid proof and a nonempty usage report.
- Assert that the regression displays every affected key's count, limit, remaining capacity, state, and warnings.
- Preserve existing behavior for pre-reservation failures, which should not invent a usage report when no counter moved.
- Retain the successful-proof and ordinary
!resultcoverage added by PR qt: preserve PQC usage after signing failures #128.
Consensus impact
Consensus-adjacent. This does not change signature validity, P2MR proof verification, counter reservation policy, or consensus rules. It affects operator visibility for stateful PQC wallet signing after capacity has already been consumed.
References
- Original failed-signing usage issue: Preserve local PQC usage reporting when Qt data signing fails #121
- Implementation PR: qt: preserve PQC usage after signing failures #128
- Current affected path:
src/qt/signverifymessagedialog.cpp:677-682 - Reviewed merge commit:
27bdaa920ec7daf075423b698c7cfa38220a8065
Activity
qt: show consumed PQC usage when a generated proof fails verification (…
qt: show consumed PQC usage when a generated proof fails verification (…
qbit v1.0.1 mainnet release