<p>To add to Pieter's <a href="https://bitcoin.stackexchange.com/a/117359/63817">answer</a>:</p>
<p>The sigops limit and how sigops are counted changed with the activation of SegWit in 2017. The sigop count in pre-SegWit scripts (P2PK, P2PKH, ...) was quadrupled. The block limit was increased from 20000 to 80000. See the sigops section in BIP-141: <a href="https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#sigops" rel="nofollow noreferrer">https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#sigops</a></p>

CC BY-SA 4.0
2024-03-22T12:59:12.520Z
2024-03-22T12:59:12.520Z
0xb10c
<p>A sigop is script opcode which performs a signature check. That includes <code>OP_CHECKSIG</code>, <code>OP_CHECKSIGVERIFY</code>, <code>OP_CHECKMULTISIG</code>, and <code>OP_CHECKMULTISIGVERIFY</code>.</p>
<p>This concept matters because of a consensus rule in Bitcoin which limits the number of sigops per block. How they are counted depends on the context:</p>
<ul>
<li>In the <code>scriptPubKey</code> of outputs, and in <code>scriptSig</code> of inputs (the latter happens ~never, but if it did, it would be counted):
<ul>
<li><code>OP_CHECKSIG</code> and <code>OP_CHECKSIGVERIFY</code> count as 4</li>
<li><code>OP_CHECKMULTISIG</code> and <code>OP_CHECKMULTISIGVERIFY</code> count as 80</li>
</ul>
</li>
<li>In P2SH redeemscripts:
<ul>
<li><code>OP_CHECKSIG</code> and <code>OP_CHECKSIGVERIFY</code> count as 4</li>
<li><code>OP_CHECKMULTISIG</code> and <code>OP_CHECKMULTISIGVERIFY</code> count as <em>4n</em> when preceded by <code>OP_n</code>, and as 80 otherwise.</li>
</ul>
</li>
<li>In P2WSH witness scripts:
<ul>
<li><code>OP_CHECKSIG</code> and <code>OP_CHECKSIGVERIFY</code> count as 1</li>
<li><code>OP_CHECKMULTISIG</code> and <code>OP_CHECKMULTISIGVERIFY</code> count as <em>n</em> when preceded by <code>OP_n</code>, and as 20 otherwise.</li>
</ul>
</li>
<li>In P2TR taproot scripts:
<ul>
<li>Sigops are not counted.</li>
</ul>
</li>
</ul>
<p>A valid block cannot have more than 80000 sigops (so roughly 1 per 50 bytes of block data), as counted by the rules above. Note that this is checked <em>before</em> actually executing any scripts. So it doesn't require these opcode to actually be executed (e.g. they also count sigops that are surrounded by <code>OP_IF ... OP_ENDIF</code> in unexecuted branches, or in coinbase <code>scriptSig</code>s which are never executed).</p>
<p>In taproot, a different mechanism is used. Instead of having a global per-block limit, there is a per-transaction-input limit, proportional to the size of that input. Also only actually executed checks for claimed-to-be-valid signatures are counted.</p>

CC BY-SA 4.0
2023-02-25T17:55:13.287Z
Thanks for your answer.
Sigops count matter because they're expensive to execute? Am I right?
Amir reza Riahi
CC BY-SA 4.0
2023-02-25T19:25:47.617Z
Yeah, they make it illegal for blocks to contain so many signature checking operations that the block would be excessively slow to validate.
Pieter Wuille
CC BY-SA 4.0
2023-02-24T19:09:27.023Z
2023-02-24T19:18:52.470Z
2023-02-24T19:18:52.470Z
Pieter Wuille
<p>I've seen the term sigop in many places frequently. I've tried to figure out what does it mean by searching, and found that it's abbreviation of signature operation. But it's still not clear to me the meaning. I guess every opcode of scriptSig is considered to be a sigop. Am I right?</p>
<p>I would appreciate any explanation.</p>
<h2>Edit:</h2>
<p>I think this question is completely different than <a href="https://bitcoin.stackexchange.com/questions/67760/how-are-sigops-calculated">this</a>. My question is clearly about what is the sigop, while the other question is about calculation of sigops.</p>

CC BY-SA 4.0
2023-02-24T18:45:53.850Z
Does this answer your question? [How are sigops calculated?](https://bitcoin.stackexchange.com/questions/67760/how-are-sigops-calculated) -- note that there is a [sigop limit for a block](https://bitcoin.stackexchange.com/q/62581/13866).
RedGrittyBrick
<terminology><signature-operations>
What is sigop (signature operation)?
Amir reza Riahi
# What is sigop (signature operation)?

(Asked by: username_0 on 2023-02-24)

I've seen the term sigop in many places frequently. I've tried to figure out what does it mean by searching, and found that it's abbreviation of signature operation. But it's still not clear to me the meaning. I guess every opcode of scriptSig is considered to be a sigop. Am I right?

I would appreciate any explanation.

## Edit:

I think this question is completely different than [this](https://bitcoin.stackexchange.com/questions/67760/how-are-sigops-calculated). My question is clearly about what is the sigop, while the other question is about calculation of sigops.

**Tags:** terminology, signature-operations

> **Comments:**
> **username_1**: Does this answer your question? [How are sigops calculated?](https://bitcoin.stackexchange.com/questions/67760/how-are-sigops-calculated) -- note that there is a [sigop limit for a block](https://bitcoin.stackexchange.com/q/62581/13866).  

---

## 2 answers

### Answer by username_3 on 2023-02-24. Score: 12 | Accepted answer

A sigop is script opcode which performs a signature check. That includes `OP_CHECKSIG`, `OP_CHECKSIGVERIFY`, `OP_CHECKMULTISIG`, and `OP_CHECKMULTISIGVERIFY`.

This concept matters because of a consensus rule in Bitcoin which limits the number of sigops per block. How they are counted depends on the context:

* In the `scriptPubKey` of outputs, and in `scriptSig` of inputs (the latter happens ~never, but if it did, it would be counted):
  + `OP_CHECKSIG` and `OP_CHECKSIGVERIFY` count as 4
  + `OP_CHECKMULTISIG` and `OP_CHECKMULTISIGVERIFY` count as 80
* In P2SH redeemscripts:
  + `OP_CHECKSIG` and `OP_CHECKSIGVERIFY` count as 4
  + `OP_CHECKMULTISIG` and `OP_CHECKMULTISIGVERIFY` count as *4n* when preceded by `OP_n`, and as 80 otherwise.
* In P2WSH witness scripts:
  + `OP_CHECKSIG` and `OP_CHECKSIGVERIFY` count as 1
  + `OP_CHECKMULTISIG` and `OP_CHECKMULTISIGVERIFY` count as *n* when preceded by `OP_n`, and as 20 otherwise.
* In P2TR taproot scripts:
  + Sigops are not counted.

A valid block cannot have more than 80000 sigops (so roughly 1 per 50 bytes of block data), as counted by the rules above. Note that this is checked *before* actually executing any scripts. So it doesn't require these opcode to actually be executed (e.g. they also count sigops that are surrounded by `OP_IF ... OP_ENDIF` in unexecuted branches, or in coinbase `scriptSig`s which are never executed).

In taproot, a different mechanism is used. Instead of having a global per-block limit, there is a per-transaction-input limit, proportional to the size of that input. Also only actually executed checks for claimed-to-be-valid signatures are counted.

> **Comments:**
> **username_0**: Thanks for your answer. Sigops count matter because they're expensive to execute? Am I right?  
> **username_3**: Yeah, they make it illegal for blocks to contain so many signature checking operations that the block would be excessively slow to validate.  

---

### Answer by username_2 on 2024-03-22. Score: 3

To add to username_3's [answer](https://bitcoin.stackexchange.com/a/117359/63817):

The sigops limit and how sigops are counted changed with the activation of SegWit in 2017. The sigop count in pre-SegWit scripts (P2PK, P2PKH, ...) was quadrupled. The block limit was increased from 20000 to 80000. See the sigops section in BIP-141: <https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#sigops>


---

