Skip to content
LearnBitcoin

ResearchBitcoin Dev Archive SegWit2x list

Notes on segwit2x and anti-replay methods

8 messages, Jul 27 to 30, 2017. Started by Jeff Garzik.

Jeff Garzik (3), Jared Lee Richardson (2), Jean-Pierre Rupp, Jacob Eliosoff, Luke Dashjr

Permalink First message in the Wayback Machine

Jeff Garzik permalink original

Given recent threads, it seemed useful to summarize the status of segwit2x vis anti-replay.

1) Thanks to all for some healthy debate on btc1 Slack's #debate channel, as well as in public.

2) anti-replay is currently an open issue: https://github.com/btc1/bitcoin/issues/34 Being an open issue implies that we are actively soliciting suggestions and solutions.

3) In informal discussions, I've termed segwit2x a "node HF", meaning that it is somewhat of a hybrid fork, somewhere between soft fork and hard fork.

3a) In a soft fork, nodes and SPV wallets auto-accept new rules (*opt-out*). At most a "new rules!" warning is emitted, but operation otherwise continues under the new ruleset.

3b) In a "pure" hard fork, nodes and SPV wallets do not auto-accept new rules, and must upgrade to adopt (*opt-in*).

3c) In segwit2x, nodes and SPV wallets split the difference. nodes do not auto-accept new rules, but many wallets, notably SPV wallets, will.

4) It is good to provide some sort of facility such that SPV wallets may also emit a "new rules" warning for the segwit2x 2M HF upgrade, to match the experience of an opt-out soft fork upgrade. James Hilliard's PR was re-opened for this purpose: https://github.com/btc1/bitcoin/pull/46

5) It is *not* good to include a change that breaks all wallets (meaning, requires upgrade to continue working post-2M HF). The likely case is that the NYA participants and 80+% hashpower will upgrade to 2M BBSI. Thus, in the the likely "one chain" outcome, a break-all-wallets change would be unnecessarily disruptive to users (to make a large understatement).

6) This leaves us with a range of solutions that include opt-in replay protection (#34) and HF visibility via block version bit (#46). Gavin's suggestion is in #34. Sergio had another suggestion on twitter last night. Both seem viable, because they are opt-in.

Jeff Garzik in reply to Jeff Garzik permalink original

Quick addendum:

7) I'm a big fan of luke-jr's OP_CHECKBLOCKATHEIGHT personally https://github.com/luke-jr/bips/blob/bip-cbah/bip-cbah.mediawiki

That seems worth mentioning in this thread, though out of scope of segwit2x charter and seemingly in need of further review and noodling.

On Thu, Jul 27, 2017 at 8:52 AM, Jeff Garzik <jeff at bloq.com> wrote:

Quoted text (45 lines)
> Given recent threads, it seemed useful to summarize the status of segwit2x
> vis anti-replay.
>
> 1) Thanks to all for some healthy debate on btc1 Slack's #debate channel,
> as well as in public.
>
> 2) anti-replay is currently an open issue:  https://github.com/btc1/
> bitcoin/issues/34  Being an open issue implies that we are actively
> soliciting suggestions and solutions.
>
> 3) In informal discussions, I've termed segwit2x a "node HF", meaning that
> it is somewhat of a hybrid fork, somewhere between soft fork and hard fork.
>
> 3a) In a soft fork, nodes and SPV wallets auto-accept new rules (*opt-out*).
> At most a "new rules!" warning is emitted, but operation otherwise
> continues under the new ruleset.
>
> 3b) In a "pure" hard fork, nodes and SPV wallets do not auto-accept new
> rules, and must upgrade to adopt (*opt-in*).
>
> 3c) In segwit2x, nodes and SPV wallets split the difference.  nodes do not
> auto-accept new rules, but many wallets, notably SPV wallets, will.
>
> 4) It is good to provide some sort of facility such that SPV wallets may
> also emit a "new rules" warning for the segwit2x 2M HF upgrade, to match
> the experience of an opt-out soft fork upgrade.  James Hilliard's PR was
> re-opened for this purpose: https://github.com/btc1/bitcoin/pull/46
>
> 5) It is *not* good to include a change that breaks all wallets (meaning,
> requires upgrade to continue working post-2M HF).  The likely case is that
> the NYA participants and 80+% hashpower will upgrade to 2M BBSI.  Thus, in
> the the likely "one chain" outcome, a break-all-wallets change would be
> unnecessarily disruptive to users (to make a large understatement).
>
> 6) This leaves us with a range of solutions that include opt-in replay
> protection (#34) and HF visibility via block version bit (#46).  Gavin's
> suggestion is in #34.  Sergio had another suggestion on twitter last
> night.  Both seem viable, because they are opt-in.
>
> --
> Jeff Garzik
> CEO and Co Founder
> Bloq, Inc.
>
>
Jean-Pierre Rupp in reply to Jeff Garzik permalink original

On Thu, 2017-07-27 at 08:52 -0400, Jeff Garzik via Bitcoin-segwit2x wrote:

Quoted text (3 lines)
> 3c) In segwit2x, nodes and SPV wallets split the difference.  nodes
> do not auto-accept new rules, but many wallets, notably SPV wallets,
> will.

With reservations, a rule like the one highlighted below surely exists in more than one SPV client library. Merkle block validation will fail if the block has too many transactions with respect to the maximum block size and minimum transaction size.

https://github.com/haskoin/haskoin/blob/master/haskoin-core/Network/Has koin/Block/Merkle.hs#L181-L182

I want to keep wallet implementors on their toes, even if their wallets only do SPV. I would recommend against a default attitude of assuming they'll work with larger blocks without changes.

Greetings

Jeff Garzik in reply to Jean-Pierre Rupp permalink original

On Thu, Jul 27, 2017 at 11:00 AM, Jean-Pierre Rupp <jp at blockchain.com> wrote:

Quoted text (5 lines)
> I want to keep wallet implementors on their toes, even if their wallets
> only do SPV. I would recommend against a default attitude of assuming
> they'll work with larger blocks without changes.
>
>

100% agree with that last - we are not making that assumption.

In fact, there has been and is on-going audit work to assess precisely what are the compatibility levels and needs.

Jacob Eliosoff in reply to Jeff Garzik permalink original

Let me make another plug for "breaking wallets" -

I understand many both believe and hope that the Nov HF will be decisive and ~all of Bitcoin will move onto the 2x chain. But the fact is it's still likely that some subset of users will stick to the old 1x chain (perhaps itself forked). I support Segwit2x, but those 1x users are Bitcoin users too and the outcome for them deserves consideration. In particular I see two main realistic options:

a) Both 2x and 1x chains cheerfully accept un-upgraded post-HF transactions.
   *Downside: *some users sending txs from old wallets find they've
accidentally sent on both chains (replay effect).
b) Both chains reject post-HF txs, until the wallet has been upgraded.
   *Downside:* users have to upgrade their software, and specify which
chain they mean, before they can send any the post-HF txs.

(Note that option b requires *both* chains to push a change to invalidate post-HF txs by default. It seems extremely unlikely that either chain will do this if the other doesn't.)

I would argue that:

   1. The inconvenience of having to upgrade software sometime in the next
   4 months is *not comparable to the inconvenience of accidentally sending
   on the wrong chain*
   2. In practice most software will be upgraded:
   - The HF is getting plenty of press
   - The software changes required to enable post-HF txs should be minor
   - Many end-users transact via websites/services that can be expected to
   upgrade

Sergio or his upcoming BIP may shed further light, but I believe "breaking wallets" in this easily-fixable way is the lesser evil here.

On Thu, Jul 27, 2017 at 9:02 AM, Jeff Garzik via Bitcoin-segwit2x < bitcoin-segwit2x at lists.linuxfoundation.org> wrote:

Quoted text (73 lines)
> Quick addendum:
>
> 7) I'm a big fan of luke-jr's OP_CHECKBLOCKATHEIGHT personally
> https://github.com/luke-jr/bips/blob/bip-cbah/bip-cbah.mediawiki
>
> That seems worth mentioning in this thread, though out of scope of
> segwit2x charter and seemingly in need of further review and noodling.
>
>
>
> On Thu, Jul 27, 2017 at 8:52 AM, Jeff Garzik <jeff at bloq.com> wrote:
>
>> Given recent threads, it seemed useful to summarize the status of
>> segwit2x vis anti-replay.
>>
>> 1) Thanks to all for some healthy debate on btc1 Slack's #debate channel,
>> as well as in public.
>>
>> 2) anti-replay is currently an open issue:  https://github.com/btc1/bitco
>> in/issues/34  Being an open issue implies that we are actively
>> soliciting suggestions and solutions.
>>
>> 3) In informal discussions, I've termed segwit2x a "node HF", meaning
>> that it is somewhat of a hybrid fork, somewhere between soft fork and hard
>> fork.
>>
>> 3a) In a soft fork, nodes and SPV wallets auto-accept new rules (
>> *opt-out*).  At most a "new rules!" warning is emitted, but operation
>> otherwise continues under the new ruleset.
>>
>> 3b) In a "pure" hard fork, nodes and SPV wallets do not auto-accept new
>> rules, and must upgrade to adopt (*opt-in*).
>>
>> 3c) In segwit2x, nodes and SPV wallets split the difference.  nodes do
>> not auto-accept new rules, but many wallets, notably SPV wallets, will.
>>
>> 4) It is good to provide some sort of facility such that SPV wallets may
>> also emit a "new rules" warning for the segwit2x 2M HF upgrade, to match
>> the experience of an opt-out soft fork upgrade.  James Hilliard's PR was
>> re-opened for this purpose: https://github.com/btc1/bitcoin/pull/46
>>
>> 5) It is *not* good to include a change that breaks all wallets
>> (meaning, requires upgrade to continue working post-2M HF).  The likely
>> case is that the NYA participants and 80+% hashpower will upgrade to 2M
>> BBSI.  Thus, in the the likely "one chain" outcome, a break-all-wallets
>> change would be unnecessarily disruptive to users (to make a large
>> understatement).
>>
>> 6) This leaves us with a range of solutions that include opt-in replay
>> protection (#34) and HF visibility via block version bit (#46).  Gavin's
>> suggestion is in #34.  Sergio had another suggestion on twitter last
>> night.  Both seem viable, because they are opt-in.
>>
>> --
>> Jeff Garzik
>> CEO and Co Founder
>> Bloq, Inc.
>>
>>
>
>
> --
> 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 Jacob Eliosoff permalink original
Quoted text (1 line)
> (Note that option b requires both chains to push a change to invalidate post-HF txs by default.  It seems extremely unlikely that either chain will do this if the other doesn't.)

I would support this proposal but I find it extremely unlikely that both chains would implement and roll-out those rule changes. Barring that, an optional replay protection mechanism would be the least disruptive choice for this hardfork based on the support currently measurable.

Jared

On Thu, Jul 27, 2017 at 11:41 AM, Jacob Eliosoff via Bitcoin-segwit2x <bitcoin-segwit2x at lists.linuxfoundation.org> wrote:

Quoted text (117 lines)
> Let me make another plug for "breaking wallets" -
>
> I understand many both believe and hope that the Nov HF will be decisive and
> ~all of Bitcoin will move onto the 2x chain.  But the fact is it's still
> likely that some subset of users will stick to the old 1x chain (perhaps
> itself forked).  I support Segwit2x, but those 1x users are Bitcoin users
> too and the outcome for them deserves consideration.  In particular I see
> two main realistic options:
>
> a) Both 2x and 1x chains cheerfully accept un-upgraded post-HF transactions.
>    Downside: some users sending txs from old wallets find they've
> accidentally sent on both chains (replay effect).
>
> b) Both chains reject post-HF txs, until the wallet has been upgraded.
>    Downside: users have to upgrade their software, and specify which chain
> they mean, before they can send any the post-HF txs.
>
> (Note that option b requires both chains to push a change to invalidate
> post-HF txs by default.  It seems extremely unlikely that either chain will
> do this if the other doesn't.)
>
> I would argue that:
>
> The inconvenience of having to upgrade software sometime in the next 4
> months is not comparable to the inconvenience of accidentally sending on the
> wrong chain
> In practice most software will be upgraded:
> - The HF is getting plenty of press
> - The software changes required to enable post-HF txs should be minor
> - Many end-users transact via websites/services that can be expected to
> upgrade
>
> Sergio or his upcoming BIP may shed further light, but I believe "breaking
> wallets" in this easily-fixable way is the lesser evil here.
>
>
> On Thu, Jul 27, 2017 at 9:02 AM, Jeff Garzik via Bitcoin-segwit2x
> <bitcoin-segwit2x at lists.linuxfoundation.org> wrote:
>>
>> Quick addendum:
>>
>> 7) I'm a big fan of luke-jr's OP_CHECKBLOCKATHEIGHT personally
>> https://github.com/luke-jr/bips/blob/bip-cbah/bip-cbah.mediawiki
>>
>> That seems worth mentioning in this thread, though out of scope of
>> segwit2x charter and seemingly in need of further review and noodling.
>>
>>
>>
>> On Thu, Jul 27, 2017 at 8:52 AM, Jeff Garzik <jeff at bloq.com> wrote:
>>>
>>> Given recent threads, it seemed useful to summarize the status of
>>> segwit2x vis anti-replay.
>>>
>>> 1) Thanks to all for some healthy debate on btc1 Slack's #debate channel,
>>> as well as in public.
>>>
>>> 2) anti-replay is currently an open issue:
>>> https://github.com/btc1/bitcoin/issues/34  Being an open issue implies that
>>> we are actively soliciting suggestions and solutions.
>>>
>>> 3) In informal discussions, I've termed segwit2x a "node HF", meaning
>>> that it is somewhat of a hybrid fork, somewhere between soft fork and hard
>>> fork.
>>>
>>> 3a) In a soft fork, nodes and SPV wallets auto-accept new rules
>>> (opt-out).  At most a "new rules!" warning is emitted, but operation
>>> otherwise continues under the new ruleset.
>>>
>>> 3b) In a "pure" hard fork, nodes and SPV wallets do not auto-accept new
>>> rules, and must upgrade to adopt (opt-in).
>>>
>>> 3c) In segwit2x, nodes and SPV wallets split the difference.  nodes do
>>> not auto-accept new rules, but many wallets, notably SPV wallets, will.
>>>
>>> 4) It is good to provide some sort of facility such that SPV wallets may
>>> also emit a "new rules" warning for the segwit2x 2M HF upgrade, to match the
>>> experience of an opt-out soft fork upgrade.  James Hilliard's PR was
>>> re-opened for this purpose: https://github.com/btc1/bitcoin/pull/46
>>>
>>> 5) It is not good to include a change that breaks all wallets (meaning,
>>> requires upgrade to continue working post-2M HF).  The likely case is that
>>> the NYA participants and 80+% hashpower will upgrade to 2M BBSI.  Thus, in
>>> the the likely "one chain" outcome, a break-all-wallets change would be
>>> unnecessarily disruptive to users (to make a large understatement).
>>>
>>> 6) This leaves us with a range of solutions that include opt-in replay
>>> protection (#34) and HF visibility via block version bit (#46).  Gavin's
>>> suggestion is in #34.  Sergio had another suggestion on twitter last night.
>>> Both seem viable, because they are opt-in.
>>>
>>> --
>>> Jeff Garzik
>>> CEO and Co Founder
>>> Bloq, Inc.
>>>
>>
>>
>>
>> --
>> 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
>>
>
>
> _______________________________________________
> Bitcoin-segwit2x mailing list
> Bitcoin-segwit2x at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/segwit2x
>
Luke Dashjr in reply to Jeff Garzik permalink original

On Thursday 27 July 2017 08:52:49 Jeff Garzik via Bitcoin-segwit2x wrote:

Quoted text (2 lines)
> 3c) In segwit2x, nodes and SPV wallets split the difference.  nodes do not
> auto-accept new rules, but many wallets, notably SPV wallets, will.

Only because real SPV does not exist. Real SPV nodes would behave identically to full nodes in this regard. That current "SPV" wallets do not is a bug.

Quoted text (2 lines)
> The likely case is that the NYA participants and 80+% hashpower will upgrade
> to 2M BBSI.  Thus, in the the likely "one chain" outcome,

The former does NOT avoid a chain split. The current style of hardfork Segwit2x is using *guarantees* two chains, with anything less than 100% adoption. Considering the community's wide opposition to the proposal, the "one chain" outcome is certain to NOT happen.

Planning as if it is a likely outcome is just going to make a mess for you.

Luke

Jared Lee Richardson in reply to Luke Dashjr permalink original
Quoted text (3 lines)
> The current style of hardfork
> Segwit2x is using *guarantees* two chains, with anything less than 100%
> adoption.

Users do not work this way. Users abandon unusable chains in favor of usable chains that have value.

On Sat, Jul 29, 2017 at 11:39 PM, Luke Dashjr via Bitcoin-segwit2x <bitcoin-segwit2x at lists.linuxfoundation.org> wrote:

Quoted text (22 lines)
> On Thursday 27 July 2017 08:52:49 Jeff Garzik via Bitcoin-segwit2x wrote:
>> 3c) In segwit2x, nodes and SPV wallets split the difference.  nodes do not
>> auto-accept new rules, but many wallets, notably SPV wallets, will.
>
> Only because real SPV does not exist. Real SPV nodes would behave identically
> to full nodes in this regard. That current "SPV" wallets do not is a bug.
>
>> The likely case is that the NYA participants and 80+% hashpower will upgrade
>> to 2M BBSI.  Thus, in the the likely "one chain" outcome,
>
> The former does NOT avoid a chain split. The current style of hardfork
> Segwit2x is using *guarantees* two chains, with anything less than 100%
> adoption. Considering the community's wide opposition to the proposal, the
> "one chain" outcome is certain to NOT happen.
>
> Planning as if it is a likely outcome is just going to make a mess for you.
>
> Luke
> _______________________________________________
> Bitcoin-segwit2x mailing list
> Bitcoin-segwit2x at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/segwit2x