What fields in a transaction are considered witness data? I need this to calculate the vsize for fee.

My understanding is these are marker, flag and witness (from 1 and 2).

Or is it just witness, without marker and flag?

Did try to look in source code, but because still new was unsuccessful. Source code references appreciated.

1 Answer 1


This is defined in BIP141, section "Block size":

Blocks are currently limited to 1,000,000 bytes (1MB) total size. We change this restriction as follows:

Block weight is defined as Base size * 3 + Total size. (rationale[3])

Base size is the block size in bytes with the original transaction serialization without any witness-related data, as seen by a non-upgraded node.

Total size is the block size in bytes with transactions serialized as described in BIP144, including base data and witness data.

From this it follows that marker, flag and witness are all considered witness data for weight (and therefore fee) calculation, because these are exactly the fields not present in the original serialization.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.