1

I have imported watchonly addresses in Bitcoin and trying to createrawtransaction with input watchonly listunspend which has spendable=false, scriptSig=empty.

after that, I'm getting an error on fundrawtransaction with message "Signing transaction failed"

I know it's unsigned and can't calculate fee but if I put in order createrawtransaction signrawtransaction fundrawtransaction sendrawtransaction

still, it gives me an error "Signing transaction failed"?

2
  • I'm confused - what results do you expect to be able to achieve here? Of course you can't sign the transaction because you don't have any private keys. Aug 30, 2017 at 16:08
  • fundrawtransaction does not sign, and does not need the private key. The error message is confusing. I'll write an answer later. Aug 30, 2017 at 22:31

1 Answer 1

-1

A bitcoin address, watchonly or not, represents a public key. This public key has a corresponding private key.

If you import a watch only address the corresponding private key is not imported. So you cannot spend any unspent outputs from those addresses.

If you want to send bitcoin to the watch only address, you have to make sure you know the corresponding private key or your bitcoin will be lost.

Choose an unspent output from another address where you know the private key. Take this output when you run 'createrawtransaction'. Sign the transaction with this private key then 'sendrawtransaction'.

Optionally before you 'sendrawtransaction', decode your hex string with 'decoderawtransaction' and make sure everything is correct.

4
  • 2
    This does not explain why fundrawtransaction doesn't work (which does not need the private key). Aug 30, 2017 at 22:21
  • thanks I didn't know about fundrawtransaction and wrongly assumed user2224893 was mixing up api calls with the english language. Sorry user2224893! I ran the call fundrawtransaction on my node but got an error 'Method not found' I run a node with wallet disabled so I checked en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list and could not see it either. Meanwhile I can see on github it does exist, my bad.
    – ubro
    Aug 30, 2017 at 22:40
  • Don't use that wiki, it's outdated by many years. Aug 30, 2017 at 22:48
  • Thanks it is even mentioned on the wiki but I didn't see it, the new version has fundrawtransaction covered: bitcoin.org/en/developer-reference#fundrawtransaction
    – ubro
    Aug 31, 2017 at 0:30

Your Answer

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

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