I'm trying to grasp some of the concepts presented in BIP 143. These are the things I'm stuck on:
(1) A new hash format is presented. This new format is used to create a hash, which when signed with a private key, acts as a signature for an input. If my transaction contains a mix of input types (e.g. P2PKH and P2WPKH, for example), and I'm signing the P2PKH input, do I still use the original hash format that was used in the past or shall I use this new format? It appears the new format is only used when signing the P2WPKH inputs, correct?
(2) In the past, I've always set lockTime to 0x00. Why is it set to 0x11 in the BIP 143 example?
(3) In the past, I've always set sequenceNumber to 0xffffffff. Why is is set to 0xeeffffff in the BIP 143 example?
(4)I can't quite figure out the format of the witness section. Clearly, there should be one entry for each input. And for the P2PKH input it's just set to zero. But what comes next? According to this, each entry consists of an integer indicating the number of "stack items for the corresponding txIn", and then each stack item consists of a size indicator and the payload of the stack item. But what are the stack items and what is their order? Presumably this is where I'd put my input script and signature, right?