0

To my understanding, the miners solve the nonce to get a valid block header based on the difficulty target. In the header, you have the Merkle root, which is generated from the transactions included in the block. Based on the documentation, the nodes validate the transactions. Does this mean the miner doesn't need to verify the transactions in the mempool?

I have been searching for examples of what a block submission looks like. I know blocks can be submitted via the RPC. Even though this won't be practical, however, say I was building a miner. Does anyone know what format is used to submit the block concretely? Are there any known practical implementations understandable by dummies? Looking for code or whatever.

2

2 Answers 2

0

does this mean the miner doesn't need to verify the transactions in the mempool ?

Miners must verify the transactions they include in a block, because if they don't, some invalid transaction may be included in the block. A block with an invalid transaction will not be accepted by the network, i.e. full nodes, which means that the miner wasted electricity and did not receive any reward.

Bitcoin block consists of:

  1. block header
    • version
    • prev_block
    • merkle_root
    • timestamp
    • bits
    • nonce
  2. transaction counter
  3. transactions
-1

Does this mean the miner doesn't need to verify the transactions in the mempool?

The actual entity doing the hashing doesn't have to verify anything as long as they have a block header to mine on. But first someone (generally the mining pool) would have to have built such block header, and for that they would have to have gathered transactions from the mempool and built the block and then took the merkle root of the transactions. In this process they would have validated the transactions included.

3
  • 1
    I can't agree with this. This would be true if the miner was part of the mining pool. Only the miner and its mempool were mentioned in the question. In that case, the miner must verify the transaction.
    – user144491
    Sep 26, 2023 at 21:18
  • You are right, but I am also right since I mentioned a real possibility.
    – fiatjaf
    Sep 26, 2023 at 22:32
  • 1
    Yes, maybe just edit the answer with a note that it is in the case of a mining pool.
    – user144491
    Sep 26, 2023 at 22:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.