<oembed><type>rich</type><version>1.0</version><author_name>npub1e46n428mcyfwznl7nlsf6d3s7rhlwm9x3cmkuqzt3emmdpadmkaqqjxmcu</author_name><author_url>https://nostr.ae/npub1e46n428mcyfwznl7nlsf6d3s7rhlwm9x3cmkuqzt3emmdpadmkaqqjxmcu</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2017-05-09&#xA;📝 Original message:I&#39;m not sure who wrote segwit.org, but I wouldn&#39;t take it as&#xA;authoritative reasoning why we must do X over Y.&#xA;&#xA;You seem to be claiming that there is not cost for a miner to fill&#xA;&#34;extra witness space&#34;, but this is very untrue - in order to do so they&#xA;must forgo fees on other transactions. Your analysis on worst-case vs&#xA;normal-case blocks also seems flawed - there is a single limit, and not&#xA;a separate, secondary, witness limit.&#xA;&#xA;You suggested &#34;If the maximum block weight is set to 2.7M, each byte of&#xA;non-witness block costs 1.7&#34;, but these numbers dont work out - setting&#xA;the discount to 1.7 gets you a maximum block size of 1.7MB (in a soft&#xA;fork), not 2.7MB. If you set the max block weight to 2.7 with a 1.7x&#xA;discount, you have a hard fork. If you set the discount to 2.7x with a&#xA;2.7 weight limit, you dont get 2.7MB average-sized blocks, but smaller,&#xA;and still have the potential for padding blocks with pure-witness data&#xA;to create larger blocks.&#xA;&#xA;Additionally, note that by padding blocks with larger witness data you&#xA;lose some of the CPU cost to validate as you no longer have as many&#xA;inputs (which have a maximal validation cost).&#xA;&#xA;Further, I&#39;m not sure why you&#39;re arguing for a given witness discount on&#xA;the basis of a future hardfork - it seems highly unlikely the community&#xA;is in a position to pull something like that off, and even if it were,&#xA;why set the witness discount with that assumption? If there were to be a&#xA;hardfork, we should probably tweak a bunch of parameters (see, eg, my&#xA;post from February of last year at&#xA;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2016-February/012403.html).&#xA;&#xA;Maybe you could clarify your proposal a bit here, because the way I read&#xA;it you seem to have misunderstood SegWit&#39;s discount system.&#xA;&#xA;On 05/09/17 13:49, Sergio Demian Lerner via bitcoin-dev wrote:&#xA;&gt; This [1] article says the current discount prevents witness spam.&#xA;&gt; Witness spam is free space in the witness part of the block that can be&#xA;&gt; filled by miners to create bigger blocks with almost no cost for the&#xA;&gt; benefit a cluster of miners with low latency, increasing centralization.&#xA;&gt; &#xA;&gt; The 75% discount does not prevent it, but on the contrary leaves a lot&#xA;&gt; of extra witness space for spam.&#xA;&gt; &#xA;&gt; If the maximum block weight is set to 2.7M, each byte of non-witness&#xA;&gt; block costs 1.7, and each byte of witness costs 1, then a normal filled&#xA;&gt; block would be 2.7M bytes (1.7+1), and there will be no need to create&#xA;&gt; ever a 4 Mbyte block. The worst case would be the average case, and the&#xA;&gt; transaction rate would be the maximum possible.&#xA;&gt; &#xA;&gt; The current 75% discount can only achieve more transactions per second&#xA;&gt; if the type of transactions change. Therefore the current 75% discount&#xA;&gt; only makes the block size worst case worse (4 Mbytes when it should be&#xA;&gt; 2.7 Mbytes).&#xA;&gt; &#xA;&gt; 80% of all inputs/outputs are P2PKH. The only way to make use of the&#xA;&gt; extra witness &#xA;&gt; space If most P2PKH transactions are replaced by multisigs (typically&#xA;&gt; for LN).&#xA;&gt; &#xA;&gt; So it seems the 75% discount has been chosen with the idea that in the&#xA;&gt; future the current transaction pattern will shift towards multisigs.&#xA;&gt; This is not a bad idea, as it&#39;s the only direction Bitcoin can scale&#xA;&gt; without a HF. &#xA;&gt; But it&#39;s a bad idea if we end up doing, for example, a 2X blocksize&#xA;&gt; increase HF in the future. In that case it&#39;s much better to use a 50%&#xA;&gt; witness discount, and do not make scaling risky by making the worse case&#xA;&gt; block size 8 Mbytes, when it could have been 2*2.7=5.4 Mbytes.&#xA;&gt; &#xA;&gt; I&#39;ve uploaded the code here:&#xA;&gt; https://github.com/SergioDemianLerner/SegwitStats&#xA;&gt; &#xA;&gt;  [1] https://segwit.org/why-a-discount-factor-of-4-why-not-2-or-8-bbcebe91721e&#xA;&gt; &lt;https://segwit.org/why-a-discount-factor-of-4-why-not-2-or-8-bbcebe91721e&gt;.&#xA;&gt; &#xA;&gt; &#xA;&gt; On Mon, May 8, 2017 at 8:47 PM, Alphonse Pace via bitcoin-dev&#xA;&gt; &lt;bitcoin-dev at lists.linuxfoundation.org&#xA;&gt; &lt;mailto:bitcoin-dev at lists.linuxfoundation.org&gt;&gt; wrote:&#xA;&gt; &#xA;&gt;     Sergio,&#xA;&gt; &#xA;&gt;     I&#39;m not sure what the data you present has to do with the discount. &#xA;&gt;     A 75% discount prevents witness spam precisely because it is 75%,&#xA;&gt;     nothing more.  The current usage simply gives a guideline on how&#xA;&gt;     much capacity is gained through a particular discount.  With the&#xA;&gt;     data you show, it would imply that those blocks, with SegWit used&#xA;&gt;     where possible, would result in blocks of ~1.8MB.&#xA;&gt; &#xA;&gt; &#xA;&gt; &#xA;&gt;     On Mon, May 8, 2017 at 5:42 PM, Sergio Demian Lerner via bitcoin-dev&#xA;&gt;     &lt;bitcoin-dev at lists.linuxfoundation.org&#xA;&gt;     &lt;mailto:bitcoin-dev at lists.linuxfoundation.org&gt;&gt; wrote:&#xA;&gt; &#xA;&gt;         I have processed 1000 blocks starting from Block #461653.&#xA;&gt; &#xA;&gt;         I computed several metrics, including the supposed size of&#xA;&gt;         witness data and non-witness data (onchain), assuming all P2SH&#xA;&gt;         inputs/outputs are converted to P2PWSH and all P2PKH&#xA;&gt;         inputs/outputs are converted to P2WPKH.&#xA;&gt; &#xA;&gt;         This takes into account that other types of transactions will&#xA;&gt;         not be modified by Segwit (e.g. OP_RETURN outputs, or P2PK).&#xA;&gt;         This analysis doesn&#39;t take into account that LN transactions may&#xA;&gt;         affect the current state,  increasing the segwit/nosegwit ratio.&#xA;&gt; &#xA;&gt;         Among a lot of information, I&#39;ve got the following real world&#xA;&gt;         results...&#xA;&gt; &#xA;&gt;         acMainChainSpace =352608924&#xA;&gt;         acSegwitSpace =599400403&#xA;&gt;         Ratio segwit/nosegwit=1.6999&#xA;&gt; &#xA;&gt;         This implies that the 75% that discount is not the best option&#xA;&gt;         to prevent witness spam in a block of 4 MB, as stated in&#xA;&gt;         https://segwit.org/why-a-discount-factor-of-4-why-not-2-or-8-bbcebe91721e&#xA;&gt;         &lt;https://segwit.org/why-a-discount-factor-of-4-why-not-2-or-8-bbcebe91721e&gt;.&#xA;&gt; &#xA;&gt;         The non-witness data weight factor should not be 4 but 2.35. The&#xA;&gt;         closest integer value is 2, which leads to a 50% witness discount.&#xA;&gt; &#xA;&gt;         The Bitcoinj source code is available for anyone to review. I&#xA;&gt;         encourage anyone to re-compute this with another utility to&#xA;&gt;         cross-check. Maybe Antoine Le Calvez (p2sh.info&#xA;&gt;         &lt;http://p2sh.info&gt;) would like to double-check.&#xA;&gt; &#xA;&gt; &#xA;&gt; &#xA;&gt; &#xA;&gt; &#xA;&gt; &#xA;&gt;         _______________________________________________&#xA;&gt;         bitcoin-dev mailing list&#xA;&gt;         bitcoin-dev at lists.linuxfoundation.org&#xA;&gt;         &lt;mailto:bitcoin-dev at lists.linuxfoundation.org&gt;&#xA;&gt;         https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;         &lt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&gt;&#xA;&gt; &#xA;&gt; &#xA;&gt; &#xA;&gt;     _______________________________________________&#xA;&gt;     bitcoin-dev mailing list&#xA;&gt;     bitcoin-dev at lists.linuxfoundation.org&#xA;&gt;     &lt;mailto:bitcoin-dev at lists.linuxfoundation.org&gt;&#xA;&gt;     https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;     &lt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&gt;&#xA;&gt; &#xA;&gt; &#xA;&gt; &#xA;&gt; &#xA;&gt; _______________________________________________&#xA;&gt; bitcoin-dev mailing list&#xA;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;</html></oembed>