0

I installed bitcoin core and I am generating an address using getnewaddress. To get the private_key of the address I am using dumpprivkey. To get the unspents I am using listunspent. Till here everything is working perfectly. Now the problem is let's say If I created an address without using bitcoin core then can I get the unspents of the address? I tried using dumpprivkey and it is returning

unspent = host.call('listunspent',0,9999999,['msjK2Az65fzqzUDA6yB6QeNi42ssUAxG93'])

Error:

Exception: Error in RPC call: {'code': -4, 'message': 'Private key for address msjK2Az65fzqzUDA6yB6QeNi42ssUAxG93 is not known'}

I tried listunspent and it is returning empty list. How to get the unspent of the address created without using bitcoin core?

2 Answers 2

0

From my experience the bitcoin wallet can only use listunspend with known addresses and keys. One can import keys or addresses, addresses without keys will be watch-only addresses. I am not sure if txindex=1 is required though (with a rescan of the blockchain). See here and for txindex also here.

0

If I created an address without using bitcoin core then can I get the unspents of the address?

No you cant see them using command listunspent

I tried using dumpprivkey and it is returning Error message

This is because your node doesnt identify the address that is not generated by it. It has inbuilt wallet configuration that allow you to send and recive fund in addresses generated by your full node . As It doesnt have any info about address created outside your full node it gives you error message when you call for private key. You cant even transfer fund from such addresses as you dont have private key to do so.

You can use bitcoin libraries to generate address, and store their pvt key to sign transaction . Full node has nothing to do in process.

Your Answer

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

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