What you need depends on what you mean by 'point difference'.

What your code appears to be attempting to do is compute the point $X$ such that $X + K2 = K1$. That is easy to do ($X = K1 + (-K2)$, or $X = K1 - K2$), and your code almost does it, except:

```
# Calculate the inverse of vk2's public key point
vk2_inverse_point = generator_point - k2.pubkey.point
```

Here's your problem: $G - K2$ is not the inverse of $K2$. You might try:

vk2_inverse_point = -k2.pubkey.point

That is, the library you're using probably has 'point negation' (which you call inversion) built it - it's actually quite simple to do on the library side.

On the other hand, you also write:

example: Pub_key_A= 02f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9 (private key is 2) pub_key_B= 02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5 (private key is 3) the deference between 2 points is 1 i need the difference in Number of points between point A and B

If, given the public keys $aG$ and $bG$, you want the integer $a-b$, well, we hope that's a hard problem. If it is not, you can easily find private keys from public keys - given the public key $aG$, we can:

- pick an arbitrary $b$
- compute $bG$
- with $aG, bG$, we use that method to recover $a-b$;
- add back $b$ and that gives us the private key $a$.