4

A merkle root in a block header is a way to commit all transactions in that block. However, since it does not cover transaction witness data, another commitment needs to be made in a coinbase transaction. The only difference is now instead of a TXID we create a WTXID that additionaly includes the marker, tag and witness data. For non-SegWit transactions, it is necessary to use the old serialization format so their TXID is equal to WTXID. My question is, are these legacy (non-SegWit) transactions, i.e. their TXID (which is equal to WTXID) also part of creating a merkle tree for committing in a coinbase transaction or we just take into account SegWit transactions?

1 Answer 1

5

The wtxids of all transactions are committed to by the witness commitment tree in the coinbase transaction (except the coinbase wtxid itself, as that would be a cyclic dependency). This includes non-witness transactions (for which the txid and wtxid are identical).

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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