Skip to content

Commit 4d79098

Browse files
committed
Increase IsStandard() scriptSig length
Removes the limits on number of pubkeys for P2SH CHECKMULTISIG outputs. Previously with the 500 byte scriptSig limit there were odd restrictions where even a 1-of-12 P2SH could be spent in a standard transaction(1), yet multisig scriptPubKey's requiring more signatures quickly ran out of scriptSig space. From a "stuff-data-in-the-blockchain" point of view not much has changed as with the prior commit now only allowing the dummy value to be null the newly allowed scriptSig space can only be used for signatures. In any case, just using more outputs is trivial and doesn't cost much. 1) See 779b519480d8c5346de6e635119c7ee772e97ec872240c45e558f582a37b4b73 Mined by BTC Guild.
1 parent f80cffa commit 4d79098

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/main.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -515,10 +515,14 @@ bool IsStandardTx(const CTransaction& tx, string& reason)
515515

516516
BOOST_FOREACH(const CTxIn& txin, tx.vin)
517517
{
518-
// Biggest 'standard' txin is a 3-signature 3-of-3 CHECKMULTISIG
519-
// pay-to-script-hash, which is 3 ~80-byte signatures, 3
520-
// ~65-byte public keys, plus a few script ops.
521-
if (txin.scriptSig.size() > 500) {
518+
// Biggest 'standard' txin is a 15-of-15 P2SH multisig with compressed
519+
// keys. (remember the 520 byte limit on redeemScript size) That works
520+
// out to a (15*(33+1))+3=513 byte redeemScript, 513+1+15*(73+1)=1624
521+
// bytes of scriptSig, which we round off to 1650 bytes for some minor
522+
// future-proofing. That's also enough to spend a 20-of-20
523+
// CHECKMULTISIG scriptPubKey, though such a scriptPubKey is not
524+
// considered standard)
525+
if (txin.scriptSig.size() > 1650) {
522526
reason = "scriptsig-size";
523527
return false;
524528
}

0 commit comments

Comments
 (0)