rpc: add a new parameter `desriptor_file` to `importdescriptors` RPC #25757

pull w0xlt wants to merge 5 commits into bitcoin:master from w0xlt:desc_from_file changing 6 files +196 −27
  1. w0xlt commented at 5:40 AM on July 31, 2022: contributor

    This PR adds a new parameter desriptor_file to importdescriptors RPC, allowing the user to import the descriptors directly from a file.

    Only the last two commits are new as this PR is built on top of #25747.

    With this PR, exporting / importing descriptors and creating watch-only wallet is as simple as:

    $ bitcoin-cli -rpcwallet="cold_wallet"  listdescriptors "{\"save_to_file\": \"/home/user/Downloads/desc.json\"}"
    $ bitcoin-cli -rpcwallet="watch_only_wallet"  importdescriptors "{\"descriptor_file\": \"/home/user/Downloads/desc.json\"}"
    

    Without this PR, the user can manually create a file from the listdescriptors output or use jq to extract the descriptor field from listdescriptors but the idea here is to make things more automated and standardized.

    And this also opens the way to add the functionality of importing descriptors from files in the GUI,

  2. RPC: Support specifying different types for param aliases
    author: Luke Dashjr <luke-jr+git@utopios.org>
    f7337ff6e6
  3. rpc: change `listdescriptors` to accept `options` parameter
    This changes `listdescriptors` to accept `options` parameter
    but retains compatibility with the previous `private` parameter.
    9569ff9273
  4. rpc: add `save_to_file` option to `listdescriptors` c8840eb855
  5. rpc: change `importdescriptors` to accept `options` parameter
    This changes `importdescriptors` to accept `options` parameter
    but maintains compatibility with the previous `requests` parameter.
    0b9732b3b5
  6. rpc: add `descriptor_file` option to `importdescriptors` 05d7df281e
  7. DrahtBot added the label RPC/REST/ZMQ on Jul 31, 2022
  8. DrahtBot commented at 7:48 PM on July 31, 2022: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #22838 (descriptors: Be able to specify change and receiving in a single descriptor string by achow101)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  9. w0xlt commented at 7:24 PM on August 2, 2022: contributor

    The commits of this PR were merged into #25747.

  10. w0xlt closed this on Aug 2, 2022

  11. w0xlt deleted the branch on Aug 2, 2022
  12. bitcoin locked this on Aug 2, 2023

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-04-13 15:13 UTC

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