WIF (Wallet Import Format)
Also called: Wallet Import Format, WIF key, WIF private key, compressed WIF, extended WIF.
WIF (Wallet Import Format) writes a single private key as Base58Check text starting with 5, K or L, so it can be moved between wallets.
WIF, Wallet Import Format, is the standard text form of a single Bitcoin private key. It is how wallets traditionally exported and imported individual keys, and how paper wallets printed them.
How it works
A WIF string is the Base58Check encoding of:
0x80 | 32-byte private key | optional 0x01 | 4-byte checksum
The version byte 0x80 marks a mainnet private key (0xEF on testnet). The optional 0x01 suffix says the matching public key should be used in compressed form, and it changes the first character:
| Key type | Mainnet starts with | Testnet starts with | Length |
|---|---|---|---|
| Uncompressed | 5 |
9 |
51 characters |
| Compressed | K or L |
c |
52 characters |
Limitations and related BIPs
WIF predates the BIP process, so no BIP defines it. Its main gap is that it doesn't say which address type the key was used with: a compressed key could sit behind a P2PKH, a P2SH-wrapped or a native P2WPKH address, so an importing wallet has to check them all. BIP 178, by Karl-Johan Alm, building on a proposal by Thomas Voegtlin, extends the suffix byte to record that: 0x10 for P2PKH, 0x11 for P2WPKH and 0x12 for P2WPKH inside P2SH.
BIP 38 offers a passphrase-encrypted alternative that starts with 6P, and output descriptors (BIP 380) accept WIF keys inside a script expression such as wpkh(...), which records the address type explicitly.
Modern HD wallets rarely export single keys. Treat any WIF string like cash: anyone who sees it can spend the coins, so never paste one into a website.