27
votes
Is there a difference between bytes and virtual bytes (vbytes)?
Yes, bytes and vbytes are referring to two different metrics: size and virtual size (vsize).
The size in [bytes] of a transaction refers to the raw byte length of its serialized format. It is used to ...
22
votes
Accepted
How do virtual size, stripped size and raw size compare between legacy address formats and native segwit?
Segwit introduced a new limit for blocks, the blockweight limit, superseding the previous blocksize limit. Under the segwit rules, witness data is counted at a lower weighting than non-witness data ...
19
votes
Accepted
How does SegWit reduce transaction size, when the signature is simply moved to another part of the transaction?
TL;DR:
SegWit does not reduce the transaction size, if you're referring to the raw byte length of transactions. Instead it introduces block weight as a new metric that does not directly correspond to ...
18
votes
Accepted
How is the size of a bitcoin transaction calculated
Since the activation of Segwit, transaction size is expressed in Weight Units (WU). Weight Units can be converted to a "virtual size" or virtual bytes (vB) by dividing by 4 and rounding up. The ...
15
votes
What is the size of different Bitcoin transaction types?
There are a number of different address formats and other standard transaction types:
Pay to Public Key (P2PK) outputs tie payments directly to the public key of the recipient instead of the derived ...
13
votes
Accepted
Is there an economic incentive to switch from P2WPKH to P2TR?
Facts
A P2WPKH input weighs 68 vB (assuming the worst-case with a high-r signature, -0.25 vB with a low-r signature) and a P2WPKH output weighs 31 vB for a total of 99 vB.
A P2TR input weighs 57.5 vB ...
10
votes
Is there a difference between bytes and virtual bytes (vbytes)?
For non-segwit transactions, vbytes = bytes.
With the implementation of SegWit, we now see the weight of the block/transactions rather than seeing the absolute size on the wire. While calculating the ...
10
votes
Accepted
What are the minimum sizes for transactions and blocks in Bitcoin?
There is no minimum size restraint on blocks and transactions. However, due to the nature of blocks and transactions, there is a practical minimum.
The smallest transaction I can think of is 61 bytes....
8
votes
Accepted
What is signature grinding?
The serialization format used for ECDSA signatures requires 33 bytes to encode an r-value that falls into the higher half of the range, but only 32 bytes to encode one falling into the lower half of ...
8
votes
Accepted
When is OP_RETURN cheaper than OP_FALSE OP_IF?
TL;DR: OP_RETURN is cheaper for data smaller than 143 bytes.
The overhead of an OP_RETURN output is at least 11 bytes:
amount (8 bytes)
compact size of script (at least 1 byte)
script:
OP_RETURN ...
7
votes
Accepted
Why does BIP141 define both virtual transaction size and weight?
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 ...
7
votes
What is the maximum number of inputs/outputs a transaction can have?
These numbers are slightly different today after the segwit and taproot softforks got activated.
A standard transaction is limited to 400 000 weight units (WU). The smallest standard (single-sig ...
7
votes
Accepted
What are the sizes of single-sig and 2-of-3 multisig taproot inputs?
Taproot generally has two ways of spending. The default way is to spend the output using the key path: pay-to-taproot then behaves like a p2pk output except that it is using a schnorr signature and ...
6
votes
Accepted
What happens if "transaction size" is larger than "maximum block size"?
what happens if size of a transaction is larger than maximum block size?
Then the transaction can never be included in a block.
There is no mechanism for dividing it up into multiple blocks, or ...
6
votes
Accepted
What is the size and weight of a P2WPKH input?
TL;DR:
A P2WPKH input should be conservatively estimated with 68.0 vbytes. Standard P2WPKH inputs generally weigh 67.75 or 68.0 vbytes, depending on whether the r-value in the signature is low or high....
6
votes
Accepted
How much blockspace would it take to spend the complete UTXO set?
TL;DR: Spending the whole UTXO set would take the blockspace of about 11 500 blocks.
What follows is some very rough napkin math that is almost certainly off by a few percent points. I've roughly ...
6
votes
Accepted
What is the maximum size transaction that will be relayed by bitcoin nodes using the default configuration?
Bitcoin Core's standardness rules limit transactions to 100000 vbytes (or 400000 WU). Larger transactions are not relayed or added to mempools. Since they are consensus-valid, they are obviously ...
6
votes
Accepted
Is there an economic incentive to use P2WSH over P2TR?
Yes, having only a single leaf and all else being equal, a P2TR input costs 34 witness bytes (8.5 vbytes) more than a P2WSH input with the same script.
However, almost all current usage of P2WSH (...
5
votes
How does SegWit reduce transaction size, when the signature is simply moved to another part of the transaction?
segwit IS a block size limit increase. No magic.
The segwit mechanism enforces a limit on a weighted data size calculated by counting the non-sig part of a transaction as base data (weight=4) and to ...
5
votes
Accepted
Benefits of Bech32 addresses?
Native P2WPKH Unspent outputs save 23 bytes as their ScriptSigs are empty instead of 0x0014{20-byte-key-hash}.
2)
Yes, there's already a checksum of the same length.
The newer checksum algorithm is
...
5
votes
What happens if "transaction size" is larger than "maximum block size"?
Nick Odell answers the original question:
The maximum transaction size is the size of the block. Source.
and
Transactions larger than 100 kilobytes (including witness at a 75% discount rate) ...
5
votes
Accepted
Is it possible for the `size` and `vsize` to be the same for a valid segwit (bech32) transaction?
With segwit outputs, yes. Segwit outputs do not have a witness that could get discounted.
With segwit inputs, in theory possibly, but in practice no. Every standard segwit input today has a non-empty ...
5
votes
Accepted
How to accurately calculate the vsize of a transaction?
It is not possible to calculate the size, weight, or vsize, purely from the JSON decoding of the transaction as the JSON decoding does not output the hex values of various counters, as well as the ...
5
votes
Accepted
What's cheaper, musig or multisig?
I assume that you are asking about MuSig being used to aggregate the participants' public keys and an input that spends directly using the aggregate pubkey in a keypath spend. In that case, the on-...
5
votes
Accepted
What is considered witness data in SegWit?
This is defined in BIP141, section "Block size":
Blocks are currently limited to 1,000,000 bytes (1MB) total size. We
change this restriction as follows:
Block weight is defined as Base ...
5
votes
Accepted
How does Bitcoin Core Wallet calculate the weight of each input before it's spent?
The coin selection algorithms all use an estimated weight. It is not a metric but rather the estimated weight that the resulting input will have.
The estimate is based on the type of the output script....
4
votes
Accepted
How to calculate the size of multisig transaction?
Let's re-write and calculate from scratch as the calculations that you have posted might not be self-explanatory in itself and some of them are not entirely accurate. From the question, I presume you ...
4
votes
Accepted
On chain cost of Segwit version 1 versus version 0
In general, Segwit v1 is cheaper than segwit v0 to spend but slightly more expensive to create.
Segwit v1 output scripts as defined by the proposed taproot BIP will always be 35 bytes in length. ...
4
votes
Accepted
UTXO Model and Trans Fee / Kb Clarification
does my wallet remember that these 2 btc came from separate UTXO's? Or does it "get melted" as someone alluded to in my first link. More precisely, if I send these 2 btc to Gerald, will it ...
4
votes
Accepted
What is the maximum number of taproot transactions that can be mined in a single block?
For a transaction spending a single p2tr output via the key-path and creating a single p2tr output, we would construct a transaction with the following fields:
version (4 bytes)
witness marker (1 byte)...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
transaction-weight × 65transactions × 16
transaction-fees × 15
segregated-witness × 13
block-weight × 11
transaction-input × 9
taproot × 6
blocksize × 6
p2tr × 5
bitcoin-core × 4
multi-signature × 4
non-standard-transaction × 4
utxo-management × 4
address-format × 3
ordinals × 3
bitcoind × 2
json-rpc × 2
block × 2
p2pkh × 2
p2wpkh × 2
p2wsh × 2
coin-selection × 2
witness-data × 2
blockchain × 1
wallet × 1