<p>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).</p>

CC BY-SA 4.0
2023-11-28T17:59:04.160Z
For coinbase transaction I am not calculating its WTIX but taking it as "0x000...0000"?
LeaBit
CC BY-SA 4.0
2023-11-28T18:02:47.600Z
Yes, see https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#commitment-structure
Pieter Wuille
CC BY-SA 4.0
2023-11-28T17:52:26.997Z
2023-11-28T17:52:26.997Z
Pieter Wuille
<p>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?</p>

<segregated-witness><coinbase-transaction><merkle-tree><witness-commitment>
Are all transactions, whether SegWit or non-SegWit, part of the commitment in a coinbase transaction?
LeaBit
# Are all transactions, whether SegWit or non-SegWit, part of the commitment in a coinbase transaction?

(Asked by: username_0 on 2023-11-28)

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?

**Tags:** segregated-witness, coinbase-transaction, merkle-tree, witness-commitment


---

## 1 answers

### Answer by username_1 on 2023-11-28. Score: 5 | Accepted answer

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).

> **Comments:**
> **username_0**: For coinbase transaction I am not calculating its WTIX but taking it as "0x000...0000"?  
> **username_1**: Yes, see https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#commitment-structure  

---

