Exact witness requirements for a segwit transaction with P2PKH and P2WPKH inputs

on

|

views

and

comments


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

Share this
Tags

Must-read

The Great Bitcoin Crash of 2024

Bitcoin Crash The cryptocurrency world faced the hell of early 2024 when the most popular Bitcoin crashed by over 80% in a matter of weeks,...

Bitcoin Gambling: A comprehensive guide in 2024

Bitcoin Gambling With online currencies rapidly gaining traditional acceptance, the intriguing convergence of the crypto-trek and gambling industries is taking place. Cryptocurrency gambling, which started...

The Rise of Bitcoin Extractor: A comprehensive guide 2024

Bitcoin Extractor  Crypto mining is resources-thirsty with investors in mining hardware and those investing in the resources needed as the main beneficiaries. In this sense,...

Recent articles

More like this