2

When using the sendtoaddress command, does the Bitcoin client automatically place the change address at vout array position 0? I would assume so, because bitcoin works through a sequence of procedures.

1

No, it picks a random position.

The purpose is to make it hard for people observing the blockchain to know which is change and which is the payment, as that would make tracing easier. This is also the reason why change outputs use new keys to send to.

Note that there has been a bug for a long time that made it always end up in the same position. It was fixed over a year ago, IIRC.

  • Note that it's still fairly easy to (semi-accurately) track which is change vs payment. blockchain.info does it automatically, and is usually correct, from what I've seen. – Tim S. May 22 '14 at 16:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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