All Questions
Tagged with segregated-witness witness-data
33 questions
2
votes
1
answer
135
views
Exact witness requirements for a segwit transaction with P2PKH and P2WPKH inputs
Segwit transactions can mix segwit and non-segwit inputs:
Segwit transaction from mixed addresses (segwit and non-segwit)
Can I build a raw segwit transaction with no segwit inputs?
But how exactly ...
1
vote
1
answer
55
views
Transaction Validation
What will it mean if the tranasaction input contains both signature script and witness, in case of scriptpubkey_type of p2sh or p2pkh, will it be invalid or valid ? As we use witness for SegWit ...
2
votes
1
answer
110
views
Is a BIP required for the removal of SegWit Discount for Inscriptions?
Is a BIP required for the removal of SegWit Discount for Inscriptions?
The rationale of such a change is to standardize the fee structure across all data types included in a block, ensuring that ...
0
votes
1
answer
49
views
What mechanism is used by nodes to link Witness data to its Transaction?
I am stuck in developing an understanding of how a node could go from SegWit TXID to lookup Witness data, or vice-versa.
I see that eventually a witness TXID is calculated and included in a Merkle ...
3
votes
1
answer
181
views
What is considered witness data in SegWit?
What fields in a transaction are considered witness data? I need this to calculate the vsize for fee.
My understanding is these are marker, flag and witness (from 1 and 2).
Or is it just witness, ...
5
votes
2
answers
296
views
Is a transaction with a non-segwit input STILL considered malleable? If so how?
Below are a few examples of witness malleability, along with reasons why I believe they are no longer valid:
DER Malleability
For every DER signature with (r,s), there exists 2 valid 's' values -> ...
16
votes
2
answers
1k
views
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?
These nodes seem to be downloading witness data just to prune it. Since we already know ...
14
votes
2
answers
1k
views
Follow-up to Segwit: Arbitrary data storage in witness?
In 2017 a question about Segwit: Arbitrary data storage in witness? asked whether people wanting to store more data in the blockchain than OP_RETURN allows could instead store data in the witness ...
0
votes
2
answers
114
views
How can I calculate the length (in bytes) of the Witness data in a transaction?
I'm trying to parse a bitcoin block.
I took as an example this block from 2019. I'm trying to parse the first transaction.
I don't understand how to calculate how many bytes I have to read for the &...
1
vote
1
answer
323
views
How do I determine whether an input or output is segwit? - revisited
This is a discussion that has already been had here, but bear with me.
We're gonna be talking about tx faae7e55db14a32e083cbf6a91db8a5ab6a3b05e050d9cefdec80b47f966848e
all I got is the encoded ...
0
votes
2
answers
565
views
Missing Witness field in p2wpkh decoded tx hex
I have placed together a raw tx hex but when it's unable to be broadcasted as I keep getting an error below
sendrawtransaction RPC error: {"code":-25,"message":"bad-txns-...
3
votes
1
answer
453
views
Where is the witness data stored in the raw block data
I can see in BIP-141 where the merkle hash is stored. And I think its clear that the witness data won't be streamed inline with the TXN data. So I assume the witness data is simply thunked on to the ...
5
votes
1
answer
3k
views
Redeem script. script hash, witness script and witness program
I have a little confusion about naming in Bitcoin.
Redeem script is the conditions that will be satisfy.
For example P2PKH inside P2SH
OP_DUP OP_HASH160 <PubKHash> OP_EQUALVERIFY OP_CHECKSIG ...
0
votes
3
answers
743
views
Generate P2SH-P2WSH
I want to generate P2SH-P2WSH with script P2PKH.
My public key is 027712968e8f2f9dfa79abe10940a3d915a0c95a0b97750881e6201acf2b66da97
SHA256 and RIPEMD160 of Public key
---------- Witness Script ...
3
votes
1
answer
805
views
Confusion about Addresses
I have a little bit confusion about addresses segwit and not segwit.
I can see P2WPKH and P2WSH from this link https://en.bitcoin.it/wiki/BIP_0173, and they are segwit and start with bc (mainnet) or ...
1
vote
1
answer
382
views
Generate P2WSH native
I want to create P2WSH native like https://en.bitcoin.it/wiki/BIP_0173.
I have already a script to generate P2WPKH and it works, thank the python part and re-arrange group byte works.
I read that ...
3
votes
1
answer
210
views
Why does a same transaction signed separately have different witness values?
I signed a bitcoin testnet transaction using nbitcoin library and got an output:
...
0
votes
0
answers
85
views
How do I ask for witness data from a Bitcoin full node?
So, I'm trying to build a Bitcoin block explorer using my own Python library. I'm doing it just as an exercise to better understand how Bitcoin works under the hood.
Right now, when I send a block ...
1
vote
2
answers
233
views
How does storing the witness outside of the block prevent malleability?
I have some question on how segregated witness work.
I'm reading this post and in the answer exist this phrase
Since signature data (witness data) is stored outside the transaction (and outside ...
1
vote
1
answer
555
views
Concept of Block weight and segwit are still unclear
It seems like duplicated question, but i read many articles and posts to undestand about segwit.
Below links are something i read
What is block weight and how is it different from block size?
After ...
11
votes
2
answers
4k
views
How do virtual size, stripped size and raw size compare between legacy address formats and native segwit?
This answer states that SegWit doesn't reduce transaction size. If this is true, why is it cheaper to send a SegWit transaction?
3
votes
2
answers
263
views
Why is the wtxid considered malleable?
Why is the wtxid considered malleable since the transaction is unconfirmed?
How can a third-party modify it?
2
votes
3
answers
876
views
Calculating the witness size of a transaction
I want to calculate how many % of a block, and thus, transactions that are witness data. I need to calculate the size of the witness data in bytes in every transaction. And as I understand it, I ...
2
votes
1
answer
64
views
Does my segwit node only have segwit blocks?
My segwit node makes a gettxout RPC query and checks the scriptPubKey.type is "witness_v0_keyhash" and does things accordingly.
To my understanding old nodes have different blocks and if I happened ...
8
votes
3
answers
11k
views
What is the Witness and what data does it contain?
I've learned about the Segregated Witness but couldn't find info on breaking it down.
I know usually when legacy addresses are used the public keys for example will be under Scriptig. With P2SH, I ...
5
votes
2
answers
638
views
How does a SegWit node verify a block?
I know that non-SegWit node could verify a block without witness.
For SegWit node, is witness necessary to verify a block? Because I know witness are committed as wtxid merkle node in coinbase. What'...
1
vote
1
answer
54
views
What happens to witness blocks?
What happens to witness blocks after they are broadcast to other witness nodes? Are they kept or forgotten after some blocks?
1
vote
1
answer
456
views
How much will Segwit *actually* increase bitcoin capacity for realistic transactions?
I often see claims that Segwit increases transactions per block by 1.7x to 2x. I'm not sure if this is true, but if I do the math myself, I don't get this number.
My understanding is:
1) The “weight”...
2
votes
0
answers
187
views
How much will Segwit increase the number of transactions that can fit in each block?
How much weight would the witness data have on the total block size? What is the culminating effect of this on the number of transactions that can fit into each block?
Thanks in advance :)
3
votes
1
answer
276
views
Parsing a SegWit transaction, what are stack items in witness data
For every input we can have multiple stack items, what do these represent?
As a reference this question is helpful
Are these defined here?
For eg. P2WPKH would have a signature followed by a pubkey, (...
5
votes
1
answer
1k
views
Segwit: Arbitrary data storage in witness?
Let's say I want to encode the text of the King James version of the Bible into the block chain, one piece at a time (replace this with any zany idea to consume copious quantities of block space). ...
2
votes
2
answers
207
views
What is the weight of a block that contains no pay-to-witness scripts?
I'm trying to understand block weight, a metric introduced by segwit (BIP-141):
block weight = 3 * base size + total size
"base size" is the length of a pre-segwit block, which contains only ...
10
votes
3
answers
1k
views
Why is the witness data fee discounted by a factor of four?
I've read that it encourages users to consolidate UTXO sets. How would it be doing that?