<p>The following code worked for me in the Electrum console and was able to give me all of the addresses in a single command.</p>
<pre class="lang-python prettyprint-override"><code>for i in listaddresses(): print(i + &quot; = &quot; + getpubkeys(i)[0])
</code></pre>

CC BY-SA 4.0
2024-03-29T00:54:09.143Z
2024-04-02T03:18:56.233Z
2024-04-02T03:18:56.233Z
okw
<p>You cannot get all of them in one go. You can call <code>getpubkeys("address")</code> for each address (or do it via the GUI by going to the Addresses tab, right clicking on an address, and selecting "Public Keys")</p>

<p>Alternatively, you can get your master public keys (xpub) and derive from those.</p>

CC BY-SA 4.0
2018-07-28T08:58:17.950Z
Thank you for the input!
Would I be better off generating them directly from the xPub using something that generates addresses in the same fashion?
cpe871
CC BY-SA 4.0
2018-07-28T09:07:15.233Z
If you're doing it often enough, having the xpub will likely help/save time. Electrum's client is open source, so you should be able to find the xpub->address code in there, and plenty of implementations exist in other languages
Raghav Sood
CC BY-SA 4.0
2018-07-28T08:39:32.393Z
2018-07-28T08:39:32.393Z
Raghav Sood
<p>I am looking for a way to extract all of the public keys associated with my electrum wallet. I am aware that listaddresses() does this for public addresses, such as 1CWX7o1Ppe4JpEpSLmuovU4HFY3D6Ay24C  - however, I am looking to extract the public keys, such as 02b96c2739e9543bdc17bbe58b73a3a9a16aedf2ed554faca9e5acf0b279f5d0e1.</p>

<electrum><public-key><private-key-export>
How would one extract the list of public keys from Electrum wallet?
cpe871
# How would one extract the list of public keys from Electrum wallet?

(Asked by: username_0 on 2018-07-28)

I am looking for a way to extract all of the public keys associated with my electrum wallet. I am aware that listaddresses() does this for public addresses, such as 1CWX7o1Ppe4JpEpSLmuovU4HFY3D6Ay24C - however, I am looking to extract the public keys, such as 02b96c2739e9543bdc17bbe58b73a3a9a16aedf2ed554faca9e5acf0b279f5d0e1.

**Tags:** electrum, public-key, private-key-export


---

## 2 answers

### Answer by username_1 on 2024-03-29. Score: 1

The following code worked for me in the Electrum console and was able to give me all of the addresses in a single command.

```python
for i in listaddresses(): print(i + " = " + getpubkeys(i)[0])

```


---

### Answer by username_2 on 2018-07-28. Score: 1

You cannot get all of them in one go. You can call `getpubkeys("address")` for each address (or do it via the GUI by going to the Addresses tab, right clicking on an address, and selecting "Public Keys")

Alternatively, you can get your master public keys (xpub) and derive from those.

> **Comments:**
> **username_0**: Thank you for the input! Would I be better off generating them directly from the xPub using something that generates addresses in the same fashion?  
> **username_2**: If you're doing it often enough, having the xpub will likely help/save time. Electrum's client is open source, so you should be able to find the xpub->address code in there, and plenty of implementations exist in other languages  

---

