Why is wif prefix 0x80 more than pubKeyHash prefix

3

I forked a coin and found that whatever I put in pubKeyHash prefix, I need to add 0x80 to it, to calculate wif prefix and hence generate an address keypair, i.e address and private key corresponding to that address. If I add anything apart from 0x80, to calculate wif prefix,the private key generated doesn't correspond to that address. Would anyone tell me the reason for the same.

troy_achilies

Posted 2018-04-10T15:56:47.883

Reputation: 35

Answers

3

0x80 is the version number for private keys. It allows a decoder to know what to do with the data it received and to check that you have entered the correct thing. Like many magic numbers in Bitcoin, it was arbitrarily chosen by Satoshi Pieter Wuille.

Andrew Chow

Posted 2018-04-10T15:56:47.883

Reputation: 40 910

6Nope. It was arbitrarily chosen by me.Pieter Wuille 2018-04-10T17:42:11.277