segregated witness – Which worth is acceptable for the MARKER discipline of a segwit tx messages: 0x00 or nonzero?

0
86


the marker would should be 0 for outdated nodes to deal with the transaction as legitimate. […] Is there one thing I am lacking?

What it’s possible you’ll be lacking is that outdated (pre-segwit) nodes by no means see segwit information, when segwit nodes ship information to pre-segwit nodes they edit out all of the segwit fields.

A part of the protocol handshake identifies segwit nodes

Consequently the marker is at all times zero and the one at the moment outlined worth for the flag is 1 (so far as I do know). When parsing I depend on the marker being zero, to differentiate it from an enter depend, however I permit for any non zero worth of flag.


Rationale for not utilizing only a single 0x00 byte as marker: that might result in empty transactions (no inputs, no outputs, that are utilized in some exams) to be interpreted as new serialized information

This says that the 0x00 marker is obligatory however is not adequate to reliably distinguish pre-segwit transaction serialisation from segwit transaction serialisation.

I consider it claims you want the extra flag to differentiate a segwit transaction (with any variety of inputs) from a pre-segwit transaction that has no inputs (enter depend = 0).

I do not suppose that is really true for mainnet†. I believe there are not any transactions utilizing the pre-segwit serialisation that haven’t any inputs. Maybe it’s true for one of many different Bitcoin networks (testnet and many others). I wrote a parser that might fail if fed a pre-segwit transaction with no inputs – It hasn’t failed however admittedly I have never examined it in opposition to each transaction in the entire mainnet blockchain.


Associated


Footnotes

† Minimal variety of inputs

  1. https://developer.bitcoin.org/devguide/transactions.html says

    Every transaction has at the very least one enter

  2. Find out how to create a bitcoin transaction with out inputs

    Solely the coinbase transaction is allowed to have a null, or non-existent enter […] Coinbase transactions have inputs. They simply reference null outpoints

LEAVE A REPLY

Please enter your comment!
Please enter your name here