<p>TL;DR: you don't need to multiply anything. <em>20037 ≤ 80000</em> is the correct comparison, so the returned values represent a valid block.</p>
<p>The confusion arises because there used to be &quot;old sigops&quot; (pre segwit), where the limit was 20000. With the introduction of segwit in 2017, the meaning of sigops changed:</p>
<ul>
<li>Operations in pre-segwit inputs count for 4 sigops each.</li>
<li>Operations in post-segwit inputs count for 1 sigop each.</li>
<li>The total limit is 80000.</li>
</ul>
<p>The number reported by the <code>getblocktemplate</code> RPC is these new sigops, with the proper 4x multiplication already applied for relevant transaction inputs.</p>
<blockquote>
<p>I would like to know if mining a block in such a situation where SigOps exceed the limit will still be considered valid.</p>
</blockquote>
<p>That would invalidate the block entirely, but that is not what is going on here.</p>

CC BY-SA 4.0
2024-01-03T02:33:27.290Z
Thank you very much for your clear response. I understand the limitation regarding sigopslimt. So, does that mean it's theoretically acceptable to include all transactions returned by getBlockTemplate in a block without any issues?
youcai zhao
CC BY-SA 4.0
2024-01-03T02:34:47.130Z
Yes, that's the normal use. `getblocktemplate` will never give you a selection of transactions that are not valid together in a block.
Pieter Wuille
CC BY-SA 4.0
2024-01-03T02:24:55.840Z
2024-01-03T02:24:55.840Z
Pieter Wuille
<p>I invoke the <code>getBlockTemplate</code> interface using SegWit. The sum of weights in the returned transactions data is 3991625, and the sum of SigOps is 20037. Each time, I package all the transactions returned by <code>getBlockTemplate</code> into a block. I observe that the weight limit is 4000000, and the data returned complies with this requirement. However, I notice that the SigOp limit is 80000, and it is said that the sum of SigOps in transactions needs to be multiplied by 4, which in this case, 20037 * 4, exceeds 80000. I would like to know if mining a block in such a situation where SigOps exceed the limit will still be considered valid. Will it have any impact on the coinbase reward and transaction fees?</p>

<block-validity><getblocktemplate><signature-operations>
Is the sum of sigops in the transaction details returned by getBlockTemplate not allowed to exceed 2000?
youcai zhao
# Is the sum of sigops in the transaction details returned by getBlockTemplate not allowed to exceed 2000?

(Asked by: username_0 on 2024-01-03)

I invoke the `getBlockTemplate` interface using SegWit. The sum of weights in the returned transactions data is 3991625, and the sum of SigOps is 20037. Each time, I package all the transactions returned by `getBlockTemplate` into a block. I observe that the weight limit is 4000000, and the data returned complies with this requirement. However, I notice that the SigOp limit is 80000, and it is said that the sum of SigOps in transactions needs to be multiplied by 4, which in this case, 20037 \* 4, exceeds 80000. I would like to know if mining a block in such a situation where SigOps exceed the limit will still be considered valid. Will it have any impact on the coinbase reward and transaction fees?

**Tags:** block-validity, getblocktemplate, signature-operations


---

## 1 answers

### Answer by username_1 on 2024-01-03. Score: 3 | Accepted answer

TL;DR: you don't need to multiply anything. *20037 ≤ 80000* is the correct comparison, so the returned values represent a valid block.

The confusion arises because there used to be "old sigops" (pre segwit), where the limit was 20000. With the introduction of segwit in 2017, the meaning of sigops changed:

* Operations in pre-segwit inputs count for 4 sigops each.
* Operations in post-segwit inputs count for 1 sigop each.
* The total limit is 80000.

The number reported by the `getblocktemplate` RPC is these new sigops, with the proper 4x multiplication already applied for relevant transaction inputs.

> I would like to know if mining a block in such a situation where SigOps exceed the limit will still be considered valid.

That would invalidate the block entirely, but that is not what is going on here.

> **Comments:**
> **username_0**: Thank you very much for your clear response. I understand the limitation regarding sigopslimt. So, does that mean it's theoretically acceptable to include all transactions returned by getBlockTemplate in a block without any issues?  
> **username_1**: Yes, that's the normal use. `getblocktemplate` will never give you a selection of transactions that are not valid together in a block.  

---

