Transaction Size | Bytes, Weight, and Virtual Bytes (2024)

Bytes, Weight, and Virtual Bytes

  • Transaction Size | Bytes, Weight, and Virtual Bytes (1)Greg Walker
  • Transaction Size | Bytes, Weight, and Virtual Bytes (2)
  • Download PDF

You can measure the size of a bitcoin transaction in 3 ways:

  1. Bytes (b) – Transaction size on disk.
  2. Weight Units (wu) – For fitting transactions in to a block.
  3. Virtual Bytes (vB) – For comparing fee rates between transactions.

Bytes is the most straightforward unit. It's used for measuring any amount of data on a computer.

Weight Units and Virtual Bytes are measurements unique to bitcoin. They both measure the size of a transaction in terms of bytes too, but they give a discount to some parts of the transaction data and are used when calculating how many transactions can fit inside a block.

Transaction Splitter

1. Bytes (b)

This is the natural way to measure the size of a transaction. It's just a transaction's actual size in terms of how many bytes of space it takes up.

Bytes are used when measuring how big a transaction is when it's being sent across the network, or how much space it takes up on disk (e.g. when stored in blockchain files).

Measuring the size of a transaction in bytes was more important when the block size limit was also measured in bytes (1,000,000 bytes, or 1 megabyte). However, the block size limit is now based on weight instead.

Example

Transaction: 30dcd74b7fd8a585db3b2beddd4a7fc0edcfe9b8a1bac9abee695648659f8a6a

01000000000101dd40a8d7f105055e781afa632207f5d3c4b4f4cad9f0fb320d0f0aa8e1ba904b0000000000ffffffff021027000000000000160014858e1f88ff6f383f45a75088e15a095f20fc663f841c0000000000001976a9142241a6c3d4cc3367efaa88b58d24748caef79a7288ac02483045022100d66341c3e6ce846b92bedcf9bc673ab8e47b770c616618eb91009e44816f4c2f0220622b5ebf6afabee3f4255bbcb84609e1185d4b6b1055602f5eed2541e26324620121022ed6c7d33a59cc16d37ad9ba54230696bd5424b8931c2a68ce76b0dbbc222f6500000000

Size: 226 bytes

There are 226 bytes in this transaction.

You can check this for yourself, because every 2 hexadecimal characters represents 1 byte.

Typical transaction sizes

The size of a transaction in bytes mostly depends on how many inputs and outputs are in the transaction. Here are the average sizes for typical transactions (with standard P2PKH locking scripts on the outputs):

  • Inputs: 1, Outputs: 1 = 191 or 192 bytes
  • Inputs: 1, Outputs: 2 = 225 or 226 bytes (most common)
  • Inputs: 2, Outputs: 1 = 338 or 339 bytes
  • Inputs: 2, Outputs: 2 = 373 or 374 bytes (very common)

The more inputs and outputs there are in a transaction, the bigger it gets.

There is no limit to how big a transaction can be in terms of bytes, other than the fact that it needs to be able to fit inside a block.

2. Weight Units (wu)

BIP 141

Every transaction has a weight measurement. This measurement was introduced in the segregated witness upgrade. A transaction's weight is calculated by multiplying the size (in bytes) of different parts of the transaction by either 4 or 1:

Field Multiplier
version x4
marker x1
flag x1
input x4
output x4
witness x1
locktime x4

This therefore gives a discount to the witness data.

Example

Transaction: 30dcd74b7fd8a585db3b2beddd4a7fc0edcfe9b8a1bac9abee695648659f8a6a

01000000000101dd40a8d7f105055e781afa632207f5d3c4b4f4cad9f0fb320d0f0aa8e1ba904b0000000000ffffffff021027000000000000160014858e1f88ff6f383f45a75088e15a095f20fc663f841c0000000000001976a9142241a6c3d4cc3367efaa88b58d24748caef79a7288ac02483045022100d66341c3e6ce846b92bedcf9bc673ab8e47b770c616618eb91009e44816f4c2f0220622b5ebf6afabee3f4255bbcb84609e1185d4b6b1055602f5eed2541e26324620121022ed6c7d33a59cc16d37ad9ba54230696bd5424b8931c2a68ce76b0dbbc222f6500000000

Size: 226 bytes

Weight: 574 weight units (116 x 4 + 110 x 1)

There are 226 bytes in this transaction. Out of those, 116 bytes are non-witness data so they get multiplied by 4, and 110 bytes are witness data so they get multiplied by 1. Add those together and you get 574 weight units.

Block Limit (4,000,000 weight units)

The weight measurement is important because blocks can hold up to 4,000,000 weight units of transaction data.

So when miners fill up their candidate blocks with transactions, they use transaction weight to determine how many transactions they can fit in their block.

Using bytes for transaction sizes and the block limit was more straightforward. But this new weight measurement introduces fairness to the cost of spending outputs.

Why does witness data weigh less?

Because it helps to bring more of a balance between the cost of creating an output and the cost of spending an output (in terms of transaction fees).

The amount of data required to unlock an output (i.e. signature data) is unfairly larger than the amount of data required to put a lock on an output in the first place. So the new weight measurement brings the "size" of outputs and inputs in a transaction more in line with each other.

3. Virtual Bytes (vBytes, vB)

The virtual size of a transaction is the same as its weight divided by 4.

Or to put it another way, instead of multiplying some parts of a transaction by 4 to create a discount for the witness data, you discount the witness data directly by multiplying it by 0.25 instead:

Field Multiplier
version x1
marker x0.25
flag x0.25
input x1
output x1
witness x0.25
locktime x1

So "weight" and "virtual size" provide the same measurement, just with different units. But using virtual bytes makes it easier to compare the fee rate of new segwit transactions with the fee rate of legacy transactions (which had previously used sats-per-byte).

A legacy transaction will be the same size in bytes as it is in vbytes.

A block can hold 1,000,000 virtual bytes.

Example

Transaction: 30dcd74b7fd8a585db3b2beddd4a7fc0edcfe9b8a1bac9abee695648659f8a6a

01000000000101dd40a8d7f105055e781afa632207f5d3c4b4f4cad9f0fb320d0f0aa8e1ba904b0000000000ffffffff021027000000000000160014858e1f88ff6f383f45a75088e15a095f20fc663f841c0000000000001976a9142241a6c3d4cc3367efaa88b58d24748caef79a7288ac02483045022100d66341c3e6ce846b92bedcf9bc673ab8e47b770c616618eb91009e44816f4c2f0220622b5ebf6afabee3f4255bbcb84609e1185d4b6b1055602f5eed2541e26324620121022ed6c7d33a59cc16d37ad9ba54230696bd5424b8931c2a68ce76b0dbbc222f6500000000

Size: 226 bytes

vSize: 143.50 virtual bytes (116 x 1 + 110 x 0.25)

There are 226 bytes in this transaction. Out of those, 116 bytes are non-witness data so they get multiplied by 1, and 110 bytes are witness data so they get multiplied by 0.25. Add those together and you get 143.50 virtual bytes.

As you can see, the weight and vsize calculations work in the same way.

Why do we use vbytes?

So why have both weight and vbytes? Why not calculate the weight of a transaction by multiplying some parts by 0.25 and just use that instead?

In other words, why have two measurements that do the same thing?

Because virtual size is fractional when computed accurately. Weight is an integer. We only use integers in consensus code.

You see, working with fractional numbers on computers can often lead to rounding errors, which is why in Bitcoin we prefer to work with whole numbers when performing critically important calculations. Integer arithmetic always returns consistent and reliable results, whereas floating point arithmetic does not.

So in summary:

  • Weight Units — Used internally when working out how many transactions can fit in to a block.
  • Virtual Bytes — Used by humans when comparing the different fee rates on transactions.

Resources

Transaction Size | Bytes, Weight, and Virtual Bytes (2024)

FAQs

What is the formula for Bitcoin transaction size? ›

The size of a transaction in bytes mostly depends on how many inputs and outputs are in the transaction. Here are the average sizes for typical transactions (with standard P2PKH locking scripts on the outputs): Inputs: 1, Outputs: 1 = 191 or 192 bytes. Inputs: 1, Outputs: 2 = 225 or 226 bytes (most common)

What is the minimum transaction size for bitcoin? ›

You can also receive bitcoin from any wallet using the blockchain. The minimum amount per transaction is 0.00001 BTC or 1,000 sats (Satoshis).

What is a virtual byte in bitcoin? ›

The vByte was introduced by the SegWit upgrade. A vByte is equivalent to 4 weight units, and thus, a block is limited to being 1 vMegabyte large, or 4 million weight units. Wallets usually calculate and display transaction fees in terms of sats/vByte, meaning the fee is paid per vByte of data used.

What is bitcoin transaction weight? ›

Weight is a measure of the size of bitcoin blocks including the segwit discount. Weight = (tx size with witness data stripped) * 3 + (tx size). Each block has a limit of 4M weight units or 1M vbytes (1 vbyte = 4 weight units).

What is transaction size? ›

Transaction Size means the contract size multiplied by the number of contracts in a particular order or trade.

How do you calculate average transaction size? ›

How do you measure average transaction value? Simple: calculate your total revenue for a given period, then divide it by the number of transactions during that same period.

How much will I get if I put $1 dollar in Bitcoin? ›

1 USD equals 0.000017 BTC. The current value of 1 United States Dollar is -0.73% against the exchange rate to BTC in the last 24 hours. ​ The current Bitcoin market cap is $1.19T. ​Create a free Kraken account to instantly convert USD to BTC today.

How much is a Bitcoin transaction fee for $100? ›

How much does a Bitcoin ATM charge per $100? If you wanted to know the fee that is charged per 100$ when you make a transaction of Bitcoin in a Bitcoin terminal, generally Bitcoin ATM fees would be roughly $8 - $20 on average, and if you are lucky you can find fees of $4.

What is the smallest transaction size in the Bitcoin market? ›

The minimum order size on the Bitcoin Market is 0.00001 BTC.

What is the weight limit for Bitcoin? ›

Bitcoin Blockspace When Rollups Launch

Since the emergence of Ordinals and BRC-20s in early 2023, Bitcoin's daily mean block weight has consistently sat just below its 4m weight unit limit (4MB of data).

How to calculate sat vbyte? ›

sats/vbyte (Most Common)

If you divide the block limit of 4,000,000 weight units by 4, you get a 1,000,000 virtual bytes. And if you divide the weight of a transaction by 4 too, you get back down to pretty much using the same sats/byte measurement as before.

How many bytes is a Bitcoin transaction? ›

First, a transaction needs to be delivered to the bitcoin network so that it can be propagated and included in the blockchain. In essence, a bitcoin transaction is just 300 to 400 bytes of data and has to reach any one of tens of thousands of bitcoin nodes.

What is the transaction size of Bitcoin cash? ›

While Bitcoin is currently limited to 1 MB per block, Bitcoin Cash can go up to 32 MB per block.

What does a Bitcoin transaction look like? ›

What does a raw bitcoin transaction look like? A raw bitcoin transaction is made up of fields, each containing bytes of data. All bitcoin transactions have the same basic structure, so to decode them you just need to know the size of each field and what format the data is in.

What is transaction formula? ›

Transaction Analysis and the Accounting Equation

The accounting equation states that assets = liabilities + owner's equity. An asset is something that a business owns. A liability is something that a business owes. Owner's equity is the amount of money that a business owner personally invests in the business.

What is Bitcoin mathematical formula? ›

Bitcoin's code is designed to generate a block every 10 minutes. Since halvings occur every 210,000 blocks (not after a specified time or date), the following basic calculation may provide a preliminary estimate: 210,000 blocks * 10 minutes/block = 2,100,000 minutes.

What is the size of a Bitcoin transaction ID? ›

The letters and numbers in a TXID have no special meaning. They're just random-looking bunches of 32 bytes (represented as 64 hexadecimal characters). But they are unique to each transaction.

Top Articles
Mutual Fund Returns | Best Performing Mutual Funds
How to Return to Normal Desktop in Windows 10?
Poe T4 Aisling
Somboun Asian Market
Rek Funerals
Bucks County Job Requisitions
Free VIN Decoder Online | Decode any VIN
The Idol - watch tv show streaming online
Fototour verlassener Fliegerhorst Schönwald [Lost Place Brandenburg]
Kent And Pelczar Obituaries
Campaign Homecoming Queen Posters
Local Collector Buying Old Motorcycles Z1 KZ900 KZ 900 KZ1000 Kawasaki - wanted - by dealer - sale - craigslist
Lake Nockamixon Fishing Report
Dignity Nfuse
Cyndaquil Gen 4 Learnset
Soccer Zone Discount Code
Spergo Net Worth 2022
Swgoh Turn Meter Reduction Teams
Saatva Memory Foam Hybrid mattress review 2024
Nordstrom Rack Glendale Photos
Halo Worth Animal Jam
Breckie Hill Mega Link
Marion City Wide Garage Sale 2023
Lost Pizza Nutrition
Lexus Credit Card Login
Craig Woolard Net Worth
Is Light Raid Hard
Cowboy Pozisyon
Sensual Massage Grand Rapids
Delta Math Login With Google
Wells Fargo Bank Florida Locations
Pixel Combat Unblocked
Warren County Skyward
Solarmovie Ma
Gideon Nicole Riddley Read Online Free
Craigslist Neworleans
Colorado Parks And Wildlife Reissue List
Pillowtalk Podcast Interview Turns Into 3Some
The Vélodrome d'Hiver (Vél d'Hiv) Roundup
Emerge Ortho Kronos
Body Surface Area (BSA) Calculator
Craigslist Freeport Illinois
Lake Andes Buy Sell Trade
Lyndie Irons And Pat Tenore
13 Fun & Best Things to Do in Hurricane, Utah
Kenner And Stevens Funeral Home
How to Connect Jabra Earbuds to an iPhone | Decortweaks
Dicks Mear Me
Theater X Orange Heights Florida
Naughty Natt Farting
Ff14 Palebloom Kudzu Cloth
Famous Dave's BBQ Catering, BBQ Catering Packages, Handcrafted Catering, Famous Dave's | Famous Dave's BBQ Restaurant
Latest Posts
Article information

Author: The Hon. Margery Christiansen

Last Updated:

Views: 5835

Rating: 5 / 5 (70 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: The Hon. Margery Christiansen

Birthday: 2000-07-07

Address: 5050 Breitenberg Knoll, New Robert, MI 45409

Phone: +2556892639372

Job: Investor Mining Engineer

Hobby: Sketching, Cosplaying, Glassblowing, Genealogy, Crocheting, Archery, Skateboarding

Introduction: My name is The Hon. Margery Christiansen, I am a bright, adorable, precious, inexpensive, gorgeous, comfortable, happy person who loves writing and wants to share my knowledge and understanding with you.