Glossary | Transaction Weight
$8,308.02/BTCBuy

Transaction Weight

With the introduction of BIP 141 (Segregated Witness), transactions were given a new unit of measurement called weight.

This weight measurement basically gives the validation part of a transaction (the signature data) a discount, so it doesn't take up as much "space" inside a block. In other words, the signature data is less costly than the rest of the transaction data.

Calculation

The weight of a transaction is calculated by multiplying the size (in bytes) of different parts of the transaction data by different values:

Data Multiplier
Version x4
Marker x1
Flag x1
Input Count x4
Input x4
Output Count x4
Output x4
Witness x1
Locktime x4

Example

Transaction: c586389e5e4b3acb9d6c8be1c19ae8ab2795397633176f5a6442a261bbdefc3a

0200000000010140d43a99926d43eb0e619bf0b3d83b4a31f60c176beecfb9d35bf45e54d0f7420100000017160014a4b4ca48de0b3fffc15404a1acdc8dbaae226955ffffffff0100e1f5050000000017a9144a1154d50b03292b3024370901711946cb7cccc387024830450221008604ef8f6d8afa892dee0f31259b6ce02dd70c545cfcfed8148179971876c54a022076d771d6e91bed212783c9b06e0de600fab2d518fad6f15a2b191d7fbd262a3e0121039d25ab79f41f75ceaf882411fd41fa670a4c672c23ffaf0e361a969cde0692e800000000
Data Bytes Multiplier Weight
Non-Witness 106 x4 434
Witness 110 x1 110
534

FAQ

Why x4?

The factor of 4 helps to create more of a balance between the the cost of creating an output and the cost of spending an output.

In typical transaction data, an output can be created using around 32 bytes, but spending it requires around 108 bytes:

With the old metric, every byte of data you included in a transaction increased its fee. So as a result, it cost more to spend an output than it did to create one.

With the old metric, every byte of data you included in a transaction increased its fee. So as a result, it cost more to spend an output than it did to create one.

However, by using the new weight metric, there is more of an even balance between the cost of creating an output and spending an output:

With the weight metric, spending an output "costs" roughly the same as creating one.

With the weight metric, spending an output "costs" roughly the same as creating one.

As a result, this creates a more balanced incentive to spend outputs, which should help to reduce the size of the UTXO set (which takes up valuable space in RAM on a computer running a full node).

Thanks

Back to Top