1

I'm new to bitcoin and want to take payments with it on my website. Taking payment isn't a problem but the manually process of verifying payments and matching up with users is.

Is there any way to use an API to search the transactions to my address and look for specific text in the "message" field?

Thanks Matt

6
  • 2
    There is no "message" field in Bitcoin transactions. – Anonymous Dec 20 '20 at 13:16
  • Oh then I misunderstood. Because I can make a QR code that includes a message or "description". When I scan it my bitcoin wallet shows this in the send dialog box. I wanted to include there like a user ID which I could match up to my back end database – Matt Deemer Dec 20 '20 at 13:29
  • 1
    That's a message to appear in their wallet about who they paid to. It isn't part of the transaction, it isn't immutable. You need to give a unique payment address to every person who pays you, and that's how you know who paid you. This is how all services operate. – Anonymous Dec 20 '20 at 13:41
  • Aaah ok thank you, now I understand. So the message won't arrive at my wallet. I'll continue my search for how to correctly implement payments on my site then. – Matt Deemer Dec 20 '20 at 13:43
  • 3
    @MattDeemer you should probably look for integrated solutions, such as btcpayserver. If you still want to go with bitcoind, look for the listunspent call exposed by the JSONRPC API. – darosior Dec 20 '20 at 15:27
2

There is no "message" field in Bitcoin transactions, only the payment information is transferred on the network. While you can generate a label for a payment requests on your end, or include a label in the QR code for the benefit of the payer, neither would be transferred on the Bitcoin network. The proper way of distinguishing payments on Bitcoin is to give each payment a unique invoice address.

Instead of using plain Bitcoin Core, you may want to take a look at BTCPay Server, which is a self-hosted open-source payment processing solution that facilitates on-chain and Lightning Network payments. If you want to continue using Bitcoin Core, look into the listunspent call.

H/T to @Anonymous and @darosior, whose comments I've collected to write this answer.

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.