0

I have read at length that address reuse should be avoided, for instance the bitcoin wiki describes numerous reasons here. I have also read Murch's master thesis on coin selection. These two concepts seem to be at ends with each other. That is, if all bitcoin users follow the instructions to never reuse an address, there should only ever be one UTXO associated to an address, and then it is abandoned once the UTXO is spent - thus only one input to any given transaction. Does following the address reuse recommendation render the concept of coin selection useless?

Some smaller related questions that I don't feel deserve their own questions:

  1. Do the instructions to not reuse an address include change? That is, should I generate a new key pair for any transaction that needs to receive change, and then manually specify my change be sent to the newly generated address?
  2. If I make a new address for every transaction, and let us say I have one key pair associated to a 1 btc UTXO and another key pair associated to a 1 btc UTXO and I want to send Alice 2 BTC, then following the address reuse policy I would ask her to provide me 2 seperate bitcoin addresses, and I would make two separate transactions, 1 btc sent to each address?
  3. Terminology - does the term "wallet" refer to a key pair, or to software/hardware etc. that could contain many key pairs. For example, thinking of a Nano Ledger S, is the device itself the "wallet" and each 3-tuple (private key, pub key, address) also considered a "wallet"?

EDIT: My question has been sufficiently answered - I failed to understand that when conducting a transaction with multiple UTXO inputs, they do not all need to be associated to the same address/private key. Good news Murch, your masters thesis wasn't in vain :)

0
3
  1. Do the instructions to not reuse an address include change? That is, should I generate a new key pair for any transaction that needs to receive change, and then manually specify my change be sent to the newly generated address?

Wallet software will do this automatically for you. Whenever change is created, the wallet will construct a new keypair, compute its address, and send the change there. You shouldn't ever do anything manual.

  1. If I make a new address for every transaction, and let us say I have one key pair associated to a 1 btc UTXO and another key pair associated to a 1 btc UTXO and I want to send Alice 2 BTC, then following the address reuse policy I would ask her to provide me 2 seperate bitcoin addresses, and I would make two separate transactions, 1 btc sent to each address?

No, you (or your wallet) will just create a single transaction that spends both 1 BTC UTXOs, and send 2 BTC to Alice's address. No reuse.

The advice of no reuse just means that if you later want to send more money to Alice, you'd ask a different address of hers, and don't send again to the same one. This is generally good practice for other reasons anyway, as Alice may have moved to a new wallet setup, and prefer not be paid to old one anymore.

  1. Terminology - does the term "wallet" refer to a key pair, or to software/hardware etc. that could contain many key pairs. For example, thinking of a Nano Ledger S, is the device itself the "wallet" and each 3-tuple (private key, pub key, address) also considered a "wallet"?

You'll hear conflicting opinions on this, but in my view it's closer to the second. A wallet is something that manages a collection of addresses, coin selection, helps constructing transactions, ...

In my view, a "hardware wallet" is badly named, because it is not managing any of these things. It is a hardware transaction signing device, which needs communication with an actual wallet to be instructed what to do.

3
  • "No, you (or your wallet) will just create a single transaction that spends both 1 BTC UTXOs, and send 2 BTC to Alice's address. No reuse." --- but if 1 btc had been sent to one of my addresses, and the other btc had been sent to another one of my addresses, when I make the transaction to Alice, when it appears on block explorer, which address will it appear to have come from? – Prince M Mar 11 at 2:50
  • 1
    It will appear to come "from" both. – Pieter Wuille Mar 11 at 2:54
  • 1
    Ok, I think I am in full understanding now. Thank you for a quality answer. I have never actually used a wallet of any kind as I am only learning about bitcoin for intellectual stimulation, so I don't really know what kind of things they do/don't do for you. Thanks! – Prince M Mar 11 at 3:08
2

Does following the address reuse recommendation render the concept of coin selection useless?

No, it does not.

It seems like the main misconception is that using an address multiple times creates fewer UTXOs than using multiple addresses for each payment. However they are the exact same. If you receive 5 payments to a single address, you will have 5 UTXOs. If you receive 5 payments to 5 different addresses, you will also have 5 UTXOs. To a coin selection algorithm, these are the exact same scenario: 5 UTXOs of the same size with the same size requirement for spending.

Do the instructions to not reuse an address include change?

Yes

That is, should I generate a new key pair for any transaction that needs to receive change, and then manually specify my change be sent to the newly generated address?

Most wallet software will already be generating new change addresses for you. There is no need to do that manually unless you are using some ancient or poorly written wallet software that does not. And in that case, you should use a different wallet software.

If I make a new address for every transaction, and let us say I have one key pair associated to a 1 btc UTXO and another key pair associated to a 1 btc UTXO and I want to send Alice 2 BTC, then following the address reuse policy I would ask her to provide me 2 seperate bitcoin addresses, and I would make two separate transactions, 1 btc sent to each address?

No. A single transaction can (and most do) have multiple inputs and multiple outputs. Your 2 UTXOs will be in the same transaction that creates a single 2 BTC UTXO for Alice.

Terminology - does the term "wallet" refer to a key pair, or to software/hardware etc. that could contain many key pairs. For example, thinking of a Nano Ledger S, is the device itself the "wallet" and each 3-tuple (private key, pub key, address) also considered a "wallet"?

Wallet can refer to two things:

  1. A collection of keys and their associated addresses and transactions
  2. A piece of software or hardware that manages a collection of keys and their associated addresses and transactions.
5
  • Wait, I think my actual misconception was that when I "sign" a transaction with my "private key", I thought the "private key" used for signing needed to be associated with ALL of the inputs in the tx AND the address I was sending from. Is that not the case? – Prince M Mar 11 at 2:48
  • 1
    Every input will contain its own signature. If those inputs spend UTXOs corresponding to distinct addresses/keys, those will be signatures with those distinct keys. – Pieter Wuille Mar 11 at 2:55
  • Ok, I see now. Thanks! So let me just clarify one more thing: If I construct a transaction with multiple inputs associated to different addresses, when the transaction gets to mempool and appears on block explorer, which address is the one the transaction appears to be from? – Prince M Mar 11 at 2:58
  • 2
    It will appear to come "from" all of them. – Pieter Wuille Mar 11 at 3:04
  • 1
    Thanks Andrew and Pieter for your answers. Both were high quality IMO. – Prince M Mar 11 at 3:09

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.