Author

Topic: Sending coins and receive "change" on special BTCAdr (Read 156 times)

legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
You can use listaddressgroupings RPC call and pass it an address, and it will list all of the change addresses associated with it. Then proceed to sweep those change addresses into your main address.
hero member
Activity: 714
Merit: 1010
Crypto Swap Exchange
@CyberOperations
Do you understand that Bitcoin transactions spend whole UTXO(s) and don't work account based like a bank account where you can deduce some small fraction of the total balance? (UTXO is Unspend Transaction Output, ie. a spendable output of a previous transaction).

I suggest a visit to https://learnmeabitcoin.com for basics or more.
sr. member
Activity: 317
Merit: 448
I wouldn't pick coins from "labels", you can make mistakes, have repeated labels etc. I would always manually copypaste the addresses I want to use, or just manually click on them with CoinControl enabled where you can see them on a list in a tree form and with the labels.
newbie
Activity: 3
Merit: 0
Thank you. I guess that is a good way to handle it.
But I still need to figure out how to set the address it lowers the balance from,
so it takes it from the right account.

Currently it seems it is picking the BTC from the entire wallet, not from
let's say label "John", who is sending 2 of his BTC to "Peter".

EDIT: seems like the "move" command might solve my problems here inside the same wallet working with accounts.
Will update once tested.

Update:
sendmany '.$fromadrlabel.' {\"'.$toadr.'\":'.$amount.'}"',

and

move "'.$fromadrlabel.'" "'.$toadrlabel.'" '.$amount.'1',

did the trick for me. Thank you for helping to understand Smiley
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
My question is: how could I still send from one BTCAddress (or label) to another BTCAddress
and receive the change on a specific BTCAddress (prefered my main BTCAddress for the senind person)
via cli?
Using sendmany. Example from the RPC API Reference:
bitcoin-cli sendmany "" "{\"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl\":0.01,\"bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3\":0.02}"

The first address is your person's address, the second is the change.
newbie
Activity: 3
Merit: 0
Hello, this is my first post and I really hope this question wasn't answered already, or is too noobish.
My search did not find a related topic, but the forum tells me I might be searching too quick  Grin
So I am asking you specialists here.

I wanted to work with labels (accounts) inside my testwallet, so I can manage different people,
that got their address bound to this "label/account". I know accounts are deprecated, but did not find
another solution.

Currently I am sending coins like this:

sendfrom "label" "to-btcadr" "amount"

e.g. >> btc-cli.exe sendfrom "Person 1" BTCADRxyz 0.1

Label "Person 1" has only one BTCAddress, but the "change" from this transaction
will create a new BTCAddress. This leads to a wrong balance checking his main BTCAdr.

My question is: how could I still send from one BTCAddress (or label) to another BTCAddress
and receive the change on a specific BTCAddress (prefered my main BTCAddress for the senind person)
via cli?
Jump to: