Skip to content

Commit bee85b7

Browse files
committed
bip54: clarify sigops counting, borrow bip16 language
1 parent 445e445 commit bee85b7

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

bip-0054.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,16 @@ Given a block at height `N`:
6969
A limit is set on the number of potentially executed signature operations in validating a
7070
transaction. It applies to all transactions in the block except the coinbase transaction[^1]. For
7171
each input in the transaction, count the number of `CHECKSIG` and `CHECKMULTISIG` in the input
72-
scriptSig and previous output's scriptPubKey, including the P2SH redeemScript. The accounting is the
73-
same as for [bip-0016][BIP16 specs]: a `CHECKSIG`/`CHECKSIGVERIFY` operation accounts for 1 and a
74-
`CHECKMULTISIG`/`CHECKMULTISIGVERIFY` accounts for the number of public keys associated, or 20 if
75-
the number of public keys is greater than 16. A `CHECKMULTISIG`/`CHECKMULTISIGVERIFY` not directly
76-
preceded by a minimally-pushed number between 1 and 16 (included) accounts for 20. If the
77-
total is strictly higher than 2500, the transaction is invalid.
72+
scriptSig and previous output's scriptPubKey, including the P2SH redeemScript. If the total summed
73+
over all transaction inputs is strictly higher than 2500, the transaction is invalid. The accounting is the
74+
same as for [bip-0016][BIP16 specs], evaluating the scriptSig, scriptPubKey, and P2SH redeemScript
75+
separately:
76+
77+
1. `CHECKSIG` and `CHECKSIGVERIFY` count as 1 signature operation, whether or not they are evaluated.
78+
2. `CHECKMULTISIG` and `CHECKMULTISIGVERIFY` immediately preceded by OP_1 through OP_16 are counted as 1 to 16 signature operations, whether or not they are evaluated.
79+
3. All other `CHECKMULTISIG` and `CHECKMULTISIGVERIFY` are counted as 20 signature operations, whether or not they are evaluated.
80+
81+
If the total summed over all transaction inputs is strictly higher than 2500, the transaction is invalid.
7882

7983
Transactions whose witness-stripped serialized size is exactly 64 bytes are invalid.
8084

0 commit comments

Comments
 (0)