<p>To be honest, it IS possible, but you need a signature made by that address. From that point, you can get the public key.</p>

<p>See this piece of code: <a href="https://github.com/bitcoinjs/bitcoinjs-message/blob/master/index.js#L57" rel="noreferrer">https://github.com/bitcoinjs/bitcoinjs-message/blob/master/index.js#L57</a></p>

CC BY-SA 3.0
2017-06-28T14:01:34.233Z
2017-06-28T14:01:34.233Z
Peter Willemsen
<p>It is impossible.  Given an ECDSA (compressed 65Bytes or not 33Bytes) public-key K, a Bitcoin
address is generated using the cryptographic hash functions SHA-256 and RIPEMD-160.
The public-key is hashed twice: HASH160 = RIPEMD-160(SHA-256(K)). The Bitcoin address is computed directly from this HASH160 value as</p>

<pre><code>base58(0x00 || HASH160 || bSHA-256(SHA-256(0x00 || HASH160))/2224c). "||=concatenation"
</code></pre>

<p><a href="https://i.sstatic.net/AcXYt.png" rel="noreferrer"><img src="https://i.sstatic.net/AcXYt.png" alt="enter image description here"></a></p>

<p>so it is impossible to reverse the hash to get the public key.</p>

CC BY-SA 4.0
2019-03-28T01:21:11.383Z
@PieterWuille : but payment transactions are performed to a pubkey… Right ?
user2284570
CC BY-SA 4.0
2019-03-28T11:40:57.053Z
it depends on the transaction type
Badr Bellaj
CC BY-SA 4.0
2019-03-28T11:45:30.817Z
I wrote this in the sense this is a requirement.
user2284570
CC BY-SA 4.0
2019-03-28T15:23:56.833Z
the pub key is shared with the network so no need to reverse an address to get the pubkey
Badr Bellaj
CC BY-SA 4.0
2019-03-28T19:32:03.100Z
@user2284570 What is a "payment transaction"?
Pieter Wuille
CC BY-SA 4.0
2019-03-28T21:32:42.697Z
@PieterWuille a transaction which bear value with a receipient which is not a miner.
user2284570
CC BY-SA 4.0
2019-03-28T21:41:38.307Z
In that case, no; there are almost no pay-to-pubkey outputs at all.
Pieter Wuille
CC BY-SA 4.0
2020-04-04T16:16:15.413Z
@BadrBellaj -- you wrote: "the pub key is shared with the network so no need to reverse an address to get the pubkey" -- So can the public key be retrieved from the network?
tufelkinder
CC BY-SA 4.0
2021-05-15T19:25:22.400Z
I just started to learn bitcoin today. By Socratic deduction, I read that a hash represents on behalf of the public key in order to hide the public key. Therefore, I conclude that the public key can never be retrieved from its hash.
daparic
CC BY-SA 3.0
2016-10-06T11:38:31.087Z
2016-10-06T15:21:27.397Z
2016-10-06T15:21:27.397Z
Badr Bellaj
<p>It is impossible to compute the public key of an address, as the address is computed from the hash of the public key. You can retrieve the public key from address with the reference client using the <code>validateaddress</code> RPC call (or in the debug window of Bitcoin-Qt), but that simply fetches it from the wallet, and only works if the address belongs to you.</p>
<p>Update: you need to use <code>getaddressinfo</code> now instead of <code>validateaddress</code>.</p>

CC BY-SA 3.0
2013-06-13T20:07:02.600Z
I would like to encrypt messages by abusing bitcoin/namecoin signing keys as encryption keys. see: https://bitcointalk.org/index.php?topic=145098    I am aware there might be peripheral risks to using the same keys for signing and encryption.
kermit
CC BY-SA 3.0
2016-01-11T02:30:16.517Z
To elaborate, a public key is 33 bytes long, whereas an address is a 20-byte hash of the public key. Because the information is smaller, therefore it is impossible to compute the correct public key from an address.
Nayuki
CC BY-SA 3.0
2016-01-23T21:27:24.323Z
don't i need the full pub key for an address i do NOT own when creating a new multisig address with "addmultisigaddress"?
Albert S
CC BY-SA 3.0
2017-07-26T08:30:28.440Z
Wait, shouldn't it be possible to lookup int he blockchain and see if that person spent from that address and then get the public key used to sign the transaction?
Guerlando OCs
CC BY-SA 4.0
2019-03-28T01:21:07.093Z
@PieterWuille : but payment transactions are performed to a pubkey… Right ?
user2284570
CC BY-SA 4.0
2019-03-28T01:48:46.310Z
What are "payment transactions"?
Pieter Wuille
CC BY-SA 4.0
2020-02-01T11:43:00.387Z
@user2284570 Bitcoin transactions have an input and output address and are normally sent to a "pubkey hash", not a "pubkey". A bitcoin address is just a pubkey hash with a header and checksum bytes appended then encoded with base58checked. So you can go from a bitcoin address to a pubkey hash without a problem.
dodgy_coder
CC BY-SA 4.0
2013-06-13T08:21:14.967Z
2020-12-02T18:21:51.783Z
2020-12-02T18:21:51.783Z
Pieter Wuille
<p>It is possible to get it from here:
<a href="https://blockchain.info/de/q/pubkeyaddr">https://blockchain.info/de/q/pubkeyaddr</a>
<a href="https://blockchain.info/q">https://blockchain.info/q</a></p>

<p>Is it possible with the standard client? How?</p>

<p>I am aware that the blockchain only contains the pubkey after a tx from that address.</p>

<public-key>
Is it possible to get the public key of a bitcoin address I do not have the private keys for with the standard client?
kermit
# Is it possible to get the public key of a bitcoin address I do not have the private keys for with the standard client?

(Asked by: username_0 on 2013-06-12)

It is possible to get it from here:
<https://blockchain.info/de/q/pubkeyaddr>
<https://blockchain.info/q>

Is it possible with the standard client? How?

I am aware that the blockchain only contains the pubkey after a tx from that address.

**Tags:** public-key


---

## 3 answers

### Answer by username_4 on 2013-06-13. Score: 28 | Accepted answer

It is impossible to compute the public key of an address, as the address is computed from the hash of the public key. You can retrieve the public key from address with the reference client using the `validateaddress` RPC call (or in the debug window of Bitcoin-Qt), but that simply fetches it from the wallet, and only works if the address belongs to you.

Update: you need to use `getaddressinfo` now instead of `validateaddress`.

> **Comments:**
> **username_0**: I would like to encrypt messages by abusing bitcoin/namecoin signing keys as encryption keys. see: https://bitcointalk.org/index.php?topic=145098    I am aware there might be peripheral risks to using the same keys for signing and encryption.  
> **username_7**: To elaborate, a public key is 33 bytes long, whereas an address is a 20-byte hash of the public key. Because the information is smaller, therefore it is impossible to compute the correct public key from an address.  
> **username_8**: don't i need the full pub key for an address i do NOT own when creating a new multisig address with "addmultisigaddress"?  
> **username_9**: Wait, shouldn't it be possible to lookup int he blockchain and see if that person spent from that address and then get the public key used to sign the transaction?  
> **username_3**: @username_4 : but payment transactions are performed to a pubkey… Right ?  
> **username_4**: What are "payment transactions"?  
> **username_10**: @username_3 Bitcoin transactions have an input and output address and are normally sent to a "pubkey hash", not a "pubkey". A bitcoin address is just a pubkey hash with a header and checksum bytes appended then encoded with base58checked. So you can go from a bitcoin address to a pubkey hash without a problem.  

---

### Answer by username_1 on 2017-06-28. Score: 14

To be honest, it IS possible, but you need a signature made by that address. From that point, you can get the public key.

See this piece of code: <https://github.com/bitcoinjs/bitcoinjs-message/blob/master/index.js#L57>


---

### Answer by username_2 on 2016-10-06. Score: 13

It is impossible. Given an ECDSA (compressed 65Bytes or not 33Bytes) public-key K, a Bitcoin
address is generated using the cryptographic hash functions SHA-256 and RIPEMD-160.
The public-key is hashed twice: HASH160 = RIPEMD-160(SHA-256(K)). The Bitcoin address is computed directly from this HASH160 value as

```
base58(0x00 || HASH160 || bSHA-256(SHA-256(0x00 || HASH160))/2224c). "||=concatenation"

```

[![enter image description here](https://i.sstatic.net/AcXYt.png)](https://i.sstatic.net/AcXYt.png)

so it is impossible to reverse the hash to get the public key.

> **Comments:**
> **username_3**: @username_4 : but payment transactions are performed to a pubkey… Right ?  
> **username_2**: it depends on the transaction type  
> **username_3**: I wrote this in the sense this is a requirement.  
> **username_2**: the pub key is shared with the network so no need to reverse an address to get the pubkey  
> **username_4**: @username_3 What is a "payment transaction"?  
> **username_3**: @username_4 a transaction which bear value with a receipient which is not a miner.  
> **username_4**: In that case, no; there are almost no pay-to-pubkey outputs at all.  
> **username_5**: @username_2 -- you wrote: "the pub key is shared with the network so no need to reverse an address to get the pubkey" -- So can the public key be retrieved from the network?  
> **username_6**: I just started to learn bitcoin today. By Socratic deduction, I read that a hash represents on behalf of the public key in order to hide the public key. Therefore, I conclude that the public key can never be retrieved from its hash.  

---

