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?

9

The bitcoin network does not know who owns which address. The concept of an address doesn't even exist at the protocol level - it's just an authentication layer on top of the scripting logic in transactions.

And of course your own client does - because it has the private key for change addresses it generated itself. That's all that matters. When spending a transaction output, the client will prove that it holds that private key by creating a digital signature that matches the address. That's all the network cares about.

  • 2
    So 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 dumpprivkey on the change address generated by my last transaction, and it worked. However, getaccount returned 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 Aug 1 '13 at 17:18
  • 4
    That'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 Aug 1 '13 at 17:23
2

The network does not have any labels associated with any address, besides the address itself.

The wallet software being used manages change addresses and corresponding private keys to ensure that the user has control over any change addresses.

From a network perspective, there are no accounts/wallets that can be readily identified (though blockchain analysis techniques can be used to attempt this to varying degrees of success). A group of addresses (AKA a wallet or maybe even account if one wants to call it that) can only be definitively identified/associated by the wallet software used to create that group of addresses.

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.