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?

  • You mean like way down the line when there's a billion blocks in the chain, will it take a long time to verify amounts? – fredsbend Dec 29 '17 at 3:00
  • 1
    Sure, or even what's the incremental difference from one year to the next. – Dave Dec 29 '17 at 3:26

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.


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.

  • 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 Dec 31 '17 at 20:18
  • 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 Jan 1 '18 at 8:52
  • 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 Jan 1 '18 at 8:53

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.