<p>With a naive implementation, yes, but in practice, no, it is not a problem.</p>

<p>This is because any developer that knows what they are doing is smart enough to create a database which, at the very least, records each transaction (or its position on disk) and its verification status. So when you receive a new transaction, instead of having to walk back through history, you just need to look back to the referenced previous transaction. As part of validating a transaction, you check if the previous transaction was valid. So if a transaction is marked as valid in your database, then you can be sure that the transactions that preceded it  are also valid. Thus there is no need to actually look through history and re-validate those transactions.</p>

<p>Since it ultimately just comes down to a simple database lookup, it does not become harder to validate new transactions.</p>

CC BY-SA 3.0
2018-01-29T05:06:29.823Z
2018-01-29T05:06:29.823Z
Ava Chow
<p>The calculation time will degenerate very slowly the longer time goes on as the mechanisms used are very efficient. Consider a simplified payment verification node (SPV) that is interested in incoming payments to an address in its wallet. The SPV node will establish a bloom filter on its connections to peers to limit the transactions received to only those containing addresses of interest. When a peer sees a transaction that matches the bloom filter, it will send the block using a merkleblock message. The merkleblock message contains the block header as well as a merkle path that links the transaction of interest to the merkle root in the block. The SPV node can use this merkle path to connect the transaction in the block and verify that the transaction is included in the block. The SPV node also uses the block header to link the block to the rest of the blockchain. The combination of these two links, between the transaction and block and between the block and the blockchain, proves that the transaction is recorded in the blockchain. All in all the SPV node will have received less than a kilobyte of data for the block header and merkle path which is very efficient and the calculation time will degenerate very slowly as more blocks are added. </p>

CC BY-SA 3.0
2017-12-31T20:18:39.753Z
If I'm reading you right, you're sayihng you can only look at certain transactions to figure out how much Bitcoin is in a wallet.  But I don't see how this can be true.  For each transaction giving to the wallet, for example, don't you ahve to verify that those people have the necessary funds in their wallet, which would cause a scan of all those wallets and so on?  So aren't you essentially scanning all transactions in the blockchain every time?
Dave
CC BY-SA 3.0
2018-01-01T08:52:42.307Z
The fundamental building block of a bitcoin transaction is a transaction output.  Transaction outputs are indivisible chunks of bitcoin currency, recorded on the blockchain and recognised as valid by the entire network. Bitcoin full nodes track all available and spendable outputs known as unspent transactions or UTXO. When a users wallet receives bitcoin it means that the wallet has detected UTXO that can be spent with one of the keys controlled by the wallet.
John Singh
CC BY-SA 3.0
2018-01-01T08:53:35.793Z
A users bitcoin balance is the sum of all UTXO that a users wallet can spend which may be scattered amongst hundreds of transactions and blocks. The transaction output consists of the amount in Satoshis and a cryptographic puzzle that determines the conditions required to spend the output. This puzzle is also known as a locking script. This means that all the conditions required to prove ownership are contained in the transaction script and the wallet does not have to scan the blockchain to check if the person that sent the bitcoin actually has the  funds.
John Singh
CC BY-SA 3.0
2017-12-29T07:00:44.193Z
2017-12-29T07:07:00.690Z
2017-12-29T07:07:00.690Z
John Singh
<p>I have read that the blockchain is a series of transactions that record one person giving bitcoin to another.  Please correct me if this assumption is wrong as it is the basis for my question.  So, over time, doesn't it take an increasingly long time to figure out if you can accept Bitcoin from someone because you will have to go through every transaction in the history of the blockchain to validate that the person giving you Bitcoin does indeed have that Bitcoin in the first place?</p>

CC BY-SA 3.0
2017-12-29T03:26:08.307Z
Sure, or even what's the incremental difference from one year to the next.
Dave
<transactions><blockchain><wallet><block>
Does calculating how many bitcoins I have take longer as time goes on?
Dave
# Does calculating how many bitcoins I have take longer as time goes on?

(Asked by: username_0 on 2017-12-28)

I have read that the blockchain is a series of transactions that record one person giving bitcoin to another. Please correct me if this assumption is wrong as it is the basis for my question. So, over time, doesn't it take an increasingly long time to figure out if you can accept Bitcoin from someone because you will have to go through every transaction in the history of the blockchain to validate that the person giving you Bitcoin does indeed have that Bitcoin in the first place?

**Tags:** transactions, blockchain, wallet, block

> **Comments:**
> **username_0**: Sure, or even what's the incremental difference from one year to the next.  

---

## 2 answers

### Answer by username_1 on 2018-01-29. Score: 1

With a naive implementation, yes, but in practice, no, it is not a problem.

This is because any developer that knows what they are doing is smart enough to create a database which, at the very least, records each transaction (or its position on disk) and its verification status. So when you receive a new transaction, instead of having to walk back through history, you just need to look back to the referenced previous transaction. As part of validating a transaction, you check if the previous transaction was valid. So if a transaction is marked as valid in your database, then you can be sure that the transactions that preceded it are also valid. Thus there is no need to actually look through history and re-validate those transactions.

Since it ultimately just comes down to a simple database lookup, it does not become harder to validate new transactions.


---

### Answer by username_2 on 2017-12-29. Score: 0

The calculation time will degenerate very slowly the longer time goes on as the mechanisms used are very efficient. Consider a simplified payment verification node (SPV) that is interested in incoming payments to an address in its wallet. The SPV node will establish a bloom filter on its connections to peers to limit the transactions received to only those containing addresses of interest. When a peer sees a transaction that matches the bloom filter, it will send the block using a merkleblock message. The merkleblock message contains the block header as well as a merkle path that links the transaction of interest to the merkle root in the block. The SPV node can use this merkle path to connect the transaction in the block and verify that the transaction is included in the block. The SPV node also uses the block header to link the block to the rest of the blockchain. The combination of these two links, between the transaction and block and between the block and the blockchain, proves that the transaction is recorded in the blockchain. All in all the SPV node will have received less than a kilobyte of data for the block header and merkle path which is very efficient and the calculation time will degenerate very slowly as more blocks are added.

> **Comments:**
> **username_0**: If I'm reading you right, you're sayihng you can only look at certain transactions to figure out how much Bitcoin is in a wallet.  But I don't see how this can be true.  For each transaction giving to the wallet, for example, don't you ahve to verify that those people have the necessary funds in their wallet, which would cause a scan of all those wallets and so on?  So aren't you essentially scanning all transactions in the blockchain every time?  
> **username_2**: The fundamental building block of a bitcoin transaction is a transaction output.  Transaction outputs are indivisible chunks of bitcoin currency, recorded on the blockchain and recognised as valid by the entire network. Bitcoin full nodes track all available and spendable outputs known as unspent transactions or UTXO. When a users wallet receives bitcoin it means that the wallet has detected UTXO that can be spent with one of the keys controlled by the wallet.  
> **username_2**: A users bitcoin balance is the sum of all UTXO that a users wallet can spend which may be scattered amongst hundreds of transactions and blocks. The transaction output consists of the amount in Satoshis and a cryptographic puzzle that determines the conditions required to spend the output. This puzzle is also known as a locking script. This means that all the conditions required to prove ownership are contained in the transaction script and the wallet does not have to scan the blockchain to check if the person that sent the bitcoin actually has the  funds.  

---

