Skip to content

Qt proofs export local PQC usage and alternate-key metadata #94

Closed

Description

@kiwidream

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

  1. Create a P2MR wallet with multiple eligible PQC leaves.
  2. Force raw signing with the first leaf to fail after reservation, then allow a later leaf to sign successfully.
  3. Sign data using qbit-qt.
  4. Copy and inspect the generated proof JSON.
  5. Observe pqc_key_states, counts, remaining budget, warnings, and a public key other than the leaf selected by the proof.
  6. 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 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 main at 7e48b45f2a8e75268fd1fd44d0091a4bdde2377e.
  • Also applies to 1.0.0 at 68a12571bcb56597c4865abce474a6cc3d356fc3; the relevant files are identical.
  • Applies to every platform supporting the qbit-qt P2MR proof flow.

Activity

  1. added
    bug
    on Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions