I used to be implementing a small utility that computes the bitcoin deal with ranging from a non-public key (256-bit quantity). I’m shocked in regards to the lack of a single reliable reference to this, in contrast to the case of the BIPs.
The e book of Antonopoulos and the bitcoin wiki point out that the general public key (pubK) should undergo sha256 and ripemd160 hashes earlier than base58check encoding that ends in the ultimate bitcoin deal with; there are additionally particulars in regards to the model byte. However the pubK may very well be serialized in a minimum of two kinds, both the complete 65-bytes 0x04<xcoord><ycoord> or the compressed 33-bytes 0x02/0x03 <xcoord> illustration. Each result in totally different bitcoin addresses. The wiki explains step-by-step the right way to receive an deal with from the compressed pubK, however the picture within the web page reveals a diagram that makes use of the complete pubK illustration as an alternative. The http://gobittest.appspot.com/ web site, referenced within the bitcoin wiki for testing the WIF format, computes the addresses utilizing the complete pubK.
Alright, I do know that the personal key WIF serialization format has a byte to point whether or not the pubK addresses are computed utilizing the the compressed or full illustration (see https://en.bitcoin.it/wiki/Wallet_import_format).
Additionally add a 0x01 byte on the finish if the personal key will correspond to a compressed public key.
Nonetheless,
- it isn’t talked about wherever what’s the worth of that byte when the complete pubK is used.
- finally a non-public key’s only a 256-bit quantity, there must be a novel strategy to derive an deal with from there.
Are there truly two addresses for every personal key within the bitcoin-core implementation? Is not there like a typical manner of getting the deal with?
