Let's say I have the stealth addresses S1 (unspent outputs = 10 XMR), S2 (unspent outputs = 20 XMR), S3 (unspent outputs = 30 XMR). Then I'm sending 35 XMR of the outputs to another one-time public key R.

  1. How does the reference wallet choose which of my stealth addresses will be used to have 35 XMR as input? S1 and S3, or S2 and S3? Why?
  2. To which address does the reference client send the change? To one of my stealth addresses (S1, S2, or S3) or to a new stealth address S4?
  • when you say "stealth address" - what do you mean? – m2049r Aug 11 at 15:10
  • The answer by @scoobybejesus is what I was looking for. I really meant stealth addresses, and not subaddresses, like @ knaccc suggested. – user2983585 Aug 18 at 1:57
up vote 0 down vote accepted
  1. How does the reference wallet choose which of my stealth addresses will be used to have 35 XMR as input? S1 and S3, or S2 and S3? Why?

The wallet prefers older outputs (though someone can give you a better, code-based answer, I'm sure). It does this because of the common heuristic that the newest ring member often indicates the true spender.

  1. To which address does the reference client send the change? To one of my stealth addresses (S1, S2, or S3) or to a new stealth address S4?

The client will construct a new S4 stealth address. S3 and S1 and/or S2 are fully spent/exhausted when used. Outputs cannot be partially spent. They are fully spent and change is returned.

  • I'm not sure, but I think the question might have been using the term stealth address to refer to subaddresses – knaccc Aug 10 at 15:36

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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