I'm curious about a particular situation involving change values.
Say I have a wallet with 2 addresses.
Each address has received 1BTC, for a total of 2BTC in the wallet.
Say I then want to send 1.999999 to someone.
As I understand it (and correct me if I'm wrong here, looking to learn, not to pick fights), I would end up sending the full 2BTC, and then receive the change back.
Now, I know I'm not including the transaction fee in this scenario. This is really just a thought exercise with regard to the handling of tiny change values.
...
How is this handled?
Yes you must send full outputs. The amount "at" each address is irrelivent. Bitcoin works on a concept of outputs. Outputs are either spent or unpsent. Unpent outputs becomes inputs for new transactions and in the process are spent. So I will correct your example and say you have a wallet which has receive 2BTC and 1 BTC. You wish to pay someone 1.999999 BTC.
The client will attempt to avoid spam at all cost. As such it will create a tx like this:
In1: 1 BTC
In2: 2 BTC
Out1: 1.999999 <- your payment
Out2: 1.000001 <- your change
Fee: 0 BTC
The 1 BTC & 2BTC outputs are now spent (and thus will be pruned from UXTO).
Your wallet would now have a single unspent output worth 1.000001 BTC.
I am guessing you are wondering next what happens if you only had a single 2 BTC input.
The tx would look like this:
In1: 2 BTC
Out1: 1.999999 BTC
Fee: 0.000001 BTC
Since the creation of a 0.000001 BTC output would create dust the client will simply not create it. In any tx the difference between inputs and outputs is the fee. Note fees are not explicitly defined in ANY transaction they are just the difference between the tx inputs and outputs.