user33010: According to bip 141, the segwit transaction serialization format (used to compute the wtxid) is:
[nVersion][marker][flag][txins][txouts][witness][nLockTime]

The bip mentions that the flag field MUST currently be 0x01. What's the purpose of this field? Is it some kind of upgrading mechanism of the serialization format?

user33010: Found it in bip 144:

Rationale for the 0x01 flag byte in between: this will allow us to easily add more extra non-committed data to transactions (like txouts being spent, ...). It can be interpreted as a bitvector.

So the 0x01 flag is indicating that the witness data should be included in the (bip144) transaction serialization.

33010: <p>According to <a href="https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki" rel="nofollow noreferrer">bip 141</a>, the segwit transaction serialization format (used to compute the wtxid) is:</p>

<pre><code>[nVersion][marker][flag][txins][txouts][witness][nLockTime]
</code></pre>

<p>The bip mentions that the <code>flag</code> field MUST currently be <code>0x01</code>. What's the purpose of this field? Is it some kind of upgrading mechanism of the serialization format?</p>
 33010: <p>Found it in <a href="https://github.com/bitcoin/bips/blob/master/bip-0144.mediawiki" rel="nofollow noreferrer">bip 144</a>:</p>

<blockquote>
  <p><strong>Rationale for the 0x01 flag byte in between</strong>: this will allow us to easily add more extra non-committed data to transactions (like txouts being spent, ...). It can be interpreted as a bitvector.</p>
</blockquote>

<p>So the <code>0x01</code> flag is indicating that the witness data should be included in the (bip144) transaction serialization.</p>
