Bitcoin Forum
July 31, 2024, 03:14:13 PM *
News: Help 1Dq create 15th anniversary forum artwork.
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin Core: fundrawtransaction or PSBT for signing simple transactions offline  (Read 33 times)
tiffy (OP)
Jr. Member
*
Offline Offline

Activity: 36
Merit: 41


View Profile
July 30, 2024, 01:07:37 AM
Merited by LoyceV (6), ABCbits (3), nc50lc (1)
 #1

I am currently using the Core Client 27.1. I only use the demon so far. If you think it is advisable, I can also switch to the GUI client. But let me first describe my scenario.

I have an offline/cold wallet on a Raspberry and a corresponding watch wallet (on a normal x86 computer). Communication between the systems takes place via cameras and QR codes. This worked quite well in tests. I can easily transfer 2k of data per QR code.

I would prefer to use only the BIP 84 addresses that the Core Client uses by default. And generally operate everything in standard mode. I only need normal Bitcoin transactions (no multisig or anything special). I would like to leave most of the work to the Core Client. I have already looked on the Internet and found this article by Pieter Wuille:

https://bitcoin.stackexchange.com/a/106204

The API call fundrawtransaction seems to be exactly what I'm looking for. But later Wuille says that it has been superseded by PSBT. I am now wondering which direction I should go in. PSBT seems to have a lot of possibilities and is therefore probably generally easier. But I just want to be able to send coins from A to B in a secure and controlled way. With devices that can only exchange QR codes.

How would you proceed?
tiffy (OP)
Jr. Member
*
Offline Offline

Activity: 36
Merit: 41


View Profile
July 30, 2024, 01:16:44 PM
Last edit: July 30, 2024, 01:32:11 PM by tiffy
 #2

I looked further on the internet and found this series of articles:
https://github.com/BlockchainCommons/Learning-Bitcoin-from-the-Command-Line/blob/master/07_1_Creating_a_Partially_Signed_Bitcoin_Transaction.md

I found the section Create a PSBT the Easy Way to be the most suitable for me. But of course I have to try it out first.

HWI is discussed in the last article. I didn't know this tool before. I think it's a good thing but at the moment I have the feeling it adds just another layer of complexity to my already existing setup. Can't I just use walletprocesspsbt on my HW wallet (Raspberry with Bitcoind 27.1)? My approach would be roughly as follows:

1. Use walletcreatefundedpsbt with empty inputs on the watch-only Wallet.
2. Transfer the output of walletcreatefundedpsbt as a QR code to my HW Wallet.
3. Use walletprocesspsbt on the HW Wallet with the transfered output of walletcreatefundedpsbt.
4. Transfer the output of walletprocesspsbt as a QR code back to the watch-only Wallet.
5. Then there: finalizepsbt and sendrawtransaction

Does that make sense? Have I understood the scheme correctly?
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3472
Merit: 6793


Just writing some code


View Profile WWW
July 30, 2024, 03:37:47 PM
 #3

Use PSBTs since they contain all of the extra information needed in order to sign. The raw transaction workflow will require you to provide that data separately.

nc50lc
Legendary
*
Offline Offline

Activity: 2492
Merit: 5865


Self-proclaimed Genius


View Profile
Today at 05:47:05 AM
 #4

Does that make sense? Have I understood the scheme correctly?
That'll work, although the guide may be written for versions older than v26.0.
Since you're using v27.1, finalizepsbt wont be necessary when using walletprocesspsbt since it'll also output the finalized raw transaction hex that you can broadcast with the watching-only wallet.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!