<p>If the same private key is used to sign different data with the same R (or equivalently k), the private key can be extracted. Since the transactions you linked have inputs from different addresses, there's no <em>one</em> private key that you can extract.</p>
<p>However, if you know the <code>k</code> value that caused this R value, which you would if you're the creator of at least one of these transactions, you should be able to extract the private key of the other by using <a href="https://crypto.stackexchange.com/a/57851/38431">the same method</a> but skipping the derivation of k steps.</p>

CC BY-SA 4.0
2021-03-02T14:37:26.753Z
I don't understand yet, can you write the equation to include it in the https://cocalc.com program
hisham yem
CC BY-SA 4.0
2021-03-02T15:55:27.860Z
@hishamyem: Reusing the same "r" value is only unsafe if you reuse the same private key. For different private keys, you cannot learn anything unless you knew "r" in the first place.
Murch
CC BY-SA 4.0
2021-03-02T14:18:43.243Z
2021-03-02T14:18:43.243Z
MCCCS
<p>What is the formula for calculating the private key? I want the equation in detail to try to solve it on cocalc</p>
<p>I want an equation to extract the private key from two different addresses I have tried
K ((z1 * s2 - z2 * s1) / (r * (s1-s2)))
And it didn't work</p>
<p>These are the data for the transactions</p>
<p>tx/ 952730ab31f6e9949343bc186484f95168fa6842489e89b5b48500c54818c683</p>
<p>01000000013cc593a1e73b9c7b5aa30e2ae1ae5ab31301b7a789ce43575c9f859513f85a800100000068453042021e6fcf15e8d272d1a995af6fcc9d6c0c2f4c0b6b0525142e8af866dd8dad4b02207b4bde105608e96da63b54288a5dae961fc074008f4fc9c79d4e486fb9d4bc0b012102a0d204d69210b21d79c60b506b27259c314f0c64ea24d419696722ea285db1f1ffffffff0103621700000000001976a91428dc4730af1538b45ee1f0e3df7a9c9f31b000a388ac00000000</p>
<p>&quot;sigR&quot;: &quot;6fcf15e8d272d1a995af6fcc9d6c0c2f4c0b6b0525142e8af866dd8dad4b&quot;,
&quot;sigS&quot;: &quot;7b4bde105608e96da63b54288a5dae961fc074008f4fc9c79d4e486fb9d4bc0b&quot;,
&quot;sigZ&quot;: &quot;c49cc0d0ef2a72386e63d28a319e58dc0258dacedf9f7858619a615bb20cd8f6&quot;,
&quot;pubKey&quot;: &quot;02a0d204d69210b21d79c60b506b27259c314f0c64ea24d419696722ea285db1f1&quot;,</p>
<p>tx/ cf7a5114e0036d98c531538885b4c906a47d74a615721d620b3c53d4f7c43856</p>
<p>0100000001ed11d775420022c79e7d17ae587242dcc3a1a679f64b27451712b990bdc84a720400000088453042021e6fcf15e8d272d1a995af6fcc9d6c0c2f4c0b6b0525142e8af866dd8dad4b022078f05c60ebd2befb89a62e438c17ace056d6a450de5c6b1a3eff8fb5080928c501410482ba73f4c09accb62b982ab2b29848a292e3380e062c03c03a5880a918f937ea28f2b7da09deb91c2358414ffd31f8daacc60a5e2f9cafb8b9d212f8a888c7e8ffffffff0129060000000000001976a91428dc4730af1538b45ee1f0e3df7a9c9f31b000a388ac00000000</p>
<p>&quot;sigR&quot;: &quot;6fcf15e8d272d1a995af6fcc9d6c0c2f4c0b6b0525142e8af866dd8dad4b&quot;,
&quot;sigS&quot;: &quot;78f05c60ebd2befb89a62e438c17ace056d6a450de5c6b1a3eff8fb5080928c5&quot;,
&quot;sigZ&quot;: &quot;3d9f9cf2b32fac5966773e0f1697f1601218c72c1a908cf11278b30da2b6a0ed&quot;,
&quot;pubKey&quot;: &quot;0482ba73f4c09accb62b982ab2b29848a292e3380e062c03c03a5880a918f937ea28f2b7da09deb91c2358414ffd31f8daacc60a5e2f9cafb8b9d212f8a888c7e8&quot;,
&quot;N&quot;: 0
}</p>

<private-key><value>
What is the formula for calculating the private key? resued R value
hisham yem
# What is the formula for calculating the private key? resued R value

(Asked by: username_0 on 2021-03-02)

What is the formula for calculating the private key? I want the equation in detail to try to solve it on cocalc

I want an equation to extract the private key from two different addresses I have tried
K ((z1 \* s2 - z2 \* s1) / (r \* (s1-s2)))
And it didn't work

These are the data for the transactions

tx/ 952730ab31f6e9949343bc186484f95168fa6842489e89b5b48500c54818c683

01000000013cc593a1e73b9c7b5aa30e2ae1ae5ab31301b7a789ce43575c9f859513f85a800100000068453042021e6fcf15e8d272d1a995af6fcc9d6c0c2f4c0b6b0525142e8af866dd8dad4b02207b4bde105608e96da63b54288a5dae961fc074008f4fc9c79d4e486fb9d4bc0b012102a0d204d69210b21d79c60b506b27259c314f0c64ea24d419696722ea285db1f1ffffffff0103621700000000001976a91428dc4730af1538b45ee1f0e3df7a9c9f31b000a388ac00000000

"sigR": "6fcf15e8d272d1a995af6fcc9d6c0c2f4c0b6b0525142e8af866dd8dad4b",
"sigS": "7b4bde105608e96da63b54288a5dae961fc074008f4fc9c79d4e486fb9d4bc0b",
"sigZ": "c49cc0d0ef2a72386e63d28a319e58dc0258dacedf9f7858619a615bb20cd8f6",
"pubKey": "02a0d204d69210b21d79c60b506b27259c314f0c64ea24d419696722ea285db1f1",

tx/ cf7a5114e0036d98c531538885b4c906a47d74a615721d620b3c53d4f7c43856

0100000001ed11d775420022c79e7d17ae587242dcc3a1a679f64b27451712b990bdc84a720400000088453042021e6fcf15e8d272d1a995af6fcc9d6c0c2f4c0b6b0525142e8af866dd8dad4b022078f05c60ebd2befb89a62e438c17ace056d6a450de5c6b1a3eff8fb5080928c501410482ba73f4c09accb62b982ab2b29848a292e3380e062c03c03a5880a918f937ea28f2b7da09deb91c2358414ffd31f8daacc60a5e2f9cafb8b9d212f8a888c7e8ffffffff0129060000000000001976a91428dc4730af1538b45ee1f0e3df7a9c9f31b000a388ac00000000

"sigR": "6fcf15e8d272d1a995af6fcc9d6c0c2f4c0b6b0525142e8af866dd8dad4b",
"sigS": "78f05c60ebd2befb89a62e438c17ace056d6a450de5c6b1a3eff8fb5080928c5",
"sigZ": "3d9f9cf2b32fac5966773e0f1697f1601218c72c1a908cf11278b30da2b6a0ed",
"pubKey": "0482ba73f4c09accb62b982ab2b29848a292e3380e062c03c03a5880a918f937ea28f2b7da09deb91c2358414ffd31f8daacc60a5e2f9cafb8b9d212f8a888c7e8",
"N": 0
}

**Tags:** private-key, value


---

## 1 answers

### Answer by username_1 on 2021-03-02. Score: 1

If the same private key is used to sign different data with the same R (or equivalently k), the private key can be extracted. Since the transactions you linked have inputs from different addresses, there's no *one* private key that you can extract.

However, if you know the `k` value that caused this R value, which you would if you're the creator of at least one of these transactions, you should be able to extract the private key of the other by using [the same method](https://crypto.stackexchange.com/a/57851/38431) but skipping the derivation of k steps.

> **Comments:**
> **username_0**: I don't understand yet, can you write the equation to include it in the https://cocalc.com program  
> **username_2**: @username_0: Reusing the same "r" value is only unsafe if you reuse the same private key. For different private keys, you cannot learn anything unless you knew "r" in the first place.  

---

