<p>A mining pool may provide an empty block template to its miners for block <code>n+1</code> once it has been announced a valid header for block <code>n</code> but hasn't received yet the whole block <code>n</code>. This is also known as <a href="https://bitcoin.stackexchange.com/a/38439/101498">SPV mining</a> and allows the pool to not be idle for the time it receives and validate the whole block.</p>
<p>The <a href="https://braiins.com/stratum-v2#empty" rel="nofollow noreferrer">doc you link</a> claims another reason for empty blocks is how the Stratum V1 protocol made it possible for pools to reduce the latency of the communication with their miners by first providing them the hash of the previous block before providing the whole block. This created another incentive for mining empty blocks. It then explains how Stratum v2 aims to fix this. (Which isn't really clear, the proposed fix seems.. Risky.)</p>
<p>I think your confusion stems from the ambiguity between the two incentives for mining empty block, which the <a href="https://braiins.com/stratum-v2#empty" rel="nofollow noreferrer">doc</a> seems to be surfing on by only mentioning the second one. Stratum v2 is only about the communication between a pool and its miners. It only claims to fix the second incentive to mine empty blocks, not the first (arguably more fundamental) one.</p>
<p>To be fair the <a href="https://braiins.com/blog/why-pools-mine-empty-blocks-and-how-stratum-v2-fixes-this#toc-why-are-fewer-empty-blocks-being-mined-than-before-" rel="nofollow noreferrer">blog post</a> you also link does mention why it doesn't consider the first incentive, but it quickly brushes it away by mentioning how transaction fees are becoming a greater part of the block reward. While true, fees are still a very minor share of the block reward. And they were even more so in 2020 when the post was written (about 2-3% in the year before)! In any case the conclusion in the <a href="https://braiins.com/stratum-v2#empty" rel="nofollow noreferrer">doc</a> is quite misleading indeed:</p>
<blockquote>
<p>Given that there is no advantage to mining on an empty block vs. a full block with Stratum V2, empty block mining should effectively be eliminated.</p>
</blockquote>

CC BY-SA 4.0
2023-12-13T11:06:15.610Z
2023-12-13T11:06:15.610Z
Antoine Poinsot
<p>In my understanding, Stratum V2 can help avoid &quot;empty&quot; blocks (<a href="https://braiins.com/stratum-v2#empty" rel="nofollow noreferrer">ref A</a>, <a href="https://braiins.com/blog/why-pools-mine-empty-blocks-and-how-stratum-v2-fixes-this" rel="nofollow noreferrer">ref B</a>), as most of the information can be distributed ahead of time, i.e. before the next block is mined.</p>
<p>To avoid confusion, I'd like to make some assumptions:</p>
<ul>
<li>The &quot;next block&quot; is the one following the current chain tip. It is not mined, yet - but it will be mined soon.</li>
<li>The block template is created for the block following the &quot;next block&quot;.</li>
<li>I'll name the template's block &quot;grandchild block&quot;, as it is the grandchild of the current chain tip. The &quot;next block&quot; then can also be seen as the &quot;child block&quot;.</li>
</ul>
<p>I don't see how the template for the grandchild block is computed, i.e. which transactions it contains. In theory, the next block may contain arbitrary transactions, including those that conflict with whatever one tries to use in the new template.</p>
<p>Are grandchild block templates only used if the next block is found by the same pool? If mining pool X finds the next block, it's easy to have a template for the grandchild block at hand. However, if the next block is found by someone else, its contents must be assumed to be unknown.</p>
<p>Do miners already create grandchild block templates containing &quot;safe&quot; transactions, e.g. those spending from previously time-locked outputs, or transactions created by the miners themselves which may be assumed to be non-conflicting?</p>

CC BY-SA 4.0
2023-12-13T09:05:46.470Z
The question about constructing a grand-child template with safe transactions is interesting. But what does Stratum V2 has to do with this? You start your post with "Stratum V2 can help avoid "empty" blocks" but in the middle of the post you correctly point out you can't have a grand-child template if the next block was mined by another pool. In this case, for the time before you receive the block and validate it, you either stop mining or mine an empty block. Stratum V2 doesn't change this, does it?
Antoine Poinsot
CC BY-SA 4.0
2023-12-13T09:06:51.763Z
That's part of my confusion. Here's a website that tries to answer our questions, but I'm still left confused: https://braiins.com/stratum-v2#empty
C-Otto
CC BY-SA 4.0
2023-12-13T09:16:19.020Z
I think it's a different incentive to use empty block that's mentioned in this link. It's not the incentive of the pool to make its miners mine an empty block until it itself has received the block and validated it. It's how before StratumV2 the pool had an incentive to at first only send the prevhash to its miners *even if it had a valid template* because it would arrive faster.  If that answers your question i can post an answer along these lines.
Antoine Poinsot
<mining-pools><stratum><getblocktemplate>
Constructing a block template to avoid mining "empty" blocks
C-Otto
# Constructing a block template to avoid mining "empty" blocks

(Asked by: username_0 on 2023-12-13)

In my understanding, Stratum V2 can help avoid "empty" blocks ([ref A](https://braiins.com/stratum-v2#empty), [ref B](https://braiins.com/blog/why-pools-mine-empty-blocks-and-how-stratum-v2-fixes-this)), as most of the information can be distributed ahead of time, i.e. before the next block is mined.

To avoid confusion, I'd like to make some assumptions:

* The "next block" is the one following the current chain tip. It is not mined, yet - but it will be mined soon.
* The block template is created for the block following the "next block".
* I'll name the template's block "grandchild block", as it is the grandchild of the current chain tip. The "next block" then can also be seen as the "child block".

I don't see how the template for the grandchild block is computed, i.e. which transactions it contains. In theory, the next block may contain arbitrary transactions, including those that conflict with whatever one tries to use in the new template.

Are grandchild block templates only used if the next block is found by the same pool? If mining pool X finds the next block, it's easy to have a template for the grandchild block at hand. However, if the next block is found by someone else, its contents must be assumed to be unknown.

Do miners already create grandchild block templates containing "safe" transactions, e.g. those spending from previously time-locked outputs, or transactions created by the miners themselves which may be assumed to be non-conflicting?

**Tags:** mining-pools, stratum, getblocktemplate

> **Comments:**
> **username_1**: The question about constructing a grand-child template with safe transactions is interesting. But what does Stratum V2 has to do with this? You start your post with "Stratum V2 can help avoid "empty" blocks" but in the middle of the post you correctly point out you can't have a grand-child template if the next block was mined by another pool. In this case, for the time before you receive the block and validate it, you either stop mining or mine an empty block. Stratum V2 doesn't change this, does it?  
> **username_0**: That's part of my confusion. Here's a website that tries to answer our questions, but I'm still left confused: https://braiins.com/stratum-v2#empty  
> **username_1**: I think it's a different incentive to use empty block that's mentioned in this link. It's not the incentive of the pool to make its miners mine an empty block until it itself has received the block and validated it. It's how before StratumV2 the pool had an incentive to at first only send the prevhash to its miners *even if it had a valid template* because it would arrive faster.  If that answers your question i can post an answer along these lines.  

---

## 1 answers

### Answer by username_1 on 2023-12-13. Score: 3 | Accepted answer

A mining pool may provide an empty block template to its miners for block `n+1` once it has been announced a valid header for block `n` but hasn't received yet the whole block `n`. This is also known as [SPV mining](https://bitcoin.stackexchange.com/a/38439/101498) and allows the pool to not be idle for the time it receives and validate the whole block.

The [doc you link](https://braiins.com/stratum-v2#empty) claims another reason for empty blocks is how the Stratum V1 protocol made it possible for pools to reduce the latency of the communication with their miners by first providing them the hash of the previous block before providing the whole block. This created another incentive for mining empty blocks. It then explains how Stratum v2 aims to fix this. (Which isn't really clear, the proposed fix seems.. Risky.)

I think your confusion stems from the ambiguity between the two incentives for mining empty block, which the [doc](https://braiins.com/stratum-v2#empty) seems to be surfing on by only mentioning the second one. Stratum v2 is only about the communication between a pool and its miners. It only claims to fix the second incentive to mine empty blocks, not the first (arguably more fundamental) one.

To be fair the [blog post](https://braiins.com/blog/why-pools-mine-empty-blocks-and-how-stratum-v2-fixes-this#toc-why-are-fewer-empty-blocks-being-mined-than-before-) you also link does mention why it doesn't consider the first incentive, but it quickly brushes it away by mentioning how transaction fees are becoming a greater part of the block reward. While true, fees are still a very minor share of the block reward. And they were even more so in 2020 when the post was written (about 2-3% in the year before)! In any case the conclusion in the [doc](https://braiins.com/stratum-v2#empty) is quite misleading indeed:

> Given that there is no advantage to mining on an empty block vs. a full block with Stratum V2, empty block mining should effectively be eliminated.


---

