1

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?

1

There is a step-by-step guide here and you can also test it on this site.

You can also use this python library.

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

from btctools import PublicKey

>>> pub = Publickey.from_hex('yourpubkeyhere')
>>> pub.to_address('P2PKH')
'mp9CpH3h25m7FZqsPBf2UfU9Gm4u41j9Eg'
  • Is there any way I can do this check by Java program or using Api? – Maroon5 Sep 11 '18 at 11:21
  • There is a java library call bitcoinj that might be able to do this. Also there is this: 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 Sep 11 '18 at 12:17
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.