RPC getdescriptorinfo shouldn’t output undefined value of the “descriptor” #27078

issue GregTonoski openend this issue on February 10, 2023
  1. GregTonoski commented at 5:18 pm on February 10, 2023: none

    Expected behavior

    0{
    1  "descriptor": "tr(cUTFbLPUaBAPmTKwjcDs4rWHUSEUbUBfkPMogrbTmQFnJA3vgrLE)#tdkpah70",
    2  "checksum": "tdkpah70",
    3  "isrange": false,
    4  "issolvable": true,
    5  "hasprivatekeys": true
    6}
    

    Actual behavior

    { “descriptor”: “tr(967a9c6e1e189a8390e8ed870b918cc64742bebc372625071c410ac96b1aa580)#x9af7q5s”, “checksum”: “tdkpah70”, “isrange”: false, “issolvable”: true, “hasprivatekeys”: true }

    To reproduce

    Execure the RPC command, e.g.: getdescriptorinfo "tr(cUTFbLPUaBAPmTKwjcDs4rWHUSEUbUBfkPMogrbTmQFnJA3vgrLE)"

    System information

    Bitcoin 24.0.1

  2. GregTonoski added the label Bug on Feb 10, 2023
  3. achow101 commented at 5:52 pm on February 10, 2023: member

    This is intended behavior, see the help text:

    0"descriptor" : "str",             (string) The descriptor in canonical form, without private keys
    
  4. achow101 closed this on Feb 10, 2023

  5. GregTonoski commented at 7:30 pm on February 10, 2023: none

    I understand that the value “967a9c6e1e189a8390e8ed870b918cc64742bebc372625071c410ac96b1aa580” is a public key. If there is a private key in a descriptor which is argument to getdescriptorinfo then another descriptor with a corresponding public key is output as a “descriptor”. Otherwise, same descriptor is output.

    • Both getdescriptorinfo "tr(cUTFbLPUaBAPmTKwjcDs4rWHUSEUbUBfkPMogrbTmQFnJA3vgrLE)"
    • and getdescriptorinfo "tr(967a9c6e1e189a8390e8ed870b918cc64742bebc372625071c410ac96b1aa580)"

    output the same “descriptor” value: “tr(967a9c6e1e189a8390e8ed870b918cc64742bebc372625071c410ac96b1aa580)"

    I would suggest adding more explanation in the help text.

  6. bitcoin locked this on Feb 10, 2024

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: 2024-06-29 10:13 UTC

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