<p>There is no such thing as a public key for a <em>user</em>, but there is such a thing as a public key for an <em>address</em>.  The transaction that has been paid to you probably contains more than one address owned by the sender.  First, the bitcoin in the transaction likely came from multiple <a href="https://bitcoin.org/en/glossary/unspent-transaction-output" rel="nofollow">unspent transaction outputs (UTXOs)</a>, all of which were owned by the sender and probably have different addresses.  Next, the transaction likely had a <a href="https://en.bitcoin.it/wiki/Change" rel="nofollow">change output</a>, which would be yet another address owned by the sender.</p>

<p>Any of the UTXO's used as inputs to the transaction would have had the public keys of the addresses revealed in the <a href="https://bitcoin.org/en/glossary/signature-script" rel="nofollow">scriptSig</a> that was used for the input to sign the bitcoin over to you.  You can find these scripts by using a <a href="https://en.bitcoin.it/wiki/Category:Block_chain_browsers" rel="nofollow">block explorer</a>.  They will each contain a <a href="https://bitcoin.org/en/developer-guide#term-signature-script" rel="nofollow">public key and a signature</a>.</p>

<p>If the change output has already been spent by the user, you can find that transaction and look up the public key in the scriptSig there as well.</p>

<p>Keep in mind that none of this information is specific to <em>your</em> wallet, as it is all public information on the blockchain.  The only information you have that I don't have is the specific transaction you are referring to.  Given that transaction ID, anyone and everyone can look up this information.</p>

CC BY-SA 3.0
2016-06-13T00:49:21.983Z
2016-06-13T00:49:21.983Z
Jestin
<p>Is it possible to get the <code>public key</code> of a user, if we have a <code>transaction</code> from that User in my wallet ?</p>

CC BY-SA 3.0
2016-06-12T21:28:34.270Z
The public/private key is unique to the wallet. Each wallet can have multiple public/private keys (accounts). Which wallet are you using?
user2277550
<transactions><public-key>
Recovering the public key from a transaction
jgm
# Recovering the public key from a transaction

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

Is it possible to get the `public key` of a user, if we have a `transaction` from that User in my wallet ?

**Tags:** transactions, public-key

> **Comments:**
> **username_1**: The public/private key is unique to the wallet. Each wallet can have multiple public/private keys (accounts). Which wallet are you using?  

---

## 1 answers

### Answer by username_2 on 2016-06-13. Score: 4 | Accepted answer

There is no such thing as a public key for a *user*, but there is such a thing as a public key for an *address*. The transaction that has been paid to you probably contains more than one address owned by the sender. First, the bitcoin in the transaction likely came from multiple [unspent transaction outputs (UTXOs)](https://bitcoin.org/en/glossary/unspent-transaction-output), all of which were owned by the sender and probably have different addresses. Next, the transaction likely had a [change output](https://en.bitcoin.it/wiki/Change), which would be yet another address owned by the sender.

Any of the UTXO's used as inputs to the transaction would have had the public keys of the addresses revealed in the [scriptSig](https://bitcoin.org/en/glossary/signature-script) that was used for the input to sign the bitcoin over to you. You can find these scripts by using a [block explorer](https://en.bitcoin.it/wiki/Category:Block_chain_browsers). They will each contain a [public key and a signature](https://bitcoin.org/en/developer-guide#term-signature-script).

If the change output has already been spent by the user, you can find that transaction and look up the public key in the scriptSig there as well.

Keep in mind that none of this information is specific to *your* wallet, as it is all public information on the blockchain. The only information you have that I don't have is the specific transaction you are referring to. Given that transaction ID, anyone and everyone can look up this information.


---

