<p>Yes, but it's pretty silly.</p>
<p>If you use your addition formula for <code>Qx = Gx</code>, the intermediary <code>s</code> will be 0. From this, it follows that <code>Rx = -2Qx = -2Gx</code> and <code>Ry = -Qy</code>.</p>
<p>So if you instead wanted doubling (all you need to do is take the <code>Rx</code> and <code>Ry</code> values, compute <code>Qx</code> and <code>Qy</code> from those, and substitute those expressions in the correct doubling formula.</p>

CC BY-SA 4.0
2023-10-02T12:03:58.963Z
2023-10-02T12:03:58.963Z
Pieter Wuille
<p>I'm working with the secp256k1 elliptic curve and have point doubling and point addition formulas for this curve. Given the following formulas:</p>
<p><strong>Point Addition Formula in Python3:</strong></p>
<pre><code>s = (Qy - Gy) * pow(Qx - Gx, -1, p) % p
Rx = (s**2 - Qx - Gx) % p
Ry = (s * (Qx - Rx) - Qy) % p
</code></pre>
<p><strong>Point Doubling Formula in Python3:</strong></p>
<pre><code>s = (3 * Qx**2) * pow(Qy*2, -1, p) % p
Rx = (s**2 - Qx*2) % p
Ry = (s * (Qx - Rx) - Qy) % p
</code></pre>
<p>If a point is given Qx and Qy</p>
<pre><code>Qx = 112711660439710606056748659173929673102114977341539408544630613555209775888121
Qy = 25583027980570883691656905877401976406448868254816295069919888960541586679410
</code></pre>
<p>performing point doubling on the given points <code>(Qx, Qy)</code> will get the below output</p>
<pre><code>Rx1 = 115780575977492633039504758427830329241728645270042306223540962614150928364886
Ry1 = 78735063515800386211891312544505775871260717697865196436804966483607426560663
</code></pre>
<p>Performing point addition on the given points <code>(Qx, Qy)</code> will get</p>
<pre><code>Rx2 = 103388573995635080359749164254216598308788835304023601477803095234286494993683
Ry2 = 37057141145242123013015316630864329550140216928701153669873286428255828810018
</code></pre>
<p>Now, I'm looking for a way to convert <code>(Rx1, Ry1)</code> to <code>(Rx2, Ry2)</code> without knowing the original given values <code>(Qx, Qy)</code>. Is there a method or algorithm to achieve this conversion?</p>

CC BY-SA 4.0
2023-10-09T00:32:52.043Z
Hello Aviril, this question has already an answer, so please refrain from heavily editing your question at this point. If you want to ask something different, please start a new topic.
Murch
CC BY-SA 4.0
2023-10-09T16:25:59.163Z
@Murch  the answer provide below does not answer my question. I already gotten the answer somewhere else so if you don't mind stop editing the question back, I tried deleting it but since some already tried answering the question I can't.
Aviril Smith
CC BY-SA 4.0
2023-10-09T16:57:20.010Z
It is not clear to me how your edit improves the question except that it removes context relevant to the answer below. I’ve already requested once that you stop removing content. I’ve locked this question to edits.
Murch
CC BY-SA 4.0
2023-11-06T22:13:05.397Z
I’m voting to close this question because it was [crossposted](https://crypto.stackexchange.com/q/108146/8801) to Crypto SE, where someone figured out that the asker meant to ask how to get from `R_1 = 2Q` to `R_2 = Q + G` which lead to a better answer.
Murch
<python><ecdsa><secp256k1>
How to convert the results of point doubling (Rx1 and Ry1) to point addition (Rx2 and Ry2) without knowledge of (Qx, Qy) in secp256k1 elliptic curve
Aviril Smith
# How to convert the results of point doubling (Rx1 and Ry1) to point addition (Rx2 and Ry2) without knowledge of (Qx, Qy) in secp256k1 elliptic curve

(Asked by: username_0 on 2023-10-01)

I'm working with the secp256k1 elliptic curve and have point doubling and point addition formulas for this curve. Given the following formulas:

**Point Addition Formula in Python3:**

```
s = (Qy - Gy) * pow(Qx - Gx, -1, p) % p
Rx = (s**2 - Qx - Gx) % p
Ry = (s * (Qx - Rx) - Qy) % p

```

**Point Doubling Formula in Python3:**

```
s = (3 * Qx**2) * pow(Qy*2, -1, p) % p
Rx = (s**2 - Qx*2) % p
Ry = (s * (Qx - Rx) - Qy) % p

```

If a point is given Qx and Qy

```
Qx = 112711660439710606056748659173929673102114977341539408544630613555209775888121
Qy = 25583027980570883691656905877401976406448868254816295069919888960541586679410

```

performing point doubling on the given points `(Qx, Qy)` will get the below output

```
Rx1 = 115780575977492633039504758427830329241728645270042306223540962614150928364886
Ry1 = 78735063515800386211891312544505775871260717697865196436804966483607426560663

```

Performing point addition on the given points `(Qx, Qy)` will get

```
Rx2 = 103388573995635080359749164254216598308788835304023601477803095234286494993683
Ry2 = 37057141145242123013015316630864329550140216928701153669873286428255828810018

```

Now, I'm looking for a way to convert `(Rx1, Ry1)` to `(Rx2, Ry2)` without knowing the original given values `(Qx, Qy)`. Is there a method or algorithm to achieve this conversion?

**Tags:** python, ecdsa, secp256k1

> **Comments:**
> **username_1**: Hello username_0, this question has already an answer, so please refrain from heavily editing your question at this point. If you want to ask something different, please start a new topic.  
> **username_0**: @username_1  the answer provide below does not answer my question. I already gotten the answer somewhere else so if you don't mind stop editing the question back, I tried deleting it but since some already tried answering the question I can't.  
> **username_1**: It is not clear to me how your edit improves the question except that it removes context relevant to the answer below. I’ve already requested once that you stop removing content. I’ve locked this question to edits.  
> **username_1**: I’m voting to close this question because it was [crossposted](https://crypto.stackexchange.com/q/108146/8801) to Crypto SE, where someone figured out that the asker meant to ask how to get from `R_1 = 2Q` to `R_2 = Q + G` which lead to a better answer.  

---

## 1 answers

### Answer by username_2 on 2023-10-02. Score: 1

Yes, but it's pretty silly.

If you use your addition formula for `Qx = Gx`, the intermediary `s` will be 0. From this, it follows that `Rx = -2Qx = -2Gx` and `Ry = -Qy`.

So if you instead wanted doubling (all you need to do is take the `Rx` and `Ry` values, compute `Qx` and `Qy` from those, and substitute those expressions in the correct doubling formula.


---

