Skip to content

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

Closed

Description

@GuTS805

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

Activity

  1. GuTS805 commented on Aug 1, 2026

    @GuTS805
    ContributorAuthor

    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.

  2. fanquake commented on Aug 13, 2026

    @fanquake
    Member

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

  3. added 2 commits that reference this issue on Sep 24, 2026
    be30864
    bfdcd97
  4. added a commit that references this issue on Oct 23, 2026
    c085663
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions