Bitcoin
Separated Witness – What is the reason for the scriptCode format in P2WPKH? (BIP 143)
Signing the P2WPKH input causes the P2WPKH locking script to be converted to the pattern of the legacy P2PKH when generating scriptCode.
From BIP 143:
for someone
P2WPKH
witness program,scriptCode
is0x1976a91420-byte-pubkey-hash88ac
.
Why?
How about using the original P2WPKH as scriptCode?