<p>The transaction limit under segwit is derived solely from the <em>transaction weight</em> and the <em>block weight limit</em> of 4,000,000 weight units.</p>
<p><em>Virtual transaction size</em> was not used for the limit calculation because it is fractional when computed accurately. Bitcoin Core only uses integers in the consensus code and thus transitioned to <em>transaction weight</em> with the activation of segwit.</p>
<p><em>Virtual transaction size</em> is merely provided as a convenient way of comparing segwit's effective transaction size to pre-segwit transaction sizes.</p>
<hr />
<p>Adding a quote of the section to clarify: <a href="https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#Transaction_size_calculations" rel="nofollow noreferrer">BIP141 specifies</a> the following terms in regard to transaction size:</p>
<blockquote>
<p><em>Transaction weight</em><br />
is defined as Base transaction size * 3 + Total
transaction size (ie. the same method as calculating Block weight from
Base size and Total size).</p>
<p><em>Virtual transaction size</em><br />
is defined as Transaction weight / 4 (rounded
up to the next integer).</p>
<p><em>Base transaction size</em><br />
is the size of the transaction serialized with
the witness data stripped.</p>
<p><em>Total transaction size</em><br />
is the transaction size in bytes serialized as
described in BIP144, including base data and witness data.</p>
</blockquote>

CC BY-SA 4.0
2017-05-22T20:52:56.883Z
2022-07-12T14:39:06.930Z
2022-07-12T14:39:06.930Z
Murch
<p>Why does BIP 141 (segwit) <a href="https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#Transaction_size_calculations" rel="noreferrer">define both <em>virtual transaction size</em> and <em>weight</em></a>?</p>

<p>Weight seems to be just four times virtual transaction size (or vice versa, depending on what you define first). Why are both needed?</p>

<segregated-witness><blocksize><transaction-weight><block-weight>
Why does BIP141 define both virtual transaction size and weight?
Karel Bílek
# Why does BIP141 define both virtual transaction size and weight?

(Asked by: username_0 on 2017-05-22)

Why does BIP 141 (segwit) [define both *virtual transaction size* and *weight*](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#Transaction_size_calculations)?

Weight seems to be just four times virtual transaction size (or vice versa, depending on what you define first). Why are both needed?

**Tags:** segregated-witness, blocksize, transaction-weight, block-weight


---

## 1 answers

### Answer by username_1 on 2017-05-22. Score: 7 | Accepted answer

The transaction limit under segwit is derived solely from the *transaction weight* and the *block weight limit* of 4,000,000 weight units.

*Virtual transaction size* was not used for the limit calculation because it is fractional when computed accurately. Bitcoin Core only uses integers in the consensus code and thus transitioned to *transaction weight* with the activation of segwit.

*Virtual transaction size* is merely provided as a convenient way of comparing segwit's effective transaction size to pre-segwit transaction sizes.

---

Adding a quote of the section to clarify: [BIP141 specifies](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#Transaction_size_calculations) the following terms in regard to transaction size:

> *Transaction weight*  
> is defined as Base transaction size \* 3 + Total
> transaction size (ie. the same method as calculating Block weight from
> Base size and Total size).
>
> *Virtual transaction size*  
> is defined as Transaction weight / 4 (rounded
> up to the next integer).
>
> *Base transaction size*  
> is the size of the transaction serialized with
> the witness data stripped.
>
> *Total transaction size*  
> is the transaction size in bytes serialized as
> described in BIP144, including base data and witness data.


---

