Bitcoin Forum

Bitcoin => Electrum => Topic started by: military-lunch on September 13, 2020, 10:33:12 AM



Title: Unable to sign transactions from command line: UnicodeDecodeError
Post by: military-lunch on September 13, 2020, 10:33:12 AM
I use Electrum (full GUI version) for my watching only wallet on a Debian 10 machine. I have my cold storage wallet on a Raspberry Pi running the command line version of Electrum.

Using version 3.3.8 I was able to export an unsigned.txn from the watching wallet and sign it using the Pi cold wallet.

I have just upgraded to version 4.0.3 on both machines. Now the export from the watching wallet is in .psbt format (it used to be .txn format). When I try to sign this on the Pi command line I get the following error:

UnicodeDecodeError: 'utf-8' codec can't decode bute 0xff in position 4: Invalid start byte

Please could anyone help me resolve this problem?

Your help is much appreciated.


Title: Re: Unable to sign transactions from command line: UnicodeDecodeError
Post by: HCP on September 13, 2020, 10:45:36 AM
I would suggest that you log this error (with the appropriate details of the devices being used, relevant OSes and application versions etc) over on the Electrum github "Issues" register, the devs are generally way more active over there.

Refer: https://github.com/spesmilo/electrum/issues


Title: Re: Unable to sign transactions from command line: UnicodeDecodeError
Post by: military-lunch on September 13, 2020, 08:00:56 PM
I have discussed this with the developers and they indicate that the binary unsigned transaction files output by Electrum from v4 are not compatible with python piping scripts used to import them on the command line.

The simple workaround is to create the unsigned transaction, and instead of saving to file, use "Export > Copy to Clipboard". Paste the unsigned transaction as text into a text editor, and then save that text to a file.

Electrum command line can then sign the transaction using this saved file with the normal command of the form:

cat unsigned.txn | python3 Electrum-4.0.3/run_electrum signtransaction -o -w WALLETNAME - > signed.txn

 (assuming the unsigned transaction is in a file named 'unsigned.txn')