Search code examples
language-agnosticbitcoin

Receiving payments from users with bitcoin


What is the correct way to receive a payment from a specific user?

I thought I could create a new address for each user, but bitcoind has no option to delete addresses (when a user deletes their account from my site).

I could do the above but (instead of deleting the old accounts when they are no longer needed) recycle them when new users join.


Solution

  • The recommended method is to generate a unique receiving address for each user. The idiom is to not care terribly about how many addresses you're using. They're lightweight and any money sent to them can never be recovered once the private key is deleted.

    Using an address pool is a little heavyweight for this situation. Usually the only real complaint is that GUIs become crowded once there are enough addresses, but since you're using RPC-JSON you'll never have to deal with that.