<oembed><type>rich</type><version>1.0</version><author_name>npub10r9d6edmnrljk59wsf06zqp494l3qtjpa3w245hy6t5euqxlzw2qdkgk2d</author_name><author_url>https://nostr.ae/npub10r9d6edmnrljk59wsf06zqp494l3qtjpa3w245hy6t5euqxlzw2qdkgk2d</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2017-05-09&#xA;📝 Original message:The discount is designed to reduce UTXO bloat primarily, witness spam&#xA;data would not make it into the UTXO set. The discount brings the fee&#xA;of a transaction more in line with the actual costs to the network for&#xA;the transaction. A miner spamming the network with 4MB witness blocks&#xA;would have very little impact on the UTXO size compared with 1MB&#xA;non-witness blocks. UTXO size is a bigger issue than blockchain size&#xA;since full nodes can&#39;t prune the UTXO set.&#xA;&#xA;The discount of 75% for the SegWit softfork doesn&#39;t really have any&#xA;effect on future hard forks as it can always be adjusted as needed&#xA;later on as part of a HF.&#xA;&#xA;On Tue, May 9, 2017 at 8:49 AM, Sergio Demian Lerner via bitcoin-dev&#xA;&lt;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&gt; This [1] article says the current discount prevents witness spam. Witness&#xA;&gt; spam is free space in the witness part of the block that can be filled by&#xA;&gt; miners to create bigger blocks with almost no cost for the benefit a cluster&#xA;&gt; 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 of&#xA;&gt; extra witness space for spam.&#xA;&gt;&#xA;&gt; If the maximum block weight is set to 2.7M, each byte of non-witness block&#xA;&gt; costs 1.7, and each byte of witness costs 1, then a normal filled block&#xA;&gt; would be 2.7M bytes (1.7+1), and there will be no need to create ever a 4&#xA;&gt; Mbyte block. The worst case would be the average case, and the transaction&#xA;&gt; rate would be the maximum possible.&#xA;&gt;&#xA;&gt; The current 75% discount can only achieve more transactions per second if&#xA;&gt; the type of transactions change. Therefore the current 75% discount only&#xA;&gt; makes the block size worst case worse (4 Mbytes when it should be 2.7&#xA;&gt; Mbytes).&#xA;&gt;&#xA;&gt; 80% of all inputs/outputs are P2PKH. The only way to make use of the extra&#xA;&gt; witness&#xA;&gt; space If most P2PKH transactions are replaced by multisigs (typically for&#xA;&gt; 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. This is&#xA;&gt; not a bad idea, as it&#39;s the only direction Bitcoin can scale without a HF.&#xA;&gt; But it&#39;s a bad idea if we end up doing, for example, a 2X blocksize increase&#xA;&gt; HF in the future. In that case it&#39;s much better to use a 50% witness&#xA;&gt; discount, and do not make scaling risky by making the worse case block size&#xA;&gt; 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]&#xA;&gt; https://segwit.org/why-a-discount-factor-of-4-why-not-2-or-8-bbcebe91721e.&#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&gt; wrote:&#xA;&gt;&gt;&#xA;&gt;&gt; Sergio,&#xA;&gt;&gt;&#xA;&gt;&gt; I&#39;m not sure what the data you present has to do with the discount.  A 75%&#xA;&gt;&gt; discount prevents witness spam precisely because it is 75%, nothing more.&#xA;&gt;&gt; The current usage simply gives a guideline on how much capacity is gained&#xA;&gt;&gt; through a particular discount.  With the data you show, it would imply that&#xA;&gt;&gt; those blocks, with SegWit used where possible, would result in blocks of&#xA;&gt;&gt; ~1.8MB.&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt; On Mon, May 8, 2017 at 5:42 PM, Sergio Demian Lerner via bitcoin-dev&#xA;&gt;&gt; &lt;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; I have processed 1000 blocks starting from Block #461653.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; I computed several metrics, including the supposed size of witness data&#xA;&gt;&gt;&gt; and non-witness data (onchain), assuming all P2SH inputs/outputs are&#xA;&gt;&gt;&gt; converted to P2PWSH and all P2PKH inputs/outputs are converted to P2WPKH.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; This takes into account that other types of transactions will not be&#xA;&gt;&gt;&gt; modified by Segwit (e.g. OP_RETURN outputs, or P2PK). This analysis doesn&#39;t&#xA;&gt;&gt;&gt; take into account that LN transactions may affect the current state,&#xA;&gt;&gt;&gt; increasing the segwit/nosegwit ratio.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Among a lot of information, I&#39;ve got the following real world results...&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; acMainChainSpace =352608924&#xA;&gt;&gt;&gt; acSegwitSpace =599400403&#xA;&gt;&gt;&gt; Ratio segwit/nosegwit=1.6999&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; This implies that the 75% that discount is not the best option to prevent&#xA;&gt;&gt;&gt; witness spam in a block of 4 MB, as stated in&#xA;&gt;&gt;&gt; https://segwit.org/why-a-discount-factor-of-4-why-not-2-or-8-bbcebe91721e.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; The non-witness data weight factor should not be 4 but 2.35. The closest&#xA;&gt;&gt;&gt; integer value is 2, which leads to a 50% witness discount.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; The Bitcoinj source code is available for anyone to review. I encourage&#xA;&gt;&gt;&gt; anyone to re-compute this with another utility to cross-check. Maybe Antoine&#xA;&gt;&gt;&gt; Le Calvez (p2sh.info) would like to double-check.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; _______________________________________________&#xA;&gt;&gt;&gt; bitcoin-dev mailing list&#xA;&gt;&gt;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt;&gt;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;&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;&#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>