0

I found the following statements about Bitcoin on the Ethereum SE:

When using Bitcoin one can generate new address per user of service and save pair (address -> userId), so it is always obvious which specific user sent coins.

Also, all these coins are stored in the wallet as UTXO, so it is easy to send them to another address paying fee once

I need to generate different unique deposit addresses for each user, so they can send funds to their accounts while I can keep track of how much each user deposited. This is fairly easy in other cryptos such as bitcoin

Are these statements true?

If so, can someone explain why it "is fairly easy" to do this in Bitcoin"? Doesn't Bitcoin also require UTXO Sweep when consolidating BTC from many addresses to one address? I was under the impression that BTC does not allow multiple public addresses corresponding to a single private key?

2 Answers 2

3

Yes, each UTXO needs to be spend individually, regardless of which address they were received to. I think it would be appropriate to read this advice as "at least one address per customer". Having separate addresses per customer will make it much simpler for you to track which customer's account needs to be credited than having only a single address for your service altogether. However, if you're not in a scenario where you're just taking deposits for a user, but e.g. selling products or services, I would even recommend to use a separate address for each payment process, which would make it trivial to discern not only the customer but also which invoice got settled.

Today, wallets generally use hierarchical deterministic derivation to generate many addresses from one master secret. Under the hood, each address is associated with a different private key, but all private keys can be regenerated from the master secret. This allows you to track many addresses with a single wallet, but simplifies backups and secret management.

Address reuse is terrible for both your and your users' financial privacy and has no palpable advantages when you start to consider the additional overhead of figuring out who paid with which transaction. I can only vehemently dissuade from using the same address for selling to multiple customers. If you get a lot of volume, it will be trivial for people to claim foreign payments as theirs and you will lose a lot of time investigating and acquiring proof from the actual customer. Using separate addresses may be more work in the beginning, but just gets rid of this whole class of issues.

3
  • Great response, upvoted and accepted. I agree that unique addresses is the way to go with Bitcoin. I just have one question: You mentioned that "If you get a lot of volume, it will be trivial for people to claim foreign payments as theirs and you will lose a lot of time investigating and acquiring proof from the actual customer" this statement implies that it is in fact "possible" for a customer to prove they sent certain funds despite multiple customers claiming the same thing. What "proof" can a customer provide (after the fact) that would be sufficient to prove he in fact sent those funds?
    – S.O.S
    Jan 15, 2021 at 0:03
  • Some wallets are able to sign messages with private keys they possess. You could challenge the payer to sign a message with the private key that was used to sign for one of the inputs. Unfortunately, not all wallets have this capability, especially online wallet services don't usually provide that functionality.
    – Murch
    Jan 15, 2021 at 1:02
  • Additionally, there is no provision to transfer these sort of challenges or their responses on the network, so you'd have establish an out-of-band communication channel to get that information in the first place. It's just one big hassle. Using distinct addresses for different payment processes is much more straightforward.
    – Murch
    Jan 15, 2021 at 19:24
0

Can someone explain why it "is fairly easy" to do this in Bitcoin"?

I hope you already read what all things you need to do as a workaround in other chains that use accounts.

How to create a new address in bitcoin core:

getnewaddress

Doesn't Bitcoin also require UTXO Sweep when consolidating BTC from many addresses to one address?

UTXO - Unspent Transaction Output

That's why you have "Coins" and "Addresses" as different terms. You need to spend, Unspent Transaction Output when creating a bitcoin transaction from scratch. This is different for every transaction even if they were all done to same address. You can try using createrawtransaction for better understanding.

UTXO consolidation is only preferred if you have lot of small inputs. Small here depends on amounts normally used while sending BTC from that wallet. If I have 1000 UTXOs in my wallet with each 0.01-0.02 BTC and I normally send 0.01-0.02 BTC in one transaction, I may not consolidate anything and spend them separately when required.

If at any point any business has lot of very small inputs, they can be consolidated when mempool is clear with 1-5 sat/vByte without affecting business assuming if you are running a business with so many transactions, must have other UTXOs to spend.

https://bitcoinops.org/en/xapo-utxo-consolidation/

Consolidation after coinjoin also kills privacy and few other cases so it's always up to an individual to decide how he wants to spend UTXOs. Coin control features in lot of bitcoin wallets provide users with the freedom to easily select UTXOs for a transaction.

I was under the impression that BTC does not allow multiple public addresses corresponding to a single private key?

You can read more public key, private key and address using below links:

What is the relationship between a Bitcoin Private Key / Public Key / Address?

HD wallets: https://learnmeabitcoin.com/technical/hd-wallets

Not related to tracking deposit but still relevant to understand basic differences:

Batching is easier and cheaper in bitcoin: https://ethereum.stackexchange.com/questions/71261/how-to-transfer-ether-from-one-account-to-multiple-account/

Tx count and fees of UTXO chains can't be compared with account based chains (Few websites exist trying to spread misinformation). Below link explains the reasons and lot of people use coinmetrics data: https://coinmetrics.io/on-data-and-certainty/

Bitcoin doesn't have failed transactions: Do we have failed transactions in bitcoin?

12
  • thanks for your reply. What I don't understand is why the same "consolidation" cannot occur on chains that use account based model. If I receive 100 payments equal to 0.01 ETH why can't I forward all 100 payments to a single address (account) when transaction (gas) fees are low? The amount of gwei continuously fluctuates based on ETH network congestion according to etherscan.io/gastracker. So why can't this transfer take place during non peek hours the same way it is being done on BTC network?
    – S.O.S
    Jan 14, 2021 at 5:50
  • "There can be multiple addresses associated with the same private key.. Not related to tracking deposit but still relevant to understand basic differences" In other words the statement on ETH SE is false? As the address cannot be used to track user deposits.. correct?
    – S.O.S
    Jan 14, 2021 at 5:54
  • 1
    I couldn't find anything false in the links you shared. You don't even need different address for tracking deposits. Every confirmed transaction can be updated separately by business which is internal thing depending on how Bitcoin payments are integrated by someone and not related to Bitcoin. New address for each deposit works better for privacy and easier to achieve.
    – user103136
    Jan 14, 2021 at 5:59
  • 1
    Because every user will deposit with a unique transaction id.
    – user103136
    Jan 14, 2021 at 6:03
  • 1
    Everything is publicly available on bitcoin blockchain. I mentioned it depends on integration and how someone manages things internally. I can have one website, user login, all pay to same address but updated in my local database with user id and transaction id when payment is done. If website has no registration required, you can still provide unique numbers (Example: Mullvad VPN) to users and update in local db with tx id. There are other ways to prove you sent BTC if required ever.
    – user103136
    Jan 14, 2021 at 6:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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