5

I know that non-SegWit node could verify a block without witness.

For SegWit node, is witness necessary to verify a block? Because I know witness are committed as wtxid merkle node in coinbase. What's the purpose of the wtxid merkle node?

If witenss is necessary for SegWit node, then can I say witness is an part of blockchain in SegWit node's view?

1

For SegWit node, is witness necessary to verify a block? Because I know witness are committed as wtxid merkle node in coinbase. What's the purpose of the wtxid merkle node?

If a block contains transactions that have witnesses, if the block then does not have a witness, the Segwit node will still validate it, but it will find it to be invalid. Because segwit is a soft fork, Segwit nodes still know what blocks without witnesses look like and can verify them as such. This is because the block structure actually did not change, what changed was the transaction structure.

If witenss is necessary for SegWit node, then can I say witness is an part of blockchain in SegWit node's view?

Yes.

  • 1
    So miners will keep all witness and never discard them, isn't it? People always say block size haven't changed and witness is not an part of blockchain after implementing Segwit. But now I got it. It is only for the non-SegWit node's view. Your answer make me clear. Thank you! – fjchen Dec 2 '17 at 7:22
0

Well, a segwit node will indeed classify a block that have transactions without a witness as 'invalid'.

See this answer, Transaction verification by miner VS full node with & without SegWit

I believe it answers the most part of your question better/more in-depth then i could.

  • So 1MB block size is only for non-SegWit nodes and it is more than 1MB for SegWit nodes, right? – fjchen Dec 2 '17 at 7:25
  • It should be more yes, since segwit reserves/receives an additional 3MB purely for signatures of P2WPKH and P2WSH transaction types, if i'm not mistaken.. This is theorethical, usually a segwit block isn't above 2.2 MB due to the low amount of these kinds of transactions. – Rutger Versteegden Dec 2 '17 at 12:02
  • That's not really true. There is simply a new unit "weight" which is defined as 4*non_witness_size + witness_size, which is restricted to 4000000. If a block has 1000000 bytes of non-witness data, there is no more space for witness data. – Pieter Wuille Apr 5 '18 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.