1

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 ?

balaphp
  • 111
  • 2
  • Possible duplicate of https://bitcoin.stackexchange.com/questions/62011/blockchain-and-transaction-validation – Ava Chow Nov 09 '17 at 18:21
  • https://medium.com/@ConsenSys/thoughts-on-utxo-by-vitalik-buterin-2bb782c67e53 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 09 '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. – Ava Chow Nov 09 '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 ? https://bitcoin.stackexchange.com/questions/4301/what-is-an-unspent-output/4304#4304 – balaphp Nov 09 '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. – Ava Chow Nov 09 '17 at 20:43
  • Understand bit.. when the transaction happen the amount will be taken from UTXO set. the process will use UTXOs is LIFO or FIFO ? – balaphp Nov 10 '17 at 03:45
  • Neither. UTXOs are specified and the sender can choose UTXOs in whatever order they want. – Ava Chow Nov 10 '17 at 04:18

0 Answers0