Marker and Flag
Size
1 byte
Format
-
Description
Used to indicate a segwit transaction. Must be 00.
Example
00
Byte Visualization
The marker and flag are optional fields introduced with SegWit.
They indicate that a transaction uses the segregated witness structure defined in BIP144 (Witness data is required for inputs locked by P2WPKH, P2WSH, or P2TR).
Marker
Marker indicates that the transaction uses the SegWit transaction format (also known as the extended format).
- Marker is 1 byte.
- Must always be
0x00
to signal a SegWit transaction.
Flag
- The flag is 1 byte.
- It is currently set to
0x01
in all SegWit transactions. - Future upgrades may use different flags.
Note: Legacy Compatibility
If a transaction doesn’t include witness data, marker and flag are omitted.
Question
How do old nodes treat marker and flag for SegWit transactions?
-> Answer here