Segwit transactions can mix segwit and non-segwit inputs:
But how exactly are the non-segwit inputs accounted for, if at all, in the witness of a transaction with both P2PKH and P2WPKH inputs?
Is a new stack item created for all inputs (non segwit included)? If so, does a 0x00
have to be added to the P2PKH input’s stack item size field to indicate an input with no witness data (the P2KH input), or is it ignored completely?
Is there an example transaction on the mainnet I could look at? Or, what would the segwit fields be for a transaction that spent the below (pretending they are valid UTXOs and using placeholders for the key checking etc):
Example P2PK: 6f7cf9580f1c2dfb3c4d5d043cdbb128c640e3f20161245aa7372e9666168516
Example P2WPKH dfcec48bb8491856c353306ab5febeb7e99e4d783eedf3de98f3ee0812b92bad