THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

Is Bitcoin Transaction Size the Same as Virtual Size?

permalink THAMER
#bitcoin-bytes-vs-vbytes#segwit-weight#vsize

Not always. A Bitcoin transaction's raw serialized byte length and its virtual size (vsize) can differ because witness bytes receive a lower weight under SegWit.

How is vsize calculated?

Weight = stripped size × 4 + (total size − stripped size). Virtual size = ceiling(weight / 4). For transactions with no witness serialization, vsize equals the serialized byte size.

Example

A transaction with 120 stripped bytes and 230 total bytes has weight 590 WU and vsize 148 vB. At 5 sat/vB, 740 sat is the corresponding fee.

Why does this matter?

Wallets generally estimate fees using virtual size, not just the raw transaction byte length. Actual fees depend on the final signed transaction and prevailing mempool and mining conditions.

Primary references

Bitcoin Developer Reference — Transactions: https://developer.bitcoin.org/reference/transactions.html
BIP141 — Segregated Witness: https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki
BIP144 — Segregated Witness Peer Services: https://github.com/bitcoin/bips/blob/master/bip-0144.mediawiki

Questions & Answers

Explore all questions →

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects