Post
Topic
Board Development & Technical Discussion
Re: My Segwit questions - a Q&A for Achow and the rest
by
nullius
on 15/12/2017, 20:55:22 UTC
Now segwit makes sense for me, thank you! One more minor question - do I understand correctly that you can fit only more transactions what use segwit addresses, and in case all clients would keep using addresses starting with 1 then the block size limit stays effectively same as it was before softfork?

You’re welcome!  To your question:  Yes, you understand correctly on that point.  Segwit’s benefit to block capacity is proportionate to adoption; and if nobody were to use Segwit addresses and tranasctions, then Segwit would have no effect at all on block capacity.  But fortunately, to the flipside, the Segwit design implicitly incentivizes Segwit use.  Anybody who uses an address starting with a “1” is overpaying (approximately[1]) fourfold on fees, because their transactions “weigh” so much more than Segwit transactions.

Looking at it from the opposite perspective, switching to a Segwit address will bring you (approximately[1]) an instant 75% discount on fees.  I have spent a bit of time on the forum (futilely) trying to inform people who complain about fees that they can get themselves an instant 75% discount, in bold letters.  (Perhaps I should try adding emoji—ick! :-( )  I myself have been using Segwit addresses for months, largely for this reason.  Well, I do like showing off in my signature; and I am a Segwit supporter.  Still, I’ll admit that for actually making the change, the fee difference was an awfully nice incentive!

But it’s not there to be “nice”; and it must be emphasized, what I am here calling a “Segwit discount” is not some arbitrary rule made to push Segwit.  Rather, as I said, it is implicit in the design.  If you use an old-style address, then your bytes are consuming about 4× the block weight; that is, you are selfishly consuming about 4× the amount of a globally shared resource.  This pushes the network toward the position you just described, of still being effectually limited to 1MB blocks.  Whereas if you use Segwit, then byte for byte, you consume about 75% less block weight.  That frees up more space for use by others, increasing the network’s capacity and relieving fee pressure.  Thus it is a natural, logical consequence that you will pay about 75% less.  Fair is fair; and as with all else in Bitcoin, the system is carefully designed to align people’s selfish interests with the common good.

(This leaves two practical issues:  Choice of Segwit address type (nested-in-P2SH vs. Bech32), and actually using Segwit addresses with currently available software.  Earlier, I started writing an exceedingly long post about these issues.  It didn’t get done; and for discussing wallets and usage instructions, this is the wrong forum, anyway.  Generally, here or elsewhere, I would be happy to answer questions in so far as I am able.)


1. The fourfold increase/75% discount is approximate.  As quoted in my previous post, the precise equation for block weight from BIP 141 is “Base size * 3 + Total size”, where “Base size is the block size in bytes with the original transaction serialization without any witness-related data, as seen by a non-upgraded node”, and “Total size is the block size in bytes with transactions serialized as described in BIP144, including base data and witness data.”  That is the equation which miners now must use when selecting transactions and, it is to be hoped, trying to fit as many as they can into a block.  The witness data are by far the biggest part of any ordinary transaction; and when the size thereof doesn’t get multiplied, the difference swamps everything else.  Thus in practice, calling Segwit a “75% discount” will suffice for a rule of thumb.