Skip to content
LearnBitcoin

ResearchBitcoin Dev Archive SegWit2x list

segwit2x alpha release code drop

14 messages, Jun 16, 2017. Started by Jeff Garzik.

Jeff Garzik (3), Jameson Lopp (3), Stephen Pair (2), Jared Lee Richardson (2), Jason Dreyzehner, Vinny Lingham, Sergio Lerner, Adam Back

Permalink First message in the Wayback Machine

Jeff Garzik permalink original

All,

An update on the alpha release, and some discussion on block weight.

Alpha release ------------------ - tl;dr The code for the alpha release is on github

- "segwit2x" is the official release branch, at https://github.com/btc1/bitcoin - If it ain't in the branch, it ain't in the release - PR #11, 2M HF, just left Work-In-Progress state, and will be pushed - PR #21, BIP91 updates (JamesH), will be pushed - Tag release in git - gitian builds - Test, test, test

Block weight ------------------

Block weight was the last detail to be finalized for the alpha release. It predictably garnered several comments on github and elsewhere. For background, here is a description: https://www.reddit.com/r/btc/comments/5vxuti/what_is_block_weight_in_segwit/de6waug/

As a first pass, the block weight solution taken in the segwit2x code pushed (above) is the obvious approach one expects from a project with "2x" in the name.

If we assume a successful SegWit activation, there are some block weight/SegWit-related issues and challenges to consider:

1) The wallet users who must reason fees face a complex market:

1a) Non-upgraded users are bidding for base block space. 1b) SegWit users are bidding for base + witness space.

These two are mixing in the same market *and* an opt-it transition implies users switch unpredictably from 1a to 1b.

Rough analogy: Imagine a market where automobiles are sold by weight (kg). This market now embarks on an opt-in transition to selling automobiles based on engine size (cc's), a metric that automobile experts agree better measures automobile ability. Result: Some bidders in the market buy cars based on weight, others based on cc's. How does one bid efficiently in an always-in-transition market? SegWit is not just a technology upgrade, it is a market upgrade.

2) Witness discount/scaling factor

It is fair to say that this remains an issue of note. A few WG members have independently described the witness discount as an arbitrary economic incentive encoded directly into the software.

As a thought exercise, removing the scaling factor still retains extra witness space and therefore retains a natural incentive to stash data there, while removing a weighting that may or may not be the best ratio.

Block weight plays into this - if you're not scaling, you don't need an abstract "weight" unit, just a total size. For wallets (#1, above), size is probably more simple to reason and calculate than weight. Block size is a well studied attribute, versus block weight.

3) "Will the discount be applied to the non-witness data for legacy transactions, as well as SegWit transactions (per Luke's suggestion)?"

That seems like a reasonable suggestion from an incentive alignment perspective.

All that said - what was delivered in the code should be, per charter, maximally compatible w/ SegWit. These notes on block weight are provided as an adjunct to what was committed, possibly noting some pain points or better-paths.

Jameson Lopp in reply to Jeff Garzik permalink original

On Thu, Jun 15, 2017 at 11:52 PM, Jeff Garzik via Bitcoin-segwit2x < bitcoin-segwit2x at lists.linuxfoundation.org> wrote:

Quoted text (39 lines)
> All,
>
> An update on the alpha release, and some discussion on block weight.
>
> Alpha release
> ------------------
> - tl;dr The code for the alpha release is on github
>
> - "segwit2x" is the official release branch, at https://github.com/btc1/
> bitcoin
> - If it ain't in the branch, it ain't in the release
> - PR #11, 2M HF, just left Work-In-Progress state, and will be pushed
> - PR #21, BIP91 updates (JamesH), will be pushed
> - Tag release in git
> - gitian builds
> - Test, test, test
>
>
> Block weight
> ------------------
>
> Block weight was the last detail to be finalized for the alpha release.
> It predictably garnered several comments on github and elsewhere.  For
> background, here is a description: https://www.reddit.com/r/btc/comments/
> 5vxuti/what_is_block_weight_in_segwit/de6waug/
>
> As a first pass, the block weight solution taken in the segwit2x code
> pushed (above) is the obvious approach one expects from a project with "2x"
> in the name.
>
> If we assume a successful SegWit activation, there are some block
> weight/SegWit-related issues and challenges to consider:
>
> 1) The wallet users who must reason fees face a complex market:
>
> 1a) Non-upgraded users are bidding for base block space.
> 1b) SegWit users are bidding for base + witness space.
>
> I see what you're saying here, though it seems to me that it's more like:

1a) Non-upgraded users are bidding for more block weight. 1b) SegWit users are bidding for less block weight.

These two are mixing in the same market *and* an opt-it transition implies

Quoted text (10 lines)
> users switch unpredictably from 1a to 1b.
>
> Rough analogy:  Imagine a market where automobiles are sold by weight
> (kg).  This market now embarks on an opt-in transition to selling
> automobiles based on engine size (cc's), a metric that automobile experts
> agree better measures automobile ability.  Result:  Some bidders in the
> market buy cars based on weight, others based on cc's.  How does one bid
> efficiently in an always-in-transition market?   SegWit is not just a
> technology upgrade, it is a market upgrade.
>

I'm not convinced this analogy fits given that the market completely transitions to all users bidding based upon weight. Users who are driving old, heavy cars will now be incentivized to upgrade to more modern cars manufactured with lightweight materials.

Quoted text (18 lines)
>
> 2) Witness discount/scaling factor
>
> It is fair to say that this remains an issue of note.  A few WG members
> have independently described the witness discount as an arbitrary economic
> incentive encoded directly into the software.
>
> As a thought exercise, removing the scaling factor still retains extra
> witness space and therefore retains a natural incentive to stash data
> there, while removing a weighting that may or may not be the best ratio.
>
> Block weight plays into this - if you're not scaling, you don't need an
> abstract "weight" unit, just a total size.   For wallets (#1, above), size
> is probably more simple to reason and calculate than weight.  Block size is
> a well studied attribute, versus block weight.
>
>
> The witness discount is not arbitrary. The economics of spending inputs

versus creating outputs is terribly imbalanced and the discount is applied in order to bring it more in balance. It can cost 5X-10X as much (data size & thus fees) to add an input (↓ UTXO set size) vs an output (↑ UTXO set size) to a transaction. It could probably be argued that a 75% discount is actually conservative in terms of trying to rebalance this discrepancy.

I'm not so sure that there is a perfect ratio given the arbitrary complexity that inputs can have. I think you'd need some kind of dynamic weighting that would be much more complex and would require significant development resources to implement. I don't think we should let perfect be the enemy of good given the timeline of this project.

Quoted text (7 lines)
> 3) "Will the discount be applied to the non-witness data for legacy
> transactions, as well as SegWit transactions (per Luke's suggestion)?"
>
> That seems like a reasonable suggestion from an incentive alignment
> perspective.
>
> I'm unaware of this proposal, but offhand it doesn't make sense to me

given that the signatures of legacy transactions neither increase block capacity nor are their signatures prunable. Seems like it would be incentivizing suboptimal usage of a highly limited resource.

Quoted text (19 lines)
>
>
> All that said - what was delivered in the code should be, per charter,
> maximally compatible w/ SegWit.  These notes on block weight are provided
> as an adjunct to what was committed, possibly noting some pain points or
> better-paths.
>
> --
> Jeff Garzik
> CEO and Co Founder
> Bloq, Inc.
>
>
> _______________________________________________
> Bitcoin-segwit2x mailing list
> Bitcoin-segwit2x at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/segwit2x
>
>
Stephen Pair in reply to Jameson Lopp permalink original

On Fri, Jun 16, 2017 at 12:37 PM, Jameson Lopp via Bitcoin-segwit2x < bitcoin-segwit2x at lists.linuxfoundation.org> wrote:

Quoted text (28 lines)
>
> On Thu, Jun 15, 2017 at 11:52 PM, Jeff Garzik via Bitcoin-segwit2x <
> bitcoin-segwit2x at lists.linuxfoundation.org> wrote:
>
>>
>> 2) Witness discount/scaling factor
>>
>> It is fair to say that this remains an issue of note.  A few WG members
>> have independently described the witness discount as an arbitrary economic
>> incentive encoded directly into the software.
>>
>> As a thought exercise, removing the scaling factor still retains extra
>> witness space and therefore retains a natural incentive to stash data
>> there, while removing a weighting that may or may not be the best ratio.
>>
>> Block weight plays into this - if you're not scaling, you don't need an
>> abstract "weight" unit, just a total size.   For wallets (#1, above), size
>> is probably more simple to reason and calculate than weight.  Block size is
>> a well studied attribute, versus block weight.
>>
>>
>> The witness discount is not arbitrary. The economics of spending inputs
> versus creating outputs is terribly imbalanced and the discount is applied
> in order to bring it more in balance. It can cost 5X-10X as much (data size
> & thus fees) to add an input (↓ UTXO set size) vs an output (↑ UTXO set
> size) to a transaction. It could probably be argued that a 75% discount is
> actually conservative in terms of trying to rebalance this discrepancy.
>

I think what you are suggesting is that data that can be pruned (yet still allow full, independent validation) should not cost as much as data that cannot be pruned. While the witness discount doesn't give me great heartburn and isn't really worth the bike shedding, I think it might be premature to assume raw UTXO data cannot be pruned. A very simple approach would be to keep a bitfield for each block to indicate which of the outputs has been spent and discard the raw UTXO data (ignoring the complexities of branches and re-orgs). To validate a transaction, you would need to fetch the input transactions from somewhere (i.e. another node that stores the full block chain). You would also need the SPV/merkle proof that it was in the chain and then you would check your bitfield to verify that it has not yet been spent.

I think if you tried hard enough, a pruning node could shed nearly all of the raw block chain data and still be able to perform full and independent validation going forward. The operator of the node could then just decide how much local storage to use vs relying on other nodes for fetching raw data. And a node that stores the entire block chain would be indifferent as to whether that data was a UTXO, a signature, or something else.

In fact, something like this might become very desirable if you had some sort of limited, expensive, secure storage that you wanted to take advantage of on a full validating node. The smaller set of essential data needed for full validation would reside in this trusted, highly secure storage, while the full block chain would reside on a less trusted bulk storage device.

Jason Dreyzehner in reply to Stephen Pair permalink original

It's also worth noting that a UTXO-set-less implementation of block validation exists: https://bitcrust.org/

Rather than reference a UTXO-set, Bitcrust checks a "spend-tree": https://github.com/tomasvdw/bitcrust/blob/master/doc/bitcrust-db.md

In this model, UTXO-set minimization seems to be much less valuable.

On Fri, Jun 16, 2017 at 1:52 PM Stephen Pair via Bitcoin-segwit2x < bitcoin-segwit2x at lists.linuxfoundation.org> wrote:

Quoted text (62 lines)
> On Fri, Jun 16, 2017 at 12:37 PM, Jameson Lopp via Bitcoin-segwit2x <
> bitcoin-segwit2x at lists.linuxfoundation.org> wrote:
>
>> On Thu, Jun 15, 2017 at 11:52 PM, Jeff Garzik via Bitcoin-segwit2x <
>> bitcoin-segwit2x at lists.linuxfoundation.org> wrote:
>>
>>>
>>> 2) Witness discount/scaling factor
>>>
>>> It is fair to say that this remains an issue of note.  A few WG members
>>> have independently described the witness discount as an arbitrary economic
>>> incentive encoded directly into the software.
>>>
>>> As a thought exercise, removing the scaling factor still retains extra
>>> witness space and therefore retains a natural incentive to stash data
>>> there, while removing a weighting that may or may not be the best ratio.
>>>
>>> Block weight plays into this - if you're not scaling, you don't need an
>>> abstract "weight" unit, just a total size.   For wallets (#1, above), size
>>> is probably more simple to reason and calculate than weight.  Block size is
>>> a well studied attribute, versus block weight.
>>>
>>>
>>> The witness discount is not arbitrary. The economics of spending inputs
>> versus creating outputs is terribly imbalanced and the discount is applied
>> in order to bring it more in balance. It can cost 5X-10X as much (data size
>> & thus fees) to add an input (↓ UTXO set size) vs an output (↑ UTXO set
>> size) to a transaction. It could probably be argued that a 75% discount is
>> actually conservative in terms of trying to rebalance this discrepancy.
>>
>
> I think what you are suggesting is that data that can be pruned (yet still
> allow full, independent validation) should not cost as much as data that
> cannot be pruned.  While the witness discount doesn't give me great
> heartburn and isn't really worth the bike shedding, I think it might be
> premature to assume raw UTXO data cannot be pruned.  A very simple approach
> would be to keep a bitfield for each block to indicate which of the outputs
> has been spent and discard the raw UTXO data (ignoring the complexities of
> branches and re-orgs).  To validate a transaction, you would need to fetch
> the input transactions from somewhere (i.e. another node that stores the
> full block chain).  You would also need the SPV/merkle proof that it was in
> the chain and then you would check your bitfield to verify that it has not
> yet been spent.
>
> I think if you tried hard enough, a pruning node could shed nearly all of
> the raw block chain data and still be able to perform full and independent
> validation going forward.  The operator of the node could then just decide
> how much local storage to use vs relying on other nodes for fetching raw
> data.  And a node that stores the entire block chain would be indifferent
> as to whether that data was a UTXO, a signature, or something else.
>
> In fact, something like this might become very desirable if you had some
> sort of limited, expensive, secure storage that you wanted to take
> advantage of on a full validating node.  The smaller set of essential data
> needed for full validation would reside in this trusted, highly secure
> storage, while the full block chain would reside on a less trusted bulk
> storage device.
> _______________________________________________
> Bitcoin-segwit2x mailing list
> Bitcoin-segwit2x at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/segwit2x
>
Jeff Garzik in reply to Jameson Lopp permalink original

On Fri, Jun 16, 2017 at 12:37 PM, Jameson Lopp <jameson.lopp at gmail.com> wrote:

Quoted text (14 lines)
> Rough analogy:  Imagine a market where automobiles are sold by weight
>> (kg).  This market now embarks on an opt-in transition to selling
>> automobiles based on engine size (cc's), a metric that automobile experts
>> agree better measures automobile ability.  Result:  Some bidders in the
>> market buy cars based on weight, others based on cc's.  How does one bid
>> efficiently in an always-in-transition market?   SegWit is not just a
>> technology upgrade, it is a market upgrade.
>>
>
> I'm not convinced this analogy fits given that the market completely
> transitions to all users bidding based upon weight. Users who are driving
> old, heavy cars will now be incentivized to upgrade to more modern cars
> manufactured with lightweight materials.
>

Comments,

C1) I was making a larger point that you have two different resources that really do have two different supply and demand rates, and bidding into that market is complex.

C2) It is therefore a *simplification* and *assumption* that market users will behave a certain way in bidding for witness data area. Wallets that hardcode this assumption may therefore be making non-optimal economic decisions on behalf of their users.

C3) It seems unwise to build in *artificial* incentives to transition from a known-working system to a new system. Let that happen naturally.

Quoted text (32 lines)
>
>
>>
>> 2) Witness discount/scaling factor
>>
>> It is fair to say that this remains an issue of note.  A few WG members
>> have independently described the witness discount as an arbitrary economic
>> incentive encoded directly into the software.
>>
>> As a thought exercise, removing the scaling factor still retains extra
>> witness space and therefore retains a natural incentive to stash data
>> there, while removing a weighting that may or may not be the best ratio.
>>
>> Block weight plays into this - if you're not scaling, you don't need an
>> abstract "weight" unit, just a total size.   For wallets (#1, above), size
>> is probably more simple to reason and calculate than weight.  Block size is
>> a well studied attribute, versus block weight.
>>
>>
>> The witness discount is not arbitrary. The economics of spending inputs
> versus creating outputs is terribly imbalanced and the discount is applied
> in order to bring it more in balance. It can cost 5X-10X as much (data size
> & thus fees) to add an input (↓ UTXO set size) vs an output (↑ UTXO set
> size) to a transaction. It could probably be argued that a 75% discount is
> actually conservative in terms of trying to rebalance this discrepancy.
>
> I'm not so sure that there is a perfect ratio given the arbitrary
> complexity that inputs can have. I think you'd need some kind of dynamic
> weighting that would be much more complex and would require significant
> development resources to implement. I don't think we should let perfect be
> the enemy of good given the timeline of this project.
>

The sum of these two paragraphs is: [it's not arbitrary][ok, it's arbitrary] :)

The bigger point, though, is that you cannot just look at the witness discount purely through a narrow UTXO lens.

The other side of the artificial incentive, for example, is that you have created a direct incentive to put cheap garbage data into this newly extended block. Let's call this Garbage Risk.

This is the risk of not letting the market naturally balance itself out, and one of several unintended consequences of inserting an artificial ratio.

Vinny Lingham in reply to Jeff Garzik permalink original

I still don't understand why, if we are increasing the block size to 2mb anyways, that Segwit needs a discount?

https://twitter.com/vinnylingham/status/844654041703432192

On Fri, Jun 16, 2017 at 12:12 Jeff Garzik via Bitcoin-segwit2x < bitcoin-segwit2x at lists.linuxfoundation.org> wrote:

Quoted text (92 lines)
> On Fri, Jun 16, 2017 at 12:37 PM, Jameson Lopp <jameson.lopp at gmail.com>
> wrote:
>
>> Rough analogy:  Imagine a market where automobiles are sold by weight
>>> (kg).  This market now embarks on an opt-in transition to selling
>>> automobiles based on engine size (cc's), a metric that automobile experts
>>> agree better measures automobile ability.  Result:  Some bidders in the
>>> market buy cars based on weight, others based on cc's.  How does one bid
>>> efficiently in an always-in-transition market?   SegWit is not just a
>>> technology upgrade, it is a market upgrade.
>>>
>>
>> I'm not convinced this analogy fits given that the market completely
>> transitions to all users bidding based upon weight. Users who are driving
>> old, heavy cars will now be incentivized to upgrade to more modern cars
>> manufactured with lightweight materials.
>>
>
> Comments,
>
> C1) I was making a larger point that you have two different resources that
> really do have two different supply and demand rates, and bidding into that
> market is complex.
>
> C2) It is therefore a *simplification* and *assumption* that market users
> will behave a certain way in bidding for witness data area.   Wallets that
> hardcode this assumption may therefore be making non-optimal economic
> decisions on behalf of their users.
>
> C3) It seems unwise to build in *artificial* incentives to transition
> from a known-working system to a new system.  Let that happen naturally.
>
>
>
>
>>
>>
>>>
>>> 2) Witness discount/scaling factor
>>>
>>> It is fair to say that this remains an issue of note.  A few WG members
>>> have independently described the witness discount as an arbitrary economic
>>> incentive encoded directly into the software.
>>>
>>> As a thought exercise, removing the scaling factor still retains extra
>>> witness space and therefore retains a natural incentive to stash data
>>> there, while removing a weighting that may or may not be the best ratio.
>>>
>>> Block weight plays into this - if you're not scaling, you don't need an
>>> abstract "weight" unit, just a total size.   For wallets (#1, above), size
>>> is probably more simple to reason and calculate than weight.  Block size is
>>> a well studied attribute, versus block weight.
>>>
>>>
>>> The witness discount is not arbitrary. The economics of spending inputs
>> versus creating outputs is terribly imbalanced and the discount is applied
>> in order to bring it more in balance. It can cost 5X-10X as much (data size
>> & thus fees) to add an input (↓ UTXO set size) vs an output (↑ UTXO set
>> size) to a transaction. It could probably be argued that a 75% discount is
>> actually conservative in terms of trying to rebalance this discrepancy.
>>
>> I'm not so sure that there is a perfect ratio given the arbitrary
>> complexity that inputs can have. I think you'd need some kind of dynamic
>> weighting that would be much more complex and would require significant
>> development resources to implement. I don't think we should let perfect be
>> the enemy of good given the timeline of this project.
>>
>
>
> The sum of these two paragraphs is: [it's not arbitrary][ok, it's
> arbitrary]   :)
>
> The bigger point, though, is that you cannot just look at the witness
> discount purely through a narrow UTXO lens.
>
> The other side of the artificial incentive, for example, is that you have
> created a direct incentive to put cheap garbage data into this newly
> extended block.  Let's call this Garbage Risk.
>
> This is the risk of not letting the market naturally balance itself out,
> and one of several unintended consequences of inserting an artificial ratio.
>
> --
> Jeff Garzik
> CEO and Co Founder
> Bloq, Inc.
>
> _______________________________________________
> Bitcoin-segwit2x mailing list
> Bitcoin-segwit2x at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/segwit2x
>
Jared Lee Richardson in reply to Stephen Pair permalink original
Quoted text (1 line)
> I think what you are suggesting is that data that can be pruned (yet

still allow full, independent validation) should not cost as much as data that cannot be pruned. While the witness discount doesn't give me great heartburn and isn't really worth the bike shedding,

I misunderstood this until just recently. The reason for the witness discount is because when making a transaction, inputs are signed now, and outputs are signed later. Users and their wallets use short-term thinking and find it easier to split one output into two (one signature) rather than combining two or more outputs (two or more signatures). The current flat transaction weight calculation takes only raw bytes size into account, and thus rewards the short term thinking in the short term.

Everyone would benefit if instead all wallets were encouraged to reduce utxos whenever possible instead of increasing them.

Bandwidth, rather than utxo bloat, is the controlling cost for all node operational costs I have looked at, but anything that encouraged the network to(over large averages) decrease total bytes weight instead of increasing it would be beneficial.

Jared

On Fri, Jun 16, 2017 at 10:46 AM, Stephen Pair via Bitcoin-segwit2x < bitcoin-segwit2x at lists.linuxfoundation.org> wrote:

Quoted text (66 lines)
>
> On Fri, Jun 16, 2017 at 12:37 PM, Jameson Lopp via Bitcoin-segwit2x <
> bitcoin-segwit2x at lists.linuxfoundation.org> wrote:
>
>>
>> On Thu, Jun 15, 2017 at 11:52 PM, Jeff Garzik via Bitcoin-segwit2x <
>> bitcoin-segwit2x at lists.linuxfoundation.org> wrote:
>>
>>>
>>> 2) Witness discount/scaling factor
>>>
>>> It is fair to say that this remains an issue of note.  A few WG members
>>> have independently described the witness discount as an arbitrary economic
>>> incentive encoded directly into the software.
>>>
>>> As a thought exercise, removing the scaling factor still retains extra
>>> witness space and therefore retains a natural incentive to stash data
>>> there, while removing a weighting that may or may not be the best ratio.
>>>
>>> Block weight plays into this - if you're not scaling, you don't need an
>>> abstract "weight" unit, just a total size.   For wallets (#1, above), size
>>> is probably more simple to reason and calculate than weight.  Block size is
>>> a well studied attribute, versus block weight.
>>>
>>>
>>> The witness discount is not arbitrary. The economics of spending inputs
>> versus creating outputs is terribly imbalanced and the discount is applied
>> in order to bring it more in balance. It can cost 5X-10X as much (data size
>> & thus fees) to add an input (↓ UTXO set size) vs an output (↑ UTXO set
>> size) to a transaction. It could probably be argued that a 75% discount is
>> actually conservative in terms of trying to rebalance this discrepancy.
>>
>
> I think what you are suggesting is that data that can be pruned (yet still
> allow full, independent validation) should not cost as much as data that
> cannot be pruned.  While the witness discount doesn't give me great
> heartburn and isn't really worth the bike shedding, I think it might be
> premature to assume raw UTXO data cannot be pruned.  A very simple approach
> would be to keep a bitfield for each block to indicate which of the outputs
> has been spent and discard the raw UTXO data (ignoring the complexities of
> branches and re-orgs).  To validate a transaction, you would need to fetch
> the input transactions from somewhere (i.e. another node that stores the
> full block chain).  You would also need the SPV/merkle proof that it was in
> the chain and then you would check your bitfield to verify that it has not
> yet been spent.
>
> I think if you tried hard enough, a pruning node could shed nearly all of
> the raw block chain data and still be able to perform full and independent
> validation going forward.  The operator of the node could then just decide
> how much local storage to use vs relying on other nodes for fetching raw
> data.  And a node that stores the entire block chain would be indifferent
> as to whether that data was a UTXO, a signature, or something else.
>
> In fact, something like this might become very desirable if you had some
> sort of limited, expensive, secure storage that you wanted to take
> advantage of on a full validating node.  The smaller set of essential data
> needed for full validation would reside in this trusted, highly secure
> storage, while the full block chain would reside on a less trusted bulk
> storage device.
>
> _______________________________________________
> Bitcoin-segwit2x mailing list
> Bitcoin-segwit2x at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/segwit2x
>
>
Jared Lee Richardson in reply to Jeff Garzik permalink original
Quoted text (1 line)
> The sum of these two paragraphs is: [it's not arbitrary][ok, it's

arbitrary] :)

Quoted text (1 line)
> The bigger point, though, is that you cannot just look at the witness

discount purely through a narrow UTXO lens.

Quoted text (1 line)
> The other side of the artificial incentive, for example, is that you have

created a direct incentive to put cheap garbage data into this newly extended block. Let's call this Garbage Risk.

Quoted text (1 line)
> This is the risk of not letting the market naturally balance itself out,

and one of several unintended consequences of inserting an artificial ratio.

This is a valid point, but I believe there is a way that the garbage risk can be removed. Unfortunately segwit would have to be changed and re-tested, and timelines are short. The purpose of the witness discount is that inputs are byte-heavy and outputs are byte-light at the time of creation/inclusion, but inputs and outputs have equal byte weights over the lifespan of the UTXO, and outputs have an additional RAM cost until they are consumed. The primary driver of this byte-heavy / byte-light discrepancy is the signature data. Users and wallets think short term and build transactions for the smallest immediate size, not the smallest data size over years.

Ergo, the witness discount is actually targeting the wrong data (slightly) because it includes all sigscript with a flat discount. The better way that comes to mind would be to take total weight of all the inputs block, average it by number of inputs to find the average input weight, and then multiply that average input weight times the number of outputs. The same thing could be done in reverse for the input weight. This would strongly favor very large transactions that combine many small outputs into a single output, and would thus drive major UTXO reduction, and long-term would drive the average transaction size down and therefore reduce bandwidth consumption for everyone.

Jared

On Fri, Jun 16, 2017 at 12:12 PM, Jeff Garzik via Bitcoin-segwit2x < bitcoin-segwit2x at lists.linuxfoundation.org> wrote:

Quoted text (94 lines)
> On Fri, Jun 16, 2017 at 12:37 PM, Jameson Lopp <jameson.lopp at gmail.com>
> wrote:
>
>> Rough analogy:  Imagine a market where automobiles are sold by weight
>>> (kg).  This market now embarks on an opt-in transition to selling
>>> automobiles based on engine size (cc's), a metric that automobile experts
>>> agree better measures automobile ability.  Result:  Some bidders in the
>>> market buy cars based on weight, others based on cc's.  How does one bid
>>> efficiently in an always-in-transition market?   SegWit is not just a
>>> technology upgrade, it is a market upgrade.
>>>
>>
>> I'm not convinced this analogy fits given that the market completely
>> transitions to all users bidding based upon weight. Users who are driving
>> old, heavy cars will now be incentivized to upgrade to more modern cars
>> manufactured with lightweight materials.
>>
>
> Comments,
>
> C1) I was making a larger point that you have two different resources that
> really do have two different supply and demand rates, and bidding into that
> market is complex.
>
> C2) It is therefore a *simplification* and *assumption* that market users
> will behave a certain way in bidding for witness data area.   Wallets that
> hardcode this assumption may therefore be making non-optimal economic
> decisions on behalf of their users.
>
> C3) It seems unwise to build in *artificial* incentives to transition
> from a known-working system to a new system.  Let that happen naturally.
>
>
>
>
>>
>>
>>>
>>> 2) Witness discount/scaling factor
>>>
>>> It is fair to say that this remains an issue of note.  A few WG members
>>> have independently described the witness discount as an arbitrary economic
>>> incentive encoded directly into the software.
>>>
>>> As a thought exercise, removing the scaling factor still retains extra
>>> witness space and therefore retains a natural incentive to stash data
>>> there, while removing a weighting that may or may not be the best ratio.
>>>
>>> Block weight plays into this - if you're not scaling, you don't need an
>>> abstract "weight" unit, just a total size.   For wallets (#1, above), size
>>> is probably more simple to reason and calculate than weight.  Block size is
>>> a well studied attribute, versus block weight.
>>>
>>>
>>> The witness discount is not arbitrary. The economics of spending inputs
>> versus creating outputs is terribly imbalanced and the discount is applied
>> in order to bring it more in balance. It can cost 5X-10X as much (data size
>> & thus fees) to add an input (↓ UTXO set size) vs an output (↑ UTXO set
>> size) to a transaction. It could probably be argued that a 75% discount is
>> actually conservative in terms of trying to rebalance this discrepancy.
>>
>> I'm not so sure that there is a perfect ratio given the arbitrary
>> complexity that inputs can have. I think you'd need some kind of dynamic
>> weighting that would be much more complex and would require significant
>> development resources to implement. I don't think we should let perfect be
>> the enemy of good given the timeline of this project.
>>
>
>
> The sum of these two paragraphs is: [it's not arbitrary][ok, it's
> arbitrary]   :)
>
> The bigger point, though, is that you cannot just look at the witness
> discount purely through a narrow UTXO lens.
>
> The other side of the artificial incentive, for example, is that you have
> created a direct incentive to put cheap garbage data into this newly
> extended block.  Let's call this Garbage Risk.
>
> This is the risk of not letting the market naturally balance itself out,
> and one of several unintended consequences of inserting an artificial ratio.
>
> --
> Jeff Garzik
> CEO and Co Founder
> Bloq, Inc.
>
>
> _______________________________________________
> Bitcoin-segwit2x mailing list
> Bitcoin-segwit2x at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/segwit2x
>
>
Stephen Pair in reply to Vinny Lingham permalink original

On Fri, Jun 16, 2017 at 3:25 PM, Vinny Lingham via Bitcoin-segwit2x < bitcoin-segwit2x at lists.linuxfoundation.org> wrote:

Quoted text (4 lines)
> I still don't understand why, if we are increasing the block size to 2mb
> anyways, that Segwit needs a discount?
>
> https://twitter.com/vinnylingham/status/844654041703432192

Well, I would say the #1 reason is compatibility with the current segwit implementation. The witness discount (and the witness block itself) is a way to soft fork in a capacity increase (of course, only if you use segwit). People observed that it also would be less costly to consume UTXOs. Believing that a smaller UTXO set is better, this is often cited as a benefit of segwit, but that view might be rather myopic.

Jameson Lopp in reply to Jeff Garzik permalink original

On Fri, Jun 16, 2017 at 12:12 PM, Jeff Garzik <jeff at bloq.com> wrote:

Quoted text (83 lines)
> On Fri, Jun 16, 2017 at 12:37 PM, Jameson Lopp <jameson.lopp at gmail.com>
> wrote:
>
>> Rough analogy:  Imagine a market where automobiles are sold by weight
>>> (kg).  This market now embarks on an opt-in transition to selling
>>> automobiles based on engine size (cc's), a metric that automobile experts
>>> agree better measures automobile ability.  Result:  Some bidders in the
>>> market buy cars based on weight, others based on cc's.  How does one bid
>>> efficiently in an always-in-transition market?   SegWit is not just a
>>> technology upgrade, it is a market upgrade.
>>>
>>
>> I'm not convinced this analogy fits given that the market completely
>> transitions to all users bidding based upon weight. Users who are driving
>> old, heavy cars will now be incentivized to upgrade to more modern cars
>> manufactured with lightweight materials.
>>
>
> Comments,
>
> C1) I was making a larger point that you have two different resources that
> really do have two different supply and demand rates, and bidding into that
> market is complex.
>
> C2) It is therefore a *simplification* and *assumption* that market users
> will behave a certain way in bidding for witness data area.   Wallets that
> hardcode this assumption may therefore be making non-optimal economic
> decisions on behalf of their users.
>
> C3) It seems unwise to build in *artificial* incentives to transition
> from a known-working system to a new system.  Let that happen naturally.
>
>
>
>
>>
>>
>>>
>>> 2) Witness discount/scaling factor
>>>
>>> It is fair to say that this remains an issue of note.  A few WG members
>>> have independently described the witness discount as an arbitrary economic
>>> incentive encoded directly into the software.
>>>
>>> As a thought exercise, removing the scaling factor still retains extra
>>> witness space and therefore retains a natural incentive to stash data
>>> there, while removing a weighting that may or may not be the best ratio.
>>>
>>> Block weight plays into this - if you're not scaling, you don't need an
>>> abstract "weight" unit, just a total size.   For wallets (#1, above), size
>>> is probably more simple to reason and calculate than weight.  Block size is
>>> a well studied attribute, versus block weight.
>>>
>>>
>>> The witness discount is not arbitrary. The economics of spending inputs
>> versus creating outputs is terribly imbalanced and the discount is applied
>> in order to bring it more in balance. It can cost 5X-10X as much (data size
>> & thus fees) to add an input (↓ UTXO set size) vs an output (↑ UTXO set
>> size) to a transaction. It could probably be argued that a 75% discount is
>> actually conservative in terms of trying to rebalance this discrepancy.
>>
>> I'm not so sure that there is a perfect ratio given the arbitrary
>> complexity that inputs can have. I think you'd need some kind of dynamic
>> weighting that would be much more complex and would require significant
>> development resources to implement. I don't think we should let perfect be
>> the enemy of good given the timeline of this project.
>>
>
>
> The sum of these two paragraphs is: [it's not arbitrary][ok, it's
> arbitrary]   :)
>
> The bigger point, though, is that you cannot just look at the witness
> discount purely through a narrow UTXO lens.
>
> The other side of the artificial incentive, for example, is that you have
> created a direct incentive to put cheap garbage data into this newly
> extended block.  Let's call this Garbage Risk.
>
> This is the risk of not letting the market naturally balance itself out,
> and one of several unintended consequences of inserting an artificial ratio.
>
> I think there has been a mixing of terms with regard to this particular

issue - a 75% discount is an approximation of a common ratio of input to output sizes (3:1) though it is possible to create more complex transactions with higher ratios, even as much as 10:1 if not higher. If the discount was /arbitrary/ rather than /approximate/ then there would be /no/ reasoning behind its selection.

That's an interesting point about Garbage Risk - I'd pose that the Garbage Risk we have today is pretty bad due to the imbalance in cost of spending inputs vs creating outputs. As it stands today, we have entities creating transactions with hundreds and hundreds of tiny value outputs on a regular basis because it's relatively cheap for them to do so - cloud mining is one specific example I have personally seen. Then later, when the recipients of these outputs try to spend them, they are greatly penalized due to the huge size of their inputs. If such recipients are using SegWit, at least they won't be paying disproportionately to spend their funds.

Sure, it's not perfect, but I think there's general agreement that it's a step in the right direction.

Quoted text (6 lines)
> --
> Jeff Garzik
> CEO and Co Founder
> Bloq, Inc.
>
>
Sergio Lerner in reply to Jameson Lopp permalink original

I have looked at the alpha release and it seems that at this time the "2x" part of segwit2x has not been implemented. If I'm wrong, please point me to the code that does the 2x.

Second, AFAIK all signatories of the NY agreement understood that to activate segwit means activate segwit *as it was in Bitcoin Core and defined by its known BIPs*. That means the that the 75% discount is preserved.

The NY agreement reads: "We agree to immediately support the following parallel upgrades to the bitcoin protocol, which will be deployed simultaneously and *based on the original Segwit2Mb proposa*l"

The immediate interpretation for "2x" that it at the same time based on the segwit2mb proposal is to increase the maximum block weight from 4M to 8M. This gives an initial average block size of 2 MBytes, and after wallets begin using segwit addresses, and increase to an average block size of 3.6 Mbytes. The worst case is always 8 Mbytes, unless we limit it.

Any change of the witness discount, even if it may be better, would require to check with all participants if they are willing to change the agreement.

Best, Sergio.

2017-06-16 17:10 GMT-03:00 Jameson Lopp via Bitcoin-segwit2x < bitcoin-segwit2x at lists.linuxfoundation.org>:

Quoted text (120 lines)
>
>
> On Fri, Jun 16, 2017 at 12:12 PM, Jeff Garzik <jeff at bloq.com> wrote:
>
>> On Fri, Jun 16, 2017 at 12:37 PM, Jameson Lopp <jameson.lopp at gmail.com>
>> wrote:
>>
>>> Rough analogy:  Imagine a market where automobiles are sold by weight
>>>> (kg).  This market now embarks on an opt-in transition to selling
>>>> automobiles based on engine size (cc's), a metric that automobile experts
>>>> agree better measures automobile ability.  Result:  Some bidders in the
>>>> market buy cars based on weight, others based on cc's.  How does one bid
>>>> efficiently in an always-in-transition market?   SegWit is not just a
>>>> technology upgrade, it is a market upgrade.
>>>>
>>>
>>> I'm not convinced this analogy fits given that the market completely
>>> transitions to all users bidding based upon weight. Users who are driving
>>> old, heavy cars will now be incentivized to upgrade to more modern cars
>>> manufactured with lightweight materials.
>>>
>>
>> Comments,
>>
>> C1) I was making a larger point that you have two different resources
>> that really do have two different supply and demand rates, and bidding into
>> that market is complex.
>>
>> C2) It is therefore a *simplification* and *assumption* that market
>> users will behave a certain way in bidding for witness data area.   Wallets
>> that hardcode this assumption may therefore be making non-optimal economic
>> decisions on behalf of their users.
>>
>> C3) It seems unwise to build in *artificial* incentives to transition
>> from a known-working system to a new system.  Let that happen naturally.
>>
>>
>>
>>
>>>
>>>
>>>>
>>>> 2) Witness discount/scaling factor
>>>>
>>>> It is fair to say that this remains an issue of note.  A few WG members
>>>> have independently described the witness discount as an arbitrary economic
>>>> incentive encoded directly into the software.
>>>>
>>>> As a thought exercise, removing the scaling factor still retains extra
>>>> witness space and therefore retains a natural incentive to stash data
>>>> there, while removing a weighting that may or may not be the best ratio.
>>>>
>>>> Block weight plays into this - if you're not scaling, you don't need an
>>>> abstract "weight" unit, just a total size.   For wallets (#1, above), size
>>>> is probably more simple to reason and calculate than weight.  Block size is
>>>> a well studied attribute, versus block weight.
>>>>
>>>>
>>>> The witness discount is not arbitrary. The economics of spending inputs
>>> versus creating outputs is terribly imbalanced and the discount is applied
>>> in order to bring it more in balance. It can cost 5X-10X as much (data size
>>> & thus fees) to add an input (↓ UTXO set size) vs an output (↑ UTXO set
>>> size) to a transaction. It could probably be argued that a 75% discount is
>>> actually conservative in terms of trying to rebalance this discrepancy.
>>>
>>> I'm not so sure that there is a perfect ratio given the arbitrary
>>> complexity that inputs can have. I think you'd need some kind of dynamic
>>> weighting that would be much more complex and would require significant
>>> development resources to implement. I don't think we should let perfect be
>>> the enemy of good given the timeline of this project.
>>>
>>
>>
>> The sum of these two paragraphs is: [it's not arbitrary][ok, it's
>> arbitrary]   :)
>>
>> The bigger point, though, is that you cannot just look at the witness
>> discount purely through a narrow UTXO lens.
>>
>> The other side of the artificial incentive, for example, is that you have
>> created a direct incentive to put cheap garbage data into this newly
>> extended block.  Let's call this Garbage Risk.
>>
>> This is the risk of not letting the market naturally balance itself out,
>> and one of several unintended consequences of inserting an artificial ratio.
>>
>> I think there has been a mixing of terms with regard to this particular
> issue - a 75% discount is an approximation of a common ratio of input to
> output sizes (3:1) though it is possible to create more complex
> transactions with higher ratios, even as much as 10:1 if not higher. If the
> discount was /arbitrary/ rather than /approximate/ then there would be /no/
> reasoning behind its selection.
>
> That's an interesting point about Garbage Risk - I'd pose that the Garbage
> Risk we have today is pretty bad due to the imbalance in cost of spending
> inputs vs creating outputs. As it stands today, we have entities creating
> transactions with hundreds and hundreds of tiny value outputs on a regular
> basis because it's relatively cheap for them to do so - cloud mining is one
> specific example I have personally seen. Then later, when the recipients of
> these outputs try to spend them, they are greatly penalized due to the huge
> size of their inputs. If such recipients are using SegWit, at least they
> won't be paying disproportionately to spend their funds.
>
> Sure, it's not perfect, but I think there's general agreement that it's a
> step in the right direction.
>
>
>> --
>> Jeff Garzik
>> CEO and Co Founder
>> Bloq, Inc.
>>
>>
>
> _______________________________________________
> Bitcoin-segwit2x mailing list
> Bitcoin-segwit2x at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/segwit2x
>
>
Jameson Lopp in reply to Sergio Lerner permalink original

I believe you're looking for this recent commit? https://github.com/btc1/bitcoin/commit/c11c37b0d6cf434b6565b2d70ed5aa2b1e63ba3e

Agreed regarding preserving the existing discount for initial activation; my understanding was that the discount discussion was with regard to a more long-term roadmap.

On Fri, Jun 16, 2017 at 1:45 PM, Sergio Lerner <sergio at rsk.co> wrote:

Quoted text (155 lines)
> I have looked at the alpha release and it seems that at this time the "2x"
>  part of segwit2x has not been implemented. If I'm wrong, please point me
> to the code that does the 2x.
>
> Second, AFAIK all signatories of the NY agreement understood that to
> activate segwit means activate segwit *as it was in Bitcoin Core and
> defined by its known BIPs*. That means the that the 75% discount is
> preserved.
>
> The NY agreement reads: "We agree to immediately support the following
> parallel upgrades to the bitcoin protocol, which will be deployed
> simultaneously and *based on the original Segwit2Mb proposa*l"
>
> The immediate interpretation for "2x" that it at the same time based on
> the segwit2mb proposal is to increase the maximum block weight from 4M to
> 8M. This gives an initial average block size of 2 MBytes, and after wallets
> begin using segwit addresses, and increase to an average block size of 3.6
> Mbytes. The worst case is always 8 Mbytes, unless we limit it.
>
> Any change of the witness discount, even if it may be better, would
> require to check with all participants if they are willing to change the
> agreement.
>
> Best, Sergio.
>
> 2017-06-16 17:10 GMT-03:00 Jameson Lopp via Bitcoin-segwit2x <
> bitcoin-segwit2x at lists.linuxfoundation.org>:
>
>>
>>
>> On Fri, Jun 16, 2017 at 12:12 PM, Jeff Garzik <jeff at bloq.com> wrote:
>>
>>> On Fri, Jun 16, 2017 at 12:37 PM, Jameson Lopp <jameson.lopp at gmail.com>
>>> wrote:
>>>
>>>> Rough analogy:  Imagine a market where automobiles are sold by weight
>>>>> (kg).  This market now embarks on an opt-in transition to selling
>>>>> automobiles based on engine size (cc's), a metric that automobile experts
>>>>> agree better measures automobile ability.  Result:  Some bidders in the
>>>>> market buy cars based on weight, others based on cc's.  How does one bid
>>>>> efficiently in an always-in-transition market?   SegWit is not just a
>>>>> technology upgrade, it is a market upgrade.
>>>>>
>>>>
>>>> I'm not convinced this analogy fits given that the market completely
>>>> transitions to all users bidding based upon weight. Users who are driving
>>>> old, heavy cars will now be incentivized to upgrade to more modern cars
>>>> manufactured with lightweight materials.
>>>>
>>>
>>> Comments,
>>>
>>> C1) I was making a larger point that you have two different resources
>>> that really do have two different supply and demand rates, and bidding into
>>> that market is complex.
>>>
>>> C2) It is therefore a *simplification* and *assumption* that market
>>> users will behave a certain way in bidding for witness data area.   Wallets
>>> that hardcode this assumption may therefore be making non-optimal economic
>>> decisions on behalf of their users.
>>>
>>> C3) It seems unwise to build in *artificial* incentives to transition
>>> from a known-working system to a new system.  Let that happen naturally.
>>>
>>>
>>>
>>>
>>>>
>>>>
>>>>>
>>>>> 2) Witness discount/scaling factor
>>>>>
>>>>> It is fair to say that this remains an issue of note.  A few WG
>>>>> members have independently described the witness discount as an arbitrary
>>>>> economic incentive encoded directly into the software.
>>>>>
>>>>> As a thought exercise, removing the scaling factor still retains extra
>>>>> witness space and therefore retains a natural incentive to stash data
>>>>> there, while removing a weighting that may or may not be the best ratio.
>>>>>
>>>>> Block weight plays into this - if you're not scaling, you don't need
>>>>> an abstract "weight" unit, just a total size.   For wallets (#1, above),
>>>>> size is probably more simple to reason and calculate than weight.  Block
>>>>> size is a well studied attribute, versus block weight.
>>>>>
>>>>>
>>>>> The witness discount is not arbitrary. The economics of spending
>>>> inputs versus creating outputs is terribly imbalanced and the discount is
>>>> applied in order to bring it more in balance. It can cost 5X-10X as much
>>>> (data size & thus fees) to add an input (↓ UTXO set size) vs an output (↑
>>>> UTXO set size) to a transaction. It could probably be argued that a 75%
>>>> discount is actually conservative in terms of trying to rebalance this
>>>> discrepancy.
>>>>
>>>> I'm not so sure that there is a perfect ratio given the arbitrary
>>>> complexity that inputs can have. I think you'd need some kind of dynamic
>>>> weighting that would be much more complex and would require significant
>>>> development resources to implement. I don't think we should let perfect be
>>>> the enemy of good given the timeline of this project.
>>>>
>>>
>>>
>>> The sum of these two paragraphs is: [it's not arbitrary][ok, it's
>>> arbitrary]   :)
>>>
>>> The bigger point, though, is that you cannot just look at the witness
>>> discount purely through a narrow UTXO lens.
>>>
>>> The other side of the artificial incentive, for example, is that you
>>> have created a direct incentive to put cheap garbage data into this newly
>>> extended block.  Let's call this Garbage Risk.
>>>
>>> This is the risk of not letting the market naturally balance itself out,
>>> and one of several unintended consequences of inserting an artificial ratio.
>>>
>>> I think there has been a mixing of terms with regard to this particular
>> issue - a 75% discount is an approximation of a common ratio of input to
>> output sizes (3:1) though it is possible to create more complex
>> transactions with higher ratios, even as much as 10:1 if not higher. If the
>> discount was /arbitrary/ rather than /approximate/ then there would be /no/
>> reasoning behind its selection.
>>
>> That's an interesting point about Garbage Risk - I'd pose that the
>> Garbage Risk we have today is pretty bad due to the imbalance in cost of
>> spending inputs vs creating outputs. As it stands today, we have entities
>> creating transactions with hundreds and hundreds of tiny value outputs on a
>> regular basis because it's relatively cheap for them to do so - cloud
>> mining is one specific example I have personally seen. Then later, when the
>> recipients of these outputs try to spend them, they are greatly penalized
>> due to the huge size of their inputs. If such recipients are using SegWit,
>> at least they won't be paying disproportionately to spend their funds.
>>
>> Sure, it's not perfect, but I think there's general agreement that it's a
>> step in the right direction.
>>
>>
>>> --
>>> Jeff Garzik
>>> CEO and Co Founder
>>> Bloq, Inc.
>>>
>>>
>>
>> _______________________________________________
>> Bitcoin-segwit2x mailing list
>> Bitcoin-segwit2x at lists.linuxfoundation.org
>> https://www.learnbitcoin.com/archive/lists/segwit2x
>>
>>
>
>
> --
> Sergio Demian Lerner
> Chief Scientist, RSK Labs
>
Adam Back in reply to Sergio Lerner permalink original

Not just the participants, but with the ecosystem, whether they agree to reintegrate, change the discount, technical review, redeployment and significant retesting etc. I am not sure why we're even talking about it.

FWIW the discount was discussed at length over the last year, many FAQs were written about it, dozens of hours of presentations at conferences meet-ups etc. It's a single weight because it's hard for wallets to do packing with two resources, as they don't have the information for it. Jameson's analogy was good.

Reducing the negative externality that actively incentivises people to bloat and fragment the UTXO is an unequivocal good. The UTXO handling is a super-linear scaling problem, and has been degrading local transaction latency as blocks are fuller, and some spam was priced out (spam caches better as it's generally long chain repeat patterns etc).

I think UTXO commitment schemes etc are interesting but they are not here today, and they have their own costs - they do actually increase bandwidth costs, place tracking obligations on passive holding. A good topic for the future.

I suppose it's worth pointing out also that the weighting is a policy not a consensus rule. If a given party had other optimisation ideas, they could unilaterally have a different policy and charge other fees in-band or out of band.

Adam

On Fri, Jun 16, 2017 at 9:45 PM, Sergio Lerner via Bitcoin-segwit2x <bitcoin-segwit2x at lists.linuxfoundation.org> wrote:

Quoted text (157 lines)
> I have looked at the alpha release and it seems that at this time the "2x"
> part of segwit2x has not been implemented. If I'm wrong, please point me to
> the code that does the 2x.
>
> Second, AFAIK all signatories of the NY agreement understood that to
> activate segwit means activate segwit as it was in Bitcoin Core and defined
> by its known BIPs. That means the that the 75% discount is preserved.
>
> The NY agreement reads: "We agree to immediately support the following
> parallel upgrades to the bitcoin protocol, which will be deployed
> simultaneously and based on the original Segwit2Mb proposal"
>
> The immediate interpretation for "2x" that it at the same time based on the
> segwit2mb proposal is to increase the maximum block weight from 4M to 8M.
> This gives an initial average block size of 2 MBytes, and after wallets
> begin using segwit addresses, and increase to an average block size of 3.6
> Mbytes. The worst case is always 8 Mbytes, unless we limit it.
>
> Any change of the witness discount, even if it may be better, would require
> to check with all participants if they are willing to change the agreement.
>
> Best, Sergio.
>
> 2017-06-16 17:10 GMT-03:00 Jameson Lopp via Bitcoin-segwit2x
> <bitcoin-segwit2x at lists.linuxfoundation.org>:
>>
>>
>>
>> On Fri, Jun 16, 2017 at 12:12 PM, Jeff Garzik <jeff at bloq.com> wrote:
>>>
>>> On Fri, Jun 16, 2017 at 12:37 PM, Jameson Lopp <jameson.lopp at gmail.com>
>>> wrote:
>>>>>
>>>>> Rough analogy:  Imagine a market where automobiles are sold by weight
>>>>> (kg).  This market now embarks on an opt-in transition to selling
>>>>> automobiles based on engine size (cc's), a metric that automobile experts
>>>>> agree better measures automobile ability.  Result:  Some bidders in the
>>>>> market buy cars based on weight, others based on cc's.  How does one bid
>>>>> efficiently in an always-in-transition market?   SegWit is not just a
>>>>> technology upgrade, it is a market upgrade.
>>>>
>>>>
>>>> I'm not convinced this analogy fits given that the market completely
>>>> transitions to all users bidding based upon weight. Users who are driving
>>>> old, heavy cars will now be incentivized to upgrade to more modern cars
>>>> manufactured with lightweight materials.
>>>
>>>
>>> Comments,
>>>
>>> C1) I was making a larger point that you have two different resources
>>> that really do have two different supply and demand rates, and bidding into
>>> that market is complex.
>>>
>>> C2) It is therefore a simplification and assumption that market users
>>> will behave a certain way in bidding for witness data area.   Wallets that
>>> hardcode this assumption may therefore be making non-optimal economic
>>> decisions on behalf of their users.
>>>
>>> C3) It seems unwise to build in artificial incentives to transition from
>>> a known-working system to a new system.  Let that happen naturally.
>>>
>>>
>>>
>>>>
>>>>
>>>>>
>>>>>
>>>>> 2) Witness discount/scaling factor
>>>>>
>>>>> It is fair to say that this remains an issue of note.  A few WG members
>>>>> have independently described the witness discount as an arbitrary economic
>>>>> incentive encoded directly into the software.
>>>>>
>>>>> As a thought exercise, removing the scaling factor still retains extra
>>>>> witness space and therefore retains a natural incentive to stash data there,
>>>>> while removing a weighting that may or may not be the best ratio.
>>>>>
>>>>> Block weight plays into this - if you're not scaling, you don't need an
>>>>> abstract "weight" unit, just a total size.   For wallets (#1, above), size
>>>>> is probably more simple to reason and calculate than weight.  Block size is
>>>>> a well studied attribute, versus block weight.
>>>>>
>>>>>
>>>> The witness discount is not arbitrary. The economics of spending inputs
>>>> versus creating outputs is terribly imbalanced and the discount is applied
>>>> in order to bring it more in balance. It can cost 5X-10X as much (data size
>>>> & thus fees) to add an input (↓ UTXO set size) vs an output (↑ UTXO set
>>>> size) to a transaction. It could probably be argued that a 75% discount is
>>>> actually conservative in terms of trying to rebalance this discrepancy.
>>>>
>>>> I'm not so sure that there is a perfect ratio given the arbitrary
>>>> complexity that inputs can have. I think you'd need some kind of dynamic
>>>> weighting that would be much more complex and would require significant
>>>> development resources to implement. I don't think we should let perfect be
>>>> the enemy of good given the timeline of this project.
>>>
>>>
>>>
>>> The sum of these two paragraphs is: [it's not arbitrary][ok, it's
>>> arbitrary]   :)
>>>
>>> The bigger point, though, is that you cannot just look at the witness
>>> discount purely through a narrow UTXO lens.
>>>
>>> The other side of the artificial incentive, for example, is that you have
>>> created a direct incentive to put cheap garbage data into this newly
>>> extended block.  Let's call this Garbage Risk.
>>>
>>> This is the risk of not letting the market naturally balance itself out,
>>> and one of several unintended consequences of inserting an artificial ratio.
>>>
>> I think there has been a mixing of terms with regard to this particular
>> issue - a 75% discount is an approximation of a common ratio of input to
>> output sizes (3:1) though it is possible to create more complex transactions
>> with higher ratios, even as much as 10:1 if not higher. If the discount was
>> /arbitrary/ rather than /approximate/ then there would be /no/ reasoning
>> behind its selection.
>>
>> That's an interesting point about Garbage Risk - I'd pose that the Garbage
>> Risk we have today is pretty bad due to the imbalance in cost of spending
>> inputs vs creating outputs. As it stands today, we have entities creating
>> transactions with hundreds and hundreds of tiny value outputs on a regular
>> basis because it's relatively cheap for them to do so - cloud mining is one
>> specific example I have personally seen. Then later, when the recipients of
>> these outputs try to spend them, they are greatly penalized due to the huge
>> size of their inputs. If such recipients are using SegWit, at least they
>> won't be paying disproportionately to spend their funds.
>>
>> Sure, it's not perfect, but I think there's general agreement that it's a
>> step in the right direction.
>>
>>>
>>> --
>>> Jeff Garzik
>>> CEO and Co Founder
>>> Bloq, Inc.
>>>
>>
>>
>> _______________________________________________
>> Bitcoin-segwit2x mailing list
>> Bitcoin-segwit2x at lists.linuxfoundation.org
>> https://www.learnbitcoin.com/archive/lists/segwit2x
>>
>
>
>
> --
> Sergio Demian Lerner
> Chief Scientist, RSK Labs
>
> _______________________________________________
> Bitcoin-segwit2x mailing list
> Bitcoin-segwit2x at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/segwit2x
>
Jeff Garzik in reply to Jameson Lopp permalink original

That's right.

- What was delivered was with the existing discount intact for maximum compatibility. - The comments were synthesizing notes and paths-not-taken

On Fri, Jun 16, 2017 at 4:53 PM, Jameson Lopp <jameson.lopp at gmail.com> wrote:

Quoted text (167 lines)
> I believe you're looking for this recent commit? https://github.com/
> btc1/bitcoin/commit/c11c37b0d6cf434b6565b2d70ed5aa2b1e63ba3e
>
> Agreed regarding preserving the existing discount for initial activation;
> my understanding was that the discount discussion was with regard to a more
> long-term roadmap.
>
> On Fri, Jun 16, 2017 at 1:45 PM, Sergio Lerner <sergio at rsk.co> wrote:
>
>> I have looked at the alpha release and it seems that at this time the
>> "2x"  part of segwit2x has not been implemented. If I'm wrong, please point
>> me to the code that does the 2x.
>>
>> Second, AFAIK all signatories of the NY agreement understood that to
>> activate segwit means activate segwit *as it was in Bitcoin Core and
>> defined by its known BIPs*. That means the that the 75% discount is
>> preserved.
>>
>> The NY agreement reads: "We agree to immediately support the following
>> parallel upgrades to the bitcoin protocol, which will be deployed
>> simultaneously and *based on the original Segwit2Mb proposa*l"
>>
>> The immediate interpretation for "2x" that it at the same time based on
>> the segwit2mb proposal is to increase the maximum block weight from 4M to
>> 8M. This gives an initial average block size of 2 MBytes, and after wallets
>> begin using segwit addresses, and increase to an average block size of 3.6
>> Mbytes. The worst case is always 8 Mbytes, unless we limit it.
>>
>> Any change of the witness discount, even if it may be better, would
>> require to check with all participants if they are willing to change the
>> agreement.
>>
>> Best, Sergio.
>>
>> 2017-06-16 17:10 GMT-03:00 Jameson Lopp via Bitcoin-segwit2x <
>> bitcoin-segwit2x at lists.linuxfoundation.org>:
>>
>>>
>>>
>>> On Fri, Jun 16, 2017 at 12:12 PM, Jeff Garzik <jeff at bloq.com> wrote:
>>>
>>>> On Fri, Jun 16, 2017 at 12:37 PM, Jameson Lopp <jameson.lopp at gmail.com>
>>>> wrote:
>>>>
>>>>> Rough analogy:  Imagine a market where automobiles are sold by weight
>>>>>> (kg).  This market now embarks on an opt-in transition to selling
>>>>>> automobiles based on engine size (cc's), a metric that automobile experts
>>>>>> agree better measures automobile ability.  Result:  Some bidders in the
>>>>>> market buy cars based on weight, others based on cc's.  How does one bid
>>>>>> efficiently in an always-in-transition market?   SegWit is not just a
>>>>>> technology upgrade, it is a market upgrade.
>>>>>>
>>>>>
>>>>> I'm not convinced this analogy fits given that the market completely
>>>>> transitions to all users bidding based upon weight. Users who are driving
>>>>> old, heavy cars will now be incentivized to upgrade to more modern cars
>>>>> manufactured with lightweight materials.
>>>>>
>>>>
>>>> Comments,
>>>>
>>>> C1) I was making a larger point that you have two different resources
>>>> that really do have two different supply and demand rates, and bidding into
>>>> that market is complex.
>>>>
>>>> C2) It is therefore a *simplification* and *assumption* that market
>>>> users will behave a certain way in bidding for witness data area.   Wallets
>>>> that hardcode this assumption may therefore be making non-optimal economic
>>>> decisions on behalf of their users.
>>>>
>>>> C3) It seems unwise to build in *artificial* incentives to transition
>>>> from a known-working system to a new system.  Let that happen naturally.
>>>>
>>>>
>>>>
>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> 2) Witness discount/scaling factor
>>>>>>
>>>>>> It is fair to say that this remains an issue of note.  A few WG
>>>>>> members have independently described the witness discount as an arbitrary
>>>>>> economic incentive encoded directly into the software.
>>>>>>
>>>>>> As a thought exercise, removing the scaling factor still retains
>>>>>> extra witness space and therefore retains a natural incentive to stash data
>>>>>> there, while removing a weighting that may or may not be the best ratio.
>>>>>>
>>>>>> Block weight plays into this - if you're not scaling, you don't need
>>>>>> an abstract "weight" unit, just a total size.   For wallets (#1, above),
>>>>>> size is probably more simple to reason and calculate than weight.  Block
>>>>>> size is a well studied attribute, versus block weight.
>>>>>>
>>>>>>
>>>>>> The witness discount is not arbitrary. The economics of spending
>>>>> inputs versus creating outputs is terribly imbalanced and the discount is
>>>>> applied in order to bring it more in balance. It can cost 5X-10X as much
>>>>> (data size & thus fees) to add an input (↓ UTXO set size) vs an output (↑
>>>>> UTXO set size) to a transaction. It could probably be argued that a 75%
>>>>> discount is actually conservative in terms of trying to rebalance this
>>>>> discrepancy.
>>>>>
>>>>> I'm not so sure that there is a perfect ratio given the arbitrary
>>>>> complexity that inputs can have. I think you'd need some kind of dynamic
>>>>> weighting that would be much more complex and would require significant
>>>>> development resources to implement. I don't think we should let perfect be
>>>>> the enemy of good given the timeline of this project.
>>>>>
>>>>
>>>>
>>>> The sum of these two paragraphs is: [it's not arbitrary][ok, it's
>>>> arbitrary]   :)
>>>>
>>>> The bigger point, though, is that you cannot just look at the witness
>>>> discount purely through a narrow UTXO lens.
>>>>
>>>> The other side of the artificial incentive, for example, is that you
>>>> have created a direct incentive to put cheap garbage data into this newly
>>>> extended block.  Let's call this Garbage Risk.
>>>>
>>>> This is the risk of not letting the market naturally balance itself
>>>> out, and one of several unintended consequences of inserting an artificial
>>>> ratio.
>>>>
>>>> I think there has been a mixing of terms with regard to this particular
>>> issue - a 75% discount is an approximation of a common ratio of input to
>>> output sizes (3:1) though it is possible to create more complex
>>> transactions with higher ratios, even as much as 10:1 if not higher. If the
>>> discount was /arbitrary/ rather than /approximate/ then there would be /no/
>>> reasoning behind its selection.
>>>
>>> That's an interesting point about Garbage Risk - I'd pose that the
>>> Garbage Risk we have today is pretty bad due to the imbalance in cost of
>>> spending inputs vs creating outputs. As it stands today, we have entities
>>> creating transactions with hundreds and hundreds of tiny value outputs on a
>>> regular basis because it's relatively cheap for them to do so - cloud
>>> mining is one specific example I have personally seen. Then later, when the
>>> recipients of these outputs try to spend them, they are greatly penalized
>>> due to the huge size of their inputs. If such recipients are using SegWit,
>>> at least they won't be paying disproportionately to spend their funds.
>>>
>>> Sure, it's not perfect, but I think there's general agreement that it's
>>> a step in the right direction.
>>>
>>>
>>>> --
>>>> Jeff Garzik
>>>> CEO and Co Founder
>>>> Bloq, Inc.
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Bitcoin-segwit2x mailing list
>>> Bitcoin-segwit2x at lists.linuxfoundation.org
>>> https://www.learnbitcoin.com/archive/lists/segwit2x
>>>
>>>
>>
>>
>> --
>> Sergio Demian Lerner
>> Chief Scientist, RSK Labs
>>
>
>