Post
Topic
Board Development & Technical Discussion
Re: modular inverse in bitcoin arithmetic
by
vjudeu
on 19/11/2024, 06:00:10 UTC
Quote
nothing is said about working with very long numbers.  So I presume that is trivial to both languages.  Is this correct?
Yes, they both have unlimited integers.

Quote
I will want to use some simple GUIs to help me understand what I am going.
It is hard to graphically express enormously big curves. Here are all of them, meeting y^2=x^3+7 equation, up to 1000: https://github.com/vjudeu/curves1000/tree/master/png

For example, if you have p=967 from Garlo Nicon's examples, then you have this: https://raw.githubusercontent.com/vjudeu/curves1000/refs/heads/master/png/967.png

Quote
Should I use Ruby per all the web pages, or Python per the book.
You can pick any language you want. Also, if you just want to explore basic things, then curves up to 32-bit should be sufficient, so you can use any language, even C/C++, because it will take some time, to know enough, to work with bigger curves correctly.

Example 32-bit curve: p=0xfffff9af, n=0xfffe390b, base=(0x1,0x3cad5d2d)

Also, Sage is your friend: https://sagecell.sagemath.org/
Code:
p = 0xfffff9af
n = 0xfffe390b
h = 1
K = GF(p)
a = K(0)
b = K(7)
E = EllipticCurve(K, (a, b))
G = E(0x1,0x3cad5d2d)
E.set_order(n * h)
d = 0x1
P = d * G
print(hex(P[0]),hex(P[1]))
And then, you have two points, for example (0x1,0x3cad5d2d) and (0x3,0x43f09f34). If you can't get the private key here, then you won't succeed with bigger curves, so you should start with this 32-bit curve, or smaller, and get familiar with them first.