Bitcoin Core's CLI has a converttopsbt command used to convert from raw transaction to PSBT transaction but how is it possible to convert from PSBT transaction to raw transaction using Bitcoin Core (or if not possible using another client like Electrum)?

Example of a PSBT transaction (testnet):


1 Answer 1


Yes, once the PSBT is finalized you can extract a fully-signed raw transaction from it (using the finalizepsbt RPC). As your PSBT does not have signatures yet, there is no point in constructing an actual transaction from it yet.

  • I see, so: a) Using the CLI how would you sign the PSBT transaction with a key not in the wallet as signrawtransactionwithkey takes a raw (not PSBT) transaction as an argument? b) Is finalizepsbt the only way in the RPC to convert from PSBT to raw transaction?
    – Amit
    Commented Dec 7, 2020 at 21:00
  • 1
    You either use a raw transaction workflow or a PSBT workflow. Mixing them is bound to cause problems. PSBT signing will generally involve walletprocesspsbt, or using something like the HWI project to sign using hardware wallets. Commented Dec 7, 2020 at 21:23
  • 2
    Perhaps part of the confusion is that raw transactions serve two distinct purposes: an unsigned form that you pass around while gathering signatures, and a fully-signed form that can be broadcast on the network. PSBT wholly replaces the first one, but not the second. In PSBT you'd use RPCs like createpsbt, walletcreatefundedpsbt, utxoupdatepsbt, walletprocesspsbt, combinepsbt, finalizepsbt. Only after the last of those do you have a (signed) raw transaction. Commented Dec 7, 2020 at 21:26
  • 1
    You can still use raw transaction RPCs, and then convert to PSBT using converttopsbt but that's just for compatibility with (the very first step) of a raw-transaction based workflow. Commented Dec 7, 2020 at 21:27
  • 2
    Bitcoin Core currently has no RPC to sign PSBT using a key not in a wallet. Commented Dec 7, 2020 at 21:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.