Bitcoin Forum
November 05, 2024, 03:35:18 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Question about public key generation  (Read 147 times)
release (OP)
Member
**
Offline Offline

Activity: 184
Merit: 14


View Profile
January 09, 2021, 01:08:41 PM
Merited by ABCbits (1)
 #1

Just a quick newbie question. I wanted to know the more times you perform the point addition does the value of the hexadecimal X and y values rise? I am so confused by this because I am new to hexadecimal multiplication. Basically if the private key was to the value of 10 we would add g to itself 10 times. If the private key was to the value if 100 and we therefore add g to itself 100 times would the X and y value (public key) be a higher number if converted? If dealing with real numbers 4 plus 4 is 8 and 8 plus 8 is 16 but does it work that way with point adding and hexadecimal?
baro77
Member
**
Offline Offline

Activity: 90
Merit: 91


View Profile WWW
January 09, 2021, 02:02:21 PM
 #2

Hi!

first of all, hexadecimal or decimal doesn't matter. They are just bases to REPRESENT values, choosing one or the other doesn't change the game... like time: you can say 13:00 or 1:00 PM, two DIFFERENT representations of the SAME moment.

The core of your doubt/problem is that addition of elliptic curves points is far different from the "legacy" addition of two numbers you are thinking to... check this thread: https://bitcointalk.org/index.php?topic=5299242.0 to find infos about the procedure to implement that kind of addition.

I want to underline a last point. You write:

    "and we therefore add g to itself 100 times would the X and y value (public key) be a higher number if converted?"

"if converted" is out of context here: it's true a procedure called "compression" exists to represent an elliptic curve point with less bytes than the ones required by the two coordinates numbers, but again it's just a DIFFERENT REPRESENTATION of the 2D point (as decimal and hexadecimal bases are just two different representations of the same number), used to save space. And dealing with 2D points, "higher/lower than" is a not available relation (at least not the common sense one you are thinking)

release (OP)
Member
**
Offline Offline

Activity: 184
Merit: 14


View Profile
January 09, 2021, 02:38:47 PM
 #3

Ok thanks for that but on the curve if you add g to itself once is the value of X greater than it was at G? If not please explain the relationship between these 2 points
NotATether
Legendary
*
Offline Offline

Activity: 1778
Merit: 7362


Top Crypto Casino


View Profile WWW
January 09, 2021, 05:40:24 PM
Merited by ABCbits (2), o_e_l_e_o (2)
 #4

Ok thanks for that but on the curve if you add g to itself once is the value of X greater than it was at G? If not please explain the relationship between these 2 points

When you add a point to itself, you take the tangent line of the point, and find the other point on the curve this line intersects, and then "flip" that point across the x-axis (this is possible because elliptic curves are symmetrical across the x-axis). This new point is G + G, or 2G.

Here it adds P to itself to give 2P, or equivalently R:

Image source: https://hackernoon.com/elliptic-curve-crypto-point-doubling-b98508d40a88

Now if you add 2G to itself like this, it is just another point so you'd use the same procedure: draw a tangent line on the point, find the other intersecting point and then flip that point across the x-axis. This will give you 4G, and similarly you can derive 8G, 16G, etc.

If you want to find the sum of two different points, you draw a line that crosses both of these points, and find the third point that intersects the line, and flip it over the x-axis. There will always be a third intersecting point, because the curve is cubic. That's how you can get 2G + G (two different points) = 3G.


Image source: https://medium.com/asecuritysite-when-bob-met-alice/adding-points-in-elliptic-curve-cryptography-a1f0a1bce638

So you see, P, Q and -R are collinear (they're all on the same line). This implies they all add up to 0. If you try to add -R and R there is no third intersecting point because they are completely vertical - that's where the 0 comes from, the point does not exist.

That's how 0 + P = P is possible, it's just adding P to a non-existing point which will still result in P.

When you "flip" a point, you are changing its sign. Flipping the point a second time changes it's sign back just like in conventional arithmetic.

The commutative property holds because it doesn't matter which wya you add Q + P or P + Q; the line is the same. And the associative property also holds because it doesn't matter which points you add first before others, you will ultimately arrive at the same point.

███████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████

███████████████████████
.
BC.GAME
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐░▀▄▀▀▀▀▀▄▀░▌█▄▀▄
▄▀░▀░░█░▄███████▄░█░░▀░▀▄
█░█░▀░█████████████░▀░█░█
█░██░▀█▀▀█▄▄█▀▀█▀░██░█
█░█▀██░█▀▀██▀▀█░██▀█░█
▀▄▀██░░░▀▀▄▌▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
██████▄▄▄▄▄▄▄██████
.
..CASINO....SPORTS....RACING..


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18746


View Profile
January 09, 2021, 06:06:14 PM
Last edit: January 09, 2021, 07:05:09 PM by o_e_l_e_o
 #5

Ok thanks for that but on the curve if you add g to itself once is the value of X greater than it was at G? If not please explain the relationship between these 2 points
To answer the first part of your question - no. Both the X and the Y coordinates may be higher or lower at 2G than they are at G. The same is true for any two multiples of G.

For the secp256k1 curve that bitcoin uses, G has the following coordinates:

Code:
x = 79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798
y = 483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8

2G has the following coordinates:

Code:
x = C6047F9441ED7D6D3045406E95C07CD85C778E4B8CEF3CA7ABAC09B95C709EE5
y = 1AE168FEA63DC339A3C58419466CEAEEF7F632653266D0E1236431A950CFE52A

100G has the following coordinates:

Code:
x = 8282263212C609D9EA2A6E3E172DE238D8C39CABD5AC1CA10646E23FD5F51508
y = 11F8A8098557DFE45E8256E830B60ACE62D613AC2F7B17BED31B6EAFF6E26CAF

So at 2G the x coordinate is higher than at G, but at 100G the x coordinate is lower than at 2G.
At 2G, the y coordinate is lower than at G, and at 100G, the y coordinate is lower still.

The graphical relationship between two points has been described by NotATether above. The algebraic relationship between two points is described in my post in your other thread here: https://bitcointalk.org/index.php?topic=5299242.msg55829844#msg55829844
release (OP)
Member
**
Offline Offline

Activity: 184
Merit: 14


View Profile
January 10, 2021, 12:28:19 AM
 #6




Image source: https://medium.com/asecuritysite-when-bob-met-alice/adding-points-in-elliptic-curve-cryp1bce638

Ok thank you.

Using the image above can you please explain which points will be the X and y coordinates of the public key if it was the final stage in the point addition process
pooya87
Legendary
*
Offline Offline

Activity: 3626
Merit: 11009


Crypto Swap Exchange


View Profile
January 10, 2021, 04:45:28 AM
 #7

Using the image above can you please explain which points will be the X and y coordinates of the public key if it was the final stage in the point addition process
If private key was `k` and P was the result of `(k-1)*G` and if `Q` was the generator point `G` then the result of the final stage where you compute the public key or `k*G` is going to be `R` which is the result of addition of P and Q which is ((k-1)*G + G).

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
RHavar
Legendary
*
Offline Offline

Activity: 1463
Merit: 1886



View Profile
January 10, 2021, 06:23:24 AM
Merited by ABCbits (2), gmaxwell (1)
 #8

Just a quick newbie question. I wanted to know the more times you perform the point addition does the value of the hexadecimal X and y values rise? I am so confused by this because I am new to hexadecimal multiplication. Basically if the private key was to the value of 10 we would add g to itself 10 times. If the private key was to the value if 100 and we therefore add g to itself 100 times would the X and y value (public key) be a higher number if converted? If dealing with real numbers 4 plus 4 is 8 and 8 plus 8 is 16 but does it work that way with point adding and hexadecimal?

Taking a step backwards, we have a formula: `privateKey*GeneratorPoint=publicKey` but for this to even be useful, we know if we're given a publicKey there's must be no real way to figure out what the privateKey is. If there was a relationship like the publicKey went "higher" when the privateKey went "higher" we would be very quickly able to bisect what the privateKey was.

So maybe it helps to understand there absolutely must no be this relationship, and then dig into how ECC works to do that. I think the real trick to make all this magic work, is that everything is mod'd by p ( 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn ). Which I think if you work with "real numbers" you'd have the same effect as it basically causes the numbers to wrap around when they get too big.

Check out gamblingsitefinder.com for a decent list/rankings of crypto casinos. Note: I have no affiliation or interest in it, and don't even agree with all the rankings ... but it's the only uncorrupted review site I'm aware of.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!