Repository navigation
Description
Summary
After successful P2MR/PQC data signing, the qbit-qt wallet interface attaches a PQC usage report to the result. BuildP2MRProofJson() then appends that entire report to the portable proof JSON displayed for copying.
The exported fields include:
- each recorded public key;
- exact signature counts and limits;
- remaining signature budget;
- current limit state; and
- warnings.
These fields are not required by the proof verifier. In a multi-leaf retry, the report can include a public key from an earlier failed signing attempt in addition to the key that produced the proof.
Impact
Sharing a proof can unnecessarily disclose signer-local operational metadata, including:
- signing-key usage history;
- near-exhaustion or rotation state;
- exact remaining signature capacity; and
- sibling or alternate public keys associated with the same P2MR output.
No secret-key bytes are exposed. The concern is avoidable wallet-structure disclosure and linkage of keys that are not needed to validate the portable proof.
Steps to reproduce
- Create a P2MR wallet with multiple eligible PQC leaves.
- Force raw signing with the first leaf to fail after reservation, then allow a later leaf to sign successfully.
- Sign data using qbit-qt.
- Copy and inspect the generated proof JSON.
- Observe
pqc_key_states, counts, remaining budget, warnings, and a public key other than the leaf selected by the proof. - Remove all PQC usage fields and verify that the proof still passes both Qt and RPC verification.
A single-leaf successful signature is sufficient to demonstrate export of exact count and remaining-budget metadata.
Relevant code
- The wallet interface always constructs a usage report on the successful Qt path.
AppendPQCUsageJson()serializes every key state, count, limit, remaining value, state, and warning.BuildP2MRProofJson()appends that report to the copyable proof.- The same report is also shown locally in the signer status.
- Existing tests show that a multi-leaf retry report can contain two public keys.
The RPC already provides an include_pqc_usage=false option. The Qt proof flow was added in #63.
Desired outcome
- Emit only verifier-required proof fields in the default Qt proof JSON.
- Keep counts, remaining budget, states, warnings, and retry-key information in the local signer UI.
- If diagnostic export is retained, make it an explicit opt-in action with a disclosure warning.
- Ensure the policy also works with failed signing: usage must remain visible locally even when no portable proof is produced.
Suggested tests
Add Qt regression coverage proving that:
- default proof JSON contains no PQC usage fields;
- default proof JSON contains no non-selected retry public keys;
- the minimal proof round-trips through Qt and RPC verification;
- local remaining-budget and warning messages remain visible after signing; and
- any diagnostic export requires an explicit opt-in and includes the expected disclosure.
Version and platform
- Source-inspected on
mainat7e48b45f2a8e75268fd1fd44d0091a4bdde2377e. - Also applies to
1.0.0at68a12571bcb56597c4865abce474a6cc3d356fc3; the relevant files are identical. - Applies to every platform supporting the qbit-qt P2MR proof flow.
Activity