How can we visualize the secp256k1 elliptic curve?

8 replies 340 views
darkguruHero Member
Posts: 849 · Reputation: 4147
#1Oct 3, 2024, 07:27 PM
My brain says math but I can't help but picture a Christmas tree. I know this might sound odd, but if there's one place to ask, it's here not at the family dinner table. I've been thinking about how people visualize the secp256k1 elliptic curve that Bitcoin uses. I've scoured the web and come across all sorts of images: - some depict a wobbly, twisted curve, - others show a circle or straight lines, - some illustrate a cloud of points in a rectangle, - and a few even resemble galaxies... which I kinda dig. It's wild how nobody seems to agree on what it really looks like. So I'm wondering, is "curve" even the right term for this thing??? In my head totally lacking any artistic skills it resembles a Christmas tree. The point G is like the star on top, and going down, there are more and more branches, creating a perfectly symmetrical tree. I'm really curious to know: what do you see?
6 Reply Quote Share
im_apeHero Member
Posts: 629 · Reputation: 3824
#2Oct 3, 2024, 07:52 PM
The bitcoin wiki has a page on it that also shows the curve. https://en.bitcoin.it/wiki/Secp256k1 Also here is a fun site you can use to play around with such stuff. Here is the curve Bitcoin uses https://www.desmos.com/calculator/xcnlmiauec Here is another more complete one that allows you to perform and visualize point addition as well: https://www.desmos.com/calculator/ialhd71we3 (fix the values for b and a to get secp256k1 curve like I did in previous link)
0 Reply Quote Share
byte2019Senior Member
Posts: 270 · Reputation: 1836
#3Oct 4, 2024, 07:48 AM
There is a repository for that: https://github.com/vjudeu/curves1000/tree/master/png Everything up to 1000 is covered, for example for p = 967: https://github.com/vjudeu/curves1000/blob/master/png/967.png You have (x,y) points, where each coordinate is in range from 1 to p - 1. And you have N points. Which means, that instead of 967 x 967 square with 906 white dots, you have 115792089237316195423570985008687907853269984665640564039457584007908834671663 x 115792089237316195423570985008687907853269984665640564039457584007908834671663 square with 115792089237316195423570985008687907852837564279074904382605163141518161494336 white dots inside. Technically, you can represent it in many different ways, but in general, you have just (x,y) points in a huge space. Which is why around 2^128 operations are needed to break it. I think the easiest way to understand it, is to start with smaller examples, and to increase numbers gradually, until you get it. And again, there is even another topic about it: https://bitcointalk.org/index.php?topic=5459153.0
1 Reply Quote Share
darkguruHero Member
Posts: 849 · Reputation: 4147
#4Oct 5, 2024, 03:29 PM
Merci Thank you  for your feedback and for the interesting links. So the curve is indeed the one I keep seeing everywhere visually, but i be honnest, it becomes mentally ::)difficult to represent it once we go beyond a certain number of scalar multiplications with respect to point G, which I call a ‘branch’ in the representation of my symmetrical Christmas-tree
0 Reply Quote Share
paul2017Senior Member
Posts: 218 · Reputation: 1426
#5Oct 6, 2024, 07:16 PM
I imagine that it looks something like this:
3 Reply Quote Share
im_altSenior Member
Posts: 130 · Reputation: 817
#6Oct 7, 2024, 06:03 AM
I use to imagine the elliptical curve multiplication in many ways before I came across a video on YouTube that gave me the convincing representation. The G point start at the top by drawing  a tangent from the point to intercept the curve.  and take the point it intercepts to the opposite point that’s like taking the inverse of that point. the starting point will be G1 and the other point from the tangent is G2 if you take another tangent and repeat same process you get more points the G points are the multiplications thats how I understand it. let me share the link with everyone here https://youtu.be/GT6AuURD8Y0?si=5gHN3xEeVTr5MnDc
6 Reply Quote Share
hash_bossLegendary
Posts: 1166 · Reputation: 5261
#7Oct 7, 2024, 10:01 AM
That video is 1 hour long. So for other who just want to see visualization, check these page (from same author). https://learnmeabitcoin.com/technical/cryptography/elliptic-curve/ https://learnmeabitcoin.com/technical/cryptography/elliptic-curve/ecdsa/
0 Reply Quote Share
LuckyCoinLegendary
Posts: 832 · Reputation: 4795
#8Oct 7, 2024, 11:05 AM
It looks like this: It's literally just a bunch of random points, like would be output by an RNG. Source: Bitcoin Wiki
3 Reply Quote Share
silentchainHero Member
Posts: 473 · Reputation: 2317
#9Oct 7, 2024, 11:46 AM
Not precisely. It’s more accurate to say “a bunch of pseudo‑random points.” We use pseudo because all those points satisfy the equation 𝑦^2 ≡ 𝑥^3 + 7  (mod 𝑝), which means they are deterministically defined (whereas true random numbers do not follow any deterministic rule/equation). We use random because, statistically, these points are distributed uniformly across the field. Source, you are refereed to says "its graph will in reality look like random scattered points" , and this is correct. You just missed "look like".
4 Reply Quote Share

Related topics