Question about sending Zcash and the remaining funds

Hello,

First of all, I apologize if I'm not making much sense because English is not my first language. I will try my best to explain.

I'm pretty new to Zcash and I just completed my first transaction. Before sending, I read the text in zcash4win and my understanding was that the total remaining fund in the address I used to send will be sent to a newly generated T address like so:

T-Address A balance = 5 Zec
Sending 0.5 Zec to T-Address B
T-Address A balance = 4.5 Zec => T-Address C
T-Address A balance = 0 Zec
T-Address C balance = 4.5 Zec

However, what ended up happening was some random amount was taken out of T-Address A in addition of the 0.5 Zec I sent, say 0.4 Zec:

T-Address A balance = 5 Zec
Sending 0.5 to T-Address B and 0.4 to T-Address C
T-Address A balance = 4.1 Zec
T-Address C balance = 0.4 Zec

In the end, I have the same balance, but would this not cause my fund to be fractured into multiple addresses as I send more Zcash? Is there anyway to consolidate my fund into one address? Or why would I NOT want to do so?

Thank you for your time.

t-addresses in Zcash work exactly as Bitcoin which work based on unspent transaction outputs which are combined as needed to send the required amount and returning the change.

It’s best described in terms of an analogy. Say you have $100 in a traditional wallet full of cash - it may be comprised of a $50 bill, a $20 bill, two $10 dollar notes and maybe a whole bunch of change. Now your bill comes to $42. You don’t hand over all of your $100 you might simply hand over the $50 and be returned $8 which is the equivalent of what you are seeing. In the main it’s not an issue and the wallet will deal with it in the best way possible - more inputs lead to a more expensive transaction but fees in Zcash currently are not a concern. If you really wanted you could consolidate all your inputs - the equivalent of collecting all your change and converting to say a $10 note.

As a side-note, this isn’t what happens with z-addrs where change is returned to the same address by default.

Is it possible to use sendmany to include the source address as the source AND a destination for change?

T-Address A balance = 5 Zec
Sending 0.5 Zec to T-Address B
Sending 4.499 Zec to T-Address A
(Fee 0.001)
T-Address A balance = 4.499 Zec
T-Address B balance = 0.5 Zec

This way you don’t end up with the change address.