Can a Non-Segwit Miner mine segwit transactions?

4

I understand that non-segwit nodes interpret segwit txes as Anyone-Can-Spend txes, and they cannot validate txes that spend segwit outputs.

But when an old style miner receives a segwit tx to mine he consideres it invalid, right? (That's because it appears to them as a strange transaction with no input and 1 output.) So, does it follow that segwit txes can only be mined in a block by upgraded miners?

Zaitsev

Posted 2017-10-06T20:48:29.967

Reputation: 63

Answers

4

An old style miner would only receive a stripped transaction, i.e. a transaction from which the witness has been removed. They will consider a segwit transaction to be valid but non-standard because one element remains on the stack when resolving the redeem script.

If a miner included this transaction in their block, the block would appear valid to segwit-incapable nodes, but invalid to any segwit-capable nodes as any segwit input would be missing the required witness and thus would not be properly signed. This would lead to the block being rejected by 98% of the nodes on the network, and thus the segwit-incapable miner to lose their block reward as it would not become part of the heaviest blockchain. Segwit-incapable miners can however contribute blocks that only include non-segwit transactions that build on top of the chain that includes segwit-blocks.

This means that only a miner collecting transactions with a segwit-capable node is able to create a valid block that includes segwit transactions.

Murch

Posted 2017-10-06T20:48:29.967

Reputation: 41 609

So, old miners can't create a block with segwit txs but can reiceve this block from new miners (stripped), right? Thank you for your explainationZaitsev 2017-10-12T02:01:17.703

Exactly. And not only can't they produce SegWit blocks, they also won't, as SegWit transactions are non-standard.Pieter Wuille 2017-10-12T04:48:08.697

they won't receive the block from other (upgrade) miner? so old miner refuse them?Zaitsev 2017-10-12T15:09:18.117

The old nodes can redistribute the stripped block amongst each other, or any new nodes will create the stripped block when it is requested from any old node.Murch 2017-10-12T22:24:12.427

yes this is clear, my last question was about what pieter said ("they also won't"), because I understand that old miners don't want segwit txs, but they accept segwit blocks (stripped)Zaitsev 2017-10-13T00:39:34.330

@Zaitsev: Segwit-incapable miners can not validate segwit-transactions completely, nor use them in their blocks. Since the outputs and inputs are part of the stripped blocks, they can however follow segwit blocks correctly and arrive at the same UTXO set as other nodes.Murch 2017-10-13T01:00:19.223

I meant that non-SegWit miners won't try to include SegWit txn, as they are non-standard to them, so they won't accept or relay them. They will however accept (stripped) SegWit txn if they occur in a block miner by a SegWit miner.Pieter Wuille 2017-12-09T17:58:44.340