3

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?

1 Answer 1

3

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.

2
  • 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? Jan 3 at 2:33
  • Yes, that's the normal use. getblocktemplate will never give you a selection of transactions that are not valid together in a block. Jan 3 at 2:34

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.