user85822: It does not seem practical to scan every transaction on a block chain to determine the balance for an account.  As the block chain grows this seems even more difficult and resource consuming. Perhaps all the transactions are grouped into what we used to call a record, specifically a variable length record.
address..trans1, trans2, etc...transN  for the last transaction. 

user7272: A somewhat more intuitive way to think about balance calculations is to think of you you use an actual fiat wallet.
If you want to look at how much money you physically have right now, you would open up your wallet, take out all the notes of varying denominations, and sum them up. This gives you your balance.
Bitcoin does something similar, where an address is similar to your physical wallet. A single address may have multiple utxos linked to it. The balance for that address is the sum of all the utxos.
The key thing here is that bitcoin only tracks unspent transaction outputs. Thus, to arrive at the balance for the address, it just needs to iterate through the blockchain, add new outputs when they are created, and remove old ones when they are spent. Moreover, this is a extendable process. If you know the utxo set as of block 100, you do not need to recalculate from block 0 to update with data from block 101. You can simply update your set from block 100.
This again is similar to how we use physical wallets. No one keeps track of all the notes and coins they have had in the past (spent transaction outputs). They only keep track of what they have currently (utxo). When a new transaction occurs (say you buy milk), you only update the current state of your wallet by removing a note, and putting the change back. You don't need to calculate it from the first time you used money.
Bitcoin takes this a step further and has a concept of accounts, which are multiple addresses that act as one wallet. A similar analogy would be if everyone in your house pooled the money from all of their wallets, so that you can spend it as one. Again, the balance of an account is simply the sum of the balance of the addresses in it.

user85746: Bitcoin uses the so called UTXO (Unspent Transaction Output) model.
The first time it is not very intuitive because it is different from the traditional accounting model where you just spend from and send to an account.
Think about full piggy banks that can't be filled more than they are and that you have to break open before being able to spend the content:

Bob has 1 piggy bank, he wants to pay Alice with half of the piggy bank's content.
He breaks his piggy bank.
He takes half of it and gives it to Alice, who will put it all in a new piggy bank belonging to her.
You put the remaining half in a new smaller piggy bank belonging to you and which is waiting to be broken open.

Each piggy bank/UTXO is linked to an address.
A Bitcoin user can of course have several UTXOs related to his address. The sum of the UTXOs gives the amount of bitcoins owned by the address (which is one of the function of wallets).
Each transaction input is the output of a previous transaction.
Although wallet software gives the feeling that you "transfer" bitcoins or satoshis, you don't spend from an account you spend UTXO.
You spend from transactions previously made to you.

85822: <p>It does not seem practical to scan every transaction on a block chain to determine the balance for an account.  As the block chain grows this seems even more difficult and resource consuming. Perhaps all the transactions are grouped into what we used to call a record, specifically a variable length record.
address..trans1, trans2, etc...transN  for the last transaction. </p>
 7272: <p>A somewhat more intuitive way to think about balance calculations is to think of you you use an actual fiat wallet.</p>

<p>If you want to look at how much money you physically have <em>right now</em>, you would open up your wallet, take out all the notes of varying denominations, and sum them up. This gives you your balance.</p>

<p>Bitcoin does something similar, where an address is similar to your physical wallet. A single address may have multiple utxos linked to it. The balance for that address is the sum of all the utxos.</p>

<p>The key thing here is that bitcoin only tracks <em>unspent</em> transaction outputs. Thus, to arrive at the balance for the address, it just needs to iterate through the blockchain, add new outputs when they are created, and remove old ones when they are spent. Moreover, this is a extendable process. If you know the utxo set as of block 100, you do not need to recalculate from block 0 to update with data from block 101. You can simply update your set from block 100.</p>

<p>This again is similar to how we use physical wallets. No one keeps track of all the notes and coins they have had in the past (spent transaction outputs). They only keep track of what they have currently (utxo). When a new transaction occurs (say you buy milk), you only update the current state of your wallet by removing a note, and putting the change back. You don't need to calculate it from the first time you used money.</p>

<p>Bitcoin takes this a step further and has a concept of accounts, which are multiple addresses that act as one wallet. A similar analogy would be if everyone in your house pooled the money from all of their wallets, so that you can spend it as one. Again, the balance of an account is simply the sum of the balance of the addresses in it.</p>
 85746: <p>Bitcoin uses the so called <strong>UTXO</strong> (Unspent Transaction Output) model.<br />
The first time it is not very intuitive because it is different from the traditional accounting model where you just spend from and send to an account.<br />
Think about full piggy banks that can't be filled more than they are and that you have to break open before being able to spend the content:</p>
<ol>
<li>Bob has 1 piggy bank, he wants to pay Alice with half of the piggy bank's content.</li>
<li>He breaks his piggy bank.</li>
<li>He takes half of it and gives it to Alice, who will put it all in a new piggy bank belonging to her.</li>
<li>You put the remaining half in a new smaller piggy bank belonging to you and which is waiting to be broken open.</li>
</ol>
<p>Each piggy bank/UTXO is linked to an address.
A Bitcoin user can of course have several UTXOs related to his address. The sum of the UTXOs gives the amount of bitcoins owned by the address (which is one of the function of wallets).<br />
Each transaction input is the output of a previous transaction.
Although wallet software gives the feeling that you &quot;transfer&quot; bitcoins or satoshis, you <strong>don't spend from an account</strong> you <strong>spend UTXO</strong>.<br />
You spend from transactions previously made to you.</p>
