Virtual Size (vSize)
Virtual Size (vSize)
While miners use Weight Units for consensus, humans and wallets typically use Virtual Size (vSize) for fee estimation. vSize is a "normalized" byte count that makes SegWit transactions comparable to legacy ones.
1. The vSize Formula
To convert Weight Units back into a byte-like number, we divide by 4:
vSize = ceil(Weight / 4)
The "ceiling" function means we always round up to the nearest whole number.
2. Why do we need vSize?
If a wallet says a fee is "10 sats/byte," but you are using SegWit, which "byte" is it referring to?
-
If it refers to raw bytes, the calculation is wrong because signatures are discounted.
-
If it refers to weight units, the number is too small (e.g., 2.5 sats/WU). vSize solves this by providing a "Virtual Byte" count that behaves exactly like legacy bytes for fee purposes.
3. Calculation Example
Take a transaction with:
-
160 bytes of Base Data
-
100 bytes of Witness Data
Step 1: Calculate Weight
(160 * 4) + (100 * 1) = 740 WU
Step 2: Calculate vSize
740 / 4 = 185 vBytes
Step 3: Compare to Raw Size
The actual physical size is 160 + 100 = 260 bytes.
The transaction only "pays" for 185 bytes. This is the SegWit efficiency in action.
4. Summary of Units
| Unit | Used For | Context |
|---|---|---|
| Weight Units | Block Limits | Consensus / Mining |
| Raw Bytes | Network Traffic | Bandwidth / Storage |
| vSize | Fee Estimation | Wallets / Users |
In the next section, we will discuss Stripped Size vs. Total Size.
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation: