How to set up a watch-only Bitcoin wallet and sign transactions offline

13 replies 22 views
orbit_rocketFull Member
Posts: 59 · Reputation: 257
#1Oct 14, 2018, 04:32 PM
You can do this with two computers (that's what I recommend), but if you're stuck with just one, a Linux distro like Tails works too. First, grab Bitcoin Core, verify the signatures, and move it to a USB flash drive. This second computer or your Tails setup won't connect to the internet at all. For the offline PC or Tails setup Double-click to open Bitcoin-qt found in bitcoin-22.0/bin/ Bitcoin-qt will launch and ask where to store the data. Just hit okay; nothing will download since we're offline. Now create a new wallet, make sure to select encrypt and descriptor wallet: After you set up the wallet, back it up and save it on another device like a USB flash drive (if you're using Tails, remember everything will reset after shutting down). To back it up, just go to File -> Backup wallet. Next, we need some info to create a watch-only wallet. Open the console (go to window → console or just hit Ctrl+T) and type: Note: This command is available since version 0.22. This command will give you a list of six descriptors. We’re interested in the ones with path derivation 84'/0'/0 (this is for native segwit, bech32). Copy both descriptors into a text file and save that to your USB. For example, my .txt file will look like this: One descriptor shows internal:false and the other internal:true. The one with internal:false will help the watch-only wallet create receiving addresses while the other one will...
3 Reply Quote Share
nickdefiMember
Posts: 1 · Reputation: 74
#2Oct 14, 2018, 10:37 PM
What version of Bitcoin Core are you using? I can't find that listdescriptors command in the version I am using. Right now, I'm using Bitcoin Core v0.21.1. However I can find importdescriptors "requests" whic I find it weird to have this command and not the listdescriptors one. Is it specific of v0.22 ?
4 Reply Quote Share
Posts: 54 · Reputation: 222
#3Oct 15, 2018, 03:09 AM
Yes. See the release note for version 22.0, here: github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-22.0.md I think the lack of info is partly my fault because I've suggested him to use that command to get the 'change address' parent descriptor while not informing him that the command is only available to the latest version (v22.0).
4 Reply Quote Share
orbit_rocketFull Member
Posts: 59 · Reputation: 257
#4Oct 17, 2018, 11:41 AM
Tutorial updated specifying that this command is only available for version 0.22 to avoid confusions, thanks!
6 Reply Quote Share
shrimpFull Member
Posts: 151 · Reputation: 456
#5Oct 17, 2018, 12:07 PM
I have done this and it shows success in the console output for Bitcoin Core 0.22 However, I do not see the balance I would expect. Will Bitcoin Core only show balances for UTXOs created after you`importdescriptors`? Or am I screwing this up somehow? Edit: It would seem like it will only see UTXOs that happen after I did the import. This could be worth mentioning. To test, I just reused an address (I DON'T DO IT EVERYTIME, OK!) and sent myself a small amount. I now see this TX show up in Bitcoin Core with the watch-only wallet setup as per this guide. Edit#2: Forgot about `rescanblockchain`. Used that and it worked. Don't forget to specify a blockheight to start at unless your wallet is super old. (I rescanned starting just before my first TXid block height)
4 Reply Quote Share
Posts: 54 · Reputation: 222
#6Oct 17, 2018, 05:08 PM
This will depend on the value of "timestamp" in 'importdescriptors'. In the example in the OP, he used "1647182091" which is the epoch date of "Sunday, March 13, 2022" so Bitcoin Core will only rescan blocks past that time. If you want to rescan from the genesis block, set it to "0"; if you do not wish to rescan, set it to "now".
2 Reply Quote Share
0x5e3dFull Member
Posts: 103 · Reputation: 519
#7Oct 18, 2018, 03:01 PM
Isn't this much easier without using a Descriptor Wallet? You can just create a new wallet and untick it. I must admit I've never used a Descriptor Wallet, and no doubt the developers had a good reason for it, but importaddress: looks much easier than this:
5 Reply Quote Share
Posts: 54 · Reputation: 222
#8Oct 19, 2018, 05:20 AM
The difference with importaddress is, this method can create an HD watching-only wallet. AFAIK, there's no other method to create an HD watching-only wallet in Core without using parent descriptors.
1 Reply Quote Share
0x5e3dFull Member
Posts: 103 · Reputation: 519
#9Oct 21, 2018, 06:46 AM
Thanks, I didn't catch that part. That does make it worth the effort. Allow me to add more Merit. @OP: can you fix the img links, so the images show up when you reach Jr. Member (only 10 posts to go)? For example: Should be:
5 Reply Quote Share
shrimpFull Member
Posts: 151 · Reputation: 456
#10Oct 21, 2018, 11:16 AM
Thank you for sharing this! This is a better solution than my findings.
1 Reply Quote Share
laseryesMember
Posts: 14 · Reputation: 192
#11Oct 21, 2018, 08:08 PM
hey , i don't understand why i create watch only wallet command for importdescriptor error message Executing command using "watch only wallet" wallet importdescriptors "[{\"desc\": \"wpkh([14e61600/84'/0'/0']xpub6BuMVZnKofsTGQSP4TkmvYLzV1MpHAceDteJgveizpvCR6PGxhaGuCvgQJz5wKjS47fESUv8Aqk sJnAYLk4uTUS4cjsyLncUzaQM7hKNXCZ/1/*)#m5n2mwfm\", \"range\": [0,999], \"timestamp\": 1714782715, \"internal\": true, \"watchonly\": true, \"active\": true}]" [   {     "success": false,     "error": {       "code": -5,       "message": "Provided checksum 'm5n2mwfm' does not match computed checksum 'g9v4p57c'"     }   } ] somebody can answer to me? i follow this man teach bitcoin core offline transaction step website : https://medium.com/@ChangTraca/bitcoin-core-as-cold-storage-sign-transactions-offline-and-generate-receiving-addresses-from-the-f0b2de8436b5 i use window system , is this reason use linux system only ?
0 Reply Quote Share
Posts: 54 · Reputation: 222
#12Oct 21, 2018, 10:18 PM
That message contains the reason for the error. The provided checksum which is the string starting with "#" sign after the descriptor isn't correct. Just change it with the correct checksum "g9v4p57c" and it will be imported to your watch-only wallet. But if it's from listdescriptors command of your offline Bitcoin Core, the checksum should already be correct. Anyways, check your setup if your offline wallet can sign low value transactions created in your watch-only wallet before funding it with your intended amount.
2 Reply Quote Share
laseryesMember
Posts: 14 · Reputation: 192
#13Oct 22, 2018, 04:03 AM
yes , it is come from offline bitcoin core create new wallet generate new address listdescriptor command :  {       "desc": \"wpkh([14e61600/84h/0h/0h]xpub6BuMVZnKofsTGQSP4TkmvYLzV1MpHAceDteJgveizpvCR6PGxhaGuCvgQJz5wKjS47fESUv8Aqk sJnAYLk4uTUS4cjsyLncUzaQM7hKNXCZ/0/*)#2qktxmer",       "timestamp": 1714782714,       "active": true,       "internal": false,       "range": [         0,         1000       ],       "next": 1,       "next_index": 1     },     {       "desc": "wpkh([14e61600/84h/0h/0h]xpub6BuMVZnKofsTGQSP4TkmvYLzV1MpHAceDteJgveizpvCR6PGxhaGuCvgQJz5wKjS47fESUv8Aqk sJnAYLk4uTUS4cjsyLncUzaQM7hKNXCZ/1/*)#m5n2mwfm",       "timestamp": 1714782715,       "active": true,       "internal": true,       "range": [         0,         999       ],       "next": 0,       "next_index": 0     }, but online computer i create watch only wallet importdescriptor command show checksum error ? i don't understand what happen ?
3 Reply Quote Share
Posts: 54 · Reputation: 222
#14Oct 22, 2018, 08:07 AM
Okay, so you didn't copied it 1:1 but used single quotations marks (') for hardened derivation instead of the character used by the descriptor which is "h". Using getdescriptorinfo command shows that the computed checksum changes if the character is changed: Result: "checksum": "g9v4p57c", Result: "checksum": "m5n2mwfm", You can use either character but edit the checksum to its corresponding descriptor, just make sure that the derivation path indices and extended public key (xpub) are correct.
1 Reply Quote Share

Related topics