Skip to content

Conversation

@waketraindev
Copy link

Added createwallet, createwalletdescriptor and migratewallet RPC commands to the Qt console history filter since they may include passphrases or other sensitive data that should not be stored in command history.

@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 10, 2025

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

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK pablomartin4btc

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@waketraindev waketraindev force-pushed the 2025-10-qt-rpcconsole-historyfilter branch from 881a7a0 to 4e352ef Compare October 11, 2025 06:57
Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 4e352ef

(historyFilter was originally added in bitcoin/bitcoin#8877)

Copy link
Contributor

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, seems fine to add. Left a question

// don't add private key handling cmd's to the history
const QStringList historyFilter = QStringList()
<< "createwallet"
<< "createwalletdescriptor"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why add this, but not importdescriptors?

Copy link
Author

@waketraindev waketraindev Oct 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I was testing this patch, I ran into some exceptions in importdescriptors related to
the internal label and the range label (see bitcoin repo #31514, #32376, #33614, #33655)
and the command line history was helpful for manually editing to get it to pass succesfully;

At that point, I used #882 to manually clear the command history.

I wasn't sure about the commands that require a "desc" (descriptor) and allowed private ones,
so I held off until I could do some manual testing.

Potential list:

  • Have passphrase:
    added createwallet "wallet_name" ( disable_private_keys blank "passphrase" avoid_reuse descriptors load_on_startup external_signer )
    added encryptwallet "passphrase"
    added migratewallet ( "wallet_name" "passphrase" )
    added walletpassphrase "passphrase" timeout
    added walletpassphrasechange "oldpassphrase" "newpassphrase

  • Have hdkey:
    added createwalletdescriptor "type" ( {"internal":bool,"hdkey":"str",...} )

  • Have privatekey or privkey
    added signrawtransactionwithkey "hexstring" ["privatekey",...] ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" )
    added signmessagewithprivkey "privkey" "message"

To check which support or allow private descriptors:

  • Have desc or descriptor:
    deriveaddresses "descriptor" ( range ) [accepts private descriptor]
    getdescriptorinfo "descriptor" [accepts private descriptor]
    descriptorprocesspsbt "psbt" ["",{"desc":"str","range":n or [n,n]},...] ( "sighashtype" bip32derivs finalize ) [accepts private descriptor]
    utxoupdatepsbt "psbt" ( ["",{"desc":"str","range":n or [n,n]},...] ) [accepts private descriptor]
    importdescriptors requests descriptor in requests [accepts private descriptor]

I also noticed that commands with more complex parameters or arguments (#907) can behave unexpectedly when repeated from the command line, at which point manually clearing the command history (#882) can be more practical for the user.

I'd be happy to add importdescriptors and other suggested privacy related commands.

Should all the commands accepting descriptor be added?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants