Post
Topic
Board Bitcoin Technical Support
Merits 2 from 1 user
Re: Question on structure of Segwit part of transaction
by
achow101
on 18/02/2019, 18:41:29 UTC
⭐ Merited by bones261 (2)
Did you read the BIPs? They explain what those fields are.

Most of what you think are codes or special types are not. They are lengths.

Segwit field? = 00 01
These are the marker (00) and flag (01) byte indicating that the transaction is segwit.

Segwitcode? = 02
No. That is the number of stack elements in the witness field. This is not a fixed number. If higher or lower, there will be more or less stack items that follow it.

Length of first Segwit field? = 47 (71)
First Segwit field? = 30 44 02 20 43 4B B6 B4 D0 FA 71 83 62 5B D5 0F 55 C2 6C 8B 74 B3 12 DF 5F 06 1B 96 88 6F 33 E5 16 AF 3D 92 02 20 7F C7 61 99 99 CB 72 96 35 6A BE 82 A9 A0 B1 EC 73 1B 66 27 25 2E C8 29 38 B9 09 99 1E 43 C3 B4 01
It is not a field. It is the first stack item.

Length of second Segwit field? = 21 (33)
Second Segwit field? = 02 00 62 14 1C CC 8E 79 C1 7F C2 0C 0C CE F8 DA 06 1F 58 D3 43 D2 1E D9 2C 00 57 F4 80 FA 52 2C 3D
It is not a field. It is the second stack item.