?
from ecdsa import SECP256k1
import matplotlib.pyplot as plt
# Secp256k1 parameters
p = SECP256k1.curve.p()
G = SECP256k1.generator
def finite_mul(k):
"""ECC with mod p"""
return (k * G).x()
def real_mul_simulation(k):
"""real number growth"""
base = 21505829891763648114329055987619236494102133314575206970830385799158076338148
return int(base * (2.5 ** (k//5 - 1)))
print("Comparison for multiples of 5G:")
for k in range(5, 26, 5):
print(f"\n{k}G:")
print(f"Simulated real nums (no mod p): x ≈ {real_mul_simulation(k)}")
print(f"Finite field (mod p): x = {finite_mul(k)}")
k_values = list(range(5, 101, 5))
plt.figure(figsize=(10,5))
plt.plot(k_values, [real_mul_simulation(k) for k in k_values], 'ro-')
plt.yscale('log')
plt.title("Simulated Exponential Growth of x-coordinates (No Mod p)")
plt.xlabel("Multiples of G (k)")
plt.ylabel("log(x-coordinate)")
plt.grid(True)
plt.show()
Comparison for multiples of 5G:
5G:
Simulated real nums (no mod p): x ≈ 21505829891763647189493603839112105714930174046003373679412332908031823052800
Finite field (mod p): x = 21505829891763648114329055987619236494102133314575206970830385799158076338148
10G:
Simulated real nums (no mod p): x ≈ 53764574729409117973734009597780264287325435115008434198530832270079557632000
Finite field (mod p): x = 72488970228380509287422715226575535698893157273063074627791787432852706183111
15G:
Simulated real nums (no mod p): x ≈ 134411436823522782078830669922528456382616849058220265318703130412856211668992
Finite field (mod p): x = 97505755694356382817881959832717013755620551362654128955029190924747025549326
20G:
Simulated real nums (no mod p): x ≈ 336028592058807006619094091094009958299329077562753944007253627081511258816512
Finite field (mod p): x = 34773495056115281091786765947597603724784643419904767525769502836017890139287
25G:
Simulated real nums (no mod p): x ≈ 840071480147017439414709103303491669734142261531079938952390366129722052575232
Finite field (mod p): x = 66165162229742397718677620062386824252848999675912518712054484685772795754260
Yup it's definitely exponential, but does happens to all point when no modulo p applied or is it specific for the 5th points