Post
Topic
Board Bitcoin Discussion
Re: Last Time. In small words. Why 2MB impossible. Why Soft Fork. Why SegWit First..
by
Lauda
on 02/05/2017, 22:47:49 UTC
https://github.com/bitcoin/bitcoin/blob/master/src/policy/policy.h
Quote
/** The maximum number of sigops we're willing to relay/mine in a single tx */
static const unsigned int MAX_STANDARD_TX_SIGOPS_COST = MAX_BLOCK_SIGOPS_COST/5;
and here is where the MAX_BLOCK_SIGOPS_COST exists
https://github.com/bitcoin/bitcoin/blob/master/src/consensus/consensus.h
Quote
/** The maximum allowed number of signature check operations in a block (network rule) */
static const int64_t MAX_BLOCK_SIGOPS_COST = 80000;

rearranged into one line of text is:
 MAX_STANDARD_TX_SIGOPS_COST = MAX_BLOCK_SIGOPS_COST/5;
becomes
MAX_STANDARD_TX_SIGOPS_COST = 80000/5 = 16,000
meaning
"The maximum number of sigops we're willing to relay/mine in a single tx = 16k"

Because of your nonsense, someone actually asked on IRC about this (it wasn't me):
Quote
questioner2: sigops in legacy scripts count 4x toward the 80k limit
this is in validation.cpp:GetTransactionSigOpCost
so a legacy tx can make 4 tx of 20k each
ok after trying to read what you say. the consensus/policy is 80k/5 for tx sigops = 16k. but legacy tx has 4x of the 16k = 4k
so just 20 tx of 4k legacy can use up all the blocks sigops
questioner2: the easiest way to see it is that from the point of view of an old wallet, nothing changed
20k legacy sigops were allowed before, 20k legacy sigops are allowed after
is using up all 20k legacy treated as using up all 80k block sigops. or treated as legacy tx only use 25% of blocksigop limits allowing segwit transactions to still have 60x sigops spare to use in the base block
60k*
a legacy sigop counts as 4 segwit sigops
so 20k legacy sigops would fill a block
so 5 legacy tx of 4k sigops would fill the block not allowing segwit txdata to sit in base block
4k sigops each* (=20k legacy)
just as 1M of non-segwit transactions would fill the whole block, not leaving space for segwit transactions
*1M bytes

Tl;dr; + ELI5: You can't use more than 20k sigops per block using native keys after Segwit.
Bonus: I was right, and franky was wrong as usual.