<p>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.</p>

CC BY-SA 4.0
2021-05-30T15:07:47.080Z
2021-05-30T15:07:47.080Z
Mike D
<p>As the original author of the WIF format, honestly: the question had never occurred to me, but I think it does make sense.</p>
<p>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.</p>
<p>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.</p>
<p>In retrospect, I think this was a reasonable choice. You shouldn't reuse keys across networks (or applications in general).</p>

CC BY-SA 4.0
2021-05-30T20:36:28.067Z
2021-05-30T20:36:28.067Z
Pieter Wuille
<p>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.</p>
<p>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?</p>
<p>Just for my understanding...</p>

<private-key><wallet-import-format>
Why does a WIF include the network?
HansHeinz
# Why does a WIF include the network?

(Asked by: username_0 on 2021-05-30)

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...

**Tags:** private-key, wallet-import-format


---

## 2 answers

### Answer by username_2 on 2021-05-30. Score: 6 | Accepted answer

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).


---

### Answer by username_1 on 2021-05-30. Score: 1

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.


---

