0

Can we calculate unspent of addresses which are generated from other node server if we are having private/public key of those addresses?

0

If you have just a pair of private and public keys, you would need a little more information.

A single public key can control Bitcoin in a number of ways:

  1. A direct p2pk output
  2. A p2pkh output paying the hash of the public key
  3. A p2sh output paying a script controlled by a set of public keys that may include keys other than the one you have
  4. A p2wpkh segwit output paying the hash of the public key
  5. A p2wsh output paying a script controlled by a set of public keys that may include keys other than the one you have

Without knowing which type of output you are looking for, the public key alone is not sufficient, especially for p2sh and p2wsh outputs where other keys are required to construct the address.

Once you know which output type to look for, you can use the scantxoutset RPC method of a node, or construct your own index similar to an explorer or Electrum server and query balances.

|improve this answer|||||
  • Thanks @Raghav. Can you please tell whether bitcoin-core support derivation path other than m/0'/0'/i. Is there any possibility for m/1'/0'/i or m/k'/0/i' where k: 1,2,3....& so on ? – Jvd Dec 17 '19 at 10:14
  • It does not, as far as I'm aware – Raghav Sood Dec 17 '19 at 10:17
  • As far as i know bitcoincore support HD wallet creation but how we can create derivartion like m/1'/0' as m/0'/0' which is for default account 0 because i want to maintain user account in bitcoincore HD wallet. – Jvd Dec 17 '19 at 10:35
  • You can't, you need to maintain a user->address mapping outside of bitcoind – Raghav Sood Dec 17 '19 at 10:43
  • yes. that's true but how we can calculate unspent of user->address mapping outside of bitcoind from any node? – Jvd Dec 17 '19 at 10:54

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.