<p>The order of the public keys is known, but it exists symmetrically.
Example) Private key 20 public key +1 = 21
20-1 = 19</p>
<p>Private key -20, public key +1 = -19
-1 = -18</p>
<p>P = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f
a = generators.main(1)
b = 0x352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5,P -0x321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c</p>
<p>c = lib1.sub(b,a)
d = lib1.add(b,a)
print((&quot;0x%x,0x%x&quot;) % b,(&quot;\n0x%x,0x%x&quot;)% c,(&quot;\n0x%x,0x%x&quot; % d))
if d == lib1.add(b,a) :
print((&quot;0x%x,0x%x&quot; % b),&quot;보다 &quot;,(&quot;\n0x%x,0x%x&quot; % d),&quot;이  더 크다&quot;)</p>
<p>d1 = lib1.sub(d,b)
print((&quot;0x%x,0x%x&quot; % d1))
print(&quot;====================================&quot;)
print(&quot;&quot;)</p>
<p>output
0x421f5fc9a21065445c96fdb91c0c1e2f2431741c72713b4b99ddcb316f31e9fc,0xd46f0e92ee254249e9092481dda2e1eb8bcfcb4c84ddceea24df8e842e3294ae
0x4ce119c96e2fa357200b559b2f7dd5a5f02d5290aff74b03f3e471b273211c97,0xed45d9234ef13e9da259e05ef57bb3989e9d6b7d8e269698bafd77106dcc1ff5
0x352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5,0xcde14bf8acb70acb2a63e7da6225c1e0b5e4c4d18e4efc639842c273307e62a3 보다<br />
0x4ce119c96e2fa357200b559b2f7dd5a5f02d5290aff74b03f3e471b273211c97,0xed45d9234ef13e9da259e05ef57bb3989e9d6b7d8e269698bafd77106dcc1ff5 이  더 크다
0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798,0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8</p>

CC BY-SA 4.0
2020-04-22T03:10:25.707Z
2020-11-29T23:47:18.997Z
2020-11-29T23:47:18.997Z
gpcam
<p>Yes, you can.</p>

<p>Public keys for a given private key correspond to elliptic curve multiplication with the generator G.</p>

<p>So we know that B = xG  and either A=(x-1)g or A=(x+1)G. This can be written as A=xG-G=B-G or A=xG+G=B+G.</p>

<p>So it suffices to check whether A equals B-G or B+G respectively.</p>

CC BY-SA 4.0
2020-04-20T01:28:21.047Z
Thanks for the answer.
I really spent a lot of time figuring this out in Python.
Can I write in Python I will pay for it.
gpcam
CC BY-SA 4.0
2020-04-20T01:36:37.373Z
I am referring to the case when the G value is unknown.
gpcam
CC BY-SA 4.0
2020-04-20T01:44:57.763Z
G is a fixed constant. It has X coordinate 0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798 and even Y.
Pieter Wuille
CC BY-SA 4.0
2020-04-20T02:28:14.563Z
I have difficulty.
If (x, y) is substituted, it is A, B, C, but when it is (x, -y), the order of C, B, A is changed.
I want to know the order when i don't know if y is -y.
gpcam
CC BY-SA 4.0
2020-04-20T02:34:14.603Z
No that isn't the case. It doesn't matter what you substitute for B. Sorry, I don't have time to discuss this privately.
Pieter Wuille
CC BY-SA 4.0
2020-04-20T04:24:23.280Z
Job offers are off topic on this site. I'm happy to answer specific questions here, but not more.
Pieter Wuille
CC BY-SA 4.0
2020-04-20T04:28:27.380Z
How can I chat?
It would be great if you chat via telegram.
gpcam
CC BY-SA 4.0
2020-04-20T04:30:12.097Z
I have already stated that I will not discuss this privately. I'll report this if you continue.
Pieter Wuille
CC BY-SA 4.0
2020-04-20T04:34:24.330Z
A message says that it is not possible to go to automatic chat.
gpcam
CC BY-SA 4.0
2020-04-20T04:39:35.720Z
Please avoid extended discussions in comments. Would you like to automatically move this discussion to chat? 
If you chat here, an error occurs and you do not go to the chat.
Sorry.
gpcam
CC BY-SA 4.0
2020-04-20T04:42:35.463Z
user105236 has only 1 reputation, not yet enough to chat ====> this massage
gpcam
CC BY-SA 4.0
2020-04-20T04:59:03.623Z
I don't participate in chat because I'm rated 1.
You can join the chat when your level is over 20.
gpcam
CC BY-SA 4.0
2020-04-20T05:03:33.200Z
I cannot enter the chat room.
Reputation is level 1.
gpcam
CC BY-SA 4.0
2020-04-20T05:03:55.543Z
I also don't want to chat, so don't bother.
Pieter Wuille
CC BY-SA 4.0
2020-04-20T01:22:18.643Z
2020-04-20T01:22:18.643Z
Pieter Wuille
<p>Private key x     = pubkey B</p>

<p>(x (+ or -) 1) = pubkey A, C</p>

<p>I only know the public keys A and C</p>

<p>I am looking for a way to know if the public key sequence is A B C or C B A</p>

<p>B = 0xa5e42a634fa42f4f22c756429a06fd104a12a0c3a61ae4b738b1716913c82732</p>

<p>A = 0xb616c736dd3d768e2e7b30b6e71caa3cd58359127af62bc633716eb2e782cca4</p>

<p>C = 0xc357ffa5f463c7a2b0ba760ceef0c7a7ae77042cae93788ce39a797693e0cc64</p>

<p>I don't know the private key of x value.</p>

<p>The public key corresponding to x is B</p>

<p>Input: B</p>

<p>Output x (+1) = A or C</p>

CC BY-SA 4.0
2020-04-20T00:46:48.367Z
Is your question this: given three public keys A B C, which you know correspond to private keys (x-1), x, (x+1), but not in which order, can you figure out which is which?
Pieter Wuille
CC BY-SA 4.0
2020-04-20T00:54:29.770Z
I don't understand your sentence. You do or do you not know the interval between them? And do you or do you not know that interval is fixed? For example, if I gave you (x - 377, x, x + 19) do you still need this to work?
Pieter Wuille
CC BY-SA 4.0
2020-04-20T01:00:29.180Z
Yes you can test me.
You can immediately know the public key value you are curious about.Please tell me the public key that only you know
And from the public key value you know, I can tell you the +-public key value.
gpcam
CC BY-SA 4.0
2020-04-20T01:00:56.067Z
I have no idea what you're asking. Please answer my question.
Pieter Wuille
CC BY-SA 4.0
2020-04-20T01:04:45.090Z
i can see (x-377, x, x + 19)
gpcam
CC BY-SA 4.0
2020-04-20T01:06:22.837Z
Please reformulate your question by editing the original above. Please use full sentences. What is given, what do you know about it, what are you trying to find?
Pieter Wuille
<bitcoin-core>
The three public keys A B C are private keys (x-1), x, (x + 1). Here, I want to know if (x-1) is A or C
gpcam
# The three public keys A B C are private keys (x-1), x, (x + 1). Here, I want to know if (x-1) is A or C

(Asked by: username_0 on 2020-04-20)

Private key x = pubkey B

(x (+ or -) 1) = pubkey A, C

I only know the public keys A and C

I am looking for a way to know if the public key sequence is A B C or C B A

B = 0xa5e42a634fa42f4f22c756429a06fd104a12a0c3a61ae4b738b1716913c82732

A = 0xb616c736dd3d768e2e7b30b6e71caa3cd58359127af62bc633716eb2e782cca4

C = 0xc357ffa5f463c7a2b0ba760ceef0c7a7ae77042cae93788ce39a797693e0cc64

I don't know the private key of x value.

The public key corresponding to x is B

Input: B

Output x (+1) = A or C

**Tags:** bitcoin-core

> **Comments:**
> **username_1**: Is your question this: given three public keys A B C, which you know correspond to private keys (x-1), x, (x+1), but not in which order, can you figure out which is which?  
> **username_1**: I don't understand your sentence. You do or do you not know the interval between them? And do you or do you not know that interval is fixed? For example, if I gave you (x - 377, x, x + 19) do you still need this to work?  
> **username_0**: Yes you can test me. You can immediately know the public key value you are curious about.Please tell me the public key that only you know And from the public key value you know, I can tell you the +-public key value.  
> **username_1**: I have no idea what you're asking. Please answer my question.  
> **username_0**: i can see (x-377, x, x + 19)  
> **username_1**: Please reformulate your question by editing the original above. Please use full sentences. What is given, what do you know about it, what are you trying to find?  

---

## 2 answers

### Answer by username_0 on 2020-04-22. Score: 0

The order of the public keys is known, but it exists symmetrically.
Example) Private key 20 public key +1 = 21
20-1 = 19

Private key -20, public key +1 = -19
-1 = -18

P = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f
a = generators.main(1)
b = 0x352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5,P -0x321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c

c = lib1.sub(b,a)
d = lib1.add(b,a)
print(("0x%x,0x%x") % b,("\n0x%x,0x%x")% c,("\n0x%x,0x%x" % d))
if d == lib1.add(b,a) :
print(("0x%x,0x%x" % b),"보다 ",("\n0x%x,0x%x" % d),"이 더 크다")

d1 = lib1.sub(d,b)
print(("0x%x,0x%x" % d1))
print("====================================")
print("")

output
0x421f5fc9a21065445c96fdb91c0c1e2f2431741c72713b4b99ddcb316f31e9fc,0xd46f0e92ee254249e9092481dda2e1eb8bcfcb4c84ddceea24df8e842e3294ae
0x4ce119c96e2fa357200b559b2f7dd5a5f02d5290aff74b03f3e471b273211c97,0xed45d9234ef13e9da259e05ef57bb3989e9d6b7d8e269698bafd77106dcc1ff5
0x352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5,0xcde14bf8acb70acb2a63e7da6225c1e0b5e4c4d18e4efc639842c273307e62a3 보다  
0x4ce119c96e2fa357200b559b2f7dd5a5f02d5290aff74b03f3e471b273211c97,0xed45d9234ef13e9da259e05ef57bb3989e9d6b7d8e269698bafd77106dcc1ff5 이 더 크다
0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798,0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8


---

### Answer by username_1 on 2020-04-20. Score: 0

Yes, you can.

Public keys for a given private key correspond to elliptic curve multiplication with the generator G.

So we know that B = xG and either A=(x-1)g or A=(x+1)G. This can be written as A=xG-G=B-G or A=xG+G=B+G.

So it suffices to check whether A equals B-G or B+G respectively.

> **Comments:**
> **username_0**: Thanks for the answer. I really spent a lot of time figuring this out in Python. Can I write in Python I will pay for it.  
> **username_0**: I am referring to the case when the G value is unknown.  
> **username_1**: G is a fixed constant. It has X coordinate 0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798 and even Y.  
> **username_0**: I have difficulty. If (x, y) is substituted, it is A, B, C, but when it is (x, -y), the order of C, B, A is changed. I want to know the order when i don't know if y is -y.  
> **username_1**: No that isn't the case. It doesn't matter what you substitute for B. Sorry, I don't have time to discuss this privately.  
> **username_1**: Job offers are off topic on this site. I'm happy to answer specific questions here, but not more.  
> **username_0**: How can I chat? It would be great if you chat via telegram.  
> **username_1**: I have already stated that I will not discuss this privately. I'll report this if you continue.  
> **username_0**: A message says that it is not possible to go to automatic chat.  
> **username_0**: Please avoid extended discussions in comments. Would you like to automatically move this discussion to chat?  If you chat here, an error occurs and you do not go to the chat. Sorry.  
> **username_0**: user105236 has only 1 reputation, not yet enough to chat ====> this massage  
> **username_0**: I don't participate in chat because I'm rated 1. You can join the chat when your level is over 20.  
> **username_0**: I cannot enter the chat room. Reputation is level 1.  
> **username_1**: I also don't want to chat, so don't bother.  

---

