HWI icon indicating copy to clipboard operation
HWI copied to clipboard

enhancement to `signtx`

Open 8go opened this issue 1 year ago • 0 comments

I added a tiny enhancement to signtx already in PR #757, allowing to pipe a PSBT into hwi by using this syntax hwi -t device signtx - such as in cat mypsbt.txt | hwi -t $device signtx - or xclip | hwi -t $device signtx -.

I would also like to add the functionality of reading a PSBT file as input, such as a file generated by Bitcoin Core. How would that be best done on the GUI/CLI/UX side?

hwi signtx { psbt-text | - | psbt-file }

Is that the best way? So, all these 3 things would work?

  • hwi -t $device signtx cHnidP8B...some.base64.string...AA== # e.g. passing string
  • xclip -o -selection clipboard | hwi -t $device signtx - # e.g. string via pipe
  • hwi -t $device signtx ../txs/psbt-file.psbt # e.g. passing a file

I think if the input is a file, the output should also be a file? How to specify the filename in the CLI? Should the output always be the input file name but with .signed added?

  • hwi -t $device signtx ../txs/psbt-file.psbt would then create the output file ../txs/psbt-file.signed.psbt?

What is the preferred way of specifying the input file name, the output file name in the CLI? Is the suggest way above the way to go?

Before I start this PR I would like to get some feedback on these questions as to assure that the PR is appropriate.

8go avatar Sep 10 '24 13:09 8go