1

BIP004 states that a derivation path's 4th digit will be 1 if it is a change address like this:

m / purpose' / coin_type' / account' / change / address_index

https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change

The idea is that once money is spent from a given address, the left over is moved in to a new address which is used as the change address. Wallet software should not leave the left over funds in an address in the old address, they should be moved to the new address. I guess that some wallets follow this, and some don't. But wallets that do not follow this would be breaking the BIP.

So, my question is, from looking at a given address on the blockchain is there a programmatic way to tell where the funds have been moved to?

If you have the public key and the derivation path for the address, you can derive the change address, but if I don't have these things, is there a way to figure it out? Or, at least to take a good guess as to what it might be based on where the funds are moved to?

Use Case (View-Only Wallet):

  • User adds a loose address to their wallet (without public key)
  • App scans blockchain for address
  • App realizes balance has changed and transaction occurred
  • Funds have moved to another address, but app can't figure this out without prompting user, or displaying an incorrect balance.
  • The change address is always an additional output in the transaction. I am not aware that there is a way to discriminate between outputs what may be a legitimate change address but, there may be? – Willtech Mar 5 '18 at 10:24
  • Yep. That's what I mean. The change address will be there, but the question is how to discriminate between the two. – Melbourne Developer Mar 6 '18 at 21:50

Your Answer

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

Browse other questions tagged or ask your own question.