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,