2

How does transaction confirmation work in bitcoin-qt? I suppose, client does not have addresses index with balance on each of them (because there is not such console/bitcoind commands). Looking through all of the blocks - it is too slow.

1

Transaction processing is a function of mining. Each time a block is found observed transactions become included in the block chain and get one confirmation. The Bitcoin protocol is designed to have an adjusting difficulty to ensure that blocks are not generated at a speed greater than that> This ensures the gradual distribution of new coins into the economy as well. So long story short this is the model that Bitcoin uses and it is one of the few shortcomings of performing transactions.

  • That's fine. But what happens if I send transaction, which are moving 1 BTC from address1 to address2 (address1 has only 0.5 BTC)? Miners will check it? What if I am a miner, and include this transaction in my own block? – Zergatul Dec 15 '13 at 10:20
  • The bitcoin nodes check all of the transactions in a block and will reject the block if it contains an invalid transaction. Each transaction must reference an unspent output in order to transfer coins. If your wallet has just 0.5 BTC, then it does not have an unspent output of 1.0 BTC and the transaction cannot be created. Note that all transactions are public and are contained in the blockchain, not in your wallet. – ScripterRon Dec 15 '13 at 15:01
  • So, bitcoin-qt/bitcoind has ability to quicky check unspent output on particular address? Does they contain index with all addresses and unspent output on them? – Zergatul Dec 15 '13 at 15:28
0

As transactions occur, the client tracks their effects on its own balances. If you add a new account, it will have to scan all unspent outputs to find any for that account.

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.