9
Reading this thread about how transaction outputs are split due to "change" made me wonder how the bitcoin network knows you own that second address. How does your wallet/client display the correct balance, if it's unknown to everyone else that the second address is yours?
I'm assuming it has something to do with the wallet and accounts... if so, how can you find the "account" that corresponds with that address?
2So when your client connects to the network, it takes all of the addresses it has the private key for, then tallies up each of the coins that have been sent to each of those addresses and haven't been sent to other addresses to arrive at the total? I just tried
dumpprivkeyon the change address generated by my last transaction, and it worked. However,getaccountreturned nothing. I'm guessing an account is a separate thing, and the relation between addresses and accounts in your wallet is not 1 to 1? – bvpx – 2013-08-01T17:18:54.1534That's entirely correct. Accounts have hardly anything to do with addresses - they are just virtual balances (they can go negative too, for example, if you send more from them than to them). – Pieter Wuille – 2013-08-01T17:23:52.780