so those large Xs wont show when we calculate a point that is 5th by point addition or scalar multiplication under the curve rules , but will they show when we calculate without applying mod p?
With mod p (Bitcoin's actual usage):
All coordinates wrap around p
NO large x-coordinates appear
Example (real secp256k1 point):
5G = (0x5ecbe4..., 0x769cf5...)
Without mod p (raw curve over ℝ):
Coordinates grow exponentially
Every 5th point (5G,10G,...) has massive x-values
Example pattern:
5G.x = 21
10G.x = 514
15G.x = 26867
20G.x = 863317
You can verify this in Python :
import matplotlib.pyplot as plt
from ecdsa import SECP256k1
from ecdsa.ellipticcurve import Point
# Secp256k1 parameters
p = SECP256k1.curve.p()
a = SECP256k1.curve.a()
b = SECP256k1.curve.b()
G = SECP256k1.generator # Base point
# Over REAL NUMBERS (no mod p)
def real_scalar_mul(k):
"""scalar multiplication without modular reduction"""
current = G
for _ in range(k - 1):
current += G # Point addition without mod p
return current
# Over FINITE FIELD (actual Bitcoin)
def finite_scalar_mul(k):
"""Normal ECC with mod p"""
return k * G
# Test for multiples of 5
print("Comparison for multiples of 5G:")
for k in range(5, 26, 5):
# Real numbers (exploding coordinates)
P_real = real_scalar_mul(k)
x_real, y_real = P_real.x(), P_real.y()
# Finite field (normal Bitcoin behavior)
P_finite = finite_scalar_mul(k)
x_finite, y_finite = P_finite.x(), P_finite.y()
print(f"\n{k}G:")
print(f"Real nums (no mod p): x = {x_real}")
print(f"Finite field (mod p): x = {x_finite}")
x_coords = []
for k in range(1, 101):
if k % 5 == 0:
P = real_scalar_mul(k)
x_coords.append((k, float(P.x()))
plt.plot([k for k, x in x_coords], [x for k, x in x_coords], 'ro-')
plt.yscale('log')
plt.title("Explosion of x-coordinates for 5G, 10G, 15G,... (no mod p)")
plt.xlabel("Multiples of G (k)")
plt.ylabel("log(x-coordinate)")
plt.grid()
plt.show()