<p>You cannot; Bitcoin has no concept of a &quot;sender&quot; of a transaction.</p>
<p>If you want to know which invoice/bill has been paid, give out a new address for every payment you expect.</p>
<p>Bitcoin block explorer sites sometimes do show the &quot;input addresses&quot; of a transaction, but these do not have the properties you generally expect from a sender:</p>
<ul>
<li>There may be 1, or more, or even no identifiable input addresses.</li>
<li>The addresses may not all belong to the sender, in case of a payjoin transaction.</li>
<li>The addresses may not belong to the sender at all. For example if the sender uses an exchange site, the addresses you see will belong to the exchange.</li>
<li>You don't know anything about where money goes if you'd try to send coins back there. If you want a refund address, you need to ask the payer for one.</li>
</ul>

CC BY-SA 4.0
2022-05-02T05:32:52.110Z
If I know the public address of my client's wallet, how do I know when and when BTC has been sent to my wallet? How can I do that query?
evvrivas
CC BY-SA 4.0
2022-05-02T07:53:43.033Z
As Pieter wrote, a wallet doesn't have an address. A wallet has control over "coins" previously sent to many "addresses" created by that wallet for receiving that money. When you are paid, the sender's wallet chooses which coins to use to make up the amount and thus what  "addresses" to use. The user usually has no control over which coins (and therefore addresses) are used unless their wallet offers a feature called coin control and the user chooses to use it. All addresses are functionally like an invoice-reference-number.
RedGrittyBrick
CC BY-SA 4.0
2022-05-02T13:11:44.953Z
@evvrivas For the reasons I elaborated on above, that does not work; Bitcoin simply has no concept of a "sender address". If you want to determine which client paid you, give each client a separate address, and remember which address belongs to whom.
Pieter Wuille
CC BY-SA 4.0
2022-05-02T02:54:21.733Z
2022-05-02T02:54:21.733Z
Pieter Wuille
<p>That won't work: Bitcoin transactions do not reliably identify the sender.</p>
<p>Bitcoin addresses are unlike (e)mail addresses. Think of bitcoin addresses as &quot;invoice identifiers&quot;: whenever you want to get paid, request to be paid to a new address on your invoice. Then, whenever you get paid, you know which invoice was paid.</p>
<p>Bitcoin wallets have many addresses and addresses should not be reused.</p>

CC BY-SA 4.0
2022-05-02T16:47:38.677Z
2022-05-02T16:47:38.677Z
Murch
<p>I have a website that will show a QR code of my bitcoin wallet (public key), I will ask the client to deposit bitcoins there, I want to know which wallet (public key) was the one that deposited this in order to know which client is paying for a service that I am going to give you. I am using Python and Django to create the WEB page</p>

<transactions>
how to know the public address of a wallet that sent me funds (bitcoins), using python
evvrivas
# how to know the public address of a wallet that sent me funds (bitcoins), using python

(Asked by: username_0 on 2022-05-02)

I have a website that will show a QR code of my bitcoin wallet (public key), I will ask the client to deposit bitcoins there, I want to know which wallet (public key) was the one that deposited this in order to know which client is paying for a service that I am going to give you. I am using Python and Django to create the WEB page

**Tags:** transactions


---

## 2 answers

### Answer by username_1 on 2022-05-02. Score: 2

You cannot; Bitcoin has no concept of a "sender" of a transaction.

If you want to know which invoice/bill has been paid, give out a new address for every payment you expect.

Bitcoin block explorer sites sometimes do show the "input addresses" of a transaction, but these do not have the properties you generally expect from a sender:

* There may be 1, or more, or even no identifiable input addresses.
* The addresses may not all belong to the sender, in case of a payjoin transaction.
* The addresses may not belong to the sender at all. For example if the sender uses an exchange site, the addresses you see will belong to the exchange.
* You don't know anything about where money goes if you'd try to send coins back there. If you want a refund address, you need to ask the payer for one.

> **Comments:**
> **username_0**: If I know the public address of my client's wallet, how do I know when and when BTC has been sent to my wallet? How can I do that query?  
> **username_2**: As username_1 wrote, a wallet doesn't have an address. A wallet has control over "coins" previously sent to many "addresses" created by that wallet for receiving that money. When you are paid, the sender's wallet chooses which coins to use to make up the amount and thus what  "addresses" to use. The user usually has no control over which coins (and therefore addresses) are used unless their wallet offers a feature called coin control and the user chooses to use it. All addresses are functionally like an invoice-reference-number.  
> **username_1**: @username_0 For the reasons I elaborated on above, that does not work; Bitcoin simply has no concept of a "sender address". If you want to determine which client paid you, give each client a separate address, and remember which address belongs to whom.  

---

### Answer by username_3 on 2022-05-02. Score: 2

That won't work: Bitcoin transactions do not reliably identify the sender.

Bitcoin addresses are unlike (e)mail addresses. Think of bitcoin addresses as "invoice identifiers": whenever you want to get paid, request to be paid to a new address on your invoice. Then, whenever you get paid, you know which invoice was paid.

Bitcoin wallets have many addresses and addresses should not be reused.


---

