doc: offline-signing-tutorial.md uses `>>` (append) instead of `>` (overwrite) for one-shot PSBT files #35862

issue GuTS805 opened this issue on August 1, 2026
  1. GuTS805 commented at 9:17 PM on August 1, 2026: none

    doc/offline-signing-tutorial.md writes the PSBT output using append (>>) instead of overwrite (>) in two spots:

    • line 115 — ... | jq -r '.psbt' >> /path/to/funded_psbt.txt
    • line 173 — ... | jq -r .hex >> /path/to/final_psbt.txt

    but every step after that just does $(cat ...) on these files, expecting only one line to be in there:

    • lines 127, 133 — decodepsbt $(cat /path/to/funded_psbt.txt), analyzepsbt $(cat ...)
    • lines 170-171 — walletprocesspsbt $(cat /path/to/funded_psbt.txt) ...
    • line 180 — sendrawtransaction $(cat /path/to/final_psbt.txt)

    so if someone reruns the send step (say they typo'd the amount or just want to redo it) without deleting the file first, >> just adds another line instead of overwritting it. then unquoted $(cat file) splits that into two separate args, and evry RPC that reads it (decodepsbt, analyzepsbt, walletprocesspsbt, sendrawtransaction) throws a "too many arguments" error. kind of a bad spot to get stuck in, given this whole tutorial is about careful key handling.

    tested the actual bash behavior to confirm this:

    $ bash -c 'f=/tmp/t.txt; rm -f "$f"; echo a >> "$f"; echo b >> "$f"; foo(){ echo argc=$#; }; foo $(cat "$f")'
    argc=2
    
  2. GuTS805 commented at 9:18 PM on August 1, 2026: none

    Happy to open a PR for this if maintainers agree it's worth fixing it's a 2-line, doc-only change with no functional/consensus impact.

  3. maflcko added the label Docs on Aug 2, 2026
  4. maflcko added the label Wallet on Aug 2, 2026
  5. fanquake commented at 1:14 PM on August 13, 2026: member

    Given a PR exists (#35890), I don't think we need to keep an issue open for this.

  6. fanquake closed this on Aug 13, 2026


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-08-31 18:51 UTC

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