Hello everyone, I've been reading a bit of the bitcoin wiki and I'm really impressed by the technical details.
However, I have one question: how is the balance of a single address or an account calculated?
AFAICT, this is the sum over all transactions in the longest chain involving that address, correct?
If yes, this leads to the next question: won't the amount of computation needed to scan through the
entire chain become prohibitive at some point? Especially if the number of transactions increases at
a similar rate as, e.g. the global hash rate?
1. Yep, that's how it works, kind of...
2. The only thing you're missing is that you don't need to go back through the entire chain- just to the previous transaction where it came under that address' control. Since every time you send coins it verifies that there is a tx where the coins came under your control, the block chain forms a transaction chain that is self building.
basically, you only need to look at the tx that gave the coins to the address that is spending them, not all the way back to generation- the blockchain already does that.