0

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

2 Answers 2

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.
3
  • 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
    May 2 at 5:32
  • 2
    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. May 2 at 7:53
  • 1
    @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. May 2 at 13:11
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.