When creating a WIF from a private key, you have to insert a special byte at the beginning of the hex string, before starting hashing and adding the checksum: 0x80 for the MainNet or 0xef for the TestNet.

Is there a special reason WHY this has to be included in the WIF? Wouldn't it be better (=more universal) just doing the hashes and adding the checksum without the network byte? What is the sense behind this, why did the founders of the WIF-mechanism decide to go this way?

Just for my understanding...


As the original author of the WIF format, honestly: the question had never occurred to me, but I think it does make sense.

At the time the only existing Base58Check format was the P2PKH address format for mainnet and testnet, which had a network byte. To create the WIF format I just modified it to set the high bit in the version byte, and changed the payload from public key hash to private key.

Note that this was before the existence of seed phrases, deterministic wallets, or altcoins. The idea that someone would want to reuse the same key on multiple networks just didn't apply.

In retrospect, I think this was a reasonable choice. You shouldn't reuse keys across networks (or applications in general).


WIF stands for Wallet Import Format which is a standardize scheme to import and export keys from wallets. As such it makes sense to include metadata such as the network byte so the wallet knows what network is the private key for instead of trying it for every supported network. If you only want to encode just the key itself and no metadata you can do so in hex.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.