btcwallet
btcwallet copied to clipboard
Allow non-interactive wallet creation
the --walletpass option does not appear to be honored when creating a wallet for the first time using --create.
This prevents the automatic creation of wallets via non-interactive scripts.
The walletpass option specifies the public passphrase. There is no flag for the private passphrase. Even if the walletpass option was honored during wallet creation, it would still need to be interactive.
It's already possible to do non-interactive wallet creation over RPC (in the gRPC API, not the legacy JSON-RPC one) but this is probably a more heavyweight solution than you're looking for, especially if you're not already using the experimental API.
I don't think that providing the public passphrase as a command line argument is a great idea, especially since process arguments show up in tools such as ps
and top
on Unix, and are also visible on Windows if you use a tool such as Process Explorer. They will also remain in shell history, if you save that (I don't, but many people do) and remembering to disable history before running the tool is very error prone.
I guess the real request is for both passwords to be optional.
Having a password-protected wallet doesn't make sense in every application. For example, an OpenStack application where many instances can be spun up from a common base image wouldn't want to have the wallet created in the base image - it would want to create the wallet programmatically on the first boot of the instance.
Right now that's not possible because btcwallet won't start until the wallet is generated with --create and this requires keyboard input.
You can use the flag --noinitialload
to defer wallet creation.
From --help
--noinitialload Defer wallet creation/opening on startup and enable loading wallets over RPC
--noinitialload comes with its own quirks though, such as the client now being responsible for calling all the startup synchronization operations, and doing so in the correct order.
It's already possible to do non-interactive wallet creation over RPC (in the gRPC API, not the legacy JSON-RPC one)
Is this remote initialization flow documented somewhere? I can't seem to find any information on how to load the wallet using the gRPC API when btcwallet is started with --noinitialload.