2

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?
2

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.

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.