1

UPDATE: The issue is resolved and I have mentioned the steps in Create unsigned tx (PSBT) in a watch-only wallet using bitcoin core, sign it in electrum and broadcast using bitcoin core

Below are the steps that I followed and couldn't create an unsigned tx. I am not even sure what are the inputs that can be used for it in this case and how to add inputs.

create a watch-only wallet

step-1

add one address in 'sending addresses'

step-2

dont see anything in 'receiving addresses' and no option to add

step-3

open console and run the below commands to add one address

importaddress tb1qu2l4n8st9w3hhsxstd8muaxgnu63fql9rkylmd "receivetesting" false

rescan blockchain to update

rescanblockchain 1800000 1834770

can see the address in 'receiving addresses' and balance

step-4

How do I create an unsigned tx because I get the below error and dont see anything in available balance or inputs?

Consider the scenario in which I have added an address from my cold storage to watch the balance and now want to create an unsigned transaction that spends from it which I will sign later on a different machine (offline)

Also receiving and sending addresses in a watch-only wallet is confusing. Not sure at this moment how can we make it easier to understand atleast in the GUI.

error

I found this on reddit related to same issue however didn't understand how was it resolved: https://www.reddit.com/r/Bitcoin/comments/ir308h/watch_only_balance_not_spendable_in_bitcoin_core/g4w3svg/

  • 1
    Just importing the address isn't enough for Bitcoin Core to be able to draft a transaction. The address contains the hash of you public key, but in order to create a transaction you need to public key itself. The importmulti command is probably better for the job. See also github.com/bitcoin-core/HWI/blob/master/docs/… – Sjors Provoost Sep 18 at 8:36
  • Thanks @SjorsProvoost I will try however think we can improve GUI in this case at least the error message. – Prayank Sep 18 at 8:46
1

Hi it's moral_agent from the reddit post.

https://www.reddit.com/r/Bitcoin/comments/ir308h/watch_only_balance_not_spendable_in_bitcoin_core/g5gg33f/

I do not know whether this will help you or not but I will tell you what helped me and what I think I was doing wrong.

In order to create a PSBT that spends a watch-only output, it is not always sufficient to import the address of the output.

For a pay-to-script-hash address you will also need to import the script of the output. This makes sense, since creating a valid P2SH transaction requires that you include (and satisfy) the script. Your cold-signing wallet is only expected to supply the signature, not the script, so the PSBT needs to contain that information, so your hot computer must have it to create a PSBT.

I was able to import the required script by doing importmulti. I actually didn't import the script, I imported the script descriptor sort of like this:

importmulti "[{ "desc": "sh(multi(2,BLAH-BLAH-HEX))" }]

I didn't check that syntax for bugs so you're on your own there. Importmulti takes a bunch of args, most of which are optional.

I got the output descriptor for the address I was trying to spend from by runnning getaddressinfo on the address on the computer where the address was originally generated, and which therefore knew what the script was.

Hope that helps. Let me know if you have success!

| improve this answer | |
  • Thanks for the details. This is helpful although I want to know if this is possible from GUI which also has an option to create unsigned tx. And if it doesn't work then it's a bug which needs to be fixed. I have also created an issue in github repository but no response yet: github.com/bitcoin-core/gui/issues/94 – Prayank Sep 17 at 21:20
  • 1
    You can create PSBT from the spend screen of the GUI as of Bitcoin Core v20: bitcoin.org/en/release/v0.20.0#gui-changes This GUI button only shows up if you have created a wallet that does not contain private keys, which is what you did. I do not know how to import watch only addresses (or scripts) via the GUI. – Moral Agent Sep 17 at 21:27
  • The PR: github.com/bitcoin/bitcoin/pull/16944 mentioned in the release notes looks good and it should work. Maybe I will ask the author of this PR on github. – Prayank Sep 17 at 21:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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