Is it the case that the blockchain has information on the balance associated with each public key-address, such that the client on my PC, say, will look at every public/private keys pair in wallet.dat, find all public keys in the blockchain for each of my private keys, sum up the balances for each, and show me the overall balance?

  • Essentially, yes. – Nick ODell Apr 21 '13 at 6:19

The Bitcoin-Qt/bitcoind client computes the balance as you describe, by summing up all the transactions for all the Bitcoin addresses in the wallet.dat.

The blockchain contains all transactions since the genesis block (block 0). So the balances are simply all the unspent transaction outputs (UTXOs).

There are third party services which will monitor the blockchain to provide balance info for a specified address or addresses. BTCBalance.net is one.

| improve this answer | |
  • I see, so there are no balances as such, only transactions. If I use the same address to receive / send the money 3 times, what will be recorded for that public key is, +20, -4, +7. These will be summed up along with everything else in the blockchain that corresponds to my wallet.dat when calculating the total balance. – Strychnine Apr 21 '13 at 18:20
  • And of course, the system rejects any transaction which would cause the balance for the public key used to become negative. – Strychnine Apr 21 '13 at 21:44
  • How do you go from a public address to a block? – user1870400 Oct 23 '17 at 5:40

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.