Sorry if this has already been asked; Stack Exchange didn't have this exact question in the "related" field.
Let's say I have two bitcoin wallets. Somebody sends wallet 1 a transaction of 0.5 BTC.
What I am wondering is if I can take that transaction and create a new one, where I'm sending 0.4 BTC to that same address in wallet 1 with the original 0.5 BTC (the one listed in the "receive" data in the UTXO), and sending the 0.1 BTC change to an address in wallet 2.
I would think this is possible since the address in wallet 2 referenced as part of the second transaction would then have the funds available once the transaction confirms in the block chain.
I just don't know enough about Bitcoin's code to know for sure if this won't cause some sort of hiccup, as my general conception of "transaction change" is that an address local to the wallet, in this case wallet 1, is generated for capturing the change from the transaction to avoid overspending in transaction fees.
Using a separate wallet's address as the change may well break something in the code that accounts for the total balance of the first wallet.
This is why I need an expert to help me out here. Too many unknown outcomes for me!