I think this is one of the most difficult concepts to get one's head around. I suspect it's because we "want" to think of them as being analogous to bank accounts, plus of course the shorthand habit of referring to them as "wallets" means one's instinct as to consider them as a place where you put "money" and if you put it there, then it stands to reason that is where you expect to take it from.
An address is not a wallet. A wallet is a collection of one
or more addresses along with the private keys necessary to spend any bitcoins received at that wallet.
If you think of a bitcoin address as an invoice number, then the idea that there is no "sent from" address makes a lot more sense.
I can give out a dozen invoices to people that are going to pay me. Each of them will include the invoice number when they send their payment. They can even think of it as sending the money to the invoice. Then when I receive the cash, it all goes into the wallet in my back pocket. Later when I buy something, I don't take the money "from and invoice number", I just take money out of my wallet. My wallet doesn't have an identifier that I supply to the grocery store.
Another thing to remember is that, at the protocol level, there aren't any addresses. There are only scripts that encumber an output with a requirement that must be met before the output can be used as an input to a transaction. We humans use "addresses" as a convenient shorthand to request a particular script on our outputs, but other scripts that aren't currently encodable as an address can also exist.
- snip -
- Provide each user a unique "deposit" bitcoin address to send to. This now means I need to create and manage a pub/private key pair for each user, and then monitor each of these for incoming payments. Not my favorite approach. Tedious and more spammy.
- snip -
Addresses are not account numbers. You shouldn't re-use addresses. You should think of an address more like an invoice number. It is a unique identifier that you give to someone so that they can send you a payment. If they will send you a new payment, they should get a new address. You should give a new address for EVERY payment you will receive.
Out of curiosity, is this a philosophical thing? I mean -- why not use an address as an account number? Technically, it is feasible, right? You are holding a certain private key, and that private key translates to some unique public key that translates to a specific BTC address.
Yes, you
CAN use a bitcoin address as an "account number" if you want to, but you
CAN'T FORCE everyone else to do the same. If you choose to operate a service where you expect all your users to use bitcoin addresses as account numbers, then you need to make this VERY clear to any and all potential users. Unfortunately, many users don't understand how their chosen method of storing bitcoins works, so they'll attempt to use your service and then be surprised when they discover that it doesn't work properly. They may not know all their addresses, they may not control their private key, or they may be using a service that stores bitcoins with scripts other than version 1 and version 3.
As an example, any casual user of Bitcoin Core will have new addresses generated for them without their knowledge every time they send a transaction. The change from their transaction will be sent to this new address. They won't know what the new address is, it won't show up anywhere in the user interface. If you ask them what their "sending address" or "wallet address" is, they'll give you a RECEIVING address. Then when they send bitcoins from the wallet, the bitcoins will appear to come "from" an address that they don't know anything about.
As another example, a user may have just purchased bitcoins at localbitcoins.com. Then they may send the bitcoins to you from their localbitcoins.com
account. They won't have any control at all over what the "sending" address is. Localbitcoins will simply send from their own wallet and then adjust the database entry for their user's account in their own system. If you send bitcoins "back" to ANY of the addresses that look like "sending" address in that transaction, the user will NOT receive the bitcoins back. Instead localbitcoins will receive the bitcoins in their own wallet and won't know which of their thousands of users the bitcoins were supposed to be credited to.
As another example, someone may create a complex output script that can not currently be encoded as an address. They may send their bitcoins to an output that is encumbered with this script. Then later when they spend the output to send bitcoins to you, you won't be able to find any sending "address" at all.
It is a "philosophical thing" that
YOU shouldn't use your own bitcoin address as an account. It is NOT a "philosophical thing" that you can't assume that
EVERYONE ELSE is using their bitcoin addresses as accounts.
So is this suggestion there to increase and maintain anonymity?
You do increase personal privacy and anonymity, as well as improving the fungible nature of bitcoins by using a new address for every transaction. However, there are many other reasons that a service shouldn't try to guess what someone's address is. There are security reasons that a service should provide a new address for every transaction.
Even if a user keeps using different "throwaway" BTC addresses for each payment, these are each funded by their "master" BTC address, right?
No. That is not how bitcoin works. I'm using Bitcoin Core, and every transaction I have ever received goes to a brand new randomly generated address. There is no "master address". When I want bitcoins, I click the "Request Payment" button, and the wallet generates a BRAND NEW address for me. Then I give this address to the person that is sending me the bitcoins. Once I close the "Request Payment" window, the address disappears, and I never see the address again. There are some wallets and services that allow users to re-use addresses, but I tend to avoid those services when possible. Any service that is lazy enough to create such a poor design can't be trusted to safely handle my bitcoins.
Or is this not true due to your "unspent" outputs statement?
Correct. At the protocol level, there are no "addresses". There are no "accounts". There are no "balances". These are all words that we humans use to abstract the underlying process to make it easier to talk about the transfer of control over value. In reality there are only transactions that use previously unspent outputs as inputs and which create new unspent outputs. Outputs are encumbered with a requirement (in the form of a computer program called a "script") that must be met in order to be used as inputs. We have taken just two of those scripts and decided that they are common enough that they can be assigned a version number (version 1 scripts, and version 3 scripts). Then we use that version number along with a chunk of data that is necessary for building the script and a checksum to prevent typing errors. We concatenate those three pieces of information, and call it an "address". Meanwhile, there can be outputs that are encumbered with a script that is neither version 1, nor version 3. Such an output cannot currently be encoded as an address at all.