I recently started a Blockchain course and came across the electrum software. While going through the list of wallet addresses and associated private keys I found that 'p2pkh' is placed at the start of every private key, why is that?

Asked
Active
Viewed 817 times
3
Raghav Sood
- 16,869
- 3
- 21
- 42
Anshu Jalan
- 145
- 4
1 Answers
3
A single private key can lead to different addresses, depending on the script it is used in - These include p2pkh, p2wpkh, p2sh-p2wpkh.
Electrum prepends the script type to the private key during export and import so that it knows which address to derive and check for outputs on.
Raghav Sood
- 16,869
- 3
- 21
- 42