Skip to content

Review finding: importdescriptors help implies PQC counters are wallet-wide #323

Closed

Description

@kiwidream

Summary

importdescriptors help says counters miss only signatures made "outside this wallet"; they also miss signatures made by other descriptors in the same wallet.

Severity: low. Found in the 2026-11-04 review of the v1.0.1 change set (all 1.x.x merges since v1.0.0 plus the open PRs that target it), against 1.x.x 21fee6ee8e; area: #264.

Observed

Confidence: confirmed from code.

  • Location: src/wallet/rpc/backup.cpp:1026 at 21fee6e.
  • Scenario: a wallet holds mr(pk(K)) in descriptor A and imports a descriptor B that also contains K (for example mr(multi_a(1,K,L))). AddDescriptorPQCKeyWithDB (src/wallet/scriptpubkeyman.cpp:1807-1844) writes B's counter for K as 0 and counters are per DescriptorScriptPubKeyMan (m_map_pqc_sig_counters), so signatures A already made with K are not counted by B, and each descriptor is capped at 2^30 separately. The help text implies wallet-wide tracking.
  • Evidence: code traced. The signrawtransactionwithkey and descriptorprocesspsbt help texts were checked against FlatSigningProvider::SignPQC (src/script/signingprovider.cpp:143-276): no reserver/writer is installed, counters start at 0 each call and advance only in memory within the call, so "each call treats every key as unused" is accurate.

Impact

Operator guidance for key-usage safety The #181 "Known limitations" bullet states the per-descriptor behaviour correctly; the RPC help, which is what integrators read, does not. Practical risk is low (approaching 2^26.6 signatures per key is unrealistic for normal use).

Suggested fix

Change to "PQC signature counters are kept per descriptor. They do not include signatures the same key made in other descriptors of this wallet, in other wallets, or outside this wallet, so the caller is responsible for keeping each PQC key within its limit of 1073741824 signatures."

Related: related to the per-descriptor counter limitation in #181 and to #279; the help-text inaccuracy is new.

Activity

  1. added
    documentation
    on Nov 4, 2026
  2. kiwidream commented on Nov 6, 2026

    @kiwidream
    MemberAuthor

    Fixed on 1.x.x by #346 (merged as 863e6b1). The importdescriptors help now says that PQC signature counters are kept per descriptor, and that they miss signatures the same key made in other descriptors of this wallet, in other wallets or outside the wallet. main gets the fix when 1.x.x is integrated.

  3. added a commit that references this issue on Nov 12, 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

    documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions