<p>Only the private key for the second input is used in this signature as this signature is only for the second input. The first input is P2PK and is ignored in this example as it is non-segwit so the standard non-segwit sighash algorithm is used for it.</p>

CC BY-SA 4.0
2019-07-13T20:51:02.517Z
2019-07-13T20:51:02.517Z
Ava Chow
<p>I am looking at the <a href="https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki#native-p2wpkh" rel="nofollow noreferrer">BIP143 P2WPKH example</a>. I am kind of following until the generation of the <code>sigHash: c37af31116d1b27caf68aae9e3ac82f1477929014d5b917657d0eb49478cb670</code> but then that is used to generate the signature <code>304402203609e17b84f6a7d30c80bfa610b5b4542f32a8a0d5447a12fb1366d7f01cc44a0220573a954c4518331561406f90300e8f3358f51928d43c212a8caed02de67eebee</code>. Given that this transaction comprises two inputs I would somehow expect both corresponding private keys to generate a signature. So how is that signature in the example obtained?</p>

<transactions><segregated-witness><signature><p2wpkh><bip143>
P2WPKH - which private key is used to generate signature?
SCBuergel
# P2WPKH - which private key is used to generate signature?

(Asked by: username_0 on 2019-07-13)

I am looking at the [BIP143 P2WPKH example](https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki#native-p2wpkh). I am kind of following until the generation of the `sigHash: c37af31116d1b27caf68aae9e3ac82f1477929014d5b917657d0eb49478cb670` but then that is used to generate the signature `304402203609e17b84f6a7d30c80bfa610b5b4542f32a8a0d5447a12fb1366d7f01cc44a0220573a954c4518331561406f90300e8f3358f51928d43c212a8caed02de67eebee`. Given that this transaction comprises two inputs I would somehow expect both corresponding private keys to generate a signature. So how is that signature in the example obtained?

**Tags:** transactions, segregated-witness, signature, p2wpkh, bip143


---

## 1 answers

### Answer by username_1 on 2019-07-13. Score: 1 | Accepted answer

Only the private key for the second input is used in this signature as this signature is only for the second input. The first input is P2PK and is ignored in this example as it is non-segwit so the standard non-segwit sighash algorithm is used for it.


---

