<div dir="ltr">Not entirely correct, no. Edge cases also matter. Segwit is described as 4MB because that is the largest possible combined block size that can be constructed. BIP 102 + segwit would allow a maximum relay of 8MB. So you have to be confident that an 8MB relay size would be acceptable, even if a block full of actual transactions would be closer to 3.5MB.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 18, 2015 at 6:01 PM, sickpig--- via bitcoin-dev <span dir="ltr">&lt;<a href="mailto:bitcoin-dev@lists.linuxfoundation.org" target="_blank">bitcoin-dev@lists.linuxfoundation.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Anthony, <br><br><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Thu, Dec 17, 2015 at 6:55 PM, Anthony Towns via bitcoin-dev <span dir="ltr">&lt;<a href="mailto:bitcoin-dev@lists.linuxfoundation.org" target="_blank">bitcoin-dev@lists.linuxfoundation.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Dec 17, 2015 at 04:51:19PM +0100, sickpig--- via bitcoin-dev wrote:<br>
<span>&gt; On Thu, Dec 17, 2015 at 2:09 PM, Jorge Timón wrote:<br>
&gt; &gt; Unless I&#39;m missing something, 2 mb x4 = 8mb, so bip102 + SW is already<br>
</span>&gt; &gt; equivalent to the 2-4-8 &quot;compromise&quot; proposal [...]<br>
<span>&gt; isn&#39;t SegWit gain ~75%? hence 2mb x 1.75 = 3.5.<br>
<br>
</span>Segwit as proposed gives a 75% *discount* to witness data with the<br>
same limit, so at a 1MB limit, that might give you (eg) 2.05MB made up<br>
of 650kB of base block data plus 1.4MB of witness data; where 650kB +<br>
1.4MB/4 = 1MB at the 1MB limit; or 4.1MB made up of 1.3MB of base plus<br>
2.8MB of witness, for 1.3MB+2.8MB/4 = 2MB at a 2MB limit.<br>
<span><br>
&gt; 4x is theoric gain you get in case of 2-2 multisig txs.<br>
<br>
</span>With segregated witness, 2-2 multisig transactions are made up of 94B<br>
of base data, plus about 214B of witness data; discounting the witness<br>
data by 75% gives 94+214/4=148 bytes. That compares to about 301B for<br>
a 2-2 multisig transaction with P2SH rather than segwit, and 301/148<br>
gives about a 2.03x gain, not a 4x gain. A 2.05x gain is what I assumed<br>
to get the numbers above.<br>
<br>
You get further improvements with, eg, 3-of-3 multisig, but to get<br>
the full, theoretical 4x gain you&#39;d need a fairly degenerate looking<br>
transaction.<br>
<br>
Pay to public key hash with segwit lets you move about half the<br>
transaction data into the witness, giving about a 1.6x improvement by<br>
my count (eg 1.6MB = 800kB of base data plus 800kB of witness data,<br>
where 800kB+800kB/4=1MB), so I think a gain of between 1.6 and 2.0 is<br>
a reasonable expectation to have for the proposed segwit scheme overall.<br>
<br></blockquote><br></div></div></div>many thanks for the explanation. <br><br></div><div class="gmail_extra">so it should be fair to say that BIP 102 + SW would bring a gain between 2*1.6 and 2*2. <br></div><div class="gmail_extra"><br>Just for the sake of simplicity if we take the middle of the interval we could say <br></div><div class="gmail_extra">that BIP102 + SW will bring us a max block (virtual) size equal to 1MB * 2 * 1.8 = 3.6<br><br></div><div class="gmail_extra">Is it right? <br></div><div class="gmail_extra"><br><br></div><div class="gmail_extra"><br></div></div>
<br>_______________________________________________<br>
bitcoin-dev mailing list<br>
<a href="mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@lists.linuxfoundation.org</a><br>
<a href="https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" rel="noreferrer" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</a><br>
<br></blockquote></div><br></div>