Author

Topic: How to sign PSBT with electrum? (Read 112 times)

legendary
Activity: 2268
Merit: 18771
July 17, 2021, 10:29:52 AM
#3
If you didn't understood i get a psbt generated [encoded/decoded] that has my address as an output and i need to sign it. [i do not have access to the input]
Then you cannot sign it.

The output address(es) do not sign the transaction. A transaction must be signed by the private key associated with the input address(es). If you do not have access to these private keys, then you cannot sign the transaction.

-Importing the psbt to electrum and attempting to sign it directly [No success, the sign button is greyed out image:
You can't just import a PSBT in to any wallet and sign it. You need to import it in to a wallet containing the private keys which generated the addresses used in the inputs. As above, without those private keys, you cannot sign the transaction.

You'll need to figure out where the input addresses are coming from and where the private keys to these addresses are stored. Once you have access to the private key, then you can import them in to Electrum and sign your PSBT.
legendary
Activity: 3710
Merit: 1586
July 16, 2021, 06:47:15 PM
#2
you sign using the private key behind the inputs not the output address. if you don't have the private key behind the input address you can't sign the transaction.

newbie
Activity: 1
Merit: 0
July 16, 2021, 05:56:28 PM
#1
So I've been trying for 4 days straight to sign a PSBT transaction using software wallets like electrum but upon all my research i failed so i'm seeking for your help.

I'm using a payment gateway that generates the psbt i only provide the address, the gateway is named BTCPay Server https://btcpayserver.org/ these are the steps they provide:
 
•A PSBT gets constructed with certain inputs and outputs, but no signatures
•The exported PSBT can be imported by a wallet that supports this format
•The transaction data can be inspected and signed using the wallet
•The signed PSBT file gets exported from the wallet and imported with BTCPay Server
•BTCPay Server produces the final Bitcoin transaction
•You verify the result and broadcast it to the network


If you didn't understood i get a psbt generated [encoded/decoded] that has my address as an output and i need to sign it. [i do not have access to the input]
After signing it, i need to upload the psbt again and they will sign the transaction and broadcast it.
It can have multiple inputs or just one.

From the psbt generated i get the following json data: https://pastebin.com/ybj10hJM
I uploaded it to pastebin to dont make this thread a mess, and replaced data/hashes with dots because im not aware if i expose anything that i shouldnt.

I'm struggling at the signing part so far i tried the following things:
-Importing the psbt to electrum and attempting to sign it directly [No success, the sign button is greyed out image: https://i.imgur.com/AgykV1V.png
-Tried signing the transaction through the electrum console with the following commands `signtransaction('txid')` and `signtransaction_with_privkey('txid', 'privatekey')` both commands get the following error:
electrum.transaction.SerializationError: Failed to recognise tx encoding, or to parse transaction.
However if i use `signtransaction_with_privkey()` with the encoded psbt insead of the txid i get another psbt but it is still not signed.
-I attempted to use bitcoin core but still failed.
-I tried using https://www.coinb.in/#newTransaction and import the data provided from the psbt but still no success.
-Tried different versions of electrum.
-Tried signing it offline and online.

If anyone offers some help that lead the solving of the problem i will offer a tip.

Thanks for your time & patience!
Jump to: