Why do WIF-compressed private keys exist?

I am reading Andreas' Mastering Bitcoin (great book btw) and got to the section where compressed and uncompressed public keys are explained (pages71-74). I have a question that I don't find an answer for, maybe someone here can help - might be a little too technical though.

If I understood correctly, the public keys are just (x,y) coordinates of the elliptic curve generated from the private key. Now there's two versions, the original version where the entire x and y coordinates are shown (04... public keys) and the newer version where the y is calculated from y² mod p=(x³+7) and are either 02... or 03... depending on whether it represents the positive or negative y.

All good. However, in order for wallets to know if they should search for the addresses generated from hashing the compressed or the uncompressed versions of the public key when importing a private key, the book says two types of private key formats were developed to represent what type of public key should be obtained from it. This way, if the private key imported looks like 5... the wallet knows it should create 04... public keys (uncompressed) and if the private key looks like K... it knows it should look for adresses derived from 02... or 03... public keys.

My question is - why do we need to show whether the addresses used came from a compressed or uncompressed public keys, IN the private key? I mean, can't we use a single standard private key format and have the wallet just create both versions of public keys to check in which one there's any funds? It would take what, a couple more minutes to check the balance?

Hope the question makes sense haha thanks!!



Submitted April 19, 2020 at 05:10PM by Jack1602 https://ift.tt/2Vjp4pt

Comments

Popular posts from this blog

Coinmarketcap are listing BCH sites as BTC

15 years of BTC Power Law