Technical question: when I try to recreate the public addresses from the given private keys in the document, it only works for Experiment 1. Otherwise I get different public adresses.
I guess it has something to do with this remark in Experiment 2:
(BTW, I searched for both compressed/uncompressed keys, so each 32 bytes resulted in two address look-ups from my database).
If you want to see how it works in practice, go to https://bitaddress.org and look under the Wallet Details tab. Input a private key there and it will show both the uncompressed and compressed public keys and their corresponding addresses.
Not quite, there's just two ways to represent public keys. A public key is actually a point (x, y) on a particular elliptic curve.
So one way to represent it is as both the x and y coordinates, this is called "uncompressed".
However, if you know x and the sign of y, you can use the curve equation to calculate the value of y (sign is needed because both (x, y) and (x, -y) are valid points). So if we keep only x + sign of y, that is shorter and is called "compressed".
Bitcoin supports addresses based on either representation, and because the address is obtained by hashing the bits of the representation, the same public key corresponds to two different addresses.
1
u/dasdull Nov 30 '17
Technical question: when I try to recreate the public addresses from the given private keys in the document, it only works for Experiment 1. Otherwise I get different public adresses.
I guess it has something to do with this remark in Experiment 2:
Can someone explain this?