1

My understanding of how the blockchain works is that to determine the balance of an address one must find all the transactions that have outputs to that address. So, the only way to be sure you are not missing a transaction is that you have to scan the whole blockchain to determine the balance of an address.

Is that correct?

2

That is correct. This is what the optional -rescan flag does to the addresses in your wallet when launching bitcoind.

There is no balance property. Balances are just the total values added up on all unspent outputs for a given address, and the only way to determine the unspent outputs of an address is by scanning/tracing/following each output from address to address.

  • So, I assume when I make a transfer, it does not normally rescan the whole blockchain, but keeps a running balance for the addresses in the wallet, but if I add a new address to the wallet, then a rescan will be necessary. Is that right? – Tyler Durden Apr 18 '17 at 4:53
  • 1
    Yes, but only when you add a new address which may have been used before. When the wallet itself creates a new address for you it knows it has never been used, so no need for a rescan. – Pieter Wuille Apr 18 '17 at 6:41

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.