In the discrete logarithm problem of the secp256k1 curve, I'm actually curious as to how the generator point and the public key would be implemented (on the grounds that there are two versions of the parameters).
I was wondering if the Public key and the Generator point should be applied “compressed with the “02
” or “03
” or uncompressed with the “04
”.
I couldn't find any answer to this anywhere.
The prefix "02","03","04" denote the compression type of the point.
"04" means that the point is uncompressed, that is, both x and y coordinates are specified in this form. "02" and "03" means that the point is compressed. Only x coordinate is present in this representation. The y coordinate can be computed from the x coordinate(by solving
y^2 = x^3 + ax + b (mod n)
). Because there are 2 possible values of y, "02" denotes the positive one and "03" denotes the negative one. (The negative one is not actually negative, because we are using modulo operation).For example for secp256k1, we have -
Internally, both these forms represent the same point, that is,
On a a side note, this has nothing to do with Discrete log problem.