Unquoted descriptor arguments cause RPC console to improperly detect method name #737

issue achow101 openend this issue on June 12, 2023
  1. achow101 commented at 10:42 pm on June 12, 2023: member

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    Using the RPC console with a command that has descriptor arguments results in a Method not found error.

    Expected behaviour

    The command should either accept the argument as is, or return an error about failing to parse the argument.

    Steps to reproduce

    0> getdescriptorinfo wpkh(cNaQCDwmmh4dS9LzCgVtyy1e1xjCJ21GUDHe9K98nzb689JvinGV)
    1Method not found (code -32601)
    

    Relevant log output

    No response

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    v25.99.0-c92fd638860c

    Operating system and version

    Arch Linux

    Machine specifications

    No response

  2. achow101 renamed this:
    Single quotes in arguments cause RPC console to to improperly detect method name
    Unquoted descriptor arguments cause RPC console to to improperly detect method name
    on Jun 12, 2023
  3. achow101 commented at 11:19 pm on June 12, 2023: member
    Ah, the issue is actually with the parentheses. The console thinks those are the beginning of a nested command or a more function-like syntax, introduced in https://github.com/bitcoin/bitcoin/pull/7783
  4. hebasto renamed this:
    Unquoted descriptor arguments cause RPC console to to improperly detect method name
    Unquoted descriptor arguments cause RPC console to improperly detect method name
    on Jun 13, 2023
  5. hernanmarino commented at 5:14 pm on June 16, 2023: contributor

    Perhaps I ’m saying something obvious, but a good workaround migth be enclosing the descriptor with double quotes:

    0> getdescriptorinfo "wpkh(cNaQCDwmmh4dS9LzCgVtyy1e1xjCJ21GUDHe9K98nzb689JvinGV)"
    1{
    2  "descriptor": "wpkh(02fcba7ecf41bc7e1be4ee122d9d22e3333671eb0a3a87b5cdf099d59874e1940f)#442qn8e8",
    3  "checksum": "3qah2w9c",
    4  "isrange": false,
    5  "issolvable": true,
    6  "hasprivatekeys": true
    7}
    

    Single quotes might work for some descriptors, but will probably fail with descriptors including hardened derivation paths.

  6. achow101 commented at 5:16 pm on June 16, 2023: member

    Perhaps I ’m saying something obvious, but a good workaround migth be enclosing the descriptor with double quotes:

    Yes, that is the correct way to pass these strings. However method not found seems like the incorrect error to be giving when not using them.

    Additionally, double quotes gets really confusing and insane when using RPCs that involve json like importdescriptors.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-01-15 13:20 UTC

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