Merge #142: Document how to handle binary format files from command line with bas…

f096c18 Document how to handle binary format files from command line with bash example (Gregory Sanders)

Pull request description:

  …h example

  Since these are quite standard utilities, we may want to take the unix philosophy and let other utils take care of these common conversions.

ACKs for commit f096c1:
  achow101:
    ACK f096c18478

Tree-SHA512: ee04a1e4e7f4106f7afcb5130cd8bb8fb1446a79b8babaf14c7aed4b753699b29ed8dfca057928289848f562b24663850377eccbbef27ba9c60f011a901cdc5a
This commit is contained in:
Andrew Chow 2019-04-15 20:29:19 -04:00
commit 4814a293e8
No known key found for this signature in database
GPG Key ID: 17565732E08E5E41

View File

@ -135,3 +135,9 @@ bitcoin-cli scantxoutset start '[{"desc":"wpkh(xpub6DP9afdc7qsz7s7mwAvciAR2dV6vP
"total_amount": 0.00000000
}
```
### Binary format handling
The input and output format supported by HWI is base64, which is prescribed by BIP174 as the string format. Note that the PSBT standard also allows for binary formatting when stored as a file. There is no direct support within HWI, but this can be easily accomplished using common utilities. A bash command-line example is detailed below, where the PSBT binary file is stored in `example.psbt` and only the common utilities `base64` and `jq` are required:
cat example.psbt | base64 --wrap=0 | ./hwi.py -t ledger --stdin signtx | jq .[] --raw-output | base64 -d > example_result.psbt