As far i know, In bitcoin there is no where storing the account balance in db straight forward. If the person wants to know his account balance from his client app the server will calculate all his transaction of credit and debit return the sum value.

If this above is true when person A has previous transactions like 20,000 and Person A wants to transfer some money he has to Person B.

When this process starts the bitcoin mining server has to calculate all his transaction from beginning to check whether the person A has enough balance or not and this has to be done in other mining server also to verify.

In this case as long as the person has 1 lac transaction, to calculate the balance the computation process will be heavy right ? more computation process uses more cpu cycles and power which affect the maintain cost of the computer and transaction fee may go high.

Please explain how its happening ?

  • Possible duplicate of bitcoin.stackexchange.com/questions/62011/… – Andrew Chow Nov 9 '17 at 18:21
  • medium.com/@ConsenSys/… From this i can understand well it uses UTXO but what if the UTXO has million transaction with value of 0.000001 BTC. At the time that the person wants to send 1.1 BTC the system has loop through 1 million records to match 1.1 BTC and finally its going to return false because the user has balance is 1 BTC. looping 1 million record seems heavy computation for me and the computation process also used some money (electricity)... – balaphp Nov 9 '17 at 19:07
  • that is not how the UTXO set works. Bitcoin does not use balances, it uses UTXOs. UTXOs are explicitly referenced when they are spent, so it is trivial to just look up each individual UTXO. A UTXO represents exactly one thing, not "million transaction" or multiple transactions. – Andrew Chow Nov 9 '17 at 19:12
  • no UTXO is a collection of unspent or received transaction right ? There can be chances of having N number (millions) of transaction in UTXO set.. am i right ? bitcoin.stackexchange.com/questions/4301/… – balaphp Nov 9 '17 at 19:21
  • No, a single UTXO is a single item: a transaction output. It is not a collection of transactions or outputs. The UTXO set is the collection of UTXOs. There are millions of UTXOs in the UTXO set, but it does not require significant computation to retrieve them (retrieval is O(1)). Calculating the sum of the inputs is only O(n) and is not very computationally expensive. The computationally expensive parts are in signature validation and other checks that need to be done, not balance calculation. – Andrew Chow Nov 9 '17 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.