rpc: Allow importing wallets by data instead of by filename #27597

issue brandonpille openend this issue on May 8, 2023
  1. brandonpille commented at 3:11 pm on May 8, 2023: none

    Please describe the feature you’d like to see added.

    Right now we can only import wallets by filename. This means you can only execute that rpc if you are executing it from the system where the bitcoin node is running. But it could be that you are sending the rpc request from outside the node. In that case you don’t have access to the file system. So it would be handy to allow passing the content of a wallet dump file instead and also allowing dumping the content not in a file but in the rpc result.

    It might be a good idea to check for other cases where the same is being done.

  2. brandonpille added the label Feature on May 8, 2023
  3. kouloumos commented at 2:02 pm on May 10, 2023: contributor
    Is there a specific reason that you need to pass around the whole wallet? You might be able to do a work-around with descriptor wallets (default wallet type since 23.0) using the {list,import}descriptors RPCs.
  4. brandonpille commented at 3:48 pm on May 10, 2023: none
    No not specifically. I was just wondering why there is an import_wallet rpc that accepts a filename where the file is on the system itself.
  5. kouloumos commented at 9:35 am on May 11, 2023: contributor

    I might be missing something here, as I cannot understand how your latest question is related to your initial feature request. It is common for backups to be in files, hence importing/restoring from a file. I understand the over-the-wire scenario, but if there is no strong use-case for such a feature, it makes it more difficult to gather interest.

    Note that importwallet and the related dumpwallet RPC are only compatible with legacy wallets, and as there is a proposed timeline for their removal, it is not very likely for improvements to happen. If your use-case is not legacy-wallet related, you should probably be looking at backupwallet and restorewallet RPCs.

  6. maflcko added the label Wallet on May 11, 2023
  7. maflcko added the label RPC/REST/ZMQ on May 11, 2023
  8. maflcko commented at 9:58 am on May 11, 2023: member

    Passing large data blobs, presumably multi-megabyte raw byte files, encoded as (presumably) hex, wrapped in json, over RPC is likely going to cause more issues than it fixes.

    See also https://github.com/bitcoin/bitcoin/issues?q=%22Argument+list+too+long%22:

  9. pinheadmz commented at 7:10 pm on May 31, 2023: member

    No not specifically. I was just wondering why there is an import_wallet rpc that accepts a filename where the file is on the system itself. @brandonpille is this still an issue for you?

  10. brandonpille commented at 10:50 am on June 1, 2023: none
    No it’s ok
  11. fanquake closed this on Jun 1, 2023

  12. bitcoin locked this on May 31, 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-12-21 15:12 UTC

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