A metric for measuring the "size" of a transaction.
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.
The weight of a transaction is calculated by multiplying the size (in bytes) of different parts of the transaction data by different values:
The factor of 4 helps to create more of a balance between 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:
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:
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 to luke-jr for explaining how multiplying non-witness data by 4 helps to create a balance between the costs of creating and spending UTXOs.
- Thanks to Pieter Wuille for this helpful link: https://segwit.org/why-a-discount-factor-of-4-why-not-2-or-8-bbcebe91721e