<blockquote>
<p>But, they are competing with each other and really busy I guess. Here is my question. How much time do miners spend validation in general and start mining?</p>
</blockquote>
<p>None at all. While they are validating new information, they are continuing to build blocks based upon the older information. Miners do not have any reason to wait to start mining except on their very initial startup. But once they are operating, they do not stop to verify information.</p>

CC BY-SA 4.0
2021-10-11T19:01:45.370Z
2021-10-11T19:01:45.370Z
David Schwartz
<p>First of all let's get a few misconceptions out of the way:</p>
<blockquote>
<p>I was guessing that miners need to validate manually. Like, go to the Blockchain.com and check the last block and unconfirmed transactions and check by themselves, manually. So, I was imagining that it takes 3 or 4 minutes for them.</p>
</blockquote>
<p>No, miners run full node software, just like you can run yourself, and they query this full node for block candidates to mine. If mining involved going to a centralized website, we could get rid of mining entirely, and just make <a href="https://www.blockchain.com/explorer" rel="nofollow noreferrer">blockchain.com</a> decide what the next block is. The whole point is to never trust any other party, but be able to perform validation yourself. blockchain.com is a third-party website, operated by a private business, and has in no way a special position in the Bitcoin protocol or its operations. Using the website for anything but debugging purposes means trusting their interpretation of what's going on in the chain. Anyone can run such a website (and in fact, many competitors exist, like <a href="https://mempool.space" rel="nofollow noreferrer">mempool.space</a>, <a href="https://blockstream.info/blocks/recent" rel="nofollow noreferrer">blockstream.info</a> (disclaimer: my former employer), <a href="https://blockchair.com/bitcoin" rel="nofollow noreferrer">blockchair.com</a>, <a href="https://live.blockcypher.com/btc" rel="nofollow noreferrer">blockcypher.com</a>, ...).</p>
<p>So what this also means: deciding what the next block candidate is going to be isn't done by the mining hardware, but by software. That means one does not interfere with the other - they happen in parallel. The hardware is <em>always</em> mining on something, and the software is <em>always</em> verifying new transactions/blocks as they come in. From time to time, the software will give an updated block candidate to the hardware, based on <em>its own</em> best understanding of what blocks are transactions are available.</p>
<p>Now, how much time is spent on validating blocks and transactions? A significant amount of time, but it's important to point out that most of it isn't actually on the critical path for constructing new blocks. The process, in theory, goes approximately like this:</p>
<ul>
<li>New transactions are continuously received by the miner's node. These transactions are validated on the fly, and stored in the mempool (a place for unconfirmed transactions; every full node has its own independent one). Typical transactions take less than a millisecond to verify, but larger/more complex ones can exceed this. It also heavily depends on the hardware used, of course.</li>
<li>At every point in time, the mempool is kept consistent with the best block the node knows about. That means that creating a new block template is very fast: just take the top transactions from the mempool (typically, for economical reasons, the ones with the highest fee per byte), as many as fit in a block (1 million bytes before BIP141; 4 million weight since). These transactions are already validated, so they don't need to be validated again at block candidate production time.</li>
<li>From time to time a new block will be received. Typically, all, or almost all, transactions in that block will already be in the mempool when it is received. The P2P protocol is even optimized for this (see BIP152 compact blocks), avoiding the need to even repeat those transactions when transmitting the block. Because of this caching, block acceptance is very fast, but occasionally it may be slow if lots of unknown transactions were included in the block, for whatever reason. In this case, it make take 100s of milliseconds, or even multiple seconds on slower hardware, to validate a block.</li>
<li>When a new block has been received and validated, the hardware must be informed as quickly as possible about a new candidate on top of this. Every millisecond before this is done means wasting the hardware's resources: it's working on a candidate on top of the previous block, which is unlikely to be accepted by the network (nodes typically only accept the earlier one of two competing blocks, unless the later one is extended first). In order to speed this up, some miners will in fact make their hardware switch over to working on an <em>empty</em> block on top of the newly received block, as soon as it arrives, and before waiting for it being validated. This is risky: as they don't know whether the received block is valid yet, this may mean switching over to working on a candidate that builds on top of an invalid block, which would be a waste of time itself. Around the time of BIP66's activation, this caused an entire chain of invalid blocks to be built, because miners started building on top of a block produced by an unupgraded other miner, without knowing it was invalid.</li>
</ul>
<p>Most of this the same for every node. Non-miners obviously don't spend time on building candidate blocks, but apart from that, the effort spent on validating blocks and transactions is the same for everyone running a fully-validating node, miners and non-miners alike.</p>

CC BY-SA 4.0
2021-10-11T15:52:34.047Z
2021-10-21T15:19:21.913Z
2021-10-21T15:19:21.913Z
Pieter Wuille
<p>I believe your question points to the <a href="https://eprint.iacr.org/2015/702.pdf" rel="nofollow noreferrer">Verifier's Dilemma</a>.</p>
<p>Basically, validating all transactions is beneficial for the system but not doing it or doing it partially might provide an advantage to the miner that chooses to skip it.</p>
<p>For Bitcoin it's close to a non issue as the cost of verifying transactions is negligible and the overall reward for doing so benefits all (including the miner)</p>
<p>Section 2.3 from the paper I linked :</p>
<blockquote>
<p>Verifying a transaction at both steps requires negligible
additional work compared to mining a new block. For
example, the Bitcoin transaction in Figure 1 has only
4 opcodes. Miners can do this extra check without
expending any significant computational work. The
cost of validation outweighs the miner’s risk of having
their earned Bitcoins in new blocks be discarded, if the
invalidity is detected in the future.</p>
</blockquote>
<p>For more complex transactions (smart contracts) other mechanisms need to be setup in order to incentivize execution / validation. Ethereum partially solves this with gas but vulnerabilities are still present (See Section 3 of the paper).</p>
<p>While there is incentive to skip the validation, there is also indirect incentive to abide by the rules :</p>
<ol>
<li>common good of the system / blockchain validity</li>
<li>Fee / block reward</li>
</ol>
<p>If the blockchain holds many invalid transactions / blocks because miners don't validate then the reputation of the system would intuitively go down which in turn would decrease the interest of mining for such system.</p>
<p>The block producer gets the block and fee reward. Ensuring that your block is valid is in your interest.</p>
<p>I hope that answers your question !</p>

CC BY-SA 4.0
2021-10-11T15:06:12.433Z
2021-10-11T15:06:12.433Z
hroussille
<p>Before mining, miners have to validate previous block and transactions which exist in mempool. Then, they pick up some validated transactions from pool and start mining on top of validated block using its hash.</p>
<p>But, they are competing with each other and really busy I guess.
Here is my question. How much time do miners spend validation in general and start mining?</p>

CC BY-SA 4.0
2021-10-11T10:36:03.657Z
Are you looking for an answer in nanoseconds?
RedGrittyBrick
CC BY-SA 4.0
2021-10-11T10:58:18.760Z
Does this answer your question? [Appending txns to merkle tree on PoW efficiency, true hash rate](https://bitcoin.stackexchange.com/questions/106893/appending-txns-to-merkle-tree-on-pow-efficiency-true-hash-rate)
Vojtěch Strnad
CC BY-SA 4.0
2021-10-11T14:42:29.270Z
@RedGrittyBrick
No. I was guessing that miners need to validate manually. Like, go to the Blockchain.com and check the last block and unconfirmed transactions and check by themselves, manually. So, I was imagining that it takes 3 or 4 minutes for them. But from what you are asking me, my guess is completely wrong.
pepperoni
<mining-theory><transaction-verification><block-validity>
How much time do miners spend validation?
pepperoni
# How much time do miners spend validation?

(Asked by: username_0 on 2021-10-11)

Before mining, miners have to validate previous block and transactions which exist in mempool. Then, they pick up some validated transactions from pool and start mining on top of validated block using its hash.

But, they are competing with each other and really busy I guess.
Here is my question. How much time do miners spend validation in general and start mining?

**Tags:** mining-theory, transaction-verification, block-validity

> **Comments:**
> **username_1**: Are you looking for an answer in nanoseconds?  
> **username_2**: Does this answer your question? [Appending txns to merkle tree on PoW efficiency, true hash rate](https://bitcoin.stackexchange.com/questions/106893/appending-txns-to-merkle-tree-on-pow-efficiency-true-hash-rate)  
> **username_0**: @username_1 No. I was guessing that miners need to validate manually. Like, go to the Blockchain.com and check the last block and unconfirmed transactions and check by themselves, manually. So, I was imagining that it takes 3 or 4 minutes for them. But from what you are asking me, my guess is completely wrong.  

---

## 3 answers

### Answer by username_3 on 2021-10-11. Score: 2 | Accepted answer

> But, they are competing with each other and really busy I guess. Here is my question. How much time do miners spend validation in general and start mining?

None at all. While they are validating new information, they are continuing to build blocks based upon the older information. Miners do not have any reason to wait to start mining except on their very initial startup. But once they are operating, they do not stop to verify information.


---

### Answer by username_4 on 2021-10-11. Score: 2

First of all let's get a few misconceptions out of the way:

> I was guessing that miners need to validate manually. Like, go to the Blockchain.com and check the last block and unconfirmed transactions and check by themselves, manually. So, I was imagining that it takes 3 or 4 minutes for them.

No, miners run full node software, just like you can run yourself, and they query this full node for block candidates to mine. If mining involved going to a centralized website, we could get rid of mining entirely, and just make [blockchain.com](https://www.blockchain.com/explorer) decide what the next block is. The whole point is to never trust any other party, but be able to perform validation yourself. blockchain.com is a third-party website, operated by a private business, and has in no way a special position in the Bitcoin protocol or its operations. Using the website for anything but debugging purposes means trusting their interpretation of what's going on in the chain. Anyone can run such a website (and in fact, many competitors exist, like [mempool.space](https://mempool.space), [blockstream.info](https://blockstream.info/blocks/recent) (disclaimer: my former employer), [blockchair.com](https://blockchair.com/bitcoin), [blockcypher.com](https://live.blockcypher.com/btc), ...).

So what this also means: deciding what the next block candidate is going to be isn't done by the mining hardware, but by software. That means one does not interfere with the other - they happen in parallel. The hardware is *always* mining on something, and the software is *always* verifying new transactions/blocks as they come in. From time to time, the software will give an updated block candidate to the hardware, based on *its own* best understanding of what blocks are transactions are available.

Now, how much time is spent on validating blocks and transactions? A significant amount of time, but it's important to point out that most of it isn't actually on the critical path for constructing new blocks. The process, in theory, goes approximately like this:

* New transactions are continuously received by the miner's node. These transactions are validated on the fly, and stored in the mempool (a place for unconfirmed transactions; every full node has its own independent one). Typical transactions take less than a millisecond to verify, but larger/more complex ones can exceed this. It also heavily depends on the hardware used, of course.
* At every point in time, the mempool is kept consistent with the best block the node knows about. That means that creating a new block template is very fast: just take the top transactions from the mempool (typically, for economical reasons, the ones with the highest fee per byte), as many as fit in a block (1 million bytes before BIP141; 4 million weight since). These transactions are already validated, so they don't need to be validated again at block candidate production time.
* From time to time a new block will be received. Typically, all, or almost all, transactions in that block will already be in the mempool when it is received. The P2P protocol is even optimized for this (see BIP152 compact blocks), avoiding the need to even repeat those transactions when transmitting the block. Because of this caching, block acceptance is very fast, but occasionally it may be slow if lots of unknown transactions were included in the block, for whatever reason. In this case, it make take 100s of milliseconds, or even multiple seconds on slower hardware, to validate a block.
* When a new block has been received and validated, the hardware must be informed as quickly as possible about a new candidate on top of this. Every millisecond before this is done means wasting the hardware's resources: it's working on a candidate on top of the previous block, which is unlikely to be accepted by the network (nodes typically only accept the earlier one of two competing blocks, unless the later one is extended first). In order to speed this up, some miners will in fact make their hardware switch over to working on an *empty* block on top of the newly received block, as soon as it arrives, and before waiting for it being validated. This is risky: as they don't know whether the received block is valid yet, this may mean switching over to working on a candidate that builds on top of an invalid block, which would be a waste of time itself. Around the time of BIP66's activation, this caused an entire chain of invalid blocks to be built, because miners started building on top of a block produced by an unupgraded other miner, without knowing it was invalid.

Most of this the same for every node. Non-miners obviously don't spend time on building candidate blocks, but apart from that, the effort spent on validating blocks and transactions is the same for everyone running a fully-validating node, miners and non-miners alike.


---

### Answer by username_5 on 2021-10-11. Score: 0

I believe your question points to the [Verifier's Dilemma](https://eprint.iacr.org/2015/702.pdf).

Basically, validating all transactions is beneficial for the system but not doing it or doing it partially might provide an advantage to the miner that chooses to skip it.

For Bitcoin it's close to a non issue as the cost of verifying transactions is negligible and the overall reward for doing so benefits all (including the miner)

Section 2.3 from the paper I linked :

> Verifying a transaction at both steps requires negligible
> additional work compared to mining a new block. For
> example, the Bitcoin transaction in Figure 1 has only
> 4 opcodes. Miners can do this extra check without
> expending any significant computational work. The
> cost of validation outweighs the miner’s risk of having
> their earned Bitcoins in new blocks be discarded, if the
> invalidity is detected in the future.

For more complex transactions (smart contracts) other mechanisms need to be setup in order to incentivize execution / validation. Ethereum partially solves this with gas but vulnerabilities are still present (See Section 3 of the paper).

While there is incentive to skip the validation, there is also indirect incentive to abide by the rules :

1. common good of the system / blockchain validity
2. Fee / block reward

If the blockchain holds many invalid transactions / blocks because miners don't validate then the reputation of the system would intuitively go down which in turn would decrease the interest of mining for such system.

The block producer gets the block and fee reward. Ensuring that your block is valid is in your interest.

I hope that answers your question !


---

