4

Following problems occur to me during my reading codebase of the current monero project,

  • Are the mix-ins grabbed through wallet2::get_outs function in the wallet side, which is further delegated to the core_rpc_server::on_get_output_histogram and core_rpc_server::on_get_outs_bin interfaces in the daemon side by means of rpc call?
    • If YES, when is the double spending checked during the execution of wallet2::get_outs?
    • If NO, which function is responsible of the mix-ins generation?
  • Will the double spending be checked during the mix-ins procedure? If yes, by who?

Really appreciate if someone can share something about the questions~

5

Yes, get_outs does mixin selection. There is no double spending check done there. The second question looks like the same as the first one. There is no double spending check done during the mixin selection procedure.

| improve this answer | |
  • Thanks a lot. So will the double spending check be done during delivering the signed transaction (corresponding to the wallet2::commit_tx function) to the miner~ – sammy00 Jul 6 '17 at 10:56
  • No. Double spending check is done in Blockchain::check_tx_inputs. – user36303 Jul 6 '17 at 11:20
  • Okay. That's to say, Blockchain::check_tx_inputs will be invoked during processing a submitted transaction in the miner/daemon side, is it right? – sammy00 Jul 6 '17 at 11:49
  • Yes. spam because a simple and concise answer isn't to stackechange's liking ffs – user36303 Jul 6 '17 at 12:14
1

After a second thought, I think the important points are

  1. double spending is checked by means of the key images embedded in the signature of a transaction. And the process of grabbing mix-ins takes place before signing transaction, which means there is no signature yet, not to say the key image for checking double spending.
  2. It's okay even when some mix-ins are collected from spent outputs, because
    • a key image is bound with a secret key and a set of public keys, but which public key exactly relates to the key image is unknown
    • in the signature of new transaction, the key image would be different, making the new transaction not marked as double spending
| improve this answer | |

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.