Handling change addresses without using rawtransactions? Since I'm using the wonderful accounts feature which is soon to be deprecated (shame on me, i know - but i simply didn't have resources and time as a single person to do an internal accounting system in a few weeks alongside everything else the project contains, this is a school project and will not be deployed), i was wondering how to handle sending transactions &amp; change addresses, without using raw transactions. 

Would the following work

SendMany(fromacc, toaddress: amount, 1, "comment", subtractfee)


(I'm planning to use SendMany for single transactions, because it has the subtractfee parameter compared to SendFrom).

Use the resulting TXID to query Blockcypher API (https://api.blockcypher.com/v1/btc/main/txs/b7bf53a74a4e4cb61ab523cc002fc4cea83fb359471d02b212d947cf86fe6077) and "grab" the change address from there (Since Bitcoin Core doesn't allow this wihout using rawtransactions?)

VerifyAddress(changeaddress)
SetAccount(account, changeaddress)


Which means that GetBalance(account) should show the correct balance of the account and not 0?

Or should i really not do that and use rawtransactions instead? :-)

edit:

So i just realised that i confused the subtractfee parameter in SendMany from the one in SendToAddress (which is what i need), so i suppose i need to use that instead.

would using:

$balance = getBalance($myaccount)
move("", $myaccount, $sendingamount, "", "comment")
SendToAddress($receiveaddr, $sendingamount, "comment", "commentto", 1, 0, 6)


do the the blockcypher grab TX id, verifyaddress and set account here

OR

$newBalance = getBalance($myaccount)
$change = $balance - $sendingamount
move("", $myaccount, $change, "", "comment")


Work in this case and would listunspent show the amount under the right account (not "")?  

Also here is what I'm trying to do from a user perspective: https://imgur.com/a/IHrF4vI
It sounds like there is a misunderstanding of how accounts work (which is not surprising given that the accounts system is very unintuitive).

First of all, addresses are only tied to accounts for receiving, not sending. So when you send from an account, any input associated with any address in the wallet can be selected for the transaction. During that send, the account's balance is deducted by exactly the amount that was sent. Change goes back into the wallet and has no effect on the balance as it was not sent from the account.

The account field in listunspent is slightly misleading as outputs are really not associated with accounts at all. When you send from an account, ANY output can be chosen as inputs for the transaction, not just ones that are part of the account.

When sending, because you know the recipients address, you can use the subtractFeeFrom parameters of sendmany or sendtoaddress to specify that the fee will be subtracted from the specified addresses (i.e. the recipients). This should still deduct from the account balance.