SegWit and SPV-mining. What if...?

3

Is the following scenario valid?

  1. Some unhonest segwit mining pool takes top-1000 segwit utxo and mines a block at height N with a transaction which transfers all funds to his p2pkh address
  2. This block does not have segwit data portion, but it can be broadcasted to all non-segwit nodes on the network
  3. All other pools have a dilema - wait the segwit data associated with this block or start mining block N+1 on the top of N
  4. What if miners will use SPV-mining on the top of this block? They will create blocks at heights N+1, N+2... etc without checking the segwit-validity of block N

Also asked here: https://bitcointalk.org/index.php?topic=1434842.0

amaclin

Posted 2016-04-13T12:36:27.443

Reputation: 5 763

Answers

4

  1. Yes, they can do that.

  2. Correct, though the switchover requires a 95% threshold to make the chance that old nodes see confirmations on such blocks very small.

  3. Segwit nodes never accept blocks that have a witness commitment but no witness section. Either the block must not have a commitment (in which case it will be invalid, as script validation fails), or it is outright not accepted (because there is missing data; similar to a block with missing transactions isn't accepted).

  4. Miners that don't validate a block before mining on top of it violate the security assumptions of the network. We can't prevent them from doing so (with or without segwit), but that is one of the reasons why block propagation and block validation needs to be low-latency: so that the potential advantage miners get from SPV mining is not too significant.

Pieter Wuille

Posted 2016-04-13T12:36:27.443

Reputation: 54 032

Why are there any requirements in step (2)? There is a valid PoW block at height N with valid transactions came from 0.9.x node which known nothing about segwit. And a valid block at height (N+1) with segwit-data. What block height will you start to mine? N or (N+1) or (N+2)?amaclin 2016-04-13T14:52:53.797

1Segwit transactions are non-standard to old versions very far back. A 0.9 node will never mine them unless they're modified to do so.Pieter Wuille 2016-04-13T22:03:57.367

We are talking about transactions in block. v0.9.x will accept such block without segwit data, check it and relay to all peers. segwit transactions are quite correct in bitcoin block for such clientsamaclin 2016-04-13T22:18:08.950

0.9.x won't create blocks with segwit transactions, but yes, it will accept, so your point (2) is correct. However, mining such an invalid block will only happen intentionally, and is costly. Furthermore, because the rule only activates after 95% support, a chain not building on top will grow 20x faster, so confirmations on top are very unlikely.Pieter Wuille 2016-04-14T11:35:49.233

1[quote]However, mining such an invalid block will only happen intentionally, and is costly [/quote] 12.5+ btc - is not a big cost. I will pay these funds to a mining pool for creating a valid block with my content, broadcasting "standard" part to a network and withholding segwit part of it. just for fun :)amaclin 2016-04-14T12:02:52.150