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 ...
5
votes
Accepted
Can The Redeem Script Consist Of Only 1 Public Key In P2SH Transactions:
Before the adoption of BIP16: Pay to Script Hash, multisig was possible, but only in the form of bare outputs. The multisig would be directly defined in the ScriptPubKey (the output script). This had ...
5
votes
Accepted
How do segwit nodes behave when they receive a transaction between two legacy nodes?
Segwit did not change the rules for existing output types. The non-segwit standard output types P2PKH (Pay to Public Key Hash) and P2SH (Pay to Script Hash) still work exactly as they always have. ...
5
votes
SegWit signing algorithm and its improvement
To be clear, this is talking about the way the message that is signed is computed. It is unrelated to transaction or block hashes and the signature algorithm itself, just how Bitcoin determines what ...
5
votes
Accepted
Can any Script opcode be used in the witness program, or only specific ones?
I was wondering, can one use an OP_RETURN in the witness script?
Yes, you can, though I believe it is pointless. Executing an OP_RETURN opcode causes the script to return false immediately, marking ...
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
How to resolve error when trying to sign and broadcast PSBT transaction via electrum - (Witness program hash mismatch code -26)?
In signing with the second party, the multisig script that is your witness script got messed up.
In both the initial PSBT and the first signing, we see that the witness script is
...
5
votes
Accepted
What are the OP codes associated with bc1?
Native segwit scriptPubKeys are of the form OP_n + <data>, so first a single number opcode followed by a push of some data (called the witness program). Specifically:
For P2WPKH (pay to witness ...
4
votes
Accepted
How do you commit to the previous output's amount when signing a segwit input with rust-bitcoin?
There is a bitcoin::util::sighash module which has all of the sighashing stuff. I'm not certain that it is the correct way, but it is definitely a way to get the result that you want.
It looks like ...
4
votes
How do segwit nodes behave when they receive a transaction between two legacy nodes?
Segwit nodes can recognise legacy transaction types and will handle them in the traditional way.
A legacy node would create a transaction that omits the optional segwit flag. When this transaction ...
4
votes
Where Is Signature Data Stored In Post-SegWit Transactions?
From the perspective of new post-segwit nodes, the witness data is part of the transaction data. It is serialized in a new field, after all the transaction outputs, before the locktime field.
However, ...
4
votes
Can one infer that a bc1 address is multisig?
No, you can only determine the output type, but not the encoded spending conditions from another user's address. Whether a *SH output is committing funds to a multisig script only becomes knowable ...
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
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 ...
3
votes
Effect of the witness data discount on the UTXO set
[...] incentivize transactions to spend more inputs [...]. Are there any data on the success of this pursuit?
I guess this is data, but you'll have to draw your own conclusions.
3
votes
Bitcoin P2P network: unable to receive the full block data (witness stripped off)
When requesting the block data with getdata, you should set the inv type to 0x40000002 (MSG_WITNESS_BLOCK), as explained in BIP144.
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
Do non-Segwit nodes reject Segwit transactions with invalid signature?
If a miner included a Segwit transaction to a block with invalid signature, it'd be rejected by Segwit nodes, but not by non-Segwit nodes.
Indeed. It would have to reach the miner so either sent to ...
3
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 ...
3
votes
Send Bitcoin cash to a Bitcoin address
On Bitcoin forks that do not support Segwit, outputs that use Wrapped Segwit scripts (P2SH-P2WSH or P2SH-P2WPKH) can in principle be spent by anyone who knows the inner segwit script hash or pubkey ...
3
votes
Accepted
How does the SegWit part of a transaction get serialized and parsed?
For "num_items = read_varint(s)", there should be a "result += encode_varint(len(tx_in.witness))".
The corresponding expression seems to be the result += int_to_little_endian(len(...
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 ...
3
votes
Accepted
Bitcoin transaction malleability is it only for unconfirmed transaction?
TL;DR: Yes, once a transaction is confirmed, unless a chain reorganization makes it unconfirmed again, no forms of malleability are possible. SegWit specifically fixed TXID malleability of unconfirmed ...
3
votes
Accepted
How can I find the public key corresponding to a P2TR input?
From BIP341:
A Taproot output is a native SegWit output (see BIP141) with version
number 1, and a 32-byte witness program. [...]
Let q be the 32-byte array containing the witness program (the second ...
2
votes
Accepted
How is a Bitcoin transaction signed using ECDSA?
You say you are familiar with how secp256k1 and ECDSA works but from what you say later I'm unsure whether you are. SegWit v0 didn't change the signing algorithm (ECDSA) nor the curve (secp256k1). ...
2
votes
Accepted
Bitcoin Bech32 address validation
Bech32 is specified in BIP173. Native segwit outputs version 0 (P2WPKH and P2WSH) use bech32 addresses.
Native segwit outputs version 1+ (P2TR) use the improved bech32m for their addresses. Bech32m is ...
2
votes
Accepted
Is the witness `version` of a bech32 address required to "send spendable funds" to the address?
Can Alice still "send spendable funds" to Bob?
If she recovers the witness version before converting the address to the scriptPubKey she puts in the transaction, yes. Otherwise, no.
All ...
2
votes
Accepted
Why doesn't Bitcoin use different types of transactions with only one type of address?
why does bitcoin need to use different types of addresses for making the different types of transactions?
I think a fundamental reason is that the recipient (payee) has to be involved in specifying ...
2
votes
Accepted
How can I calculate the length (in bytes) of the Witness data in a transaction?
The serialization format for witnesses is described in BIP144.
The rough structure is:
For each transaction input (implicitly, there is no separate indicator of how many inputs there are), there is a ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
segregated-witness × 571bitcoin-core × 74
transactions × 73
bech32-address × 55
signature × 36
address × 32
witness-data × 28
p2sh × 27
segwit2x × 24
taproot × 20
p2wpkh × 20
p2wsh × 19
raw-transaction × 18
transaction-fees × 17
transaction-malleability × 17
block-weight × 17
multi-signature × 15
bitcoin-cash × 15
blocksize × 15
bitcoind × 14
electrum × 14
script × 14
wallet × 13
address-generation × 12
python × 12