TeachMeBitcoin

Transaction Size and Weight Overview

From TeachMeBitcoin, the free encyclopedia Reading time: 2 min

Transaction Size and Weight

In the early days of Bitcoin, transactions were measured purely in Raw Bytes, and blocks had a hard limit of 1 Megabyte. With the introduction of SegWit in 2017, the protocol moved to a more complex measurement system called Weight Units.

1. Raw Bytes (The Legacy Metric)

Raw bytes refer to the actual physical size of the transaction data as it travels across the network.

2. Weight Units (The Modern Metric)

To fix transaction malleability and increase capacity, Bitcoin now uses Weight Units (WU).

3. The Weight Calculation

The weight of a transaction is calculated as: Weight = (Non-Witness Bytes * 4) + (Witness Bytes * 1)

This formula effectively creates a "discount" for signature data, which we will explore in the next section.

4. Why Use Weight?

By using weight instead of raw bytes, Bitcoin achieved several goals:

  1. Soft Fork Compatibility: Older nodes still see a "stripped" transaction that fits within the 1MB limit.

  2. Capacity Increase: By discounting signatures, blocks can now hold up to ~2MB to 4MB of actual data while staying within the 4M WU limit.

  3. Incentivizing Best Practices: It makes using SegWit cheaper for users, encouraging adoption of more secure and scalable address formats.

Metric Limit Type Value
Legacy Limit Max Bytes 1,000,000
SegWit Limit Max Weight Units 4,000,000
Max Theoretical Size Max Raw Bytes ~4,000,000

In the next section, we will deep dive into the 4:1 Witness Discount.

☕ Help support TeachMeBitcoin

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:

Ethereum: 0x578417C51783663D8A6A811B3544E1f779D39A85
Bitcoin: bc1q77k9e95rn669kpzyjr8ke9w95zhk7pa5s63qzz
Solana: 4ycT2ayqeMucixj3wS8Ay8Tq9NRDYRPKYbj3UGESyQ4J
Address copied to clipboard!