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~

user36303
  • 34,928
  • 2
  • 58
  • 123
sammy00
  • 159
  • 6

2 Answers2

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.

user36303
  • 34,928
  • 2
  • 58
  • 123
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
sammy00
  • 159
  • 6