SegWit and previous hash: txid or wtxid, or either?

4

With segwit there will be two transaction ids wtxid and txid
Can either one of them be used as previous hash or only txid?

Albert s

Posted 2017-07-06T19:44:51.860

Reputation: 1 344

Answers

6

Inside transaction inputs, you have to refer to previous transactions using the txid. Allowing a wtxid there would be (1) a hard fork and (2) defeating the purpose, as it'd make transactions malleable again.

The wtxid is only used to compute the Witness merkle root, which is committed to in the coinbase.

Pieter Wuille

Posted 2017-07-06T19:44:51.860

Reputation: 54 032