<p>There is a step-by-step guide <a href="https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses#How_to_create_Bitcoin_Address" rel="nofollow noreferrer">here</a> and you can also test it on <a href="https://gobittest.appspot.com/Address" rel="nofollow noreferrer">this</a> site. </p>

<p>You can also use <a href="https://github.com/mcdallas/cryptotools" rel="nofollow noreferrer">this</a> python library.</p>

<pre><code>import os
os.environ['CRYPTOTOOLS_NETWORK'] = 'test'

from btctools import PublicKey

&gt;&gt;&gt; pub = Publickey.from_hex('yourpubkeyhere')
&gt;&gt;&gt; pub.to_address('P2PKH')
'mp9CpH3h25m7FZqsPBf2UfU9Gm4u41j9Eg'
</code></pre>

CC BY-SA 4.0
2018-09-11T11:21:55.987Z
Is there any way I can do this check by Java program or using Api?
Maroon5
CC BY-SA 4.0
2018-09-11T12:17:28.827Z
There is a java library call bitcoinj that might be able to do this. Also there is this: https://bitcore.io/playground/#/address but I wouldn't trust any online service with a private key. It might be good enough for testnet though.
Mike D
CC BY-SA 4.0
2018-09-11T11:01:42.010Z
2018-09-11T11:01:42.010Z
Mike D
<p>Your only option is to derive the address from each public key, and compare it with the address you have.</p>

CC BY-SA 4.0
2018-09-11T10:54:13.803Z
2018-09-11T10:54:13.803Z
Raghav Sood
<p>I have 10s of private and public keys associated with 10s of different addresses. </p>

<p>Now I have a test-net btc address "<strong>mfoxBS2TpoiUWrEV3sZopoEB6Pi2d7TE9N</strong>".</p>

<p>What operations can I perform to find the appropriate <strong>Public Key</strong> associated with <strong>given address</strong>?</p>

<p><strong>UPDATE</strong>
I am not trying to find out reverse scenario of fetching a public key from address.</p>

<p>As I already have bunch of public keys. One of them have created the given address. And I just want to figure out which one is it from the whole bunch?</p>

CC BY-SA 4.0
2018-09-11T10:18:11.643Z
Possible duplicate of [Is it possible to get the public key of a bitcoin address I do not have the private keys for with the standard client?](https://bitcoin.stackexchange.com/questions/11604/is-it-possible-to-get-the-public-key-of-a-bitcoin-address-i-do-not-have-the-priv)
Roman Kiselenko
CC BY-SA 4.0
2018-09-11T10:38:35.177Z
it's not duplicate. updated my question description.
Maroon5
<bitcoin-core><blockchain><blockchain-wallet-app><blockcypher>
How to confirm that given bitcoin address is generated by given public key?
Maroon5
# How to confirm that given bitcoin address is generated by given public key?

(Asked by: username_0 on 2018-09-11)

I have 10s of private and public keys associated with 10s of different addresses.

Now I have a test-net btc address "**mfoxBS2TpoiUWrEV3sZopoEB6Pi2d7TE9N**".

What operations can I perform to find the appropriate **Public Key** associated with **given address**?

**UPDATE**
I am not trying to find out reverse scenario of fetching a public key from address.

As I already have bunch of public keys. One of them have created the given address. And I just want to figure out which one is it from the whole bunch?

**Tags:** bitcoin-core, blockchain, blockchain-wallet-app, blockcypher

> **Comments:**
> **username_1**: Possible duplicate of [Is it possible to get the public key of a bitcoin address I do not have the private keys for with the standard client?](https://bitcoin.stackexchange.com/questions/11604/is-it-possible-to-get-the-public-key-of-a-bitcoin-address-i-do-not-have-the-priv)  
> **username_0**: it's not duplicate. updated my question description.  

---

## 2 answers

### Answer by username_2 on 2018-09-11. Score: 1 | Accepted answer

There is a step-by-step guide [here](https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses#How_to_create_Bitcoin_Address) and you can also test it on [this](https://gobittest.appspot.com/Address) site.

You can also use [this](https://github.com/mcdallas/cryptotools) python library.

```
import os
os.environ['CRYPTOTOOLS_NETWORK'] = 'test'

from btctools import PublicKey

>>> pub = Publickey.from_hex('yourpubkeyhere')
>>> pub.to_address('P2PKH')
'mp9CpH3h25m7FZqsPBf2UfU9Gm4u41j9Eg'

```

> **Comments:**
> **username_0**: Is there any way I can do this check by Java program or using Api?  
> **username_2**: There is a java library call bitcoinj that might be able to do this. Also there is this: https://bitcore.io/playground/#/address but I wouldn't trust any online service with a private key. It might be good enough for testnet though.  

---

### Answer by username_3 on 2018-09-11. Score: 0

Your only option is to derive the address from each public key, and compare it with the address you have.


---

