doc: mention -stdinwalletpassphrase in walletpassphrase(change) help #35242

pull isghe wants to merge 1 commits into bitcoin:master from isghe:doc/stdinwalletpassphrase-hint changing 1 files +6 −2
  1. isghe commented at 1:59 PM on May 8, 2026: contributor

    The -stdinwalletpassphrase flag reads the passphrase from stdin with echo disabled, avoiding exposure in shell history and the process list. Add an example of its use to walletpassphrase and walletpassphrasechange so users discover the safer alternative where they need it.

  2. doc: mention -stdinwalletpassphrase in walletpassphrase(change) help
    The -stdinwalletpassphrase flag reads the passphrase from stdin with
    echo disabled, avoiding exposure in shell history and the process list.
    Add an example of its use to walletpassphrase and walletpassphrasechange
    so users discover the safer alternative where they need it.
    cce5f94cef
  3. DrahtBot added the label Docs on May 8, 2026
  4. DrahtBot commented at 1:59 PM on May 8, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35242.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK ferminquant, mercie-ux

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. ferminquant commented at 3:32 PM on May 8, 2026: none

    ACK cce5f94cef34a009ad1e8fae1d63806c099c8bd8

    Reviewed the diff and checked the bitcoin-cli stdin parsing. Built bitcoind and bitcoin-cli with wallet support via depends, verified the new help output, and tested both examples on regtest with an encrypted wallet.

  6. mercie-ux commented at 4:28 AM on May 12, 2026: none

    ACK cce5f94 Verified the -stdinwalletpassphrase -stdin walletpassphrasechange example is correct by tracing the flag handling in bitcoin-cli.cpp : -stdinwalletpassphrase reads line 1 from stdin and inserts it as oldpassphrase , then -stdin reads remaining lines and appends newpassphrase. The starts_with("walletpassphrase")guard confirms both commands are supported.

  7. sedited requested review from polespinasa on Jul 2, 2026
  8. in src/wallet/rpc/encrypt.cpp:133 in cce5f94cef
     127 | @@ -126,8 +128,10 @@ RPCMethod walletpassphrasechange()
     128 |                  },
     129 |                  RPCResult{RPCResult::Type::NONE, "", ""},
     130 |                  RPCExamples{
     131 | -                    HelpExampleCli("walletpassphrasechange", "\"old one\" \"new one\"")
     132 | -            + HelpExampleRpc("walletpassphrasechange", "\"old one\", \"new one\"")
     133 | +                    HelpExampleCli("walletpassphrasechange", "\"old one\" \"new one\"") +
     134 | +            "\nUsing -stdinwalletpassphrase to avoid exposing passphrases in shell history or process list\n"
     135 | +            + HelpExampleCli("-stdinwalletpassphrase -stdin walletpassphrasechange", "") +
    


    polespinasa commented at 7:18 PM on July 2, 2026:

    I don't think there is need for using both -stdinwalletpassphrase and -stdin in the case of walletpassphrasechange. Using only either stdin or stdinwalletpassphrase also works

  9. in src/wallet/rpc/encrypt.cpp:134 in cce5f94cef
     127 | @@ -126,8 +128,10 @@ RPCMethod walletpassphrasechange()
     128 |                  },
     129 |                  RPCResult{RPCResult::Type::NONE, "", ""},
     130 |                  RPCExamples{
     131 | -                    HelpExampleCli("walletpassphrasechange", "\"old one\" \"new one\"")
     132 | -            + HelpExampleRpc("walletpassphrasechange", "\"old one\", \"new one\"")
     133 | +                    HelpExampleCli("walletpassphrasechange", "\"old one\" \"new one\"") +
     134 | +            "\nUsing -stdinwalletpassphrase to avoid exposing passphrases in shell history or process list\n"
     135 | +            + HelpExampleCli("-stdinwalletpassphrase -stdin walletpassphrasechange", "") +
     136 | +            HelpExampleRpc("walletpassphrasechange", "\"old one\", \"new one\"")
    


    polespinasa commented at 7:22 PM on July 2, 2026:

    The view is bit ugly, worth adding before the HelpExampleRpc

    "\nAs a JSON-RPC call\n"
    
  10. polespinasa commented at 7:23 PM on July 2, 2026: member

    Concept~0

    Idk how useful this will be as examples are incomplete, they miss how to pass the passphrase, and because it can be done in many ways, idk if it is worth adding it. Also I am not sure if HelpExampleCli would accept a non bitcoin-cli command


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-07-09 06:47 UTC