From f096c184785114658c7e18dc40dba697bff798e7 Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Fri, 15 Mar 2019 09:49:24 -0400 Subject: [PATCH] Document how to handle binary format files from command line with bash example --- docs/examples.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/examples.md b/docs/examples.md index 26b8afb..0aa5d5c 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -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