1

From what i understand private is a point on the Elliptic curve and a public key is x,y co-ordinates on the curve therefore showing them on the graph should be easy to those who knows how to code. The below code shows the graph using python

import matplotlib.pyplot as plt

plt.rcParams["figure.figsize"] = [7.50, 3.50]
plt.rcParams["figure.autolayout"] = True

x = [3, 1, 2, 5]
y = [5, 2, 4, 7]

plt.plot(x, y, 'r*')
plt.axis([0, 6, 0, 20])

for i, j in zip(x, y):
   plt.text(i, j+0.5, '({}, {})'.format(i, j))

plt.show()

I need to do the same but with Elliptic curve and x,y co-ordinates of public key. My goal is to find the relationship between 2 public key with bitcoin addresses that share the 8 first characters, so it would be easy if i see them on a curve.

i have read Scalar multiplication HERE

can someone show me how to show public and private key on the curve using python?

The below code is a sample from HERE

import numpy as np
import matplotlib.pyplot as plt

def main():
    a = -1
    b = 1

    y, x = np.ogrid[-5:5:100j, -5:5:100j]
    plt.contour(x.ravel(), y.ravel(), pow(y, 2) - pow(x, 3) - x * a - b, [0])
    plt.grid()
    plt.show()

if __name__ == '__main__':
    main()

I am still learning python.

the curve that i want to see 2 public keys on

  • like the curve in this link [link](https://learnmeabitcoin.com/technical/public-key) – terry franklin Dec 08 '22 at 17:29
  • The private key is *not* a point on the curve. Curves in cryptography are over finite fields, so their "graph" is not really meaningful and for example doesn't have any continuous segments. – President James K. Polk Dec 08 '22 at 19:16
  • @PresidentJamesK.Polk you are right, a private key is a number from which we derive public key(x,y). thats what i want to on the curve above – terry franklin Dec 09 '22 at 08:21

0 Answers0