<p>Using the bitcoin-cli or the bitcoin-qt console, enter the command:</p>
<pre><code>validateaddress &quot;ADDRESS_BASE58_ENCODED&quot;
</code></pre>
<p>Where <code>ADDRESS_BASE58_ENCODED</code> is the address for which you want to know the public key.</p>

CC BY-SA 4.0
2018-08-10T06:37:45.990Z
I think this the correct answer. "pubkey" field holds the public key.
Abhishek Sinha
CC BY-SA 4.0
2017-07-05T13:55:17.960Z
2021-01-19T11:59:35.943Z
2021-01-19T11:59:35.943Z
DOLLY PATWA
<p>Use the following command to get all the receiving addresses.</p>
<blockquote>
<p>bitcoin-cli listreceivedbyaddress 0 true</p>
</blockquote>
<p>'0' represents no minimum number of confirmations.
'true' is for including addresses which have not received any payments.</p>
<p>For reference: <a href="https://developer.bitcoin.org/reference/rpc/listreceivedbyaddress.html" rel="nofollow noreferrer">listreceivedbyaddress — Bitcoin</a></p>

CC BY-SA 4.0
2023-11-08T15:14:31.287Z
2023-11-10T17:04:59.863Z
2023-11-10T17:04:59.863Z
Kirti Singh
<p>I have written a program in Python3 that allows you to search for any address on bitcoin core whether it belongs to your wallet or not.</p>
<p>Here is the github link:</p>
<p><a href="https://github.com/ORP967/Bitcoin_Core_RPC_par_address" rel="nofollow noreferrer">https://github.com/ORP967/Bitcoin_Core_RPC_par_address</a></p>
<p>Let me know what you think or if you have any improvements you might have.</p>

CC BY-SA 4.0
2022-01-23T23:03:56.210Z
2022-01-23T23:03:56.210Z
ORP967
<p><strong>Edit: Answer to the question: How to get private keys out of Bitcoin Core</strong></p>
<p>After you found your addresses (by using the commands I listed below, for example) you can execute the folllowing command:</p>
<pre><code>dumpprivatekey 1ofYourAddresses
</code></pre>
<p>If your wallet is password protected and locked run:</p>
<pre><code>walletpassphrase &quot;your password or passphrase&quot; 600
</code></pre>
<p>And 'walletlock' when you're done to re-lock it.</p>
<p>You can easily recognize addresses from Private Keys because addresses start always with one (1), Private Keys instead start with 5, K or L. You don't need to manage public keys at all. Also you just need the Private key to export/import a &quot;wallet&quot;, in fact a private key is a wallet, and from that ypthe software can find out the address(es) that correspond to it, so you need just to export that.</p>
<hr />
<p><strong>Answer to the original question: How to get public address in Bitcoin Core</strong></p>
<p><strong>Warning:</strong> <a href="https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.18.0.md#deprecated-or-removed-rpcs" rel="nofollow noreferrer">The 'account' API which is used below has been removed since v0.18</a> *</p>
<p><strong>Your main</strong> (first) <strong>bitcoin account</strong> in Bitcoin Core and bitcoin-qt <strong>is the empty-string account, '&quot;&quot;'</strong>.</p>
<p>To get your bitcoin addresses via bitcoin-cli or via the bitcoin-qt console, for your main account, <strong>use</strong>:</p>
<pre><code>getaccountaddress &quot;&quot;
</code></pre>
<p>That will return your first address of the main account, and:</p>
<pre><code>getaddressesbyaccount &quot;&quot;
</code></pre>
<p>Will return (at first launch two addresses and in general) the list of all your addresses associated with your main account.</p>
<hr />
<p>This is an example output of the <code>getaddressesbyaccount</code> call on a newly installed bitcoin-qt:</p>
<pre><code>&gt; bitcoin-cli getaddressesbyaccount &quot;&quot;

[
    &quot;1AA37Akj16aj9nU4NYgx2cRwjgmuwpxR6Z&quot;,
    &quot;1CbkkAbB7ootHHu9Fhbh8TtRR2iiCoNCZD&quot;
]
</code></pre>
<hr />
<p>This is the minimal <code>~/.bitcoin/bitcoin.conf</code> you want to have to be able to run <code>bitcoin-qt</code> with the CLI enabled, this way you can understand which accounts and addresses you own and their balances etc. from the UI.</p>
<pre><code>rpcuser=bitcoin
rpcpassword=TYPE_A_STRONG_PASS_HERE

# enables deamon in bitcoin-qt
server=1
</code></pre>

CC BY-SA 3.0
2016-02-01T22:07:10.533Z
These two commands give me my first receiving address, and then a list of all receiving addresses associated with my account. I can already access them through File->Receiving addresses. I'm trying to get my 'publicaddress' or public key. I need these when I enter the dumpprivkey "INSERT PUBLIC ADDRESS/PUBLIC KEY". Any idea how I could find this?
Rhys Cole
CC BY-SA 3.0
2016-02-01T23:10:03.430Z
It seems you are trying to dump your private keys, not list your addresses, In that case I'll edit this answer
makevoid
CC BY-SA 3.0
2016-02-02T00:40:55.310Z
@RhysCole: You need either your public address or your public key. These are related but not the same, and any of them will suffice. You already know your address - it's what your friend used to send coins to you. use it with the dumpprivkey command, e.g.

dumpprivkey 1Jd6J5FaPiUYLHbqtybqaXuTUgvw65Us1R
Meni Rosenfeld
CC BY-SA 3.0
2016-02-02T05:28:03.853Z
Hi, thanks again for all your help. I just did what you suggested, I used the original address my friend used which is also on the receiving addresses on my bitcoin core. However when I used the dumpprivkey "" command with that address, the reply was Invalid Bitcoin address (code -5). Do you have any other suggestions? If not is there any other way I can get access to the coins, or transfer them some other way?
Rhys Cole
CC BY-SA 3.0
2016-02-02T07:08:35.520Z
As Mani and me told you, step 1: find your address, it starts with 1, getaccountaddress "" will return an address for example, step 2, use that address in the dump function: dumpprivatekey 1................, it will give a private key, you can recognize it because it starts with 5
makevoid
CC BY-SA 4.0
2019-07-08T10:08:31.687Z
When running `bitcoin-cli getaddressesbyaccount ""` I get: `error code: -32601 error message: Method not found`. I am using *Bitcoin Core RPC client version v0.18.0.0-g2472733a24a9364e4c6233ccd04166a26a68cc65*.
kitsune
CC BY-SA 4.0
2019-09-25T15:02:43.933Z
Those methods have been removed. I would appreciate if @makevoid could update the answer or at least give a hint.
bomben
CC BY-SA 4.0
2016-02-01T01:25:34.410Z
2022-03-21T10:32:14.437Z
2022-03-21T10:32:14.437Z
makevoid
<p>In a world of pain at the moment. I downloaded Bitcoin Core, and before I realised I'd need the complete downloaded Blockchain, my friend transferred some coins to my address. </p>

<p>I did some research and am trying to import my Bitcoin core private keys to Blockchain, therefore having access to my coins. My problem is, I can't get my public address. I have tried using several commands in the console window, and are able to unlock and lock. I've used 'listaddressgroupings' - which works, but the return is "[" and then "]" directly below? </p>

<p>I've also used <em>getaccountaddress</em> and <em>getaddressesbyaccount "Your Address"</em> with no luck. </p>

<p>Many thanks</p>

CC BY-SA 3.0
2016-01-31T22:38:01.943Z
Listing my bitcoin addresses
Listing the bitcoin addresses in your wallet is easily done via listreceivedbyaddress. It normally lists only addresses which already have received transactions, however you can list all the addresses by setting the first argument to 0, and the second one to true. *I've just seen this on a wiki page, I haven't received any transactions yet, because the blockchain hasn't downloaded fully. I don't understand how to enter the first argument to 0, and the second one to true. Additionally, what is my account name? Where would I find it?
Rhys Cole
CC BY-SA 3.0
2016-02-01T17:12:55.300Z
You can't get your public address? If you need to move bitcoin from a bitcoin core wallet don't you need the private keys?
Mark S.
<bitcoin-core><public-key><private-key-import>
How do I get my public address in Bitcoin Core?
Rhys Cole
# How do I get my public address in Bitcoin Core?

(Asked by: username_0 on 2016-01-31)

In a world of pain at the moment. I downloaded Bitcoin Core, and before I realised I'd need the complete downloaded Blockchain, my friend transferred some coins to my address.

I did some research and am trying to import my Bitcoin core private keys to Blockchain, therefore having access to my coins. My problem is, I can't get my public address. I have tried using several commands in the console window, and are able to unlock and lock. I've used 'listaddressgroupings' - which works, but the return is "[" and then "]" directly below?

I've also used *getaccountaddress* and *getaddressesbyaccount "Your Address"* with no luck.

Many thanks

**Tags:** bitcoin-core, public-key, private-key-import

> **Comments:**
> **username_0**: Listing my bitcoin addresses Listing the bitcoin addresses in your wallet is easily done via listreceivedbyaddress. It normally lists only addresses which already have received transactions, however you can list all the addresses by setting the first argument to 0, and the second one to true. *I've just seen this on a wiki page, I haven't received any transactions yet, because the blockchain hasn't downloaded fully. I don't understand how to enter the first argument to 0, and the second one to true. Additionally, what is my account name? Where would I find it?  
> **username_1**: You can't get your public address? If you need to move bitcoin from a bitcoin core wallet don't you need the private keys?  

---

## 4 answers

### Answer by username_6 on 2016-02-01. Score: 12 | Accepted answer

Edit: Answer to the question: How to get private keys out of Bitcoin Core
After you found your addresses (by using the commands I listed below, for example) you can execute the folllowing command:
dumpprivatekey 1ofYourAddresses

If your wallet is password protected and locked run:
walletpassphrase "your password or passphrase" 600

And 'walletlock' when you're done to re-lock it.
You can easily recognize addresses from Private Keys because addresses start always with one (1), Private Keys instead start with 5, K or L. You don't need to manage public keys at all. Also you just need the Private key to export/import a "wallet", in fact a private key is a wallet, and from that ypthe software can find out the address(es) that correspond to it, so you need just to export that.

Answer to the original question: How to get public address in Bitcoin Core
Warning: The 'account' API which is used below has been removed since v0.18 *
Your main (first) bitcoin account in Bitcoin Core and bitcoin-qt is the empty-string account, '""'.
To get your bitcoin addresses via bitcoin-cli or via the bitcoin-qt console, for your main account, use:
getaccountaddress ""

That will return your first address of the main account, and:
getaddressesbyaccount ""

Will return (at first launch two addresses and in general) the list of all your addresses associated with your main account.

This is an example output of the getaddressesbyaccount call on a newly installed bitcoin-qt:
> bitcoin-cli getaddressesbyaccount ""

[
    "1AA37Akj16aj9nU4NYgx2cRwjgmuwpxR6Z",
    "1CbkkAbB7ootHHu9Fhbh8TtRR2iiCoNCZD"
]


This is the minimal ~/.bitcoin/bitcoin.conf you want to have to be able to run bitcoin-qt with the CLI enabled, this way you can understand which accounts and addresses you own and their balances etc. from the UI.
rpcuser=bitcoin
rpcpassword=TYPE_A_STRONG_PASS_HERE

# enables deamon in bitcoin-qt
server=1

> **Comments:**
> **username_0**: These two commands give me my first receiving address, and then a list of all receiving addresses associated with my account. I can already access them through File->Receiving addresses. I'm trying to get my 'publicaddress' or public key. I need these when I enter the dumpprivkey "INSERT PUBLIC ADDRESS/PUBLIC KEY". Any idea how I could find this?  
> **username_6**: It seems you are trying to dump your private keys, not list your addresses, In that case I'll edit this answer  
> **username_7**: @RhysCole: You need either your public address or your public key. These are related but not the same, and any of them will suffice. You already know your address - it's what your friend used to send coins to you. use it with the dumpprivkey command, e.g.  dumpprivkey 1Jd6J5FaPiUYLHbqtybqaXuTUgvw65Us1R  
> **username_0**: Hi, thanks again for all your help. I just did what you suggested, I used the original address my friend used which is also on the receiving addresses on my bitcoin core. However when I used the dumpprivkey "" command with that address, the reply was Invalid Bitcoin address (code -5). Do you have any other suggestions? If not is there any other way I can get access to the coins, or transfer them some other way?  
> **username_6**: As Mani and me told you, step 1: find your address, it starts with 1, getaccountaddress "" will return an address for example, step 2, use that address in the dump function: dumpprivatekey 1................, it will give a private key, you can recognize it because it starts with 5  
> **username_8**: When running `bitcoin-cli getaddressesbyaccount ""` I get: `error code: -32601 error message: Method not found`. I am using *Bitcoin Core RPC client version v0.18.0.0-g2472733a24a9364e4c6233ccd04166a26a68cc65*.  
> **username_9**: Those methods have been removed. I would appreciate if @username_6 could update the answer or at least give a hint.  

---

### Answer by username_2 on 2017-07-05. Score: 4

Using the bitcoin-cli or the bitcoin-qt console, enter the command:
validateaddress "ADDRESS_BASE58_ENCODED"

Where ADDRESS_BASE58_ENCODED is the address for which you want to know the public key.

> **Comments:**
> **username_3**: I think this the correct answer. "pubkey" field holds the public key.  

---

### Answer by username_4 on 2023-11-08. Score: 2

Use the following command to get all the receiving addresses.

> bitcoin-cli listreceivedbyaddress 0 true

'0' represents no minimum number of confirmations.
'true' is for including addresses which have not received any payments.

For reference: [listreceivedbyaddress — Bitcoin](https://developer.bitcoin.org/reference/rpc/listreceivedbyaddress.html)


---

### Answer by username_5 on 2022-01-23. Score: 0

I have written a program in Python3 that allows you to search for any address on bitcoin core whether it belongs to your wallet or not.

Here is the github link:

<https://github.com/username_5/Bitcoin_Core_RPC_par_address>

Let me know what you think or if you have any improvements you might have.


---

