Post
Topic
Board Bitcoin Technical Support
Merits 21 from 7 users
Re: Use GUI to get raw tx. Can you do this?
by
achow101
on 09/04/2019, 04:16:14 UTC
⭐ Merited by Foxpup (6) ,Carlton Banks (4) ,ETFbitcoin (3) ,HCP (2) ,joniboini (2) ,bones261 (2) ,malevolent (2)
You could do that.
If one had a setup of 2 computers, one offline as cold storage, and one online, with offline's addresses in online's wallet as watch-only, both Core clients. Could you copy the block files from the synced online node into the offline computer, then as the current coins of your wallet show up, do whatever transaction you want to do using Coin Control and whatnot, then press "send" and get the result of this action in raw tx code, then convert this code into a QR, then pass this QR into the online node's computer and broadcast it?
You could do that. It's a bit inefficient though.

Instead, I suggest that you use the PSBT RPCs. This is currently RPC only, but there is work to bring this to the GUI in the future.

On your online computer, you can use walletcreatefundedpsbt to create a PSBT. You provide it outputs and any inputs you want to have included. Bitcoin Core will perform coin selection to select the rest of the coins. It will also add a change output if needed and set the appropriate transaction fee. The resulting PSBT contains all of the information needed to sign the transaction, so you can move that to your offline machine through whatever method and sign it there.

Some more detailed instructions and examples can be found at https://github.com/bitcoin/bitcoin/blob/master/doc/psbt.md and https://github.com/bitcoin-core/HWI/blob/master/docs/bitcoin-core-usage.md#sending. They don't quite describe the airgapped setup case, but the examples there can be easily worked into the airgapped setup. Note that some features may not yet be available. They will be available in Bitcoin Core 0.18.0 which should be released in the next couple of days.