Live data from Hacker News

Why does the all 0 public key have a known private key in SR25519 and ED25519?

substrate.stackexchange.com

61–64 of 64 posts

Re: Why does the all 0 public key have a known private key in SR25519 and ED25519?

#61

Earlier quoted context omitted.

It’s not strange at all. The “all zero public key” is the encoding of the zero element (identity element) of the group. Finding the private key corresponding to a public key A is finding the number a so that A = a*B. When A = 0, this is really easy: a = 0.

It's strange if you come from Weierstrasser curves and think of public keys as points on the curve, which I think is what most people start with. I was obviously oversimplifying heavily.

It's still a point on a curve here. It's just on a twisted Edwards curve (or in the case of Ristretto, on a Jacobi quartic curve), not on a Weierstrass curve, but it's the same idea.

When encoding the public key, you give only one coordinate and possibly also a sign bit, and the other person uses the curve equation to solve for the other coordinate. Just like with a Weierstrass curve y^2 = x^3 + ax + b, you can solve for y using only x, plus one bit to say whether to take the positive or negative square root.

Technically, the zero-string encodes the identity element (0,1) for Ristretto, but not for Ed25519 where it's the point (i,0) where i = sqrt(-1). (Not (1,0) as the StackExchange claims, unless I'm very much mistaken. For Ed448 instead I believe it encodes (-1,0).) However the points (i,0) or (-1,0) are basically a rotation of (0,1). So for some protocols it works out that you can use 0 as the private key and it will work anyway.

Part of the point of Ristretto is to eliminate this sort of "gotcha" where certain public keys are equivalent. The way around it is that you pick a certain one of the equivalent points to encode, in a canonical way, and the other options are not valid encodings. This also means you don't need a sign bit: one of the criteria for choosing which rotation is that the sign bit would be zero.

Re: Why does the all 0 public key have a known private key in SR25519 and ED25519?

#62
post #31
post #25

Earlier quoted context omitted.

Might as well take an Introduction to Semiconductor Devices engineering course while you're at it. Just as relevant when it comes to software development.

Abstract algebra is more relevant to the general practice of cryptography engineering than semiconductor engineering is to the general practice of writing software.

I'm talking specifically about the requirements for your average software developer, not a developer trying to specifically study cryptography.

Re: Why does the all 0 public key have a known private key in SR25519 and ED25519?

#63

Earlier quoted context omitted.

Just out of curiosity: is a similar problem (generate a valid public key that surely nobody including myself can know the private key of) solvable for RSA?

That problem can't be solvable in any context. There's no way to rule out the possibility that someone else in the world knows your mathematical secret.

[deleted]

Re: Why does the all 0 public key have a known private key in SR25519 and ED25519?

#64
post #20

Earlier quoted context omitted.

Thanks for putting in the effort to compose this explanation (assuming U did, and not simply asked GPT). But FYI, I did not find it helpful at all. Even after re-reading it twice. Bawolff's concise ELI5 comment helped though.

Thanks for the feedback. It's certainly interesting to see that you did not find it helpful at all. I was oversimplifying so much that I felt uncomfortable about it because I feel like some aspects of my answer are just borderline wrong. I don't think I can make it even simpler. Explaining highly technical issues to people without any background in that field really is a tough skill that I apparently don't possess. A…

> I was oversimplifying so much that I felt uncomfortable about it because I feel like some aspects of my answer are just borderline wrong

Hmmm... true true. Simplifications are likely to miss the nuances involved.

Post reply on HN