<oembed><type>rich</type><version>1.0</version><author_name>npub1fvuxqdqg7klqqgy3yy8gdxjv4phu92sll5y8zqm2qe5qdrhxymhqf3vq7f</author_name><author_url>https://nostr.ae/npub1fvuxqdqg7klqqgy3yy8gdxjv4phu92sll5y8zqm2qe5qdrhxymhqf3vq7f</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2017-05-09&#xA;📝 Original message:This [1] article says the current discount prevents witness spam. Witness&#xA;spam is free space in the witness part of the block that can be filled by&#xA;miners to create bigger blocks with almost no cost for the benefit a&#xA;cluster of miners with low latency, increasing centralization.&#xA;&#xA;The 75% discount does not prevent it, but on the contrary leaves a lot of&#xA;extra witness space for spam.&#xA;&#xA;If the maximum block weight is set to 2.7M, each byte of non-witness block&#xA;costs 1.7, and each byte of witness costs 1, then a normal filled block&#xA;would be 2.7M bytes (1.7+1), and there will be no need to create ever a 4&#xA;Mbyte block. The worst case would be the average case, and the transaction&#xA;rate would be the maximum possible.&#xA;&#xA;The current 75% discount can only achieve more transactions per second if&#xA;the type of transactions change. Therefore the current 75% discount only&#xA;makes the block size worst case worse (4 Mbytes when it should be 2.7&#xA;Mbytes).&#xA;&#xA;80% of all inputs/outputs are P2PKH. The only way to make use of the extra&#xA;witness&#xA;space If most P2PKH transactions are replaced by multisigs (typically for&#xA;LN).&#xA;&#xA;So it seems the 75% discount has been chosen with the idea that in the&#xA;future the current transaction pattern will shift towards multisigs. This&#xA;is not a bad idea, as it&#39;s the only direction Bitcoin can scale without a&#xA;HF.&#xA;But it&#39;s a bad idea if we end up doing, for example, a 2X blocksize&#xA;increase HF in the future. In that case it&#39;s much better to use a 50%&#xA;witness discount, and do not make scaling risky by making the worse case&#xA;block size 8 Mbytes, when it could have been 2*2.7=5.4 Mbytes.&#xA;&#xA;I&#39;ve uploaded the code here:&#xA;https://github.com/SergioDemianLerner/SegwitStats&#xA;&#xA; [1] https://segwit.org/why-a-discount-factor-of-4-why-not-&#xA;2-or-8-bbcebe91721e.&#xA;&#xA;&#xA;On Mon, May 8, 2017 at 8:47 PM, Alphonse Pace via bitcoin-dev &lt;&#xA;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&#xA;&gt; Sergio,&#xA;&gt;&#xA;&gt; I&#39;m not sure what the data you present has to do with the discount.  A 75%&#xA;&gt; discount prevents witness spam precisely because it is 75%, nothing more.&#xA;&gt; The current usage simply gives a guideline on how much capacity is gained&#xA;&gt; through a particular discount.  With the data you show, it would imply that&#xA;&gt; those blocks, with SegWit used where possible, would result in blocks of&#xA;&gt; ~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 &lt;&#xA;&gt; bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&gt;&#xA;&gt;&gt; I have processed 1000 blocks starting from Block #461653.&#xA;&gt;&gt;&#xA;&gt;&gt; I computed several metrics, including the supposed size of witness data&#xA;&gt;&gt; and non-witness data (onchain), assuming all P2SH inputs/outputs are&#xA;&gt;&gt; converted to P2PWSH and all P2PKH inputs/outputs are converted to P2WPKH.&#xA;&gt;&gt;&#xA;&gt;&gt; This takes into account that other types of transactions will not be&#xA;&gt;&gt; modified by Segwit (e.g. OP_RETURN outputs, or P2PK). This analysis doesn&#39;t&#xA;&gt;&gt; take into account that LN transactions may affect the current state,&#xA;&gt;&gt;  increasing the segwit/nosegwit ratio.&#xA;&gt;&gt;&#xA;&gt;&gt; Among a lot of information, I&#39;ve got the following real world results...&#xA;&gt;&gt;&#xA;&gt;&gt; acMainChainSpace =352608924&#xA;&gt;&gt; acSegwitSpace =599400403&#xA;&gt;&gt; Ratio segwit/nosegwit=1.6999&#xA;&gt;&gt;&#xA;&gt;&gt; This implies that the 75% that discount is not the best option to prevent&#xA;&gt;&gt; witness spam in a block of 4 MB, as stated in&#xA;&gt;&gt; https://segwit.org/why-a-discount-factor-of-4-why-not-2-or-8-bbcebe91721e&#xA;&gt;&gt; .&#xA;&gt;&gt;&#xA;&gt;&gt; The non-witness data weight factor should not be 4 but 2.35. The closest&#xA;&gt;&gt; integer value is 2, which leads to a 50% witness discount.&#xA;&gt;&gt;&#xA;&gt;&gt; The Bitcoinj source code is available for anyone to review. I encourage&#xA;&gt;&gt; anyone to re-compute this with another utility to cross-check. Maybe&#xA;&gt;&gt; Antoine Le Calvez (p2sh.info) would like to double-check.&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt; _______________________________________________&#xA;&gt;&gt; bitcoin-dev mailing list&#xA;&gt;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;&gt;&#xA;&gt;&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;&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20170509/38a4f95e/attachment.html&gt;</html></oembed>