<p>the private key is a Private Key WIF Compressed, 52 characters base58, and can be used to convert into (compressed or uncompressed) public keys. These pub keys are usually hex codes, and can be converted into bitcoin addresses: 1D2mnuj9qeRAzmw8mjLDciyvqzQiiYZCfE and 1KWvNZB4Gf2Kars88aGR2cedUb81Q6gZKC. There is no easy way I am aware of to do this in bitcoin client. </p>

<p>Looking at the line you provided, the bitcoin address is behind the comment sign (#), and is part of a HD key, which complicates things even more, if I had to explain it. To understand the whole idea behind keys, you may want to read bitcoin.org or the book af Andreas "Mastering Bitcoin" (online available). </p>

<p>Looking then at e.g. blockchain.info, you can provide the addresses or the keys, and see that there is no value. </p>

<p>Hint: <strong>never ever (!)</strong> use this key again to transfer values. It has been disclosed, and people are only waiting to snipe the values from this address! - me too :-)</p>

CC BY-SA 3.0
2017-11-28T12:12:53.093Z
So is it possible to generate more than one address using same private key?
Tailer
CC BY-SA 3.0
2017-11-28T12:17:04.210Z
yes. A priv key alone can already generate two pubkeys (compressed and uncompressed). And HD wallets: just a short extract from the book: "HD wallets contain keys derived in a tree structure, such that a  parent  key  can  derive  a  sequence  of  children  keys,  each  of  which  can  derive  a sequence of grandchildren keys, and so on, to an infinite depth".
pebwindkraft
CC BY-SA 3.0
2017-11-28T12:20:06.190Z
Thanks for your answer, I would be happy to get this book!
Tailer
CC BY-SA 3.0
2017-11-28T12:20:55.607Z
here: http://chimera.labs.oreilly.com/books/1234000001802/ and there is somewhere already the second edition (don't have the link ...)
pebwindkraft
CC BY-SA 3.0
2017-11-28T12:34:11.677Z
https://unglueit-files.s3.amazonaws.com/ebf/05db7df4f31840f0a873d6ea14dcc28d.pdf
Tailer
CC BY-SA 3.0
2017-11-28T12:08:56.570Z
2017-11-28T17:20:20.693Z
2017-11-28T17:20:20.693Z
pebwindkraft
<p>using PHP and Bitcoin-PHP library, we can do the following to get Bitcoin address of any private key:</p>

<pre><code>        try {
            $master = PrivateKeyFactory::fromWif($key);
        } catch (\Exception $e) {
            echo "Invalid Address";
        }

        $BitcoinAddress = $master-&gt;getPublicKey()-&gt;getAddress()-&gt;getAddress();

        echo $BitcoinAddress;
</code></pre>

CC BY-SA 3.0
2018-03-05T08:25:16.170Z
2018-03-05T08:25:16.170Z
Tailer
<p>calling <code>bitcoin-cli dumpwallet</code> returns wallet private keys and addresses. </p>

<p><strong>Example</strong></p>

<pre><code>L34D2hAS9KBJQzJkHtmNt1bdSJ18cQUvfSnJEqPKH2oUj6sBxvXt 2017-11-23T05:11:13Z reserve=1 # addr=1D2mnuj9qeRAzmw8mjLDciyvqzQiiYZCfE hdkeypath=m/0'/0'/1030'
</code></pre>

<p>Importing this private key to wallet using <code>importprivkey</code> command returns <code>null</code> on success.</p>

<p>How to get bitcoin address related to this private key? or is there's any way get this private key details like balance or addresses? </p>

CC BY-SA 3.0
2017-11-28T10:20:57.887Z
You could use an online wallet like https://blockchain.info/wallet/#/.
l1b3rty
CC BY-SA 3.0
2017-11-28T11:20:06.107Z
Thanks but i'm looking for a solution on bitcoin-core. if you got any idea how blockchain is getting these info it would be great.
Tailer
<bitcoin-core><address-generation>
How to get bitcoin address of any private key?
Tailer
# How to get bitcoin address of any private key?

(Asked by: username_0 on 2017-11-28)

calling `bitcoin-cli dumpwallet` returns wallet private keys and addresses.

**Example**

```
L34D2hAS9KBJQzJkHtmNt1bdSJ18cQUvfSnJEqPKH2oUj6sBxvXt 2017-11-23T05:11:13Z reserve=1 # addr=1D2mnuj9qeRAzmw8mjLDciyvqzQiiYZCfE hdkeypath=m/0'/0'/1030'

```

Importing this private key to wallet using `importprivkey` command returns `null` on success.

How to get bitcoin address related to this private key? or is there's any way get this private key details like balance or addresses?

**Tags:** bitcoin-core, address-generation

> **Comments:**
> **username_1**: You could use an online wallet like https://blockchain.info/wallet/#/.  
> **username_0**: Thanks but i'm looking for a solution on bitcoin-core. if you got any idea how blockchain is getting these info it would be great.  

---

## 2 answers

### Answer by username_2 on 2017-11-28. Score: 2 | Accepted answer

the private key is a Private Key WIF Compressed, 52 characters base58, and can be used to convert into (compressed or uncompressed) public keys. These pub keys are usually hex codes, and can be converted into bitcoin addresses: 1D2mnuj9qeRAzmw8mjLDciyvqzQiiYZCfE and 1KWvNZB4Gf2Kars88aGR2cedUb81Q6gZKC. There is no easy way I am aware of to do this in bitcoin client.

Looking at the line you provided, the bitcoin address is behind the comment sign (#), and is part of a HD key, which complicates things even more, if I had to explain it. To understand the whole idea behind keys, you may want to read bitcoin.org or the book af Andreas "Mastering Bitcoin" (online available).

Looking then at e.g. blockchain.info, you can provide the addresses or the keys, and see that there is no value.

Hint: **never ever (!)** use this key again to transfer values. It has been disclosed, and people are only waiting to snipe the values from this address! - me too :-)

> **Comments:**
> **username_0**: So is it possible to generate more than one address using same private key?  
> **username_2**: yes. A priv key alone can already generate two pubkeys (compressed and uncompressed). And HD wallets: just a short extract from the book: "HD wallets contain keys derived in a tree structure, such that a  parent  key  can  derive  a  sequence  of  children  keys,  each  of  which  can  derive  a sequence of grandchildren keys, and so on, to an infinite depth".  
> **username_0**: Thanks for your answer, I would be happy to get this book!  
> **username_2**: here: http://chimera.labs.oreilly.com/books/1234000001802/ and there is somewhere already the second edition (don't have the link ...)  
> **username_0**: https://unglueit-files.s3.amazonaws.com/ebf/05db7df4f31840f0a873d6ea14dcc28d.pdf  

---

### Answer by username_0 on 2018-03-05. Score: 0

using PHP and Bitcoin-PHP library, we can do the following to get Bitcoin address of any private key:

```
        try {
            $master = PrivateKeyFactory::fromWif($key);
        } catch (\Exception $e) {
            echo "Invalid Address";
        }

        $BitcoinAddress = $master->getPublicKey()->getAddress()->getAddress();

        echo $BitcoinAddress;

```


---

