Post
Topic
Board Meta
Merits 7 from 4 users
Topic OP
Commentary about deleted posts
by
NotATether
on 02/05/2025, 07:59:24 UTC
⭐ Merited by vapourminer (4) ,ABCbits (1) ,Cricktor (1) ,dkbit98 (1)
In the case where one person deletes their own posts, it sometimes causes adjacent posts to be merged together, like this:

Quote from: Bitcoin Forum
A reply of yours, quoted below, was deleted by a Bitcoin Forum moderator. Posts are most frequently deleted because they are off-topic, though they can also be deleted for other reasons. In the future, please avoid posting things that need to be deleted.

Quote
[moderator's note: This post was deleted but its contents weren't. Due to a violation of either rule 21 or 32 (see https://bitcointalk.org/index.php?topic=703657.0) this post's contents were merged into the first post in a row you've made]

In that case, please show me a witness transaction only Legancy inputs in the blockchain.

You were right about only legacy inputs transaction since that's what the last sentence of the quote also says. It's at the beginning of the document btw. My question now is how to construct the witness in the following case:

but what if only some of the inputs are segwit?
= segwit

Quote from: Bitcoin Forum
A reply of yours, quoted below, was deleted by a Bitcoin Forum moderator. Posts are most frequently deleted because they are off-topic, though they can also be deleted for other reasons. In the future, please avoid posting things that need to be deleted.

Quote
[moderator's note: This post was deleted but its contents weren't. Due to a violation of either rule 21 or 32 (see https://bitcointalk.org/index.php?topic=703657.0) this post's contents were merged into the first post in a row you've made]


They're all UTXOs from a legacy address so I figured that the witness array still needs to be the total length of the inputs.


I am relatively certain that in this case you are not allowed to create a Segwit transaction. It must be a legancy TX!
Witness Field also not permitted in this TX!
Witness field may only be inserted if at least one input comes from a Segwit address.

BIP141 says this:

Quote
The witness is a serialization of all witness fields of the transaction. Each txin is associated with a witness field. A witness field starts with a var_int to indicate the number of stack items for the txin. It is followed by stack items, with each item starts with a var_int to indicate the length. Witness data is NOT script.

A non-witness program (defined hereinafter) txin MUST be associated with an empty witness field, represented by a 0x00. If all txins are not witness program, a transaction's wtxid is equal to its txid.

So if there is no segwit input, it basically means there is no marker, flag, witness field, etc. but what if only some of the inputs are segwit?

I am not sure what the witness is supposed to be in this case.

In this case, hypothetically if there were 8 witness items, they would not be specified as 00 x8 times, but 08 as the stack length and then each stack (containing the relevant scriptsig)?

And if only half of them were witnesses, then it's 04 as stack length and then the 4 stack items?

How does Core even keep track of which input a witness belongs to if there are legacy inputs scattered in the middle?

Do you think the moderator's note should additionally talk about this possibility?

In other words, I'd like to see something like this:

Quote
[moderator's note: This post was deleted but its contents weren't. Due to a violation of either rule 21 or 32 (see https://bitcointalk.org/index.php?topic=703657.0) this post's contents were merged into the first post in a row you've made. This could be caused by posts you've quoted being deleted for some other reason.]

In addition, it would obviously be better if only one "deleted post" notification was sent, given the circumstances of the merge. Though I'm probably nit-picking here.

I saw dkbit98's topic https://bitcointalk.org/index.php?topic=5540122.msg65333946#msg65333946 but I wanted to create a new one to suggest this optimization.