Author: Thomas Voegtlin 2017-09-15 08:55:37
Published on: 2017-09-15T08:55:37+00:00
The Wallet Import Format (WIF) is a way to represent private keys for Bitcoin. Currently, WIF appends a 0x01 byte after the raw private key when used in conjunction with a compressed public key. This allows wallets to associate a single Bitcoin address to a WIF key. However, it would be useful to extend the semantics of that byte to signal for segwit scripts, as these scripts result in different addresses. By doing this, a WIF private key can still be associated with a single Bitcoin address.To extend WIF, there are proposals to add new bytes for segwit script embedded in P2SH (P2WPKH or P2WSH) and native segwit script (P2WKH or P2WSH). It is not necessary to use distinct bytes for P2WKH and P2WSH because the P2SH script is not known anyway. It is also possible to use a bech32 format for the private key if it is going to be used with a bech32 address.It is important to note that this proposal will not result in a user-visible change at the beginning of the string, like we have for compressed/uncompressed. However, this could be improved in the future. The proposed changes to WIF are similar to the {x,y,z}{pub,prv} proposal for bip32 extended keys.
Updated on: 2023-06-12T18:51:28.895428+00:00