gethdkeys RPC throws for descriptors with partial xprvs #34378

issue rkrux openend this issue on January 22, 2026
  1. rkrux commented at 12:08 pm on January 22, 2026: contributor

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    A non-watch-only wallet allows to import descriptors with partial private keys, eg: a multisig descriptor with one private key and one public key. In case an xpub is imported in any such descriptors whose private key the wallet doesn’t have, then the gethdkeys RPC throws an unhandled error like below when the private keys are requested.

    0    ➜ bitcoincli -named gethdkeys private=true
    1    error code: -1
    2    error message:
    3    map::at:  key not found
    

    Expected behaviour

    The RPC should properly handle the request and not throw.

    Steps to reproduce

    1. Create a non watch only wallet.
    2. Call importdescriptors RPC with partial private keys, eg:
    0[{'desc': 'wsh(multi(2,tprv8ZgxMBicQKsPdaTnUf1FUTUtnupv4pHiwFLsVHPnNHhJtACT3sdj7eMRx1ixLchduVUD4XQzN5qNyZri9NYkrS4kt4tvgyhnW7byhxHzSHw/*,tpubD6NzVbkrYhZ4WzibfNc8tzv6GtMzQ4LnP5YRgM8X5Dia9iPdBdrx3QujdD9fzkwxnGQaBh3q4eFENqJxr8Fzj9bNZhwGndoWJgQQeKTNRWE/*))#m5xlzyqz', 'timestamp': 'now'}]
    
    1. Call gethdkeys RPC.
    0bitcoincli -named gethdkeys private=true
    

    Relevant log output

    No response

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    master@d7fd8c6952f288685bf16151b6c1139aad74ffea

    Operating system and version

    MacOS

    Machine specifications

    No response

  2. willcl-ark added the label Wallet on Jan 23, 2026
  3. willcl-ark added the label RPC/REST/ZMQ on Jan 23, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-01-27 06:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me