21
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 ...
14
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 ...
13
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 ...
10
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 ...
10
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 ...
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 ...
6
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 ...
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 ...
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 ...
4
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 ...
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 ...
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 ...
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 (...
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-...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
3
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 &...
3
votes
Is a transaction with a non-segwit input STILL considered malleable? If so how?
The status of BIP146 is “withdrawn”. Even for segwit inputs, high-s ECDSA signatures are only non-standard but consensus valid.
I don’t know about the other malleability issues in detail, but would ...
2
votes
Accepted
How to generate an output address from output scrips which start with 0x00?
It's a native segwit output. 0x00 signifies the segwit version (which is v0 in this case), 0x14 is the bytes to push and 2f82e61a98eb7027672760c691784d5fbccf7ce3 is the hash160 of the public key. ...
2
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. (...
2
votes
Why is the wtxid considered malleable?
To add to James' answer, the "segregated" witness can be switched out for an alternative valid witness which changes the wtxid but not the txid. The txid stays the same if you change the ...
2
votes
Accepted
Why is the wtxid considered malleable?
All transaction data is committed to the WTXID, unlike in the case of TXID's.
Malleability is found in the unlocking script/data of a transaction. It is malleable, because is not committed to the ...
2
votes
Accepted
Calculating the witness size of a transaction
Elaborating on Andrew's answer:
You can calculate it from size and vsize.
Transaction size
See BIP141
Transaction weight is defined as Base transaction size * 3 + Total
transaction size (ie. ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
witness-data × 37segregated-witness × 29
transactions × 7
blocksize × 5
bitcoin-core × 4
p2wsh × 4
blockchain × 3
transaction-input × 3
transaction-malleability × 3
block-weight × 3
block × 2
script × 2
synchronization × 2
signature × 2
p2sh × 2
transaction-weight × 2
ordinals × 2
address × 1
transaction-fees × 1
json-rpc × 1
mining-theory × 1
unconfirmed-transactions × 1
full-node × 1
raw-transaction × 1
terminology × 1