From a private key to a public key
Elliptic-curve scalar multiplication as a cryptographic one-way function, played out on a toy curve small enough to see every point.
The idea
Ethereum keys live on the elliptic curve secp256k1. A private key is just an integer k. The public key is the point Q = kG, where G is a fixed base point and the multiplication means adding the point to itself k times (scalar multiplication). Going from k to Q is fast; going from Q back to k is the Elliptic Curve Discrete Logarithm Problem (ECDLP), believed to be infeasible. That asymmetry is what makes scalar multiplication a one-way function: deterministic and cheap forwards, hard backwards.
To see the mechanism we use a toy curve: the very same equation yΒ² = xΒ³ + 7, but over the small field π½ββ (mod 17) instead of a 256-bit prime. It has 17 affine points plus the point at infinity β 18 in total. The base point G = (1, 5) has order 9, so its multiples cycle through 9 points. With the homework's private key k = 6 the toy public key is 6G = (5, 8).
Explore the curve
Setup
Walking the subgroup
The whole finite field is a 17Γ17 lattice. The dots are the points that actually satisfy the curve equation; the accent points are the subgroup generated by the base point. Drag the slider to multiply and watch kG jump around the cycle.
The algorithm: double-and-add
Adding the point k times is slow for large k. Double-and-add instead reads the binary expansion of k: double the accumulator once per bit, and add the base point for every 1-bit. That is O(log k) operations instead of O(k) β the same trick that makes real 256-bit keys practical.
Statistical exploration
The task asks us to repeat the experiment over many values of k (and different valid base points) and look at the statistics of the resulting points. Run the sampler below and then read the commentary β the honest interpretation matters more than the pictures.
Sampler
What the statistics mean β and what they don't
Uniformity here is trivial, not evidence of strength. The subgroup has only 9 points, so the map k β kG is a bijection: every k β {1..8} lands on a distinct point and every subgroup coordinate is hit exactly once. Perfectly flat histograms follow from the subgroup being a cyclic group, not from any cryptographic virtue. A permutation of a tiny set always looks uniform.
The real property is computational. What makes this a one-way function is that the permutation is hard to invert β that is the ECDLP β not anything about the output distribution. On a toy curve you can brute-force the answer in microseconds; on secp256k1 the same map is secure because the search space is ~2Β²β΅βΆ.
"Avalanche-like" is an analogy, not an equivalence. Scalar multiplication is algebraic, not chaotic. A cryptographic hash flips about 50% of the output bits when a single input bit changes; the coordinate change here follows the group law and the subgroup size, and need not be near 50%. The scatter of kβvsβx looks like noise, but the dependence exists by construction.
Correlations exist but are useless. Q determines k uniquely, so in principle the input and output are perfectly correlated. The point of the one-way property is that exploiting that correlation requires solving the discrete logarithm. Statistical independence of bit patterns is a property associated with cryptographic hash functions; hardness of inversion is what matters for public-key primitives like this one.