0

I am developing a website where each user has a unique bitcoin address and each user can receive or send money. I have a bitcoin node running, so I connect to it to run json-rpc api calls.

The problem which I have is the following: If one user has 1BTC and send 0.5BTC to the external wallet. I want that the user has 0.5 BTC in his wallet but right now with sendtoaddress api call the 0.5 BTC remaining aren't in the original wallet, the 0.5 BTC is moved to a new address from the wallet.

I don't see right now how can achieve it through json-rpc calls, if someone could help I'd be grateful!

1 Answer 1

1

The leftover 0.5 BTC is sent to a change address because it is not good practice to reuse addresses. You would simply have to assign the change addresses to the users.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.