Home Bitcoin Is a Segwit format transaction with all inputs of non-witness program kind legitimate?

Is a Segwit format transaction with all inputs of non-witness program kind legitimate?

0
Is a Segwit format transaction with all inputs of non-witness program kind legitimate?


TL;DR: no, that won’t be accepted, however not due to something in BIP141.

BIP141 specifies the segwit block and validity guidelines, nevertheless it does not specify how transactions must be serialized to bytes for communication (that’s in BIP144). So far as BIP141 is anxious, transactions are summary objects (constructions containing inputs and outputs, witnesses and scripts, …), not sequences of bytes. On this view, each transaction (even pre-segwit transactions) has a witness for every enter, which can be empty. It doesn’t care whether or not you utilize the legacy transaction serialization format (with out marker/flag/witnesses) or the prolonged legacy transaction serialization format (with marker/flag/witnesses), or one thing else (say, a elaborate compressed format for transactions). It simply cares about transactions.

Nevertheless, transactions, for validation purporses, do have have txids and wtxids, that are hashes of one thing. That one thing have to be well-defined, as txids and wtxids are related for consensus guidelines; in the event that they have been computed any in a different way by some nodes, they’d fork off. It is for that reason that BIP141 mentions the serialization format for the needs of computing the wtxid. However, once more, it doesn’t care how that transaction is definitely despatched to the node. It simply states that when you’ve got a transaction, how you need to compute its wtxid. The wtxid may in concept not equal the hash of the byte serialization of the transaction as your node acquired them (although in apply, for now, it’s).

BIP144 does specify the peer to look protocol for communication of segwit transactions, which occurs to specify the identical encoding because the one utilized in BIP141 for the computation of wtxids. However it additionally contains the road:

If the witness is empty, the previous serialization format have to be used.

So, for the needs of the peer-to-peer protocol, you can not use the prolonged format when transmitting a transaction to a node that has all empty witnesses. As that is only a peer-to-peer protocol alternative, it’s potential in concept that in future peer-to-peer protocol extensions one other serialization format for transactions will get outlined, and if and when that occurs, the wtxid calculation in BIP141 will nonetheless apply precisely the identical, as a result of altering that half could be a consensus change.

LEAVE A REPLY

Please enter your comment!
Please enter your name here