I have script to create a P2WPKH to P2WPKH transaction (1 input, 1 output) and sign it with the sighash type 0x01 SIGHASH_ALL.
Which fields would I need to change in the tx digest preimage to turn the signature into one with a sighash type of 0x83 (SINGLE|ANYONECANPAY)? I'm having trouble understanding the documentation in bip_143.
For reference, the tx digest preimage:
Double SHA256 of the serialization of:
1. nVersion of the transaction (4-byte little endian)
2. hashPrevouts (32-byte hash)
3. hashSequence (32-byte hash)
4. outpoint (32-byte hash + 4-byte little endian)
5. scriptCode of the input (serialized as scripts inside CTxOuts)
6. value of the output spent by this input (8-byte little endian)
7. nSequence of the input (4-byte little endian)
8. hashOutputs (32-byte hash)
9. nLocktime of the transaction (4-byte little endian)
10. sighash type of the signature (4-byte little endian)