3
As I understand it, a transaction basically consists of a from address, to address, amount and some component that verifies that the owner of the from_address has requested the transaction. A transaction is broadcast to the network in the hope that it will get included into a freshly mined block.
If the miner can choose which transactions to add to a block. How does the Bitcoin protocol stop a miner from re-adding an existing transaction to the chain? and thus recreating the transaction and doubling the effect of the transaction.
Surely it is not feasible to search the entire transaction history to make sure the transaction hasn't already been included.
EDIT - from a bit of further research, it looks like including a confirmed transaction will render a block invalid and it will be rejected by other Bitcoin nodes. But how can you determine if the block contained an already confirmed transaction in an efficient way?
Thanks. So the UTXO set must be rather large? A look on http://statoshi.info/dashboard/db/unspent-transaction-output-set suggests that there are 22,500,000 unspent transaction outputs? and this all has to be searched in order to validate a block?
– Roger – 2017-10-02T21:41:27.650Would distributing coins to a large number of addresses serve to increase the UTXO set, and gathering coins into a single address reduce the UTXO set? – Roger – 2017-10-02T21:43:19.600
Yes, sounds about right. Searching 22.5M UTXO is fast if you put them into an adequate data structure. If you meant sending into a single UTXO in one address, yes on both counts. – Murch – 2017-10-02T23:14:01.147
So UTXO is another data set, different from the blockchain, right? How is consensus over UTXO reached? – Mark Neuhaus – 2018-04-06T21:26:50.910
@MarkNeuhaus: I've improved my answer to better explain your follow-up question. – Murch – 2018-04-07T18:38:21.803