Skip to main content
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 ...
Murch's user avatar
  • 76k
15 votes
Accepted

Why is witness data downloaded during IBD in prune mode?

Why do pruned nodes download (segregated) witness data during IBD if much of that data is marked as Assumevalid? Good question, probably because nobody implemented it. Honestly, I had never ...
Pieter Wuille's user avatar
14 votes
Accepted

Follow-up to Segwit: Arbitrary data storage in witness?

Am I understanding this correctly? Yes. will this transaction have failed the normal rules in Bitcoin Core for relaying transactions It's a P2TR (taproot) spend. Those spends have different policy ...
Pieter Wuille's user avatar
11 votes
Accepted

Redeem script. script hash, witness script and witness program

The scriptPubKey is the script as it is placed in the transaction output. The redeemScript (P2SH only) is the script pushed as the last scriptSig item. In P2SH scripts, the scriptPubKey is equal to ...
Pieter Wuille's user avatar
11 votes
Accepted

What is the Witness and what data does it contain?

This structure contains data required to check transaction validity but not required to determine transaction effects. In particular, scripts and signatures are moved into this new structure. The ...
JBaczuk's user avatar
  • 7,418
8 votes
Accepted

Why is the witness data fee discounted by a factor of four?

A transaction input means that the previous output it is spending can be removed from the expensive UTXO set. To incentivize making txin's (and hence reducing the UTXO size), Segregated witness ...
morsecoder's user avatar
  • 14.2k
7 votes
Accepted

Concept of Block weight and segwit are still unclear

Have a look: https://blockchair.com/bitcoin/block/0000000000000000000cbbceb342e07071f9621607e044ec909aa86fcdf88e8a Size = 1,158,038 bytes Weight units = 3,992,825 WU Now what does it mean? So the ...
Wapac's user avatar
  • 1,074
6 votes
Accepted

Would signature aggregation reduce the largest feasible blocksize

SegWit blocks aren't limited in bytes anymore but rather in weight. The maximum weight for a block is 4M. The weight of non-witness data is 4x its number of bytes. So, yes, decreasing the amount of ...
Jannes's user avatar
  • 6,344
6 votes

Why is the witness data fee discounted by a factor of four?

Witnesses do not need to be stored once they have been verified and can be discarded. This effectively reduces the size of the UTXO. The discount is supposed to account for the reduced storage ...
cdecker's user avatar
  • 9,508
5 votes

Why is the witness data fee discounted by a factor of four?

Because Txouts are about 1/4th the size of TxIns, since signatures are that much bigger than a simple hash. This means that in the old situation it was cheaper to split coins (increasing UTXO set ...
Jannes's user avatar
  • 6,344
5 votes
Accepted

Segwit: Arbitrary data storage in witness?

Your transaction, although not invalid, is non-standard. Since it is non-standard, it will not be propagated and will be rejected for being non-standard. However this does not mean that it cannot be ...
Ava Chow's user avatar
  • 70.9k
5 votes

Why is witness data downloaded during IBD in prune mode?

This was described in the "Segregated Witness Benefits" article on bitcoincore.org (from Jan 2016, prior to Segwit's activation): Efficiency gains when not verifying signatures Signatures ...
shesek's user avatar
  • 676
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 ...
Vojtěch Strnad's user avatar
4 votes

What is the Witness and what data does it contain?

For the segwit variants of an output (P2PKH becomes P2WPKH and P2SH becomes P2WSH), the witness contains the same data that would be found in the scriptSig. For P2PKH, in the scriptSig, you would have ...
Ava Chow's user avatar
  • 70.9k
4 votes
Accepted

Confusion about Addresses

6 types of Bitcoin addresses (in parentheses are the data they keep): Legacy P2PKH 1... (a public key's hash) P2SH 3... (a script's hash) (defined in BIP16) SegWit (P2WPKH/P2WSH) nested in P2SH (...
MCCCS's user avatar
  • 10.2k
4 votes
Accepted

Why does a same transaction signed separately have different witness values?

Bitcoin signatures have two components: s and R. To sign a Bitcoin transaction with private key k, the signing algorithm generates an ephemeral private key r. The R component of the signature is the x-...
Ugam Kamat's user avatar
  • 7,417
4 votes
Accepted

Where is the witness data stored in the raw block data

If your question is about how witness data is transmitted to other peers in the P2P protocol, the right place to look is BIP-144; the P2P side of the segwit specification. In short, the witness data ...
Pieter Wuille's user avatar
4 votes
Accepted

How do I determine whether an input or output is segwit? - revisited

The way the BIP141 segwit rules consider transactions is simply that every transaction input (even non-segwit ones) have a witness stack. Non-segwit inputs are required to have an empty witness stack ...
Pieter Wuille's user avatar
4 votes

Follow-up to Segwit: Arbitrary data storage in witness?

Pieter Wuille has answered the technical question of how these transactions are affected by the rules. Vojtěch Strnad identified the origin as Ordinals Inscriptions - a kind of NFT. When I asked &...
RedGrittyBrick's user avatar
4 votes

Is a transaction with a non-segwit input STILL considered malleable? If so how?

I think you are conflating two types of malleability: The first one is txid malleability of a presigned transaction: two (or more) parties can't trustlessly build a chain of unconfirmed transactions ...
Antoine Poinsot's user avatar
4 votes

Asumming a quantum computer gets deployed. Is it safe to prune the witness area and make blocks 1MB again?

Can we prune the witness area to save space You can so do today already, with a pruned node. It precludes the ability to let other post-segwit nodes synchronize from you, and loses the ability to ...
Pieter Wuille's user avatar
4 votes

How can I tell from the `getrawtransaction` if a transaction signaled Taproot?

It is still not clear to me what tx version number a Taproot transaction uses. Any transaction version number can have Taproot inputs or outputs. Is there a way to know via the ins (via ...
Pieter Wuille's user avatar
4 votes
Accepted

Is a BIP required for the removal of SegWit Discount for Inscriptions?

The removal of the witness discount would be a consensus change, specifically a soft fork. Changes to consensus rules have always been standardized as BIPs ever since the BIP process was created and I ...
Vojtěch Strnad's user avatar
3 votes

Re-index/Re-download from specific height?

A reindex will not redownload the block. However, after safely shutting down Bitcoin Core, you can delete the block file containing that block. When you start it again, you will need to reindex, but ...
Ava Chow's user avatar
  • 70.9k
3 votes

How do virtual size, stripped size and raw size compare between legacy address formats and native segwit?

I compared to the following 9 types of transaction's weight. And then I found that No9 (P2WPKH => P2WPKH) was the lightest. Transaction patterns // 1 transaction consists of 1 txin and 1 txout 1. (...
zono's user avatar
  • 1,945
3 votes

What is the weight of a block that contains no pay-to-witness scripts?

From BIP 144: If the witness is empty, the old serialization format should be used. It is illegal to encode a transaction using the extended serialization format if the witness is empty. Another way ...
Pieter Wuille's user avatar
3 votes
Accepted

What is the weight of a block that contains no pay-to-witness scripts?

The witness serialization format only applies to transactions that have witnesses. If a transaction does not have witnesses, then its witness serialization format is the non-witness serialization ...
Ava Chow's user avatar
  • 70.9k
3 votes

What is the Witness and what data does it contain?

additional to JBaczuk and Andrew Chow, here is a detailed tx decoding. This is a mixed transaction, with three "normal" inputs, and a 4th segwit type input (TX_IN[3]). Therefor after the version field ...
pebwindkraft's user avatar
  • 5,096
3 votes

Calculating the witness size of a transaction

Will a loop through the "txinwitness" array of hex and do a byte length calculation on every one be enough? That is not enough as there are extra data in witnesses that is not included in the ...
Ava Chow's user avatar
  • 70.9k
3 votes
Accepted

How is the witness reserved value set in a coinbase transaction?

The only constraint on this value is that it must be 32 bytes. Otherwise there are no constraints. This is done to allow for a future soft fork to commit to new data and have non-upgraded nodes still ...
Ava Chow's user avatar
  • 70.9k

Only top scored, non community-wiki answers of a minimum length are eligible