Author

Topic: question about ECDSA (Read 750 times)

sr. member
Activity: 354
Merit: 250
December 17, 2013, 11:26:37 PM
#7
Thanks, that helps.
sr. member
Activity: 280
Merit: 257
bluemeanie
December 17, 2013, 01:25:42 PM
#6
Thanks both of you.

So:

X=79BE667E F9DCBBAC 55A06295 CE870B07 029BFCDB 2DCE28D9 59F2815B 16F81798
Y=483ADA77 26A3C465 5DA4FBFC 0E1108A8 FD17B448 A6855419 9C47D08F FB10D4B8

Is this correct?

that does look correct.

this image can help you understand point compression better, this is an elliptic curve:



note that the vertical line intersects the curve at only 2 points.  If you study the curve, you will see that this is true for any vertical line.  This if we know the X(the position of the vertical line) then we've narrowed it down to two Y points that are perfect mirror images of each other on the X axis.  Thus we only need to express the positive or negative component.  This also suggests that the ECDSA algo could probably be refactored into simpler math terms, but as of now this is the best we have(that is fully proven).
sr. member
Activity: 354
Merit: 250
December 16, 2013, 09:51:04 PM
#5
Thanks both of you.

So:

X=79BE667E F9DCBBAC 55A06295 CE870B07 029BFCDB 2DCE28D9 59F2815B 16F81798
Y=483ADA77 26A3C465 5DA4FBFC 0E1108A8 FD17B448 A6855419 9C47D08F FB10D4B8

Is this correct?
kjj
legendary
Activity: 1302
Merit: 1026
December 16, 2013, 06:06:12 PM
#4

G = 02 79BE667E F9DCBBAC 55A06295 CE870B07 029BFCDB 2DCE28D9 59F2815B 16F81798
G = 04 79BE667E F9DCBBAC 55A06295 CE870B07 029BFCDB 2DCE28D9 59F2815B 16F81798 483ADA77 26A3C465 5DA4FBFC 0E1108A8 FD17B448 A6855419 9C47D08F FB10D4B8


Red - encoding marker.  04 = x then y.  02 = x only, y has even parity.  03 = x only, y has odd parity
Green - X
Blue - Y
sr. member
Activity: 280
Merit: 257
bluemeanie
December 16, 2013, 05:23:03 PM
#3
Recently, I decided that I needed to better understand what goes on in the backend of cryptocurrency.  I've slowly been trying to teach myself to comprehend the various backend protocols.

However, I'm a little confused about this.  From my understanding, the "base point" G should be a point, with both an x and a y value.  However, it's given there as a single value, with a compressed and uncompressed form.  The linked pdf doesn't seem to elaborate on this.  What does this number mean, and how do you derive the x and y of the base point from it?

Thanks in advance.

An EC curve point is compressed by abbreviating the way the Y coordinate is expressed.  There are really only two possible values of Y for any X, thus we only need to indicate if it is either positive or negative(1 bit).

while this isn't exactly a standard, more of a convention, typically you take the first byte off(the 0x04 in the uncompressed point) and then the remaining data is two 32 byte integers.  As you can see from the example there in your link, in the compressed format, only the X coordinate of G is fully expressed.
sr. member
Activity: 354
Merit: 250
December 16, 2013, 03:10:53 AM
#2
Ah, here we go.  I found this in bitaddress.org's source code.
Code:
ec.CurveFp.prototype.decodePointHex = function (s) {
                var firstByte = parseInt(s.substr(0, 2), 16);
                switch (firstByte) { // first byte
                        case 0:
                                return this.infinity;
                        case 2: // compressed
                        case 3: // compressed
                                var yTilde = firstByte & 1;
                                var xHex = s.substr(2, s.length - 2);
                                var X1 = new BigInteger(xHex, 16);
                                return this.decompressPoint(yTilde, X1);
                        case 4: // uncompressed
                        case 6: // hybrid
                        case 7: // hybrid
                                var len = (s.length - 2) / 2;
                                var xHex = s.substr(2, len);
                                var yHex = s.substr(len + 2, len);

                                return new ec.PointFp(this,
                                        this.fromBigInteger(new BigInteger(xHex, 16)),
                                        this.fromBigInteger(new BigInteger(yHex, 16)));

                        default: // unsupported
                                return null;
                }
        };
So, I guess that answers that.
sr. member
Activity: 354
Merit: 250
December 16, 2013, 02:23:52 AM
#1
Recently, I decided that I needed to better understand what goes on in the backend of cryptocurrency.  I've slowly been trying to teach myself to comprehend the various backend protocols.

However, I'm a little confused about this.  From my understanding, the "base point" G should be a point, with both an x and a y value.  However, it's given there as a single value, with a compressed and uncompressed form.  The linked pdf doesn't seem to elaborate on this.  What does this number mean, and how do you derive the x and y of the base point from it?

Thanks in advance.
Jump to: