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-b98508d40a88Now 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-a1f0a1bce638So 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.