<p>First of, each node on the network maintains an UTXO-set. Not only miners.</p>

<p><strong>to 1.</strong> The UTXO-set is created by <em>applying</em> all transactions in each block in the chain from the beginning. All transactions that remain unspent when reaching the chain tip are in the UTXO-set. The older a block, the higher the probability that the whole network has a equal block. Equal blocks result in an equal UTXO-set.</p>

<p><strong>to 2.</strong> Each node validates blocks, not only miners. A block is deemed valid, if it follows the consensus rules. One consensus rule is, that each spend transaction (TXO) must be in the current (pre-acceptance) UTXO-set or a TXO created early in the same block. Block validation does not interfere with the actual mining (only for a short time, when the block is accepted and a new blocktemplate has to be pushed to the ASIC). Validation happens on the host CPU and the actual mining part happens in the ASIC. If a miner doesn't validate an invalid block, he wastes his time/electricity/money with mining an invalid block on top of the previous invalid block. </p>

CC BY-SA 4.0
2018-06-28T19:38:22.680Z
2018-06-28T19:38:22.680Z
0xb10c
<p>I have understood that miners validate the transactions by checking for double spends and that the transaction was not already confirmed, what I don't understand is how the miners are able to do this when all the data they have is the transactions. </p>

<ol>
<li>Do miners maintain a UTXO set that has the UTXO details of all<br>
nodes in the network? If that is the case it might be possible that 
the UTXO sets maintained ny different miners is different at a given
point of time right.</li>
<li>Now once the block is broadcast to the    network, we know that
other miners express their acceptance to the    block by mining the
next block on top of this. But before that they    validate the
block that was just published. How do they validate this    block?
Also why will they have to care to do it when they can save    time
by creating the next block? Is it that we are assuming honesty<br>
from miners who are actually interested in making money?</li>
</ol>

<mining-theory><mining-profitability><transaction-verification><utxo-set>
Transaction vaildation
Vasista
# Transaction vaildation

(Asked by: username_0 on 2018-06-28)

I have understood that miners validate the transactions by checking for double spends and that the transaction was not already confirmed, what I don't understand is how the miners are able to do this when all the data they have is the transactions.

1. Do miners maintain a UTXO set that has the UTXO details of all  
   nodes in the network? If that is the case it might be possible that
   the UTXO sets maintained ny different miners is different at a given
   point of time right.
2. Now once the block is broadcast to the network, we know that
   other miners express their acceptance to the block by mining the
   next block on top of this. But before that they validate the
   block that was just published. How do they validate this block?
   Also why will they have to care to do it when they can save time
   by creating the next block? Is it that we are assuming honesty  
   from miners who are actually interested in making money?

**Tags:** mining-theory, mining-profitability, transaction-verification, utxo-set


---

## 1 answers

### Answer by username_1 on 2018-06-28. Score: 2 | Accepted answer

First of, each node on the network maintains an UTXO-set. Not only miners.

**to 1.** The UTXO-set is created by *applying* all transactions in each block in the chain from the beginning. All transactions that remain unspent when reaching the chain tip are in the UTXO-set. The older a block, the higher the probability that the whole network has a equal block. Equal blocks result in an equal UTXO-set.

**to 2.** Each node validates blocks, not only miners. A block is deemed valid, if it follows the consensus rules. One consensus rule is, that each spend transaction (TXO) must be in the current (pre-acceptance) UTXO-set or a TXO created early in the same block. Block validation does not interfere with the actual mining (only for a short time, when the block is accepted and a new blocktemplate has to be pushed to the ASIC). Validation happens on the host CPU and the actual mining part happens in the ASIC. If a miner doesn't validate an invalid block, he wastes his time/electricity/money with mining an invalid block on top of the previous invalid block.


---

