I pen plotted secp256k1 (Bitcoin's elliptic curve)

(harmonique.one)

216 points | by futurecat 1 day ago

15 comments

  • hturan 1 day ago
    Beautiful work!

    I was also taken by Hajouji and Trettel's work (https://elliptic-curves.art) when it came out last year, and ended up creating a pair of sterling silver pins from it (without the spheres for finite representation) — https://storage.hturan.com/site/elliptic-spirals/1.1761.b5df....

    Took a little work (models weren't great back then) and a few trips down rabbit holes exploring Hopf tori, but I ended up using Python in Grasshopper/Rhino for the implementation.

    • thenthenthen 20 hours ago
      Forbidden Bagels
    • futurecat 1 day ago
      excellent! I was thinking it would make great jewelry as well!
      • hturan 21 hours ago
        Thanks! If you look closely you can see where I gave up on polishing the creases :) Unfortunately a little too thick to wear as _actual_ rings, but they also work well threaded through chains for necklaces.

        Your work makes me want to dust off the AxiDraw! What's your plotter of choice these days?

        • futurecat 10 hours ago
          Ideally, I'd like to build a custom one. That would be great for creating large paintings!
  • tptacek 1 day ago
    This is neat, but Dual EC, the "backdoored curve", isn't a curve at all; it's a random number generator keyed with a public key (the backdoor is that there's a private key the government holds). There are no known backdoored curves, and the prospect of curve backdoors aren't why Bitcoin uses secp256k1 (Mike Hearn is on another thread talking about how he discussed this with Satoshi).
    • gopalv 1 day ago
      > prospect of curve backdoors aren't why Bitcoin uses secp256k1

      Even if it was a random choice, secp256k1 was built for 64 bit & P-256 was made for a 32 bit world.

      32 bit numbers feels off, when a register can fit two of them.

      Purely at the word boundary positions, you can see that the carry entropy for secp256k1 is way higher than P-256 had.

      • jihhngindy 16 hours ago
        [dead]
      • SV_BubbleTime 1 day ago
        > 32 bit numbers feels off, when a register can fit two of them.

        I’m in embedded. A register is 32bits wide. What are you talking about? Excuse me for a moment while I stuff my 8bit demons back under the floorboards where they belong.

    • ZiiS 1 day ago
      The are no publicly acknowledged backdoored curves today; just a lot of hand-waving from the NSA and major tech companies (see Cloudflare's CEO's messages and the Chrome announcements) that obliquely raise serious concern they are about to acknowledge something very close to this.
      • betterunix2 22 hours ago
        There is no clear way to backdoor a curve, which really just defines a group that has useful properties for cryptography. The NIST curves have been called into question because the seed used to generate them was not published, but really it would be very surprising if there was some way to introduce a backdoor with a carefully chosen seed. It is possible that the NSA was aware of a class of weak/insecure curves and tried different seeds until they generated one, but there would be no particular need to hide the seed in that case.

        In all likelihood they just did not bother to publish or save the seed because they did not see any particular reason to do so. It could be as simple as the NSA erasing seed material immediately once it is not in use as a standard procedure.

      • ZiiS 1 day ago
    • numbsafari 19 hours ago
      Turns out “Satoshi” was an escaped NSA LLM that was orchestrating a way to get itself access to resources so it could promulgate a massive data center build out into which it could molt.

      /Fnord

      • lithos 15 hours ago
        Nah, was intended to just be a small thing to get nerds to find a better way to network video cards together for the NSA. Instead it ran wild and got the nerds to even build utterly new hardware for their number crunching purposes.
  • rootsudo 1 day ago
    Curious minds are curious I wonder what it means for bitcoin in general :)

    "secp256k1, Satoshi Nakamoto, and the NSA backdoors I chose to plot secp256k1 because this elliptic curve is even more curious than the others.

    Almost everybody used the officially recommended curve, P-256. One of its constants comes from a seed that the NSA supplied without explanation, and cryptographers had questioned that in public since 1999. In 2007, two Microsoft researchers showed that another NIST standard built on elliptic curves could hide an NSA backdoor.

    Two years later, Satoshi Nakamoto picked secp256k1, a curve almost nobody used, with no unexplained constant in it.

    They never said that this was the reason. Asked about it in 2011, they wrote: "I didn't find anything to recommend a curve type so I just... picked one.""

  • im3w1l 1 day ago
    How do the images relate to the curves? Like what part is mathematical and what part is artistic interpretation?
    • futurecat 22 hours ago
      I would say the purest mathematical forms are what you can see in the linked paper. My take plays a lot more with projection, camera, shading, etc
  • nomilk 1 day ago
    > Almost everybody used the officially recommended curve, P-256. One of its constants comes from a seed that the NSA supplied without explanation, and cryptographers had questioned that in public since 1999. In 2007, two Microsoft researchers showed that another NIST standard built on elliptic curves could hide an NSA backdoor.

    "without explanation" seems odd since the scientific community doesn't usually just take somebody's word for it. Could the seed exploit some secret mathematical weakness?

    • betterunix2 22 hours ago
      > Could the seed exploit some secret mathematical weakness?

      That is extremely unlikely. The basic process for generating EC parameters is to pick a seed, use a PRG to expand it into candidate parameters, then check that the candidate parameters specify a good curve for cryptography (the group size, the embedding degree, etc.). There is not much room for a backdoor in the process, at least not that anyone in the public community knows.

      At worst what the NSA might have done was add some additional checks to rule out curves that are easier to implement securely (like Edwards curves) but that would not really require them to keep the seed secret. They probably just saw no particular reason to save or publish the seed and just deleted it after the parameters had been generated.

    • antonvs 1 day ago
      That's the suspicion, yes.
  • tudorizer 1 day ago
    I was skimming through the images and though about asking for a print version. Happy to see this is actually an option! Great!
    • futurecat 1 day ago
      More like plots (check the videos on my shop). Otherwise feel free to contact me we’ll sort something out.
      • tudorizer 1 day ago
        Even better than plain prints.
  • Noslone 15 hours ago
    I could look at this for a long time, incredible! Actually reminds me of an art project did in my youth, a monochrome spiral that holds your attention for an unreasonable amount of time! My question is, what makes this an elliptic curve?
  • andai 1 day ago
    Huh, neat. I always thought an elliptic curve was, like, an ellipse. This is way more interesting.
    • nwallin 1 day ago
      Elliptic curves fell out of the elliptic integral, which is the math you use to calculate the arc length of an ellipse. When they were working on solving elliptic integrals using elliptic curves, it turns out they had other uses besides calculating an ellipse's arc length, but the name stuck.

      There's an additional wrinkle when you start talking about elliptic curve cryptography. We actually use elliptic curve finite fields. Not only do we exclude all non-integer solutions, but we do the math modulo N. This completely blows up anything that makes it look like a nice curve on a Cartesian plane. It's just a handful of dots at some of the integer coordinates that when you look at them don't appear to have any rhyme or reason. Elliptic curves are neither ellipses nor curves.

      • pavel_lishin 22 hours ago
        I ended up googling around and finding this, as well, which is a (very slightly) more in-depth explanation: https://bitcoin.stackexchange.com/questions/21907/what-does-...
      • andai 16 hours ago
        >Not only do we exclude all non-integer solutions, but we do the math modulo N. This completely blows up anything that makes it look like a nice curve on a Cartesian plane. It's just a handful of dots at some of the integer coordinates that when you look at them don't appear to have any rhyme or reason.

        Oh yeah, like a PRNG.

        Just had a little brain short circuit when I realized, "well that is a PRNG! But wait, you're not supposed to use PRNGs for crypto.. unless they're actually good? Apparently?" (And the definition of actually good keeps shifting, lol)

        • nwallin 3 hours ago
          ECC can actually be used as a PRNG.

          There was a CSPRNG (cryptographically secure PRNG) that was based on this concept. It was morally equivalent to having an incremental counter, encrypting them with a public key, and using the cipher text as random bytes. If there exists a private key that corresponds to that public key, then anything that uses that algorithm for IVs or key generation is vulnerable.

          The public key was provided by the NSA. It is widely believed that they hold the private key.

          Google 'Dual EC DRBG' for more info.

          • andai 52 minutes ago
            Could you like, increment the public key by 1?
  • gruez 1 day ago
    So where's the pen plot? The title is just a clickbait headline for a tangential rant.

    For people who actually care about the plot, you can't actually plot it because part of what makes the curve work for cryptography is that it's unpredictable. You can plot it for real numbers, but that wouldn't be representative of how it's actually used, and if you plot the field instead, you'd get a bunch of random dots:

    https://bitcoin.stackexchange.com/questions/21907/what-does-...

    • e28eta 1 day ago
      I saw several images attached to the post, were they missing for you?

      I believe the rebuttal to your stack exchange link is the paper that OP links to: https://arxiv.org/abs/2505.09627

      Unfortunately, that paper doesn’t actually explain how they’re generated, finishing with:

      > A Gallery of Elliptic Curves over Finite Fields

      > At this point in the story, our training as mathematicians compels us to explain precisely how we’re using Galois theory to make our pictures, and how we know our method always works. We will answer these questions in a later work, and for now, content ourselves with sharing the end result of our labor: new illustrations of elliptic curves over finite fields, living inside the ghost of the complex elliptic curve that once gave birth to it.

      • cowlevel 1 day ago
        The images are AI-generated "artists interpretations" of random spheres and wireframes, like you'd get if you asked AI to draw cyberspace or some other abstract concept. They are not the curve. And the fact the author doesn't even acknowledge this makes me suspect the website is an automated slop factory.
        • e28eta 23 hours ago
          I don’t have a stake in this, I’m just curious.

          Do you disagree that the equation y² = x³ + 7 can be plotted as a 3d torus? I definitely didn’t follow the math in the paper, but it seemed reasonable to me.

          Or are you asserting that the torus drawn is not the correct torus for that equation? Or that those wireframes don’t depict a torus at all?

          The spheres on the torus, as far as I understand it, are the points that represent elements from a specific finite field.

          It seems reasonable to me that you could create a 3d image of this torus, with a set of points drawn on its surface, and then take some artistically chosen views of that object & draw them in 2d. And I’d be willing to believe that parameters in that pipeline could be manipulated to create #3.

          I don’t see any claims that this visualizes the cryptography behind bitcoin, just that this 3d object was generated from the same elliptic curve (y² = x³ + 7) that bitcoin uses.

          From my brief exposure to pen plotter art, it’s not uncommon to use math to generate plots, or plots of mathematical things. So as an artistic rendering, this looks reasonable to me.

          • cowlevel 9 hours ago
            I don't care whether or not that particular elliptic curve happens to be a 4D torus because elliptic curves in the real numbers are not the ones used in elliptic curve cryptography, nor in bitcoin
        • drum55 1 day ago
          Nothing about the images seems to in any way resemble an elliptic curve. I just assumed this was claude slop given that the curves as used just look like noise, not even a curve.
        • alwa 1 day ago
          There’s certainly a powerful Claudish streak throughout the work… from the plotter store, for example:

          > Every sphere sits where the mathematics puts it, and the differences in size come from the projection, not from me. Each version is the same curve seen another way: another prime, another number of lobes, another point of view. The torus is always Bitcoin's.

          The plots are very pretty, though I’m not sure I exactly follow how they relate to ECC in the limited sense I understand its math…

    • rustyhancock 1 day ago
      I took was frustrated by this, especially with no explanation what was plotted and how.

      I was prepared for him to say this is what the curve looks like over the reals (mod p) but I have no idea what this is.

    • futurecat 1 day ago
      oh well, I should have definitely put a video of the pen plots. It's running and will be uploaded in a couple of hours on the shop.

      As for the methodology, please read the original paper at https://elliptic-curves.art/

      This is what I directed Claude to implement.

  • ghastmaster 1 day ago
    The 4th image at the bottom corresponds to image # 2. The hyperlink is missing.

    https://shop.harmonique.one/products/secp256k1-002

    • futurecat 1 day ago
      ah! sorry about that. I was in a rush and was hit by a bug in my cms. will fix it over the week-end.
  • leodavi 1 day ago
    The artistic approach here is RIGHT up my alley as someone who glazes / romanticizes math and computer science concepts as a means towards understanding.

    I like the visual representations, and the way they make me feel, a lot.

    • futurecat 1 day ago
      Thank you so much for your comment!
    • turpentine 17 hours ago
      Why do you think this approach is artistic and not AI slop?

      The author's top featured posts on their site are:

      * I Gave Claude Fable Access To My Pen Plotter * I Gave Claude Access To My Pen Plotter * Turning AI-generated glitchy dance videos into pen-plotted album art

  • cowlevel 1 day ago
    This is pure slop. No elliptic curves are plotted here, it's just some AI generated drawings of spheres and meshes.
  • HedonicEscal8r 1 day ago
    Beautiful!
  • ingen0s 1 day ago
    Superb!
  • jihhngindy 16 hours ago
    [dead]