Score:1

Is it possible to calculate and unknown point on an EC

bd flag

I aim to find the answer to what is $X$ on an EC over a finite field where $A + X = B$ and $A$ and $B$ are known. I’m currently learning with secp256k1 so the simplified equation for the curve is $y^2 = x^3 + 7$. I am trying to figure this out so I can write the formula in python.

fgrieu avatar
ng flag
Welcome to crypto-SE! I edited the question to use consistent notation. You are working on the Elliptic Curve secp256k1, that is the set of $(x,y)\in{\mathbb F_p}^2$ (where $\mathbb F_p$ is a prime field) with $y^2=x^3+7$. Multiplication and addition here are in this field. $A$, $X$ and $B$ are in the curve (not the field), and the $+$ operation there is a group law (more complex than the law in the field). Since it's a group, there is a single solution $X$ to the equation $A+X=B$, and it can be computed.
bd flag
Yeah I realized now I used some pretty stupid variables given the context of the question. I want to know if I have PublicKey1 + PublicKey2 = PublicKey3 and I know 1 and 3 can I calculate 2. If so what formula would I use.
Score:1
ng flag

Since an Elliptic Curve is a group, $A+X=B$ in this group can¹ be solved per $X=(-A)+B$, where $+$ is the group law and $-A$ is the opposite of $A$ in the group.

To compute $-A$, change $A=(x,y)$ to $-A=(x,p-y)$. The addition formulas are in Sec1 §2.2.1. If you get $A$ or $B$ in bytestring form (perhaps, compressed), use the conversion in Sec1 §2.3.4. The value of $p$ for secp256k1 is in Sec2 §2.4.


¹ Proof: $A$ is a member of the group, thus has an opposite $-A$. We add it on the left of both sides of $A+X=B$, yielding $(-A)+(A+X)=(-A)+B$. We use the group law's associativity to get $((-A)+A)+X=(-A)+B$. By definition of the opposite, $(-A)+A$ is the neutral $\mathcal O$, thus $\mathcal O+X=(-A)+B$. By definition of the neutral, $\mathcal O+X=X$, thus by replacement we get $A+X=B\implies X=(-A)+B$. Proving that $X=(-A)+B\implies A+X=B$ is just as easy, by adding $A$ on the left of both sides.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.