Complete definition of 'tx_witness' data structure used in 'tx' data structure I'm reading the Protocol Documentation page for the 'tx' data structure and cannot find a completely clear definition of the 'tx_witness' data structure.

After the 'tx_out' table, there is short comment stating that "The TxWitness structure consists of a var_int count of witness data components, followed by (for each witness data component) a var_int length of the component and the raw component data itself."

Could someone post a table, similar to others on the Protocol Documentation page, defining clearly how a 'tx_witness' data structure should be formed?
In Bitcoin Core, the scriptWitness property (for the CTxIn class) is serialized from a CTransaction as a std::vector&lt;std::vector&lt;unsigned char&gt; &gt;, so I would imagine the serialized version would look something like:

TxWitness:


+------------+-------------------------+------------------------+
| Field Size |        Description      |       Data Type        |
+------------+-------------------------+------------------------+
| 0+         | witness_component count | var_int                |
| ?          | witness_components      | witness_component[]    |
+------------+-------------------------+------------------------+


WitnessComponent:


+------------+------------------+-----------+
| Field Size |   Description    | Data Type |
+------------+------------------+-----------+
| 0+         | component length | var_int   |
| ?          | component        | uchar[]   |
+------------+------------------+-----------+


References:


https://github.com/bitcoin/bitcoin/blob/master/src/primitives/transaction.h#L67
https://github.com/bitcoin/bitcoin/blob/master/src/primitives/transaction.h#L254
https://github.com/bitcoin/bitcoin/blob/master/src/script/script.h#L676