1
I know that a public key can be compressed. However, a public key and its compressed one have the same private key. Then why do we need two different Wallet import formats for each compressed and uncompressed one?
1
I know that a public key can be compressed. However, a public key and its compressed one have the same private key. Then why do we need two different Wallet import formats for each compressed and uncompressed one?
1
Wallet software needs to know whether to search the blockchain for an address generated from a compressed public key or not. The encoding of the private key signals which type should be searched for.
Assuming there're two P2PKH addresses A and B, where A is generated from a public key, B is generated from its compressed one. I send 1 BTC to A, 2 BTC to B. If I input my private key to a Bitcoin wallet software in WIF-uncompressed format, would the software show me only 1 BTC (by searching for transactions regarding A on the blockchain), which means A and B are considered as two different addresses that have two different private keys? – Константин Ван – 2018-01-01T13:57:52.370
1It really depends on the implementation of the wallet software. Some software may decide to check both addresses, others may not. The addresses will be considered as distinct, but funds from either could be spent from a signature generated from the same private key. – Matthew Charles Stannard – 2018-01-01T14:01:39.410
Then I cannot make a transaction transferring 3 BTC from A. Is it right? – Константин Ван – 2018-01-01T14:08:03.363
1No, the protocol would allow you to spend bitcoin from either address A or B. – Matthew Charles Stannard – 2018-01-01T14:13:35.523
I'm sorry to keep asking. Would the software that searches for only A on the blockchain, consider the transaction (A → 3 BTC) as invalid? – Константин Ван – 2018-01-01T14:25:24.170
1Which transaction? – Matthew Charles Stannard – 2018-01-01T14:26:18.137
I meant the transaction transferring 3 BTC from A. – Константин Ван – 2018-01-01T14:30:29.820
1All transactions from either type of address would be valid, but it would depend on the implementation of the particular wallet software as to whether both uncompressed and compressed addresses are tracked. – Matthew Charles Stannard – 2018-01-01T14:34:44.043
Shouldn't a wallet software track the both A and B in order to know if it has enough balance to pay 3 BTC? – Константин Ван – 2018-01-01T14:39:41.517
1Wallet software should never reuse the same private key. Unless they have done this, the software will never need to track the two different types of addresses – Matthew Charles Stannard – 2018-01-01T14:42:07.820